tfk_toast 0.0.16 copy "tfk_toast: ^0.0.16" to clipboard
tfk_toast: ^0.0.16 copied to clipboard

tfk_toast is a lightweight Flutter package for displaying customizable toast messages. It supports various toast types like info, warning, error, and success, seamlessly integrating with Flutter's Ove [...]

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:tfk_toast_example/src/tfk_toast.dart';

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

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(title: const Text('Custom Toast Example')),
        body: Center(
          child: Builder(
            builder: (context) {
              return ElevatedButton(
                onPressed: () {
                  TfkToast.showToast(context, "This is an error message!",
                      title: "Error",
                      position: ToastPosition.top,
                      animation: ToastAnimation.scale,
                      type: ToastType.info,
                      icon: const Icon(
                        Icons.info,
                        color: Colors.white,
                      ));
                },
                child: const Text('Show Error Toast'),
              );
            },
          ),
        ),
      ),
    );
  }
}
2
likes
0
points
2
downloads

Publisher

unverified uploader

Weekly Downloads

tfk_toast is a lightweight Flutter package for displaying customizable toast messages. It supports various toast types like info, warning, error, and success, seamlessly integrating with Flutter's Overlay widget to ensure toasts appear correctly above other UI elements.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on tfk_toast

Packages that implement tfk_toast