moxxy/lib/ui/widgets/backdrop_spinner.dart
Alexander "PapaTutuWawa f094a326ac feat(ui): Switch cropping libraries
This makes the avatar cropper much more consistent
with the background cropper. Fixes #168.
2022-11-26 18:40:46 +01:00

33 lines
824 B
Dart

import 'package:flutter/material.dart';
import 'package:moxxyv2/ui/constants.dart';
/// A simple CircularProgressIndicator that has a semi-transparent black
/// circle around it to provide contrast to whatever is behind it.
class BackdropSpinner extends StatelessWidget {
const BackdropSpinner({
required this.enabled,
super.key,
});
final bool enabled;
@override
Widget build(BuildContext context) {
if (enabled) {
return Center(
child: DecoratedBox(
decoration: BoxDecoration(
color: backdropBlack,
borderRadius: BorderRadius.circular(100),
),
child: const Padding(
padding: EdgeInsets.all(12),
child: CircularProgressIndicator(),
),
),
);
}
return const SizedBox();
}
}