confirm_dialog 0.0.4 confirm_dialog: ^0.0.4 copied to clipboard
Confirm Dialog Widget for Flutter. Use confirm dialog easy and simple for your flutter app.
Confirm Dialog #
Confirm Dialog Widget for Flutter. https://pub.dev/packages/confirm_dialog
Installation #
Add pubspec.yaml #
dependencies:
confirm_dialog: lastest_version
Example #
Basic #
import 'package:flutter/material.dart';
import 'package:confirm_dialog/confirm_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('Confirm Dialog'),
onPressed: () => showDialog(
context: context,
builder: (_) => ConfirmDialog(
onPressedOK: () => print('pressedOK'),
),
),
),
),
),
);
}
}
Custom Message #
ConfirmDialog(
onPressedOK: () => print('pressedOK'),
message: 'Would you like to remove?',
textOK: 'Yes',
textCancel: 'No',
)