seprable 0.0.1
seprable: ^0.0.1 copied to clipboard
A highly customizable and elegant snackbar package for Flutter that uses Overlay for non-blocking notifications.
example/lib/main.dart
import 'package:flutter/material.dart';
import 'package:seprable/seprable.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Seprable Example',
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
useMaterial3: true,
),
home: const MyHomePage(),
);
}
}
class MyHomePage extends StatelessWidget {
const MyHomePage({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: const Text('Seprable Example')),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
ElevatedButton(
onPressed: () {
SeparableSnackbar.show(
context: context,
title: 'Success',
message: 'Operation completed successfully!',
type: SeparableSnackbarType.success,
);
},
child: const Text('Show Success Snackbar'),
),
const SizedBox(height: 16),
ElevatedButton(
onPressed: () {
SeparableSnackbar.show(
context: context,
title: 'Error',
message: 'Something went wrong.',
type: SeparableSnackbarType.error,
onUndo: () {},
);
},
child: const Text('Show Error with Undo'),
),
const SizedBox(height: 16),
ElevatedButton(
onPressed: () {
SeparableSnackbar.show(
context: context,
title: 'Info',
message: 'This is an information message.',
type: SeparableSnackbarType.info,
);
},
child: const Text('Show Info Snackbar'),
),
],
),
),
);
}
}