Skip to content

Commit

Permalink
add issue191_toast
Browse files Browse the repository at this point in the history
  • Loading branch information
xdd666t committed May 27, 2024
1 parent 9897214 commit 2ed9b0e
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions example/lib/demo/issue191_toast.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
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({Key? key}) : super(key: key);

@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
body: Center(
child: ElevatedButton(
onPressed: () => _show(),
child: const Text('show'),
),
),
),
navigatorObservers: [FlutterSmartDialog.observer],
builder: FlutterSmartDialog.init(),
);
}

void _show() async {
SmartDialog.showLoading();
await Future.delayed(const Duration(seconds: 1));
await SmartDialog.dismiss(status: SmartStatus.loading);
SmartDialog.showToast('test toast');
}
}

0 comments on commit 2ed9b0e

Please sign in to comment.