loadix 1.0.1
loadix: ^1.0.1 copied to clipboard
Loadix is a customizable Flutter loading overlay package that provides easy-to-use, animated loading indicators. Perfect for displaying loading states during async operations in mobile and web apps.
example/lib/main.dart
import 'package:flutter/material.dart';
import 'package:loadix/loadix.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Loadix',
debugShowCheckedModeBanner: false,
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.lightBlueAccent),
useMaterial3: true,
),
home: const MyHomePage(),
);
}
}
class MyHomePage extends StatefulWidget {
const MyHomePage({super.key});
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
bool showLoading = false;
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: Theme.of(context).colorScheme.inversePrimary,
title: Text("Loadix"),
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
SizedBox(
height: 100,
),
ElevatedButton(
onPressed: () {
Loadix.show(context);
Future.delayed((Duration(seconds: 4)), () {
Loadix.hide();
});
},
child: Text("Show Loading Overlay"),
),
SizedBox(
height: 20,
),
ElevatedButton(
onPressed: () {
setState(() {
showLoading = !showLoading;
});
},
child: Text("${showLoading ? "Hide" : "Show"} Loading Widget"),
),
SizedBox(
height: 30,
),
if (showLoading) Loadix.loadingWidget,
],
),
),
);
}
}