rich_alert 0.1.32 rich_alert: ^0.1.32 copied to clipboard
Flutter Alert Dialogs for the "rich". Used for rendering beautiful untraditional alert dialogs in Flutter apps.
import 'package:flutter/material.dart';
import 'package:rich_alert/rich_alert.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: MyHomePage(title: 'Flutter Rich Alert Dialog'),
);
}
}
class MyHomePage extends StatefulWidget {
MyHomePage({Key key, this.title}) : super(key: key);
final String title;
@override
_MyHomePageState createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text(
'This is to test the rich dialog',
),
],
),
),
floatingActionButton: FloatingActionButton(
onPressed: () {
/// Use case scenario for the rich alert dialog
showDialog(
context: context,
builder: (BuildContext context) {
return RichAlertDialog(
alertTitle: richTitle("Alert title"),
alertSubtitle: richSubtitle("Subtitle"),
alertType: RichAlertType.WARNING,
actions: <Widget>[
Text("hello"),
Text("its me"),
],
);
});
},
), // This trailing comma makes auto-formatting nicer for build methods.
);
}
}