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

PlatformAndroid

The Flutter Plugin to show native toast on Android

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:native_toast/native_toast.dart';

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

class App extends StatefulWidget {
  const App({Key? key}) : super(key: key);

  @override
  _AppState createState() => _AppState();
}

class _AppState extends State<App> {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      title: 'Native Toast Example',
      theme: ThemeData.light(),
      darkTheme: ThemeData.dark(),
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Native Toast Example'),
        ),
        body: Center(
          child: ElevatedButton(
            child: const Text('Show Native Toast'),
            onPressed: () async {
              await NativeToast().makeText(
                message: "This is a Native Toast On Android!",
                duration: NativeToast.shortLength,
              );
            },
          ),
        ),
      ),
    );
  }
}
5
likes
130
pub points
75%
popularity

Publisher

verified publisherimihirpaldhikar.com

The Flutter Plugin to show native toast on Android

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on native_toast