We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SmartDialog.show关闭后 马上调用SmartDialog.showLoading();不能正常显示Loading
void main() { runApp(const MyApp()); } class MyApp extends StatelessWidget { const MyApp({super.key}); @override Widget build(BuildContext context) { return MaterialApp( title: 'Flutter Demo', theme: ThemeData( colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple), useMaterial3: true, ), home: const MyHomePage(title: 'Flutter Demo Home Page'), navigatorObservers: [FlutterSmartDialog.observer], builder: FlutterSmartDialog.init(), ); } } class MyHomePage extends StatefulWidget { const MyHomePage({super.key, required this.title}); final String title; @override State<MyHomePage> createState() => _MyHomePageState(); } class _MyHomePageState extends State<MyHomePage> { @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( backgroundColor: Theme.of(context).colorScheme.inversePrimary, title: Text(widget.title), ), body: Center( child: TextButton(onPressed: _onPressed, child: const Text('弹出Dialog')), ), ); } Future<void> _onPressed() async { var result = await SmartDialog.show<bool>( tag: 'tag', backDismiss: false, clickMaskDismiss: false, builder: (_) { return ElevatedButton( onPressed: () async { await SmartDialog.dismiss(tag: 'tag', result: true); // return true; }, child: const Text('关闭Dialog,显示Loading'), ); }, onDismiss: () { // showLoading()放在这里能正常显示 // SmartDialog.showLoading(); }); if (result == true) { // showLoading() 放在这里需要加一点延时才能显示Loading // await Future.delayed(const Duration(seconds: 1)); SmartDialog.showLoading(); // 延时关闭Loading await Future.delayed(const Duration(seconds: 2)); SmartDialog.dismiss(); } } }
目前是放在onDismiss里使用,小白一个,不知道啥情况。感谢大佬百忙之中抽时间来看下 Orz
The text was updated successfully, but these errors were encountered:
process #209
a383fd5
dependencies: flutter_smart_dialog: ^4.9.8+1
Sorry, something went wrong.
xdd666t
No branches or pull requests
Version Information
Describe the bug/requirement
SmartDialog.show关闭后 马上调用SmartDialog.showLoading();不能正常显示Loading
Problem demo
目前是放在onDismiss里使用,小白一个,不知道啥情况。感谢大佬百忙之中抽时间来看下 Orz
The text was updated successfully, but these errors were encountered: