bs_flutter_alert 1.0.1
bs_flutter_alert: ^1.0.1 copied to clipboard
Bootstrap alert to provide contextual feedback messages for typical user actions with the handful of available and flexible alert messages.
import 'package:bs_flutter_alert/bs_flutter_alert.dart';
import 'package:bs_flutter_responsive/bs_flutter_responsive.dart';
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatefulWidget {
@override
_MyAppState createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
@override
void initState() {
super.initState();
}
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: const Text('Bootstrap Alert'),
),
body: Scrollbar(
child: SingleChildScrollView(
child: Container(
padding: EdgeInsets.only(top: 20.0, bottom: 20.0),
child: BsRow(
gutter: EdgeInsets.only(left: 10.0, right: 10.0),
children: [
BsCol(
sizes: ColScreen(md: Col.col_4),
child: BsAlert(
closeButton: true,
margin: EdgeInsets.only(bottom: 10.0),
child: Text('Alert Primary'),
),
),
BsCol(
sizes: ColScreen(md: Col.col_4),
child: BsAlert(
closeButton: true,
margin: EdgeInsets.only(bottom: 10.0),
style: BsAlertStyle.secondary,
child: Text('Alert Secondary'),
),
),
BsCol(
sizes: ColScreen(md: Col.col_4),
child: BsAlert(
closeButton: true,
margin: EdgeInsets.only(bottom: 10.0),
style: BsAlertStyle.success,
child: Text('Alert Success'),
),
),
BsCol(
sizes: ColScreen(md: Col.col_4),
child: BsAlert(
closeButton: true,
margin: EdgeInsets.only(bottom: 10.0),
style: BsAlertStyle.danger,
child: Text('Alert Danger'),
),
),
BsCol(
sizes: ColScreen(md: Col.col_4),
child: BsAlert(
closeButton: true,
margin: EdgeInsets.only(bottom: 10.0),
style: BsAlertStyle.warning,
child: Text('Alert Warning'),
),
),
BsCol(
sizes: ColScreen(md: Col.col_4),
child: BsAlert(
closeButton: true,
margin: EdgeInsets.only(bottom: 10.0),
style: BsAlertStyle.info,
child: Text('Alert Info'),
),
),
BsCol(
sizes: ColScreen(md: Col.col_4),
child: BsAlert(
closeButton: true,
margin: EdgeInsets.only(bottom: 10.0),
style: BsAlertStyle.light,
child: Text('Alert Light'),
),
),
BsCol(
sizes: ColScreen(md: Col.col_4),
child: BsAlert(
closeButton: true,
margin: EdgeInsets.only(bottom: 10.0),
style: BsAlertStyle.dark,
child: Text('Alert Dark'),
),
),
BsCol(
sizes: ColScreen.all(Col.col_12),
child: BsAlert(
closeButton: true,
margin: EdgeInsets.only(bottom: 10.0),
style: BsAlertStyle.success,
heading: Text('Hello World'),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text('Alert Dark'),
],
),
),
),
],
),
),
),
),
),
);
}
}