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

A new Custom Toast for flutter.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:customtoastflutter/customtoast.dart';

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

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Custom Toast Example',
      theme: ThemeData(primarySwatch: Colors.blue),
      home: const HomePage(),
    );
  }
}

class HomePage extends StatelessWidget {
  const HomePage({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Custom Toast Example'),
      ),
      body: Center(
        child: ElevatedButton(
          onPressed: () {
            FlutterCustomToast.showToast(
              context: context,
              message: 'This is a custom toast!' ,

              textStyle: const TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 12),
              duration: Durations.extralong4,
                animationDuration: Durations.extralong4
            );
          },
          child: const Text('Show Custom Toast'),
        ),
      ),
    );
  }
}
0
likes
125
points
28
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

A new Custom Toast for flutter.

Homepage

License

MIT (license)

Dependencies

flutter

More

Packages that depend on customtoastflutter