Skip to content

Commit 66ceef3

Browse files
committed
add some demo
1 parent 83cbf09 commit 66ceef3

File tree

2 files changed

+53
-1
lines changed

2 files changed

+53
-1
lines changed

example/lib/demo/issue266.dart

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
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+
}

example/lib/main.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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(),

0 commit comments

Comments
 (0)