loadify 0.0.5 copy "loadify: ^0.0.5" to clipboard
loadify: ^0.0.5 copied to clipboard

A simple and customizable loading overlay package for Flutter applications without the need of context.

example/lib/main.dart

import 'dart:developer';

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

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

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Loadify Demo',
      builder: Loadify.initialize(),
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      home: const MyHomePage(title: 'Loadify Demo'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key, required this.title});

  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  void initState() {
    super.initState();
    Loadify.addStatusListener(_listener);
  }

  void _listener(loadingStatus) {
    log("loadingStatus: $loadingStatus");
  }

  @override
  void dispose() {
    Loadify.removeStatusListener(_listener);
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        backgroundColor: Theme.of(context).colorScheme.inversePrimary,
        title: Text(widget.title),
      ),
      body: const Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            Text(
              'Press the button to show Loading',
            ),
          ],
        ),
      ),
      floatingActionButton: FloatingActionButton.extended(
        onPressed: () async {
          Loadify.show();
          await Future.delayed(const Duration(seconds: 2));
          Loadify.hide();
        },
        tooltip: 'Increment',
        label: const Text('show Loading'),
      ),
    );
  }
}
1
likes
160
points
361
downloads

Publisher

unverified uploader

Weekly Downloads

A simple and customizable loading overlay package for Flutter applications without the need of context.

Repository (GitHub)
View/report issues

Topics

#overlay-loading #loading #overlay #loadify #flutter-overlay-loading

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on loadify