From 5e72634a034626f283c06523a38ea021ff0d44da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E5=91=86=E5=91=86666?= Date: Wed, 22 May 2024 16:54:40 +0800 Subject: [PATCH] only use dynamic load of overlay in debug mode. --- lib/src/widget/helper/smart_overlay.dart | 10 ++++++---- pubspec.yaml | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/src/widget/helper/smart_overlay.dart b/lib/src/widget/helper/smart_overlay.dart index af41e9e..ef24768 100644 --- a/lib/src/widget/helper/smart_overlay.dart +++ b/lib/src/widget/helper/smart_overlay.dart @@ -1,5 +1,6 @@ import 'dart:async'; +import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter_smart_dialog/src/widget/helper/smart_overlay_entry.dart'; @@ -26,12 +27,13 @@ class SmartOverlay extends StatefulWidget { class _SmartOverlayState extends State { bool visible = false; - // bool _visible = false; - // set visible(bool value) => _visible = value; - // bool get visible => _visible || !kDebugMode; - @override void initState() { + if (!kDebugMode) { + visible = true; + return; + } + widget.controller?._setListener( onShow: () { setState(() { diff --git a/pubspec.yaml b/pubspec.yaml index 70e5ca4..9f57fa1 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+3 +version: 4.9.7+4 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/"