prompt_dialog 0.1.1
prompt_dialog: ^0.1.1

Flutter Android iOS web

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

Prompt Dialog #

pub package

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

Installation #

Add pubspec.yaml #

dependencies:
  prompt_dialog: <lastest_version>

Usage #

Basic #

import 'package:flutter/material.dart';

import 'package:prompt_dialog/prompt_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('Prompt Dialog'),
            onPressed: () async {
              return print(await prompt(context));
            },
          ),
        ),
      ),
    );
  }
}

Custom Message #

import 'package:flutter/material.dart';

import 'package:prompt_dialog/prompt_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('Prompt Dialog'),
            onPressed: () async {
              return print(await prompt(
                context,
                title: Text('Would you like to remove?'),
                initialValue: 'Sure',
                textOK: Text('Yes'),
                textCancel: Text('No'),
                hintText: 'Please write reason',
                minLines: 1,
                maxLines: 3,
                autoFocus: true,
              ));
            },
          ),
        ),
      ),
    );
  }
}

Recommend Libraries #

Maintainer #

License #

MIT

1
likes
110
pub points
64%
popularity

Prompt Dialog Widget JS-LIKE for Flutter. Use prompt 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 prompt_dialog