### Configuring LoaderOverlay Animations in Flutter Source: https://github.com/rodrigobastosv/loading_overlay/blob/master/README.md This snippet demonstrates how to wrap your application's main content with LoaderOverlay and configure basic fade animations by setting the duration and reverseDuration properties. It shows the typical setup within a StatelessWidget's build method. ```Dart class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( title: 'Flutter Demo', theme: ThemeData( primarySwatch: Colors.blue, ), home: LoaderOverlay( duration: const Duration(milliseconds: 250), reverseDuration: const Duration(milliseconds: 250), // switchInCurve, // switchOutCurve, // transitionBuilder, // layoutBuilder, child: MyHomePage(title: 'Flutter Demo Home Page'), ), ); } } ``` -------------------------------- ### Creating a Fully Custom LoaderOverlay in Flutter Source: https://github.com/rodrigobastosv/loading_overlay/blob/master/README.md Shows how to create a completely custom overlay by setting `overlayColor` to transparent and `useDefaultLoading` to false, then providing a custom widget tree in `overlayWidgetBuilder`. This example uses `BackdropFilter` for a blur effect and includes a `CircularProgressIndicator` and `Text`. ```Dart LoaderOverlay( overlayColor: Colors.transparent, useDefaultLoading: false, overlayWidgetBuilder: (progress) { return BackdropFilter( filter: ImageFilter.blur( sigmaX: 4.5, sigmaY: 4.5, ), child: Center( child: Container( width: 100, height: 100, color: Colors.purple, child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ CircularProgressIndicator(), Text( 'Doing stuff... bip...bup', textAlign: TextAlign.center, ) ], ), ), ), ); }, ) ``` -------------------------------- ### Customizing Loader Overlay Color and Opacity in Flutter Source: https://github.com/rodrigobastosv/loading_overlay/blob/master/README.md Illustrates how to change the background color and opacity of the loader overlay by setting the `overlayColor` property on the `LoaderOverlay` widget. The example sets the color to yellow with 80% opacity. ```Dart class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( title: 'Flutter Demo', theme: ThemeData( primarySwatch: Colors.blue, ), home: LoaderOverlay( useDefaultLoading: false, overlayWidgetBuilder: (_) { //ignored progress for the moment return Center( child: SpinKitCubeGrid( color: Colors.red, size: 50.0, ), ); }, overlayColor: Colors.yellow.withValues(alpha: 0.8), child: MyHomePage(title: 'Flutter Demo Home Page'), ), ); } } ``` -------------------------------- ### Showing Custom Dynamic Loader Overlay in Flutter Source: https://github.com/rodrigobastosv/loading_overlay/blob/master/README.md Demonstrates how to programmatically show a custom loader widget, like the `ReconnectingOverlay`, using the `context.loaderOverlay.show` method. The `widgetBuilder` callback provides the context and progress information to the custom widget. This overrides any default or static overlay configuration. ```Dart context.loaderOverlay.show( widgetBuilder: (progress) { return ReconnectingOverlay( progress != null ? progress as String : null, ); }, ); ``` -------------------------------- ### Show Loader Overlay Source: https://github.com/rodrigobastosv/loading_overlay/blob/master/README.md After configuring `LoaderOverlay` or `GlobalLoaderOverlay`, call this method from a context within the wrapped widget tree to display the default loading indicator overlay. ```Dart context.loaderOverlay.show(); ``` -------------------------------- ### Using Custom Widget for Loader Overlay in Flutter Source: https://github.com/rodrigobastosv/loading_overlay/blob/master/README.md Demonstrates how to replace the default loading indicator with a custom widget, such as one from `flutter_spinkit`, by setting `useDefaultLoading` to `false` and providing a `overlayWidgetBuilder` function to the `LoaderOverlay` widget. Requires the `flutter_spinkit` package. ```Dart class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( title: 'Flutter Demo', theme: ThemeData( primarySwatch: Colors.blue, ), home: LoaderOverlay( useDefaultLoading: false, overlayWidgetBuilder: (_) { //ignored progress for the moment return Center( child: SpinKitCubeGrid( color: Colors.red, size: 50.0, ), ); }, child: MyHomePage(title: 'Flutter Demo Home Page'), ), ); } } ``` -------------------------------- ### Updating LoaderOverlay Progress in Flutter Source: https://github.com/rodrigobastosv/loading_overlay/blob/master/README.md Illustrates how to show the loader overlay with an initial progress message using `context.loaderOverlay.show` and subsequently update the progress text using `context.loaderOverlay.progress`. Includes delays to simulate asynchronous operations and a call to `hide` to dismiss the overlay. ```Dart context.loaderOverlay.show( progress: 'Doing progress #0', ); await Future.delayed(Duration(seconds: 1)); context.loaderOverlay.progress('Doing progress #1'); await Future.delayed(Duration(seconds: 1)); context.loaderOverlay.progress('Doing progress #2'); await Future.delayed(Duration(seconds: 1)); context.loaderOverlay.progress('Doing progress #3'); await Future.delayed(Duration(seconds: 1)); if (_isLoaderVisible) { context.loaderOverlay.hide(); } ``` -------------------------------- ### Global Loader Overlay for Named Routes Source: https://github.com/rodrigobastosv/loading_overlay/blob/master/README.md For applications using named routes, wrap your `MaterialApp` with `GlobalLoaderOverlay`. This provides the loader overlay functionality across all routes defined within the `MaterialApp`. ```Dart @override Widget build(BuildContext context) { return GlobalLoaderOverlay( child: MaterialApp( debugShowCheckedModeBanner: false, title: 'Flutter Demo', theme: ThemeData(primarySwatch: Colors.teal, fontFamily: 'Baloo'), initialRoute: '/', routes: { '/': (context) => Page1(), '/page2': (context) => Page2(), }, ), ); } ``` -------------------------------- ### Configuring LoaderOverlay with Progress Builder in Flutter Source: https://github.com/rodrigobastosv/loading_overlay/blob/master/README.md Demonstrates how to set up the `LoaderOverlay` widget with a custom `overlayWidgetBuilder` that accepts a `progress` parameter. This builder is used to define the appearance of the overlay and display the current progress value passed to it. ```Dart class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( title: 'Flutter Demo', theme: ThemeData( primarySwatch: Colors.blue, ), home: LoaderOverlay( useDefaultLoading: false, overlayWidgetBuilder: (dynamic? progress) { return Column( mainAxisAlignment: MainAxisAlignment.center, children: [ SpinKitCubeGrid( color: Colors.red, size: 50.0, ), SizedBox( height: 50, ), if (progress != null) Text(progress) ], ); }, child: MyHomePage(title: 'Flutter Demo Home Page'), ), ); } } ``` -------------------------------- ### Open Flutter iOS Project in Xcode Source: https://github.com/rodrigobastosv/loading_overlay/blob/master/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md This command opens the Xcode workspace for your Flutter project, allowing you to manage assets like the launch screen images via the Assets.xcassets catalog. ```Shell open ios/Runner.xcworkspace ``` -------------------------------- ### Wrap Widget with LoaderOverlay Source: https://github.com/rodrigobastosv/loading_overlay/blob/master/README.md To enable the loader overlay for a specific part of your application, wrap the target widget (e.g., your main page) with the `LoaderOverlay` widget. This sets up the context needed to show/hide the overlay later. ```Dart class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( title: 'Flutter Demo', theme: ThemeData( primarySwatch: Colors.blue, ), home: LoaderOverlay( child: MyHomePage(title: 'Flutter Demo Home Page'), ), ); } } ``` -------------------------------- ### Defining Custom Dynamic Loader Widget in Flutter Source: https://github.com/rodrigobastosv/loading_overlay/blob/master/README.md Creates a custom `StatelessWidget` that displays a `CircularProgressIndicator` and text, optionally showing progress information. This widget is designed to be used dynamically with the `context.loaderOverlay.show` method to display specific loading states. ```Dart class ReconnectingOverlay extends StatelessWidget { String? progress; ReconnectingOverlay(this.progress); @override Widget build(BuildContext context) => Center( child: Column( mainAxisSize: MainAxisSize.min, mainAxisAlignment: MainAxisAlignment.center, children: [ CircularProgressIndicator(), SizedBox(height: 12), Text( 'Reconnecting...', ), SizedBox(height: 12), Text( progress ?? '', ), ], ), ); } ``` -------------------------------- ### LoaderOverlay After v3.0.0 (Builder) in Flutter Source: https://github.com/rodrigobastosv/loading_overlay/blob/master/README.md Shows the current approach for defining the overlay content using `overlayWidgetBuilder` introduced in version 3.0.0. This builder receives a context (which can include progress) allowing for dynamic overlay content. ```Dart LoaderOverlay( //... useDefaultLoading: false, overlayWidgetBuilder: (_) { return Center( child: SpinKitCubeGrid( color: Colors.red, size: 50.0, ), ); }, //... ) ``` -------------------------------- ### LoaderOverlay Opacity After v3.0.0 in Flutter Source: https://github.com/rodrigobastosv/loading_overlay/blob/master/README.md Shows the current method for setting the opacity of the `overlayColor` after version 3.0.0, which involves using the `withValues(alpha:)` method directly on the color object. ```Dart LoaderOverlay( //... overlayColor: Colors.black.withValues(alpha: 0.8), //... ) ``` -------------------------------- ### LoaderOverlay Before v3.0.0 (Static Widget) in Flutter Source: https://github.com/rodrigobastosv/loading_overlay/blob/master/README.md Illustrates the deprecated method of providing a static `overlayWidget` directly to `LoaderOverlay` before version 3.0.0. This approach did not support dynamic content updates like progress display. ```Dart LoaderOverlay( //... useDefaultLoading: false, overlayWidget: Center( child: SpinKitCubeGrid( color: Colors.red, size: 50.0, ), ), //... ) ``` -------------------------------- ### LoaderOverlay Opacity Before v3.0.0 in Flutter Source: https://github.com/rodrigobastosv/loading_overlay/blob/master/README.md Demonstrates the deprecated `overlayOpacity` property used in older versions of `loader_overlay` to control the transparency level of the `overlayColor`. ```Dart LoaderOverlay( //... overlayColor: Colors.black, overlayOpacity: 0.8, //... ) ``` -------------------------------- ### Check Loader Overlay Visibility Source: https://github.com/rodrigobastosv/loading_overlay/blob/master/README.md Use this property to check the current visibility state of the loader overlay associated with the given context. It returns a boolean value. ```Dart final isVisible = context.loaderOverlay.visible; ``` -------------------------------- ### Hide Loader Overlay Source: https://github.com/rodrigobastosv/loading_overlay/blob/master/README.md Call this method from a context within the wrapped widget tree to dismiss the currently visible loader overlay, typically after an asynchronous operation has completed. ```Dart context.loaderOverlay.hide(); ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.