From 98972143a3ca94403178faca4665c6a0db9e6dd8 Mon Sep 17 00:00:00 2001 From: xdd666 Date: Sat, 25 May 2024 19:54:01 +0800 Subject: [PATCH] process #190 --- example/lib/demo/issue190_release.dart | 51 +++++++++++++++++++ .../helper/smart_overly_controller.dart | 8 +++ .../ephemeral/Flutter-Generated.xcconfig | 8 +-- .../ephemeral/flutter_export_environment.sh | 8 +-- pubspec.yaml | 2 +- 5 files changed, 68 insertions(+), 9 deletions(-) create mode 100644 example/lib/demo/issue190_release.dart diff --git a/example/lib/demo/issue190_release.dart b/example/lib/demo/issue190_release.dart new file mode 100644 index 0000000..442a5a8 --- /dev/null +++ b/example/lib/demo/issue190_release.dart @@ -0,0 +1,51 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; + +void main() => runApp(const MyApp()); + +class MyApp extends StatelessWidget { + const MyApp({super.key}); + + // This widget is the root of your application. + @override + Widget build(BuildContext context) { + return MaterialApp( + title: 'Flutter Demo', + builder: FlutterSmartDialog.init(), + navigatorObservers: [FlutterSmartDialog.observer], + theme: ThemeData( + colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple), + useMaterial3: true, + ), + home: Scaffold( + body: Center( + child: GestureDetector( + onTap: () { + SmartDialog.show( + tag: '11', + builder: (context) { + return Center( + child: Container( + height: 300, + width: 300, + color: Colors.blue, + ), + ); + }, + animationType: SmartAnimationType.centerFade_otherSlide, + backDismiss: true, + keepSingle: true, + debounce: true, + ); + }, + child: Container( + width: 200, + height: 200, + color: Colors.red, + ), + ), + ), + ), + ); + } +} diff --git a/lib/src/widget/helper/smart_overly_controller.dart b/lib/src/widget/helper/smart_overly_controller.dart index 96bb83e..8f8412c 100644 --- a/lib/src/widget/helper/smart_overly_controller.dart +++ b/lib/src/widget/helper/smart_overly_controller.dart @@ -7,6 +7,10 @@ class SmartOverlayController { // show Future show() async { + if (_onShow == null) { + return; + } + _onShow?.call(); var completer = Completer(); widgetsBinding.addPostFrameCallback((timeStamp) { @@ -17,6 +21,10 @@ class SmartOverlayController { // dismiss void dismiss() { + if (_onDismiss == null) { + return; + } + _onDismiss?.call(); } diff --git a/macos/Flutter/ephemeral/Flutter-Generated.xcconfig b/macos/Flutter/ephemeral/Flutter-Generated.xcconfig index 6da04c3..c5240fb 100644 --- a/macos/Flutter/ephemeral/Flutter-Generated.xcconfig +++ b/macos/Flutter/ephemeral/Flutter-Generated.xcconfig @@ -1,10 +1,10 @@ // This is a generated file; do not edit or check into version control. -FLUTTER_ROOT=/Users/xdd666/Develop/SDK/flutter_sdk -FLUTTER_APPLICATION_PATH=/Users/xdd666/Develop/Github/flutter_smart_dialog +FLUTTER_ROOT=D:\Develop\SDK\flutter_sdk +FLUTTER_APPLICATION_PATH=D:\Develop\GitHub\flutter_smart_dialog COCOAPODS_PARALLEL_CODE_SIGN=true FLUTTER_BUILD_DIR=build -FLUTTER_BUILD_NAME=4.9.6 -FLUTTER_BUILD_NUMBER=2 +FLUTTER_BUILD_NAME=4.9.7 +FLUTTER_BUILD_NUMBER=4 DART_OBFUSCATION=false TRACK_WIDGET_CREATION=true TREE_SHAKE_ICONS=false diff --git a/macos/Flutter/ephemeral/flutter_export_environment.sh b/macos/Flutter/ephemeral/flutter_export_environment.sh index 69c8e53..6976cb1 100755 --- a/macos/Flutter/ephemeral/flutter_export_environment.sh +++ b/macos/Flutter/ephemeral/flutter_export_environment.sh @@ -1,11 +1,11 @@ #!/bin/sh # This is a generated file; do not edit or check into version control. -export "FLUTTER_ROOT=/Users/xdd666/Develop/SDK/flutter_sdk" -export "FLUTTER_APPLICATION_PATH=/Users/xdd666/Develop/Github/flutter_smart_dialog" +export "FLUTTER_ROOT=D:\Develop\SDK\flutter_sdk" +export "FLUTTER_APPLICATION_PATH=D:\Develop\GitHub\flutter_smart_dialog" export "COCOAPODS_PARALLEL_CODE_SIGN=true" export "FLUTTER_BUILD_DIR=build" -export "FLUTTER_BUILD_NAME=4.9.6" -export "FLUTTER_BUILD_NUMBER=2" +export "FLUTTER_BUILD_NAME=4.9.7" +export "FLUTTER_BUILD_NUMBER=4" export "DART_OBFUSCATION=false" export "TRACK_WIDGET_CREATION=true" export "TREE_SHAKE_ICONS=false" diff --git a/pubspec.yaml b/pubspec.yaml index 9f57fa1..b52b769 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -3,7 +3,7 @@ description: An elegant Flutter Dialog solution, Easily implement Toast, Loading and custom Dialog, Make the use of the dialog easier! -version: 4.9.7+4 +version: 4.9.7+5 homepage: https://github.com/fluttercandies/flutter_smart_dialog # flutter pub publish --server=https://pub.dartlang.org # flutter build web --release --base-href="/flutter_smart_dialog/web/"