snacky 0.3.0 copy "snacky: ^0.3.0" to clipboard
snacky: ^0.3.0 copied to clipboard

Easily display customizable snackbars in Flutter with minimal configuration. Ideal for quick notifications and alerts in your app.

example/lib/main.dart

import 'package:impaktfull_ui/impaktfull_ui.dart';
import 'package:snacky_example/widget/example_snacky_configurator.dart';
import 'package:snacky_example/widget/snacky_example.dart';

const colorAccent = Color(0xFF7D64F2);
const colorPrimary = Color(0xFF1A1A1A);

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

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

  @override
  Widget build(BuildContext context) {
    return ImpaktfullThemeConfiguratorWidget(
      child: ExampleSnackyConfigurator(
        child: MaterialApp(
          title: 'Flutter Demo',
          theme: ThemeData(
            colorScheme: ColorScheme.fromSeed(seedColor: colorAccent),
            useMaterial3: true,
          ),
          navigatorObservers: [
            SnackyNavigationObserver(),
          ],
          home: const HomeScreen(),
        ),
      ),
    );
  }
}

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

  @override
  Widget build(BuildContext context) {
    return ImpaktfullScreen(
      child: ImpaktfullListView(
        spacing: 8,
        children: [
          Image.asset(
            '../assets/logo.png',
            height: 50,
          ),
          const SizedBox(height: 48),
          ImpaktfullButton.primary(
            label: 'Simple',
            onTap: () => Navigator.of(context).push(
              MaterialPageRoute(
                builder: (context) => SnackyExampleScreen(
                  title: 'Simple',
                  controller: SnackyController.instance,
                ),
              ),
            ),
          ),
          ImpaktfullButton.primary(
            label: 'Toast',
            onTap: () => Navigator.of(context).push(
              MaterialPageRoute(
                builder: (context) => SnackyExampleScreen(
                  title: 'Toast',
                  controller: taostSnackyController,
                ),
              ),
            ),
          ),
          ImpaktfullButton.primary(
            label: 'Gradient',
            onTap: () => Navigator.of(context).push(
              MaterialPageRoute(
                builder: (context) => SnackyExampleScreen(
                  title: 'Gradient',
                  controller: gradientSnackyController,
                ),
              ),
            ),
          ),
        ],
      ),
    );
  }
}
5
likes
0
pub points
57%
popularity

Publisher

verified publisherimpaktfull.com

Easily display customizable snackbars in Flutter with minimal configuration. Ideal for quick notifications and alerts in your app.

Repository (GitHub)
View/report issues

Topics

#snackbar #flutter-snackbar #custom-flutter-snackbar #flutter-flushbar #custom-flutter-toast

License

unknown (license)

Dependencies

flutter

More

Packages that depend on snacky