an_toast 0.1.0 copy "an_toast: ^0.1.0" to clipboard
an_toast: ^0.1.0 copied to clipboard

A Flutter toast library with usage identical to Android.

A custom-drawn Flutter toast library that does not rely on native implementation.

Usage #

class ToastDemo extends StatefulWidget {
  const ToastDemo({super.key});

  @override
  State<ToastDemo> createState() => _ToastDemoState();
}

class _ToastDemoState extends State<ToastDemo> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Toast Demo'),
      ),
      body: ListView(
        children: [
          TextButton(
            onPressed: () {
              Toast.show('当前的toast样式及动画');
            },
            child: const Text('显示Toast'),
          ),
          TextButton(
            onPressed: () {
              Toast.show('当前的toast样式及动画', duration: Toast.DURATION_LONG);
            },
            child: const Text('显示Toast'),
          ),
        ],
      ),
    );
  }
}

See example for detailed.

Issues #

If you encounter issues, here are some tips for debug, if nothing helps report to issue tracker on GitHub:

2
likes
0
points
54
downloads

Publisher

verified publisheraymtools.com

Weekly Downloads

A Flutter toast library with usage identical to Android.

Repository (GitHub)
View/report issues

Topics

#toast

License

unknown (license)

Dependencies

cancellable, flutter

More

Packages that depend on an_toast