A sample flutter plugin for wrap the widgrt with indicator.
See example for details
Add the package to your pubspec.yml
file.
dependencies:
simple_loading_view: ^0.0.1
Next, import the library into your widget.
import 'package:simple_loading_view/simple_loading_view.dart';
How to implement LoadingView ?
...
bool _isLoading = false
...
@override
Widget build(BuildContext context) {
return Scaffold(
body: LoadingView(
isLoading: isLoading,
// you can use your own widget here, more example please refer example project.
progressIndicator: IndicatorMap[Indicator.defaultIndicator],
// Current page UI implement here as child, Here i'm implemented a button for showing the indicator.
child: OutlineButton(
child: const Text('Default', semanticsLabel: 'Default'),
onPressed: () {
indicatorWidget = IndicatorMap[Indicator.defaultIndicator];
setState(() {
isLoading = true;
});
// For testing Purpose i used a function for Hiding the Indicator.
closeIndicator();
},
)),
);
}
The parameters are customizable
LoadingOverlay({
@required this.isLoading,
@required this.child,
this.opacity = 0.7,
this.progressIndicator = IndicatorMap[Indicator.defaultIndicator],
});
Please file issues to send feedback or report a bug. Thank you!