custom_loading 0.0.1 copy "custom_loading: ^0.0.1" to clipboard
custom_loading: ^0.0.1 copied to clipboard

custom_loading is a Flutter package that allows you to easily display customizable loading screens in your Flutter applications. You can create visually appealing loading screens that match your app's [...]

example/lib/main.dart

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

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

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

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Custom Loading Scaffold Example',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      home: const MyHomePage(title: 'Custom Loading Scaffold Example'),
    );
  }
}

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

  final String title;

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

class _MyHomePageState extends State<MyHomePage> {
  bool isLoading = false;

  @override
  Widget build(BuildContext context) {
    return CustomLoadingScaffold(
      isLoading: isLoading,
      blurIntensity: 2.0,
      loaderWidget: Container(
        height: 100,
        padding: const EdgeInsets.all(15),
        decoration: BoxDecoration(
            borderRadius: BorderRadius.circular(10), color: Colors.grey),
        child: const Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            CircularProgressIndicator(),
          ],
        ),
      ),
      appBar: AppBar(
        backgroundColor: Theme.of(context).colorScheme.inversePrimary,
        title: Text(widget.title,
            style: const TextStyle(
                color: Colors.black,
                fontSize: 14,
                fontWeight: FontWeight.w500)),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            const Text(
              "Press Below Button To Start Loading",
              style: TextStyle(
                  color: Colors.black,
                  fontSize: 14,
                  fontWeight: FontWeight.w500),
            ),
            const SizedBox(
              height: 20,
            ),
            InkWell(
              onTap: () {
                setState(() {
                  isLoading = true;
                });

                Future.delayed(const Duration(seconds: 5), () {
                  setState(() {
                    isLoading = false;
                  });
                });
              },
              child: Container(
                height: 60,
                width: 180,
                decoration: BoxDecoration(
                    color: Colors.deepPurple,
                    borderRadius: BorderRadius.circular(20)),
                child: const Center(
                    child: Text(
                  "Show Loading",
                  style: TextStyle(
                      color: Colors.white,
                      fontSize: 18,
                      fontWeight: FontWeight.w600),
                )),
              ),
            )
          ],
        ),
      ),
    );
  }
}
15
likes
130
pub points
48%
popularity

Publisher

verified publishervaibhavchandolia.info

custom_loading is a Flutter package that allows you to easily display customizable loading screens in your Flutter applications. You can create visually appealing loading screens that match your app's design and provide a seamless user experience during data fetching or processing operations

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on custom_loading