awesome_top_snackbar 0.0.3 copy "awesome_top_snackbar: ^0.0.3" to clipboard
awesome_top_snackbar: ^0.0.3 copied to clipboard

Introducing the incredible awesomeTopSnackbar! It's your gateway to displaying stunning CustomSnackBars. All you need to do is pass the context and message, and voila!

example/lib/main.dart

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

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

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
        title: 'Flutter Demo',
        debugShowCheckedModeBanner: false,
        theme: ThemeData(
          // colorScheme: ColorScheme.fromSeed(seedColor: const Color(0xFF31B98C)),
          useMaterial3: true,
        ),
        home: const MyHomePage());
  }
}

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

  @override
  Widget build(BuildContext context) {
    return SafeArea(
      child: Scaffold(
        body: Center(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              ElevatedButton(
                  onPressed: () {
                    awesomeTopSnackbar(context, "Hello world");
                  },
                  child: const Text('Snackbar 1 ')),
              const SizedBox(height: 50),
              ElevatedButton(
                onPressed: () {
                  awesomeTopSnackbar(
                    context,
                    "Hello world",
                    backgroundColor: Color.fromARGB(255, 19, 129, 45),
                    icon: const Icon(Icons.close, color: Colors.white),
                    iconWithDecoration: BoxDecoration(
                      borderRadius: BorderRadius.circular(20),
                      border: Border.all(color: Colors.white),
                    ),
                  ); // for the decoration you can use this property
                },
                child: const Text('Snackbar 2'),
              ),
              const SizedBox(height: 50),
              ElevatedButton(
                onPressed: () {
                  awesomeTopSnackbar(
                    context,
                    "Hello world ...",
                    textStyle: const TextStyle(
                        color: Color.fromARGB(255, 20, 64, 83), fontStyle: FontStyle.italic, fontWeight: FontWeight.w400, fontSize: 24),
                    backgroundColor: Color.fromARGB(255, 220, 149, 111),
                    icon: const Icon(Icons.close, color: Colors.white),
                    iconWithDecoration: BoxDecoration(
                      borderRadius: BorderRadius.circular(20),
                      border: Border.all(color: Colors.white),
                    ),
                  ); // for the decoration you can use this property
                },
                child: const Text('Snackbar 3'),
              ),
            ],
          ),
        ),
      ),
    );
  }
}
14
likes
150
points
42
downloads

Publisher

unverified uploader

Weekly Downloads

Introducing the incredible awesomeTopSnackbar! It's your gateway to displaying stunning CustomSnackBars. All you need to do is pass the context and message, and voila!

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-2-Clause (license)

Dependencies

flutter

More

Packages that depend on awesome_top_snackbar