flutter_snackbox 1.0.1 copy "flutter_snackbox: ^1.0.1" to clipboard
flutter_snackbox: ^1.0.1 copied to clipboard

show snackBar made easy, display snackBar without buildContext with pure dart code.

example/lib/main.dart

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

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

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Snackbox Demo',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.red),
        useMaterial3: true,
      ),
      home: const HomeScreen(),
    );
  }
}

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

  @override
  Widget build(BuildContext context) {
    return Center(
      child: ElevatedButton(
        onPressed: () {
          /// showSnackBar(String message) - show snackbar without BuildContext
          showSnackBar("HELLO WORLD");
        },
        child: const Icon(Icons.slideshow_rounded),
      ),
    );
  }
}
copied to clipboard
4
likes
150
points
29
downloads

Publisher

unverified uploader

Weekly Downloads

2024.07.08 - 2025.01.20

show snackBar made easy, display snackBar without buildContext with pure dart code.

Repository (GitHub)

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

flutter

More

Packages that depend on flutter_snackbox