A pure flutter toast library

Overview

oktoast

oktoast pub package GitHub GitHub stars

A library for flutter.

A pure dart toast Library.

You can completely customize the style of toast.

中文博客介绍

Screenshot

Default Custom GIF
pic pic pic

Versions

3.x.x

Starting from the 3.x version, OKToast provides a null-safety version, the specific introduction of null-safety can be viewed in dart or flutter.

The 2.3.2 version is the last version that does not support null-safety.

About version 1.x

if you use OKToast 1.x, Please use the 1.x branch, and read version readme.

Proposed migration to 2.x version. The new version does not require buildContext.

And you can completely customize the style of toast, because now you can use showToastWidget.

Usage

1. Add library to your pubspec.yaml

latest version: pub package

dependencies:
  oktoast: ^latest_version

2. Import library in dart file

import 'package:oktoast/oktoast.dart';

3. Wrap your app widget

OKToast(
  /// set toast style, optional
  child:MaterialApp()
);

Tips: If you happened error like: No MediaQuery widget found, you can try to use this code to include OKToast to your App.

MaterialApp(
  builder: (BuildContext context, Widget? widget) {
    return OKToast(child: widget);
  },
);

4. Call method showToast

showToast('content');

// position and second have default value, is optional

showToastWidget(Text('hello oktoast'));

Explain

There are two reasons why you need to wrap MaterialApp

  1. Because this ensures that toast can be displayed in front of all other controls
  2. Context can be cached so that it can be invoked anywhere without passing in context

Properties

OKToast params

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

name type need desc
child Widget required Usually Material App
textStyle TextStyle optional
radius double optional
backgroundColor Color optional backroundColor
position ToastPosition optional
dismissOtherOnShow bool optional If true, other toasts will be dismissed. Default false.
movingOnWindowChange bool optional If true, when the size changes, toast is moved. Default true.
textDirection TextDirection optional
textPadding EdgeInsetsGeometry optional Outer margin of text
textAlign TextAlign optional When the text wraps, the align of the text.
handleTouch bool optional Default is false, if it's true, can responed use touch event.
animationBuilder OKToastAnimationBuilder optional Add animation to show / hide toast.
animationDuration Duration optional The duration of animation.
animationCurve Curve optional Curve of animation.
duration Duration optional Default duration of toast.

Method showToast

Display text on toast.

Description of params see OKToast.

name type need desc
msg String required Text of toast.
context BuildContext optional
duration Duration optional
position ToastPosition optional
textStyle TextStyle optional
textPadding EdgeInsetsGeometry optional
backgroundColor Color optional
radius double optional
onDismiss Function optional
textDirection TextDirection optional
dismissOtherToast bool optional
textAlign TextAlign optional
animationBuilder OKToastAnimationBuilder optional
animationDuration Duration optional
animationCurve Curve optional

Method showToastWidget

Display custom widgets on toast

Description of params see showToast.

name type need desc
widget Widget required The widget you want to display.
context BuildContext optional
duration Duration optional
position ToastPosition optional
onDismiss Function optional
dismissOtherToast bool optional
textDirection TextDirection optional
handleTouch bool optional
animationBuilder OKToastAnimationBuilder optional
animationDuration Duration optional
animationCurve Curve optional

Method dismissAllToast

Dismiss all toast.

Return value of showToast and showToastWidget

about return type:
showToast and showToastWidget return type is ToastFuture, The ToastFuture can be use to dismiss the toast.

For all dismiss toast method

An optional parameter showAnim is added to control whether fading animation is required for dismiss.

The praram default value is false.

Examples

[ Center( child: ListView( children: [ Text( 'You have pushed the button this many times:', ), Text( '$_counter', style: Theme.of(context).textTheme.display1, ), Padding( padding: const EdgeInsets.all(8.0), child: RaisedButton( onPressed: () { Navigator.push(context, MaterialPageRoute(builder: (ctx) => MyHomePage())); }, ), ), Padding( padding: const EdgeInsets.all(8.0), child: RaisedButton( onPressed: _incrementCounter, child: Text('toast'), ), ), ], ), ), ], ), ); } } ">
import 'package:flutter/material.dart';
import 'package:oktoast/oktoast.dart'; // 1. import library

void main() => runApp( MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return OKToast(
      // 2. wrap your app with OKToast
      child:  MaterialApp(
        title: 'Flutter Demo',
        theme:  ThemeData(
          primarySwatch: Colors.blue,
        ),
        home:  MyHomePage(),
      ),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key}) : super(key: key);

  @override
  _MyHomePageState createState() =>  _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  int _counter = 0;

  void _incrementCounter() {
    _counter++;

    // 3.1 use showToast method
    showToast(
      "$_counter",
      duration: Duration(seconds: 2),
      position: ToastPosition.bottom,
      backgroundColor: Colors.black.withOpacity(0.8),
      radius: 13.0,
      textStyle: TextStyle(fontSize: 18.0),
    );

    showToast(
      "$_counter",
      duration: Duration(seconds: 2),
      position: ToastPosition.top,
      backgroundColor: Colors.black.withOpacity(0.8),
      radius: 3.0,
      textStyle: TextStyle(fontSize: 30.0),
    );

    // 3.2 use showToastWidget method to custom widget
    Widget widget = Center(
      child: ClipRRect(
        borderRadius: BorderRadius.circular(30.0),
        child: Container(
          width: 40.0,
          height: 40.0,
           color: Colors.grey.withOpacity(0.3),
          child: Icon(
            Icons.add,
            size: 30.0,
            color: Colors.green,
          ),
        ),
      ),
    );

    ToastFuture toastFuture = showToastWidget(
      widget,
      duration: Duration(seconds: 3),
      onDismiss: () {
        print("the toast dismiss"); // the method will be called on toast dismiss.
      },
    );

    // can use future
    Future.delayed(Duration(seconds: 1), () {
      toastFuture.dismiss(); // dismiss
    });

    setState(() {

    });
  }

  @override
  Widget build(BuildContext context) {
    return  Scaffold(
      appBar:  AppBar(
        title:  Text("ktoast demo"),
      ),
      body: Stack(
        children: <Widget>[
           Center(
            child: ListView(
              children: <Widget>[
                 Text(
                  'You have pushed the button this many times:',
                ),
                 Text(
                  '$_counter',
                  style: Theme.of(context).textTheme.display1,
                ),
                Padding(
                  padding: const EdgeInsets.all(8.0),
                  child: RaisedButton(
                    onPressed: () {
                      Navigator.push(context,
                          MaterialPageRoute(builder: (ctx) => MyHomePage()));
                    },
                  ),
                ),
                Padding(
                  padding: const EdgeInsets.all(8.0),
                  child: RaisedButton(
                    onPressed: _incrementCounter,
                    child: Text('toast'),
                  ),
                ),
              ],
            ),
          ),
        ],
      ),
    );
  }
}

CHANGELOG

Link

LICENSE

Apache-2.0

Comments
  • OKToast 配置 dismissOtherOnShow无效

    OKToast 配置 dismissOtherOnShow无效

    问题代码在 https://github.com/OpenFlutter/flutter_oktoast/blob/master/lib/src/toast.dart#L238

    修复:

    
    dismissOtherToast = _ToastTheme.of(context).dismissOtherOnShow ?? false;
    
    
    enhancement 
    opened by simplezhli 7
  • Replace debugDoingBuild flag with SchedulerPhase

    Replace debugDoingBuild flag with SchedulerPhase

    Replace context.debugDoingBuild flag with SchedulerBinding.instance.schedulerPhase. 'debugDoingBuild' is only valid in debug mode and it should not be used in release mode, 'SchedulerBinding.instance.schedulerPhase' can be used instead.

    opened by fengmlo 5
  • 我在弹窗中使用TextField时遇到了错误

    我在弹窗中使用TextField时遇到了错误

    这是我的错误日志:

    Reload already in progress, ignoring request
    ════════ Exception caught by widgets library ═══════════════════════════════════
    The following assertion was thrown building TextField(controller: TextEditingController#86c12(TextEditingValue(text: ┤├, selection: TextSelection(baseOffset: -1, extentOffset: -1, affinity: TextAffinity.downstream, isDirectional: false), composing: TextRange(start: -1, end: -1))), decoration: InputDecoration(filled: true, fillColor: Color(0xffefefef), border: _NoInputBorder()), style: TextStyle(inherit: true, color: Color(0xff000000), size: 13.3, height: 1.0x), dirty, state: _TextFieldState#8dc02):
    No Material widget found.
    
    TextField widgets require a Material widget ancestor.
    In material design, most widgets are conceptually "printed" on a sheet of material. In Flutter's material library, that material is represented by the Material widget. It is the Material widget that renders ink splashes, for instance. Because of this, many material library widgets require that there be a Material widget in the tree above them.
    
    To introduce a Material widget, you can either directly include one, or use a widget that contains Material itself, such as a Card, Dialog, Drawer, or Scaffold.
    
    The specific widget that could not find a Material ancestor was: TextField
        controller: TextEditingController#86c12(TextEditingValue(text: ┤├, selection: TextSelection(baseOffset: -1, extentOffset: -1, affinity: TextAffinity.downstream, isDirectional: false), composing: TextRange(start: -1, end: -1)))
    

    看起来像是TextField组件需要有一个MaterialApp的祖先组件; 然而 我在使用OKToast的时候:

    // main.dart 的build部分
     Widget build(BuildContext context) {
        return DoubleQuit(
            child: OKToast(
                child: MaterialApp(
          title: 'Flutter Demo',
          theme: ThemeData(
              primarySwatch: Colors.blue,
              textTheme: TextTheme().apply(decoration: TextDecoration.none)),
          initialRoute: 'Home',
          onGenerateRoute: onGenerateRoute,
        )));
      }
    }
    

    OKToast是包裹着MaterialApp的, 看起来使得TextField没有MaterialApp作为其祖先 ;导致了错误.

    请问有什么解决方案么?

    wontfix 
    opened by yangbean4 5
  • Param position in showToastWidget is not valid.

    Param position in showToastWidget is not valid.

    this items doesn't work with this implementation:

                  onPressed: () {
                    //model.add();
                    Widget widget = ClipRRect(
                      borderRadius: BorderRadius.circular(30.0),
                      child: ConstrainedBox(
                        constraints: BoxConstraints(
                          maxWidth: 200.0,
                          maxHeight: 50.0,
                        ),
                        child: Icon(
                          Icons.add,
                          size: 30.0,
                          color: Colors.green,
                          ),
                        ),
                      );
    
                    showToastWidget(
                      widget,
                      position: ToastPosition.bottom,
                      duration: Duration(seconds: 3),
                      onDismiss: () {
                        print("the toast dismiss");
                      },
                      );
                  },
    
    bug 
    opened by pishguy 5
  • Toast displayed on main page only

    Toast displayed on main page only

    I have multiple pages in my app. The problem is Toast is showing only on the main page, even if I call showToastWidget(...) from any other pages. Please have a look at my code below

    Page 1 - Main Page

      Widget build(BuildContext context) {
        return OKToast(
          child: Scaffold(
            backgroundColor: Theme.of(context).accentColor,
            body: Center(
              child: SizedBox(
                height: 50,
                width: 50,
                child: Image(image: AssetImage('assets/ic_logo.png')),
              ),
            ),
          ),
        );
      }```
    
    **Page 2**
    ```  @override
      Widget build(BuildContext context) {
        return OKToast(
          child: Scaffold(
            appBar: AppBar(
              centerTitle: true,
              title: Text('Page2'),
            ),
            body: ...
    );```
    opened by xihuny 4
  • Is it possible to add a close button to a widget toast?

    Is it possible to add a close button to a widget toast?

    Just that.

    I am trying dismissAllToast like this

                TextButton(
                      child: Text(
                        "a"
                      ),
                    onPressed: () {dismissAllToast(showAnim: true);},
                ),
    

    inside the toast widget (it's not wht I want but it is to try an option) but it doesn't do anything

    opened by arualana 3
  • [flutter_web] showToastWidget crashes in release mode on flutter web

    [flutter_web] showToastWidget crashes in release mode on flutter web

    It works fine in debug mode or with --verbose, but breaks when ran using --release or in production.

    Error: Another exception was thrown: Instance of 'minified:hH<void>'

    flutter run -d chrome --release --verbose

    [ +153 ms] executing: [/Users/shashwataditya/tools/flutter/] git -c log.showSignature=false log -n 1 --pretty=format:%H
    [  +57 ms] Exit code 0 from: git -c log.showSignature=false log -n 1 --pretty=format:%H
    [        ] 916c3ac648aa0498a70f32b5fc4f6c51447628e3
    [        ] executing: [/Users/shashwataditya/tools/flutter/] git tag --contains HEAD
    [ +458 ms] Exit code 0 from: git tag --contains HEAD
    [   +1 ms] 1.20.0
               1.20.0-7.4.pre
               1.20.1
               1.20.2
    [  +15 ms] executing: [/Users/shashwataditya/tools/flutter/] git rev-parse --abbrev-ref --symbolic @{u}
    [  +11 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{u}
    [   +1 ms] origin/beta
    [        ] executing: [/Users/shashwataditya/tools/flutter/] git ls-remote --get-url origin
    [   +7 ms] Exit code 0 from: git ls-remote --get-url origin
    [        ] https://github.com/flutter/flutter.git
    [  +82 ms] executing: [/Users/shashwataditya/tools/flutter/] git rev-parse --abbrev-ref HEAD
    [  +12 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD
    [   +1 ms] beta
    [  +11 ms] executing: sw_vers -productName
    [  +25 ms] Exit code 0 from: sw_vers -productName
    [        ] Mac OS X
    [        ] executing: sw_vers -productVersion
    [  +18 ms] Exit code 0 from: sw_vers -productVersion
    [   +1 ms] 10.13.6
    [        ] executing: sw_vers -buildVersion
    [  +18 ms] Exit code 0 from: sw_vers -buildVersion
    [   +1 ms] 17G13035
    [  +53 ms] Artifact Instance of 'AndroidMavenArtifacts' is not required, skipping update.
    [        ] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
    [        ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
    [        ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
    [        ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
    [   +3 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
    [        ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
    [        ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
    [        ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
    [        ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
    [        ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
    [        ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
    [  +16 ms] executing: /Users/shashwataditya/Library/Android/sdk/platform-tools/adb devices -l
    [  +24 ms] executing: /usr/bin/xcode-select --print-path
    [  +12 ms] Exit code 0 from: /usr/bin/xcode-select --print-path
    [   +1 ms] /Applications/Xcode.app/Contents/Developer
    [   +1 ms] executing: /usr/bin/xcodebuild -version
    [+1103 ms] Exit code 0 from: /usr/bin/xcodebuild -version
    [        ] Xcode 10.1
               Build version 10B61
    [   +1 ms] Xcode not found. Run 'flutter doctor' for more information.
    [  +49 ms] List of devices attached
    [   +5 ms] Artifact Instance of 'AndroidMavenArtifacts' is not required, skipping update.
    [        ] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
    [        ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
    [        ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
    [   +3 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
    [        ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
    [        ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
    [        ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
    [        ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
    [        ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
    [        ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
    [ +184 ms] Found plugin cloud_firestore at /Users/shashwataditya/tools/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.14.0+2/
    [  +15 ms] Found plugin cloud_firestore_web at /Users/shashwataditya/tools/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore_web-0.2.0+1/
    [  +27 ms] Found plugin firebase_analytics at /Users/shashwataditya/tools/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_analytics-6.0.0/
    [   +4 ms] Found plugin firebase_analytics_web at /Users/shashwataditya/tools/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_analytics_web-0.1.1/
    [   +2 ms] Found plugin firebase_auth at /Users/shashwataditya/tools/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.18.0+1/
    [   +6 ms] Found plugin firebase_auth_web at /Users/shashwataditya/tools/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth_web-0.3.0+1/
    [   +2 ms] Found plugin firebase_core at /Users/shashwataditya/tools/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core-0.5.0/
    [   +4 ms] Found plugin firebase_core_web at /Users/shashwataditya/tools/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core_web-0.2.0/
    [   +7 ms] Found plugin flutter_custom_tabs at /Users/shashwataditya/tools/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_custom_tabs-0.6.0/
    [  +11 ms] Found plugin flutter_plugin_android_lifecycle at
    /Users/shashwataditya/tools/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_plugin_android_lifecycle-1.0.8/
    [  +19 ms] Found plugin google_sign_in at /Users/shashwataditya/tools/flutter/.pub-cache/hosted/pub.dartlang.org/google_sign_in-4.5.1/
    [   +4 ms] Found plugin google_sign_in_web at /Users/shashwataditya/tools/flutter/.pub-cache/hosted/pub.dartlang.org/google_sign_in_web-0.9.1+1/
    [  +28 ms] Found plugin image_picker at /Users/shashwataditya/tools/flutter/.pub-cache/hosted/pub.dartlang.org/image_picker-0.6.7+4/
    [  +41 ms] Found plugin path_provider at /Users/shashwataditya/tools/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-1.6.11/
    [   +1 ms] Found plugin path_provider_linux at /Users/shashwataditya/tools/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_linux-0.0.1+1/
    [   +3 ms] Found plugin path_provider_macos at /Users/shashwataditya/tools/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_macos-0.0.4+3/
    [  +23 ms] Found plugin social_share at /Users/shashwataditya/tools/flutter/.pub-cache/hosted/pub.dartlang.org/social_share-2.0.5/
    [  +35 ms] Found plugin url_launcher at /Users/shashwataditya/tools/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher-5.5.0/
    [   +1 ms] Found plugin url_launcher_linux at /Users/shashwataditya/tools/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_linux-0.0.1+1/
    [   +1 ms] Found plugin url_launcher_macos at /Users/shashwataditya/tools/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_macos-0.0.1+7/
    [   +2 ms] Found plugin url_launcher_web at /Users/shashwataditya/tools/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_web-0.1.2/
    [  +73 ms] Found plugin cloud_firestore at /Users/shashwataditya/tools/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.14.0+2/
    [   +2 ms] Found plugin cloud_firestore_web at /Users/shashwataditya/tools/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore_web-0.2.0+1/
    [  +12 ms] Found plugin firebase_analytics at /Users/shashwataditya/tools/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_analytics-6.0.0/
    [   +1 ms] Found plugin firebase_analytics_web at /Users/shashwataditya/tools/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_analytics_web-0.1.1/
    [   +1 ms] Found plugin firebase_auth at /Users/shashwataditya/tools/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.18.0+1/
    [   +1 ms] Found plugin firebase_auth_web at /Users/shashwataditya/tools/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth_web-0.3.0+1/
    [   +1 ms] Found plugin firebase_core at /Users/shashwataditya/tools/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core-0.5.0/
    [   +1 ms] Found plugin firebase_core_web at /Users/shashwataditya/tools/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core_web-0.2.0/
    [   +1 ms] Found plugin flutter_custom_tabs at /Users/shashwataditya/tools/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_custom_tabs-0.6.0/
    [   +2 ms] Found plugin flutter_plugin_android_lifecycle at
    /Users/shashwataditya/tools/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_plugin_android_lifecycle-1.0.8/
    [   +8 ms] Found plugin google_sign_in at /Users/shashwataditya/tools/flutter/.pub-cache/hosted/pub.dartlang.org/google_sign_in-4.5.1/
    [   +3 ms] Found plugin google_sign_in_web at /Users/shashwataditya/tools/flutter/.pub-cache/hosted/pub.dartlang.org/google_sign_in_web-0.9.1+1/
    [   +4 ms] Found plugin image_picker at /Users/shashwataditya/tools/flutter/.pub-cache/hosted/pub.dartlang.org/image_picker-0.6.7+4/
    [   +9 ms] Found plugin path_provider at /Users/shashwataditya/tools/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-1.6.11/
    [        ] Found plugin path_provider_linux at /Users/shashwataditya/tools/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_linux-0.0.1+1/
    [   +1 ms] Found plugin path_provider_macos at /Users/shashwataditya/tools/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_macos-0.0.4+3/
    [  +12 ms] Found plugin social_share at /Users/shashwataditya/tools/flutter/.pub-cache/hosted/pub.dartlang.org/social_share-2.0.5/
    [   +7 ms] Found plugin url_launcher at /Users/shashwataditya/tools/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher-5.5.0/
    [   +4 ms] Found plugin url_launcher_linux at /Users/shashwataditya/tools/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_linux-0.0.1+1/
    [   +1 ms] Found plugin url_launcher_macos at /Users/shashwataditya/tools/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_macos-0.0.1+7/
    [   +1 ms] Found plugin url_launcher_web at /Users/shashwataditya/tools/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_web-0.1.2/
    [  +76 ms] Generating /Users/shashwataditya/flutter/Kohbee/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java
    [ +268 ms] Launching lib/main.dart on Chrome in release mode...
    [  +64 ms] Found plugin cloud_firestore at /Users/shashwataditya/tools/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.14.0+2/
    [   +1 ms] Found plugin cloud_firestore_web at /Users/shashwataditya/tools/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore_web-0.2.0+1/
    [   +8 ms] Found plugin firebase_analytics at /Users/shashwataditya/tools/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_analytics-6.0.0/
    [   +1 ms] Found plugin firebase_analytics_web at /Users/shashwataditya/tools/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_analytics_web-0.1.1/
    [        ] Found plugin firebase_auth at /Users/shashwataditya/tools/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.18.0+1/
    [   +1 ms] Found plugin firebase_auth_web at /Users/shashwataditya/tools/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth_web-0.3.0+1/
    [   +3 ms] Found plugin firebase_core at /Users/shashwataditya/tools/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core-0.5.0/
    [   +1 ms] Found plugin firebase_core_web at /Users/shashwataditya/tools/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core_web-0.2.0/
    [   +1 ms] Found plugin flutter_custom_tabs at /Users/shashwataditya/tools/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_custom_tabs-0.6.0/
    [   +1 ms] Found plugin flutter_plugin_android_lifecycle at
    /Users/shashwataditya/tools/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_plugin_android_lifecycle-1.0.8/
    [   +2 ms] Found plugin google_sign_in at /Users/shashwataditya/tools/flutter/.pub-cache/hosted/pub.dartlang.org/google_sign_in-4.5.1/
    [        ] Found plugin google_sign_in_web at /Users/shashwataditya/tools/flutter/.pub-cache/hosted/pub.dartlang.org/google_sign_in_web-0.9.1+1/
    [   +2 ms] Found plugin image_picker at /Users/shashwataditya/tools/flutter/.pub-cache/hosted/pub.dartlang.org/image_picker-0.6.7+4/
    [  +11 ms] Found plugin path_provider at /Users/shashwataditya/tools/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-1.6.11/
    [        ] Found plugin path_provider_linux at /Users/shashwataditya/tools/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_linux-0.0.1+1/
    [        ] Found plugin path_provider_macos at /Users/shashwataditya/tools/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_macos-0.0.4+3/
    [   +4 ms] Found plugin social_share at /Users/shashwataditya/tools/flutter/.pub-cache/hosted/pub.dartlang.org/social_share-2.0.5/
    [  +10 ms] Found plugin url_launcher at /Users/shashwataditya/tools/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher-5.5.0/
    [        ] Found plugin url_launcher_linux at /Users/shashwataditya/tools/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_linux-0.0.1+1/
    [        ] Found plugin url_launcher_macos at /Users/shashwataditya/tools/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_macos-0.0.1+7/
    [        ] Found plugin url_launcher_web at /Users/shashwataditya/tools/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_web-0.1.2/
    [  +35 ms] Found plugin cloud_firestore at /Users/shashwataditya/tools/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.14.0+2/
    [   +1 ms] Found plugin cloud_firestore_web at /Users/shashwataditya/tools/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore_web-0.2.0+1/
    [   +4 ms] Found plugin firebase_analytics at /Users/shashwataditya/tools/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_analytics-6.0.0/
    [   +1 ms] Found plugin firebase_analytics_web at /Users/shashwataditya/tools/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_analytics_web-0.1.1/
    [        ] Found plugin firebase_auth at /Users/shashwataditya/tools/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.18.0+1/
    [   +1 ms] Found plugin firebase_auth_web at /Users/shashwataditya/tools/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth_web-0.3.0+1/
    [        ] Found plugin firebase_core at /Users/shashwataditya/tools/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core-0.5.0/
    [   +2 ms] Found plugin firebase_core_web at /Users/shashwataditya/tools/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core_web-0.2.0/
    [   +2 ms] Found plugin flutter_custom_tabs at /Users/shashwataditya/tools/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_custom_tabs-0.6.0/
    [   +1 ms] Found plugin flutter_plugin_android_lifecycle at
    /Users/shashwataditya/tools/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_plugin_android_lifecycle-1.0.8/
    [   +2 ms] Found plugin google_sign_in at /Users/shashwataditya/tools/flutter/.pub-cache/hosted/pub.dartlang.org/google_sign_in-4.5.1/
    [        ] Found plugin google_sign_in_web at /Users/shashwataditya/tools/flutter/.pub-cache/hosted/pub.dartlang.org/google_sign_in_web-0.9.1+1/
    [   +6 ms] Found plugin image_picker at /Users/shashwataditya/tools/flutter/.pub-cache/hosted/pub.dartlang.org/image_picker-0.6.7+4/
    [   +7 ms] Found plugin path_provider at /Users/shashwataditya/tools/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-1.6.11/
    [        ] Found plugin path_provider_linux at /Users/shashwataditya/tools/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_linux-0.0.1+1/
    [   +1 ms] Found plugin path_provider_macos at /Users/shashwataditya/tools/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_macos-0.0.4+3/
    [   +9 ms] Found plugin social_share at /Users/shashwataditya/tools/flutter/.pub-cache/hosted/pub.dartlang.org/social_share-2.0.5/
    [   +6 ms] Found plugin url_launcher at /Users/shashwataditya/tools/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher-5.5.0/
    [        ] Found plugin url_launcher_linux at /Users/shashwataditya/tools/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_linux-0.0.1+1/
    [        ] Found plugin url_launcher_macos at /Users/shashwataditya/tools/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_macos-0.0.1+7/
    [   +1 ms] Found plugin url_launcher_web at /Users/shashwataditya/tools/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_web-0.1.2/
    [  +24 ms] Generating /Users/shashwataditya/flutter/Kohbee/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java
    [   +7 ms] Compiling lib/main.dart for the Web...
    [  +19 ms] Initializing file store
    [   +9 ms] Done initializing file store
    [  +81 ms] Skipping target: gen_localizations
    [  +19 ms] Skipping target: web_entrypoint
    [ +846 ms] dart2js: Starting due to {InvalidatedReason.inputChanged}
    [+40432 ms] dart2js: Complete
    [  +68 ms] invalidated build due to missing files: /Users/shashwataditya/flutter/Kohbee/DOES_NOT_EXIST_RERUN_FOR_WILDCARD865199376
    [ +123 ms] web_release_bundle: Starting due to {InvalidatedReason.inputChanged, InvalidatedReason.inputMissing}
    [ +277 ms] Manifest contained wildcard assets. Inserting missing file into build graph to force rerun. for more information see #56466.
    [ +188 ms] web_release_bundle: Complete
    [ +256 ms] Skipping target: web_service_worker
    [   +2 ms] Persisting file store
    [  +10 ms] Done persisting file store
    [  +29 ms] Compiling lib/main.dart for the Web... (completed in 42.3s)
    [ +957 ms] [CHROME]:
    [   +3 ms] [CHROME]:DevTools listening on ws://127.0.0.1:63801/devtools/browser/25ad54c5-83ba-41d4-8d30-9590ed3331fe
    [+1008 ms] Warning: Flutter's support for web development is not stable yet and hasn't
    [        ] been thoroughly tested in production environments.
    [        ] For more information see https://flutter.dev/web
    [   +1 ms] 🔥  To hot restart changes while running, press "r" or "R".
    [   +5 ms] For a more detailed help message, press "h". To quit, press "q".
    

    pubspec.yaml

    name: Kohbee
    description: Live classes for CBSE, ICSE
    
    # The following line prevents the package from being accidentally published to
    # pub.dev using `pub publish`. This is preferred for private packages.
    publish_to: 'none' # Remove this line if you wish to publish to pub.dev
    
    # The following defines the version and build number for your application.
    # A version number is three numbers separated by dots, like 1.2.43
    # followed by an optional build number separated by a +.
    # Both the version and the builder number may be overridden in flutter
    # build by specifying --build-name and --build-number, respectively.
    # In Android, build-name is used as versionName while build-number used as versionCode.
    # Read more about Android versioning at https://developer.android.com/studio/publish/versioning
    # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
    # Read more about iOS versioning at
    # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
    version: 1.0.0+2
    
    environment:
      sdk: ">=2.7.0 <3.0.0"
    
    dependencies:
      flutter:
        sdk: flutter
    
    
      # The following adds the Cupertino Icons font to your application.
      # Use with the CupertinoIcons class for iOS style icons.
      cupertino_icons: ^0.1.3
      provider: ^4.1.3
      firebase_auth: any #^0.16.1
      google_sign_in: ^4.5.1
      http: ^0.12.1
      moor: ^3.1.0
      flare_flutter: ^2.0.1
      google_fonts: ^1.1.0
      curved_navigation_bar: ^0.3.3
      get_it: ^4.0.2
      intl: ^0.16.1
      xml: ^4.2.0
      crypto: ^2.1.5
      url_launcher: ^5.5.0
      stacked: ^1.7.4
      uuid: ^2.2.0
      universal_html: ^1.2.1
      oktoast: ^2.3.2
      platform_detect: ^1.4.0
      flutter_slidable: ^0.5.5
      flutter_launcher_icons: ^0.7.5
      flutter_custom_tabs: ^0.6.0
      dash_chat: ^1.1.14
      firebase: ^7.3.0
      cloud_firestore:
      # firebase_storage: ^3.1.6
      image_picker: ^0.6.7+4
      timeago: ^2.0.26
      social_share: ^2.0.5
      grouped_list: ^3.3.0
      logger: ^0.6.0
      firebase_analytics: ^6.0.0
      flutter_spinkit: ^4.1.2+1
    
    
    dev_dependencies:
      flutter_test:
        sdk: flutter
      moor_generator: ^3.1.0
      build_runner: ^1.10.0
    
    flutter_icons:
      android: true
      ios: true
      image_path_android: "assets/icons/Icon-192.png"
      image_path_ios: "assets/icons/apple-icon.png"
    
    # For information on the generic Dart part of this file, see the
    # following page: https://dart.dev/tools/pub/pubspec
    
    # The following section is specific to Flutter.
    flutter:
    
      # The following line ensures that the Material Icons font is
      # included with your application, so that you can use the icons in
      # the material Icons class.
      uses-material-design: true
    
      # To add assets to your application, add an assets section, like this:
      assets:
          - assets/images/
    
      #   - images/a_dot_burr.jpeg
      #   - images/a_dot_ham.jpeg
    
      
      # An image asset can refer to one or more resolution-specific "variants", see
      # https://flutter.dev/assets-and-images/#resolution-aware.
    
      # For details regarding adding assets from package dependencies, see
      # https://flutter.dev/assets-and-images/#from-packages
    
      # To add custom fonts to your application, add a fonts section here,
      # in this "flutter" section. Each entry in this list should have a
      # "family" key with the font family name, and a "fonts" key with a
      # list giving the asset and other descriptors for the font. For
      # example:
      # fonts:
      #   - family: Schyler
      #     fonts:
      #       - asset: fonts/Schyler-Regular.ttf
      #       - asset: fonts/Schyler-Italic.ttf
      #         style: italic
      #   - family: Trajan Pro
      #     fonts:
      #       - asset: fonts/TrajanPro.ttf
      #       - asset: fonts/TrajanPro_Bold.ttf
      #         weight: 700
      #
      # For details regarding fonts from package dependencies,
      # see https://flutter.dev/custom-fonts/#from-packages
    

    flutter doctor

    Doctor summary (to see all details, run flutter doctor -v):
    [✓] Flutter (Channel beta, 1.20.0, on Mac OS X 10.13.6 17G13035, locale en-IN)
     
    [✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    [!] Xcode - develop for iOS and macOS (Xcode 10.1)
        ✗ Flutter requires a minimum Xcode version of 11.0.0.
          Download the latest version or update via the Mac App Store.
        ! CocoaPods 1.7.5 out of date (1.8.0 is recommended).
            CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin usage on the Dart side.
            Without CocoaPods, plugins will not work on iOS or macOS.
            For more info, see https://flutter.dev/platform-plugins
          To upgrade:
            sudo gem install cocoapods
    [✓] Chrome - develop for the web
    [✓] Android Studio (version 3.5)
    [✓] Connected device (2 available)
    
    ! Doctor found issues in 1 category.
    
    opened by shashwatadi 3
  • 在异步请求前报错了

    在异步请求前报错了

    我在封装底层请求时遇到的问题,望解答 image

    在位置1处使用时报异常如下: [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: setState() or markNeedsBuild() called during build. E/flutter ( 6736): This Overlay widget cannot be marked as needing to build because the framework is already in the process of building widgets. A widget can be marked as needing to be built during the build phase only if one of its ancestors is currently building. This exception is allowed because the framework builds parent widgets before children, which means a dirty descendant will always be built. Otherwise, the framework might not visit this widget during this build phase.

    在位置2正常

    在位置3正常

    opened by yin-shu 3
  • 添加遮罩后点击穿透了

    添加遮罩后点击穿透了

    Use showToastWidget method, wrap a Container and use property color. showToastWidget( Container( color: Colors.black.withOpacity(0.5), child: Center( child:xxxx), ), ), )

    opened by li305263 3
  • How to call showToast from builder of FutureBuilder

    How to call showToast from builder of FutureBuilder

    When I try to call showToast from the builder of a FutureBuilder, I'm getting an error that says setState() or markNeedsBuild() called during build. This Overlay widget cannot be marked as needing to build because the framework is already in the process of building widgets. A widget can be marked as needing to be built during the build phase only if one of its ancestors is currently building..

    What is the best way to do this?

    no response 
    opened by IoanaAlexandru 3
  • 关闭自身调用dismiss无效, 怎么解决?

    关闭自身调用dismiss无效, 怎么解决?

    代码如下:

    
    class Loading {
      ToastFuture a;
      static final Loading _singleton = Loading._internal();
    
      static Loading get instance => Loading();
    
      factory Loading() {
        return _singleton;
      }
    
      Loading._internal() {}
    
      show({String title = ''}) {
        print('显示loading');
        a = showToastWidget(
          LoadingDialog(
            text: title,
          ),
          duration: Duration(seconds: 20),
        );
      }
    
      hide() {
        print('隐藏loading $a');
        a?.dismiss();
        a = null;
      }
    }
    
    

    调用后不会隐藏当前的loading, 而是要20s后自己隐藏;

    question no response 
    opened by cander0815 3
  • 有办法屏蔽点击返回事件吗?

    有办法屏蔽点击返回事件吗?

    var w = WillPopScope(
        child: Listener(
          behavior: HitTestBehavior.opaque,
          child: Center(
            child: Container(
                decoration: BoxDecoration(
                  borderRadius: BorderRadius.circular(5),
                  color: Colors.black.withOpacity(0.7),
                ),
                padding: const EdgeInsets.all(20),
                child: CircularProgressIndicator(
                  valueColor: AlwaysStoppedAnimation(Colors.white),
                )),
          ),
        ),
        onWillPop: () async {
          print("onWillPop");
          return false;
        },
      );
    showToastWidget(w, duration: Duration.zero, handleTouch: true);
    

    需要屏蔽安卓点击物理返回键事件,这样写监听不到,有没有什么办法?

    opened by oshiwei 0
  • The Toast Movement while showing.

    The Toast Movement while showing.

    Dear author, Thank you for developing this useful package. It helps me a lot. I feel that it can add a function that if there are more than one toast showing, the toast can change its position. Now the toast could not change its position after it was shown in the screen so that if there are more than one toast at one time , they will overlay each other. Hope you could consider this. Thanks Best wishes

    question 
    opened by Hermit-Alex 1
Releases(3.3.1)
Owner
OpenFlutter
Make it easier.让Flutter更简单。
OpenFlutter
A Styled Toast Flutter package.

flutter_styled_toast A Styled Toast Flutter package. You can highly customize toast ever. Beautify toast with a series of animations and make toast mo

null 67 Jan 8, 2023
A package for flutter to use alert and toast within one line code.

easy_alert A package for flutter to use alert and toast within one line code. Getting Started Add easy_alert: to your pubspec.yaml, and run flutt

null 34 Jun 25, 2021
Provider support for overlay, make it easy to build toast and In-App notification.

overlay_support Provider support for overlay, make it easy to build toast and In-App notification. this library support ALL platform Interaction If yo

Bin 340 Jan 1, 2023
A Flutter plugin that makes it easier to make floating/overlay windows for Android with pure Flutter

flutter_floatwing A Flutter plugin that makes it easier to make floating/overlay windows for Android with pure Flutter. Android only Features Pure Flu

Zoe 116 Dec 21, 2022
Math rendering and editing in pure Flutter.

Flutter Math Math equation rendering in pure Dart & Flutter. This project aims to achieve maximum compatibility and fidelity with regard to the KaTeX

null 109 Dec 16, 2022
A light-weight Emoji 📦 for Dart & Flutter with all up-to-date emojis written in pure Dart 😄 . Made from 💯% ☕ with ❤️!

dart_emoji ?? A light-weight Emoji ?? for Dart & Flutter with all up-to-date emojis written in pure Dart ?? . Made from ?? % ☕ with ❤️ ! This is a for

Gatch 18 Mar 22, 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
A simple Flutter widget library that helps us to select days in a week.

A simple Flutter widget library that helps us to select days in a week.

Shan Shaji 4 Oct 9, 2022
A Flutter library to add bubble tab indicator to TabBar

Bubble Tab Indicator A Flutter library to add bubble tab indicator to TabBar. Getting Started Add package from github by adding the following to your

Vipul Asri 184 Nov 23, 2022
An Extension library for Flutter Widgets.

widget_extensions An Extension library for Flutter Widgets. Getting Started This Lib helps by providing utility functions for Flutter Widgets. These M

null 7 May 11, 2021
Flutter ScrollView Observer - a library of widget that can be used to listen for child widgets those are being displayed in the scroll view

Flutter ScrollView Observer - a library of widget that can be used to listen for child widgets those are being displayed in the scroll view

林洵锋 67 Jan 6, 2023
A Flutter library to add the Common effect (line, bubble, dot ...) of tab indicator.

flutter_tab_indicator A Flutter library to add the Common effect (line, bubble, dot ...) of tab indicator. Showcases Installation Showcases Showcases

CrabMan 14 Jun 19, 2022
Library Widgets

Library Widgets Installing 1. Depend on it Add this to your package's pubspec.yaml file: dependencies: library_widgets: ^0.0.1 2. Install it You can

Leonardo Serrano 1 Oct 28, 2021
A Facebook & Twitter Like Card Loading Shimmer Skeleton Library.

PKSkeleton A Facebook & Twitter Like Card Loading Shimmer Skeleton Library. The source code is 100% Dart, and everything resides in the /lib folder. S

Pawan Kumar 283 Nov 26, 2022
A library to easily create radio button and checkbox groups.

Check/Radio Group A library to easily create radio button and checkbox groups. Define font size, selection color, position of radios / check and text

Caiubi Tech 2 Jan 6, 2021
The public ui library is used with the openim demo, and you can directly use it for secondary development.

flutter_openim_widget The public ui library is used with the openim demo, and you can directly use it for secondary development. import 'package:flutt

null 28 Dec 27, 2022
Flutter package: Assorted layout widgets that boldly go where no native Flutter widgets have gone before.

assorted_layout_widgets I will slowly but surely add interesting widgets, classes and methods to this package. Despite the package name, they are not

Marcelo Glasberg 122 Dec 22, 2022
Flutter Carousel Pro - A Flutter Carousel widget

Carousel Extended A Flutter Carousel widget. Usage As simple as using any flutter Widget. Based on Carousel Pro but extended to be able to navigate be

omid habibi 3 Dec 7, 2020
Flutter-useful-widgets - Flutter Useful Widgets

useful_widgets This package makes it easy to build apps by providing a list of simple and useful widgets. import 'package:useful_widgets/useful_widget

Ricardo Crescenti 6 Jun 20, 2022