0 purchases
alert dialog
Alert Dialog #
Alert Dialog Widget for Flutter(JS-LIKE).
https://pub.dev/packages/alert_dialog
Installation #
Add pubspec.yaml #
dependencies:
alert_dialog: ^1.0.2
copied to clipboard
Usage #
Basic #
import 'package:flutter/material.dart';
import 'package:alert_dialog/alert_dialog.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Welcome to Flutter',
home: Scaffold(
appBar: AppBar(
title: Text('Welcome to Flutter'),
),
body: Center(
child: FlatButton(
child: Text('Alert Dialog'),
onPressed: () async {
return alert(context, title: Text('Alert'));
},
),
),
),
);
}
}
copied to clipboard
Custom Message #
import 'package:flutter/material.dart';
import 'package:alert_dialog/alert_dialog.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Welcome to Flutter',
home: Scaffold(
appBar: AppBar(
title: Text('Welcome to Flutter'),
),
body: Center(
child: FlatButton(
child: Text('Alert Dialog'),
onPressed: () async {
return alert(
context,
title: Text('Alert'),
content: Text('It is fun!'),
textOK: Text('Yes'),
);
},
),
),
),
);
}
}
copied to clipboard
Recommend Libraries #
Confirm Dialog - Confirm Dialog Widget for Flutter(JS-LIKE).
Prompt Dialog - Prompt Dialog Widget for Flutter(JS-LIKE).
Currency Text Input Formatter - Currency Text Input Formatter for Flutter.
Maintainer #
Jehun Seem
License #
MIT
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.