File tree Expand file tree Collapse file tree 2 files changed +53
-1
lines changed Expand file tree Collapse file tree 2 files changed +53
-1
lines changed Original file line number Diff line number Diff line change 1+ import 'package:flutter/material.dart' ;
2+ import 'package:flutter_smart_dialog/flutter_smart_dialog.dart' ;
3+
4+ void main () {
5+ runApp (const MyApp ());
6+ }
7+
8+ class MyApp extends StatelessWidget {
9+ const MyApp ({super .key});
10+
11+ @override
12+ Widget build (BuildContext context) {
13+ SmartDialog .config.toast = SmartConfigToast (
14+ displayType: SmartToastType .last,
15+ );
16+ return MaterialApp (
17+ title: 'NestedScrollView 解决方案' ,
18+ theme: ThemeData (
19+ primarySwatch: Colors .blue,
20+ useMaterial3: true ,
21+ ),
22+ builder: FlutterSmartDialog .init (),
23+ home: const NestedScrollSolution (),
24+ );
25+ }
26+ }
27+
28+ class NestedScrollSolution extends StatefulWidget {
29+ const NestedScrollSolution ({super .key});
30+
31+ @override
32+ State createState () => _NestedScrollSolutionState ();
33+ }
34+
35+ class _NestedScrollSolutionState extends State {
36+ @override
37+ void initState () {
38+ super .initState ();
39+ }
40+
41+ @override
42+ Widget build (BuildContext context) {
43+ return Scaffold (
44+ floatingActionButton: FloatingActionButton (
45+ onPressed: () {
46+ SmartDialog .showToast ("已经是最大回合数" );
47+ },
48+ child: const Icon (Icons .shopping_cart),
49+ ),
50+ );
51+ }
52+ }
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ class SmartDialogPage extends StatelessWidget {
3636 appBar: AppBar (title: const Text ('SmartDialog-EasyDemo' )),
3737 body: Container (
3838 margin: const EdgeInsets .all (30 ),
39- child: Wrap (spacing: 20 , children: [
39+ child: Wrap (spacing: 20 , runSpacing : 20 , children: [
4040 //toast
4141 ElevatedButton (
4242 onPressed: () => _showToast (),
You can’t perform that action at this time.
0 commit comments