Flutter progress dialog. Support both Android and iOS platform.

Overview

Flutter Progress Dialog

[pub packages] | 中文说明

Flutter progress dialog. Support both Android and iOS platform.

The progress dialog just display one at the same time.

The usage inspired by OpenFlutter/flutter_oktoast

Example

Usage

1. Depend

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

dependencies:
  flutter_progress_dialog: ^0.1.0

2. Install

Run command:

$ flutter packages get

3. Import

Import in Dart code:

import 'package:flutter_progress_dialog/flutter_progress_dialog.dart';

4. Display Progress Dialog

Support two ways to display a progress dialog.

Wrap app widget
  1. Wrap your app widget
ProgressDialog(
  child: MaterialApp(),
);
  1. Exec showProgressDialog() and dismissProgressDialog() without parameters.
showProgressDialog();
//dismissProgressDialog();
Exec showProgressDialog() directly

You can exec showProgressDialog() without wrap app widget, should specify the param: context: BuildContext.

var dialog = showProgressDialog(context: context);
//dismissProgressDialog();

5. Properties

ProgressDialog have default style, and you also can custom style or other behavior.

Name Type Desc
loading Widget If specified, default widget will not show
loadingText String Hint text, just for default widget
textStyle TextStyle Hint text's style, just for default widget
backgroundColor Color Background color of the progress dialog
radius double Radius of the progress dialog
onDismiss Function Callback for dismissed
textDirection TextDirection Loading hint text's direction
orientation ProgressOrientation The direction of spin kit and hint text

Example

Example sources

Example APK

Example APK Download

Comments
  • Project not building on new beta sdk 1.26.0-17.6.pre

    Project not building on new beta sdk 1.26.0-17.6.pre

    /C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_progress_dialog-0.1.0/lib/src/widget/theme.dart:39:15: Error: The method 'inheritFromWidgetOfExactType' isn't defined for the class 'BuildContext'.

    • 'BuildContext' is from 'package:flutter/src/widgets/framework.dart' ('/C:/src/flutter/packages/flutter/lib/src/widgets/framework.dart'). Try correcting the name to the name of an existing method, or defining a method named 'inheritFromWidgetOfExactType'. context.inheritFromWidgetOfExactType(_ProgressTheme); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Failed to compile application.
    opened by Dhana2513 3
  • App crashes when double tap or long press on Cupertino TextField with ProgressDialog

    App crashes when double tap or long press on Cupertino TextField with ProgressDialog

    I am using this progress dialog library to show progress UI when app is performing something serious IO stuff. But i noticed when we double tap or long press on any Text Input Field, App crashed / shows Red screen in debug.

    Here is the related logs:

    ======== Exception caught by widgets library =======================================================
    The following ArgumentError was thrown building _OverlayEntryWidget-[LabeledGlobalKey<_OverlayEntryWidgetState>#235b1](dirty, dependencies: [MediaQuery], state: _OverlayEntryWidgetState#faabb):
    Invalid argument(s): 26.0
    
    The relevant error-causing widget was: 
      ProgressDialog file:///Users/bipinvaylu/Documents/Work/Workspaces/xyzapp/lib/main.dart:89:24
    When the exception was thrown, this was the stack: 
    #0      double.clamp (dart:core-patch/double.dart:183:7)
    #1      _CupertinoTextSelectionControls.buildToolbar (package:flutter/src/cupertino/text_selection.dart:478:72)
    #2      TextSelectionOverlay._buildToolbar (package:flutter/src/widgets/text_selection.dart:578:34)
    #3      _OverlayEntryWidgetState.build (package:flutter/src/widgets/overlay.dart:179:34)
    #4      StatefulElement.build (package:flutter/src/widgets/framework.dart:4744:28)
    ...
    ====================================================================================================
    

    main.dart - MyApp:

    class MyApp extends StatelessWidget {
      MyApp();
    
      @override
      Widget build(BuildContext context) {
        SystemChrome.setPreferredOrientations([
          DeviceOrientation.portraitUp,
        ]);
    
        return Localizations(
          locale: const Locale('en', 'US'),
          delegates: <LocalizationsDelegate<dynamic>>[
            DefaultWidgetsLocalizations.delegate,
            DefaultMaterialLocalizations.delegate,
          ],
          child: MediaQuery(
            data: const MediaQueryData(),
            child: ThemeBuilder(
              defaultThemeMode: ThemeMode.system,
              darkTheme: darkTheme,
              lightTheme: lightTheme,
              statusBarColorBuilder: (theme) => HomePage.tabBackgroundColor,
              themes: getThemes(),
              builder: (context, regularTheme, darkTheme, themeMode) {
                return LayoutBuilder(
                    //return LayoutBuilder
                    builder: (context, constraints) {
                  return OrientationBuilder(
                      //return OrientationBuilder
                      builder: (context, orientation) {
                    //initialize SizerUtil()
                    SizerUtil().init(constraints, orientation);
    
                    return ProgressDialog(
                      orientation: ProgressOrientation.vertical,
                      loadingText: "Please wait...",
                      backgroundColor: Theme.of(context).backgroundColor,
                      child: MaterialApp(
                        title: "Xyz app",
                        theme: regularTheme,
                        darkTheme: darkTheme,
                        themeMode: themeMode,
                        home: SplashScreen(),
                      ),
                    );
                  });
                });
              },
            ),
          ),
        );
      }
    }
    

    Text input field setup in other screen as follow:

                        Expanded(
                          child: CupertinoTextField(
                            controller: _userNameTextController,
                            keyboardType: TextInputType.name,
                            placeholder: "Friend username",
                            style: Theme.of(context).textTheme.bodyText1,
                            cursorColor: Theme.of(context).primaryColor,
                            prefix: Padding(
                              padding:
                                  const EdgeInsets.fromLTRB(9.0, 6.0, 9.0, 6.0),
                              child: Icon(
                                Icons.search,
                                color: Theme.of(context).primaryColor,
                              ),
                            ),
                            decoration: BoxDecoration(
                              borderRadius: BorderRadius.circular(8.0),
                              color: Theme.of(context).accentColor.withAlpha(70),
                            ),
                          ),
                        ),
    

    I don't see any proper solution as of now. Please help me here to resolve this issue. Else i might need try and switch over to other library and that some extra work. Thanks.

    opened by bipinvaylu 2
  • Fix build error on Flutter 1.26.0-12.0.pre-dev and above

    Fix build error on Flutter 1.26.0-12.0.pre-dev and above

    The method inheritFromWidgetOfExactType(T) was deprecated after v1.12.1, and totally replaced by dependOnInheritedWidgetOfExactType<T>() on version 1.26.0-12.0.pre-dev.

    opened by w568w 0
  • dialog should act like a dialog

    dialog should act like a dialog

    the visual display is very nice. one thing lacking is that the user can click anywhere on the screen. the behavior should still be the same as a dialog where clicking anywhere will dismiss it, or have an option to not dismiss it and can only do so programmatically.

    opened by chitgoks 0
  • dismiss error

    dismiss error

    Unhandled Exception: NoSuchMethodError: The method 'showDismissAnim' was called on null.
    Receiver: null
    Tried calling: showDismissAnim()
    #0      Object.noSuchMethod (dart:core-patch/object_patch.dart:53:5)
    #1      ProgressFuture.dismiss (package:flutter_progress_dialog/src/core/future.dart:25:34)
    #2      ProgressManager.dismissAll.<anonymous closure>
    
    opened by badboy-tian 2
Owner
Dylan Wu
just coding
Dylan Wu
Make your native android Dialog Fancy and Gify.

Make your native android Dialog Fancy and Gify. A library that takes the standard Android Dialog to the next level with a variety of styling options and Gif's. Style your dialog from code.

Shashank Singhal 522 Jan 2, 2023
Donation/Support buttons to allow you to add your favorite support buttons like: Paypal, Ko-fi or Patreon and more.

flutter_donation_buttons Donation/Support buttons to allow you to add your favorite support buttons like: Paypal, Ko-fi or Patreon and more. Getting S

null 6 Dec 10, 2022
Build a grouped list, which support expand/collapse section and sticky headers, support use it with sliver widget.

sticky_and_expandable_list Flutter implementation of sticky headers and expandable list.Support use it in a CustomScrollView. README i18n:中文说明 Feature

tp7309 114 Nov 16, 2022
PowerFileView - A powerful file view widget, support a variety of file types, such as Doc Eexcl PPT TXT PDF and so on, Android is implemented by Tencent X5, iOS is implemented by WKWebView.

PowerFileView - A powerful file view widget, support a variety of file types, such as Doc Eexcl PPT TXT PDF and so on, Android is implemented by Tencent X5, iOS is implemented by WKWebView.

Yao 8 Oct 22, 2022
Dialog-manager - A Flutter package that allows for neater declaration, abstraction and use of customisable dialogs

flutter_dialog_manager A Flutter package that allows for neater declaration, abs

Lucky Ebere 2 Dec 28, 2022
SKAlertDialog - A highly customizable, powerful and easy-to-use alert dialog for Flutter.

SKAlertDialog A highly customizable, powerful and easy-to-use alert dialog for Flutter. GIF Screenshots SKAlertDialog Basic Alert Alert with buttons A

Senthil_Kumar 7 May 18, 2022
A multi select form field using alert dialog to select multiple items with checkboxes and showing as chips.

A multi select form field using alert dialog to select multiple items with checkboxes and showing as chips.

Carlos Eugenio Torres 73 Sep 7, 2022
Customizable Material and Cupertino buttons with progress indicators and more

future_button Customizable Material and Cupertino buttons with progress indicators and more.

Erzhan 33 Oct 13, 2022
Display simple blurry dialog popup for flutter

Blurry Dialog Features Display simple blurry dialog popup Offer built-in themes Possibility to create you custom dialog button click handler callbacks

Kouki Badr 7 Dec 18, 2022
A Flutter widget to show a text form field to display a date or clock dialog

A Flutter widget to show a text form field to display a date or clock dialog. This widget extend TextField and has a similar behavior as TextFormField.

m3uzz Soluções em TI 82 Jan 6, 2023
Flutter overlay loading dialog example

flutter_overlay_loading_dialog_example Demo

Javeed Ishaq 4 Mar 24, 2022
A Flutter plugin which makes it straightforward to show the native equivalent of a CupertinoAlertDialog or CupertinoActionSheet dialog

A Flutter plugin which makes it straightforward to show the native equivalent of a CupertinoAlertDialog or CupertinoActionSheet dialog

Christoph Krassnigg 9 Dec 9, 2022
Widget to let the user search through a keyword string typed on a customizable keyboard in a single or multiple choices list presented as a dropdown in a dialog box or a menu.

searchable_dropdown Widget to let the user search through a keyword string typed on a customizable keyboard in a single or multiple choices list prese

Bobby Stenly Irawan 108 Sep 11, 2022
🚀🚀🚀 Semantic dialog

✨ flutter_custom_dialog [Language ~~] English | 中文文档 Global dialog function encapsulation, with a semantic way to fill the content inside the dialog,

YYDev 459 Dec 2, 2022
A Simple and easy to use flutter package for showing progress bar.

progress_dialog A Simple and easy to use flutter package for showing progress bar. #Usage Import the package import 'package:custom_progress_dialog/cu

Vikas Jilla 6 May 23, 2022
Flutter progress button

flutter_progress_button flutter_progress_button is a free and open source (MIT license) Material Flutter Button that supports variety of buttons style

Yang JIANG 91 Dec 6, 2022
Square progress bar

Square progress bar because why not ?? Features Dynamic sizing Animated progress bar Gradient color progress bar Prgreess bar cap shape customization

Yasir Rmaya 5 Dec 2, 2022
Flutter Adaptive widgets are a great way to keep the UI uniform in both platforms

Adaptive widgets are a great way to keep the UI uniform in both Android & iOS platforms. This repo contains few of the adaptive widgets. But there are more to implement like: date picker, time picker, bottom tab bar etc.

Md. Siam 3 Apr 12, 2022
Pure Dart and Flutter package for Android,IOS and Web

Fancy Flutter Alert Dialog Pure Dart and Flutter package for Android,IOS and Web A flutter Package to show custom alert Dialog,you can choose between

Dokkar Rachid Reda 119 Sep 23, 2022