loader_overlay 1.1.1 copy "loader_overlay: ^1.1.1" to clipboard
loader_overlay: ^1.1.1 copied to clipboard

outdated

A simple package to simplify screen management. When loading any async task, this package prevent the user from interacting with the screen until the async task finishes.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:flutter_spinkit/flutter_spinkit.dart';
import 'package:loader_overlay/loader_overlay.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: LoaderOverlay(
        overlayWidget: Center(
          child: SpinKitCubeGrid(
            color: Colors.red,
            size: 50.0,
          ),
        ),
        overlayOpacity: 0.8,
        child: MyHomePage(title: 'Flutter Demo Home Page'),
      ),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key, this.title}) : super(key: key);

  final String title;

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            RaisedButton(
              onPressed: () async {
                context.showLoaderOverlay();
                await Future.delayed(Duration(seconds: 3));
                context.hideLoaderOverlay();
              },
              child: Text('Show loader overlay for 2 seconds'),
            )
          ],
        ),
      ),
    );
  }
}
493
likes
0
points
38.9k
downloads

Publisher

verified publisherrodrigobastos.dev

Weekly Downloads

A simple package to simplify screen management. When loading any async task, this package prevent the user from interacting with the screen until the async task finishes.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on loader_overlay