floating_snackbar 1.0.2 copy "floating_snackbar: ^1.0.2" to clipboard
floating_snackbar: ^1.0.2 copied to clipboard

A package that provides custom floating snackbar for your project.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:floating_snackbar/floating_snackbar.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: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatelessWidget {
  // ignore: use_key_in_widget_constructors
  const MyHomePage({Key? key, required this.title});

  final String title;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Floating Snackbar'),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            TextButton(
              onPressed: () {
                FloatingSnackBar(
                  message: 'Hi Ameen Palakkad',
                  context: context,
                  textColor: Colors.black,
                  textStyle: const TextStyle(color: Colors.red),
                  duration: const Duration(milliseconds: 4000),
                  backgroundColor: Colors.white,
                );
              },
              child: const Text('Show SnackBar'),
            ),
            const SizedBox(height: 20),
          ],
        ),
      ),
    );
  }
}
15
likes
0
pub points
88%
popularity

Publisher

verified publisherameeen.me

A package that provides custom floating snackbar for your project.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

cupertino_icons, flutter

More

Packages that depend on floating_snackbar