confirm_dialog 0.1.1

Flutter Android iOS web

Confirm Dialog Widget JS-LIKE for Flutter. Use confirm dialog easy and simple for your flutter app.

Confirm Dialog #

pub package

Confirm Dialog Widget for Flutter(JS-LIKE). https://pub.dev/packages/confirm_dialog

Installation #

Add pubspec.yaml #

dependencies:
  confirm_dialog: lastest_version

Usage #

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: () async {
              if (await confirm(context)) {
                return print('pressedOK');
              }
              return print('pressedCancel');
            },
          ),
        ),
      ),
    );
  }
}

Custom Message #

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: () async {
              if (await confirm(
                context,
                title: Text('Confirm'),
                content: Text('Would you like to remove?'),
                textOK: Text('Yes'),
                textCancel: Text('No'),
              )) {
                return print('pressedOK');
              }
              return print('pressedCancel');
            },
          ),
        ),
      ),
    );
  }
}

Recommend Libraries #

Maintainer #

License #

MIT

0
likes
100
pub points
67%
popularity

Confirm Dialog Widget JS-LIKE for Flutter. Use confirm dialog easy and simple for your flutter app.

Repository (GitHub)
View/report issues

Documentation

API reference

Uploader

jehunseem@gmail.com

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on confirm_dialog