loading_toast 0.0.2 copy "loading_toast: ^0.0.2" to clipboard
loading_toast: ^0.0.2 copied to clipboard

flutter toast, context not required, also can show loading indicator or else

Loading Toast #

A lightweight toast & loading overlay for Flutter.

Features #

  • Overlay-based toasts: Show toast messages on top of everything using Overlay.
  • Flexible positioning: Control toast position with Alignment, e.g. Alignment.topCenter, Alignment.center, etc.
  • No BuildContext required: After initialization, you can show toasts without passing a BuildContext.
  • Any widget as content: Not only text – you can show widgets like CircularProgressIndicator, icons, or custom widgets.

Installing #

dependencies:
  loading_toast: ^latest

Setup #

If you want to use it without context, add builder: LToast.init(), to your MaterialApp / CupertinoApp:

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: const MyHomePage(title: 'Flutter Demo Home Page'),
      builder: LToast.init(),
    );
  }
}

Usage #

// Simple text toast (center)
LToast.showText('toast text');

// Text toast at topCenter
LToast.showText(
  'count: $_counter',
  alignment: Alignment.topCenter,
);

// Loading indicator (e.g. while waiting for a request)
LToast.showLoading(
  const CircularProgressIndicator(),
);

// Show any custom widget
LToast.show(
  const Icon(
    Icons.remove,
    color: Colors.orange,
  ),
);
0
likes
160
points
9
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

flutter toast, context not required, also can show loading indicator or else

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

flutter

More

Packages that depend on loading_toast