bs_flutter_alert 1.0.0 copy "bs_flutter_alert: ^1.0.0" to clipboard
bs_flutter_alert: ^1.0.0 copied to clipboard

outdated

Bootstrap alert to provide contextual feedback messages for typical user actions with the handful of available and flexible alert messages.

example/lib/main.dart

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: Container(
          padding: EdgeInsets.only(top: 20.0, bottom: 20.0),
          child: BsRow(
            gutter: EdgeInsets.only(left: 10.0, right: 10.0),
            children: [
              BsCol(
                margin: EdgeInsets.only(bottom: 10.0),
                sizes: ColScreen(md: Col.col_4),
                child: BsAlert(
                  closeButton: true,
                  margin: EdgeInsets.only(bottom: 10.0),
                  child: Text('Alert Primary'),
                ),
              ),
              BsCol(
                margin: EdgeInsets.only(bottom: 10.0),
                sizes: ColScreen(md: Col.col_4),
                child: BsAlert(
                  closeButton: true,
                  margin: EdgeInsets.only(bottom: 10.0),
                  style: BsAlertStyle.secondary,
                  child: Text('Alert Secondary'),
                ),
              ),
              BsCol(
                margin: EdgeInsets.only(bottom: 10.0),
                sizes: ColScreen(md: Col.col_4),
                child: BsAlert(
                  closeButton: true,
                  margin: EdgeInsets.only(bottom: 10.0),
                  style: BsAlertStyle.success,
                  child: Text('Alert Success'),
                ),
              ),
              BsCol(
                margin: EdgeInsets.only(bottom: 10.0),
                sizes: ColScreen(md: Col.col_4),
                child: BsAlert(
                  closeButton: true,
                  margin: EdgeInsets.only(bottom: 10.0),
                  style: BsAlertStyle.danger,
                  child: Text('Alert Danger'),
                ),
              ),
              BsCol(
                margin: EdgeInsets.only(bottom: 10.0),
                sizes: ColScreen(md: Col.col_4),
                child: BsAlert(
                  closeButton: true,
                  margin: EdgeInsets.only(bottom: 10.0),
                  style: BsAlertStyle.warning,
                  child: Text('Alert Warning'),
                ),
              ),
              BsCol(
                margin: EdgeInsets.only(bottom: 10.0),
                sizes: ColScreen(md: Col.col_4),
                child: BsAlert(
                  closeButton: true,
                  margin: EdgeInsets.only(bottom: 10.0),
                  style: BsAlertStyle.info,
                  child: Text('Alert Info'),
                ),
              ),
              BsCol(
                margin: EdgeInsets.only(bottom: 10.0),
                sizes: ColScreen(md: Col.col_4),
                child: BsAlert(
                  closeButton: true,
                  margin: EdgeInsets.only(bottom: 10.0),
                  style: BsAlertStyle.light,
                  child: Text('Alert Light'),
                ),
              ),
              BsCol(
                margin: EdgeInsets.only(bottom: 10.0),
                sizes: ColScreen(md: Col.col_4),
                child: BsAlert(
                  closeButton: true,
                  margin: EdgeInsets.only(bottom: 10.0),
                  style: BsAlertStyle.dark,
                  child: Text('Alert Dark'),
                ),
              ),
              BsCol(
                margin: EdgeInsets.only(bottom: 10.0),
                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'),
                    ],
                  ),
                ),
              ),
            ],
          ),
        ),
      ),
    );
  }
}
10
likes
150
points
58
downloads

Publisher

unverified uploader

Weekly Downloads

Bootstrap alert to provide contextual feedback messages for typical user actions with the handful of available and flexible alert messages.

Repository (GitHub)

Documentation

API reference

License

MIT (license)

Dependencies

bs_flutter_utils, flutter, flutter_web_plugins

More

Packages that depend on bs_flutter_alert