customprompt 0.2.6+8

  • Readme
  • Changelog
  • Example
  • Installing
  • 73

Customprompt for Flutter #

Customprompt is a simple animated modal for flutter IOS, Android and Web apps. Customprompt was built with with you in mind, all widgets like Icon, Text, Color can be replaced by the user, plus animation curve and animation duration.

It should look something like this:

Pull requests certainly welcome.

Installation #

In your pubspec.yaml root add:

dependencies:
  customprompt: ^0.2.6+8

then,

import 'package:customprompt/customprompt.dart';

Usage #

Typically, customprompt will be used, as follows:

type: 'success' #

    CustomPrompt(
        animDuration: 500,
        type: Type.success,
        curve: Curves.easeInCubic,
        transparent: true,
        context: context,
        btnOneText: Text('Okay'),
        content: 'Action was successful!',
        btnOneOnClick: () => print('Okay click'),
    ).alert();

type: 'error' #

  CustomPrompt(
      animDuration: 500,
      title: 'Error',
      type: Type.error,
      curve: Curves.easeInCubic,
      transparent: true,
      context: context,
      btnOneText: Text('Okay'),
      content: 'An error occurred!',
      btnOneOnClick: () => print('Okay click'),
  ).alert();

type: 'warning' #

    CustomPrompt(
        animDuration: 500,
        title: 'Warning',
        type: Type.warning,
        curve: Curves.easeInCubic,
        transparent: true,
        context: context,
        btnOneText: Text('Okay'),
        content: 'Enter password!',
        btnOneOnClick: () => print('Okay click'),
    ).alert();

type: 'confirm' #

  CustomPrompt(
      context: context,
      type: Type.confirm,
      animDuration: 300,
      transparent: true,
      color: Colors.blue,
      title: 'Confirm',
      content: 'Are you sure?',
      curve: Curves.easeIn,
      btnOneText: Text('Yes'),
      btnOneColor: Colors.green,
      btnTwoColor: Colors.red,
      btnTwoText: Text('No'),
      btnOneOnClick: () {
          print('Button one clicked');
      },
      btnTwoOnClick: () {
          print('Button two clicked');
      },
  ).alert();

type: 'input' #

  CustomPrompt(
      context: context,
      animDuration: 800,
      color: Colors.red,
      type: Type.input,
      transparent: true,
      curve: Curves.bounceOut,
      btnOneOnClick: (value) {
          print('Input value ${value}');
      },
  ).alert();

[0.0.1] - June 9 2020. #

  • Initial release.

[0.0.2] - June 9 2020. #

  • More modals added.

[0.0.3] - June 9 2020. #

  • imports cleaned.

[0.0.4] - June 9 2020. #

  • Cleared bugs.

[0.0.5] - June 9 2020. #

  • example added.

[0.0.6] - June 9 2020. #

  • MIT license added.

[0.0.7] - June 10 2020. #

  • Dispose animation controller.

[0.0.8] - June 10 2020. #

  • Reformatted the code.

[0.0.9] - June 10 2020. #

  • Reformatted lib/customprompt.dart.

[0.1.0] - June 10 2020. #

  • Updated variables for immutable classes.

[0.1.1] - June 10 2020. #

  • Reformatted lib/warning.dart.

[0.1.2] - June 10 2020. #

  • Added read me text.

[0.1.3] - June 10 2020. #

  • Added read me gif image.

[0.1.4] - June 10 2020. #

  • Typo corrected in read me.

[0.1.5] - June 10 2020. #

  • Description added to .yaml.

[0.1.6] - June 10 2020. #

  • Edited read me.

[0.1.7] - June 10 2020. #

  • Edited read me example code.

[0.1.8] - June 10 2020. #

  • Added types on read me example code.

[0.1.8] - June 10 2020. #

  • Edited title on read me example code.

[0.1.8] - June 10 2020. #

  • Edited title on read me example code.

[0.2.1] - June 11 2020. #

  • Updated example and read me.

[0.2.3] - June 11 2020. #

  • Updated input example and read me.

[0.2.4] - June 11 2020. #

  • Solved minor bugs and updated read me.

[0.2.5] - June 11 2020. #

  • Added success modal.
  • Updated read me.

[0.2.6] - June 11 2020. #

  • Updated constants file name.

[0.2.6+1] - June 11 2020. #

  • Updated util package name.

[0.2.6+2] - June 11 2020. #

  • Updated read me.

[0.2.6+3] - June 11 2020. #

  • Updated read me.

[0.2.6+4] - June 11 2020. #

  • Solved formatting issues.

[0.2.6+5] - June 11 2020. #

  • Solved formatting issues.

[0.2.6+6] - June 11 2020. #

  • Cleaned code

[0.2.6+8] - June 12 2020. #

  • Added Type class.

example/example.dart

import 'package:customprompt/customprompt.dart';
import 'package:flutter/material.dart';

void main() {
  runApp(new HelloWorld());
}

class HelloWorld extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Custom Prompt',
      home: Scaffold(
        appBar: AppBar(
          title: Text('Custom Prompt example'),
        ),
        body: Center(
          child: FlatButton(
            color: Colors.green,
            shape: RoundedRectangleBorder(
              borderRadius: BorderRadius.circular(8.0),
            ),
            onPressed: () {
              CustomPrompt(
                context: context,
                animDuration: 800,
                color: Colors.red,
                type: Type.input,
                transparent: true,
                curve: Curves.bounceOut,
                btnOneOnClick: (value) {
                  print('Input value ${value}');
                },
              ).alert();
            },
            child: Text('Show Modal'),
          ),
        ),
      ),
    );
  }
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  customprompt: ^0.2.6+8

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:customprompt/customprompt.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
46
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
73
Learn more about scoring.

We analyzed this package on Jul 9, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.4
  • pana: 0.13.14
  • Flutter: 1.17.5

Analysis suggestions

Package not compatible with SDK dart

Because:

  • customprompt that is a package requiring null.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.7.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.12 1.14.13
meta 1.1.8 1.2.2
sky_engine 0.0.99
typed_data 1.1.6 1.2.0
vector_math 2.0.8 2.1.0-nullsafety
Dev dependencies
flutter_test