Flushbar|Show Snackbar:
Video:
Code:
import 'package:flutter/material.dart';
import 'package:flushbar/flushbar.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
home: Page(),
);
}
}
class Page extends StatefulWidget {
@override
_PageState createState() => _PageState();
}
class _PageState extends State<Page> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("Flushbar"),
backgroundColor: Colors.deepOrange,
),
body: Container(
child: Center(
child: MaterialButton(
color: Colors.yellow,
child: Text(
"Subscribed now",
style: TextStyle(
fontSize: 25,
),
),
onPressed: () {
Flushbar(
title: "maherban husen tech",
message: "Subscribed Successfuly",
duration: Duration(seconds: 5),
)..show(context);
}),
),
),
);
}
}
0 Comments