You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
diplomatic-quarter/lib/widgets/progress_indicator/app_loader_widget.dart

41 lines
1002 B
Dart

import 'package:flutter/material.dart';
import 'package:flutter_progress_hud/flutter_progress_hud.dart';
/// show app Loader
/// [backgroundColor] the background color for the app loader
/// [color] the color for the app loader
class AppLoaderWidget extends StatefulWidget {
AppLoaderWidget(
{Key? key,
this.backgroundColor = Colors.black12,
this.color = Colors.black})
: super(key: key);
final Color backgroundColor;
final Color color;
@override
_AppLoaderWidgetState createState() => new _AppLoaderWidgetState();
}
class _AppLoaderWidgetState extends State<AppLoaderWidget> {
late ProgressHUD _progressHUD;
@override
void initState() {
super.initState();
/// create progress Hud Indicator
_progressHUD = new ProgressHUD(
backgroundColor: widget.backgroundColor,
indicatorColor: widget.color,
child: SizedBox(),
);
}
@override
Widget build(BuildContext context) {
return Positioned(child: _progressHUD);
}
}