easy_loader 2.0.0 copy "easy_loader: ^2.0.0" to clipboard
easy_loader: ^2.0.0 copied to clipboard

The easiest way to handle a simple full screen loader in Flutter. Written in Dart. Fully customizable.

example/lib/main.dart

import 'package:easy_loader/easy_loader.dart';
import 'package:flutter/material.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        // This is the theme of your application.
        //
        // Try running your application with "flutter run". You'll see the
        // application has a blue toolbar. Then, without quitting the app, try
        // changing the primarySwatch below to Colors.green and then invoke
        // "hot reload" (press "r" in the console where you ran "flutter run",
        // or simply save your changes to "hot reload" in a Flutter IDE).
        // Notice that the counter didn't reset back to zero; the application
        // is not restarted.
        primarySwatch: Colors.blue,
        // This makes the visual density adapt to the platform that you run
        // the app on. For desktop platforms, the controls will be smaller and
        // closer together (more dense) than on mobile platforms.
        visualDensity: VisualDensity.adaptivePlatformDensity,
      ),
      home: MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key}) : super(key: key);
  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      //// Wrap your body in a stack
      body: Stack(
        children: <Widget>[
          Center(
            child: Text("Lorem Ipsum"),
          ),
          //// Put the loader widget at the end of the stack. You can set it to appear based on a boolean. E.g. a loading flag.
          EasyLoader(
            image: AssetImage(
              'assets/loading.png',
            ),
            iconColor: Colors.white,
          )
        ],
      ),
    );
  }
}
16
likes
140
pub points
82%
popularity

Publisher

verified publisheraligorithm.i.ng

The easiest way to handle a simple full screen loader in Flutter. Written in Dart. Fully customizable.

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on easy_loader