Skip to content

Commit 31a27b2

Browse files
committed
🐛 (fix) Displose widget when removing from widget tree. #1
1 parent 9d2639f commit 31a27b2

9 files changed

Lines changed: 321 additions & 228 deletions

File tree

example/lib/main.dart

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class MyApp extends StatelessWidget {
99
return MaterialApp(
1010
title: 'Flutter Demo',
1111
theme: ThemeData(
12-
primarySwatch: Colors.blue,
12+
primarySwatch: Colors.blue,
1313
),
1414
home: MyHomePage(title: 'Empty widget demo'),
1515
);
@@ -19,7 +19,7 @@ class MyApp extends StatelessWidget {
1919
class MyHomePage extends StatefulWidget {
2020
MyHomePage({Key key, this.title}) : super(key: key);
2121

22-
final String title;
22+
final String title;
2323

2424
@override
2525
_MyHomePageState createState() => _MyHomePageState();
@@ -33,19 +33,25 @@ class _MyHomePageState extends State<MyHomePage> {
3333
title: Text(widget.title),
3434
),
3535
body: Center(
36-
child: Container(
37-
height: 500,
38-
width:350,
39-
child: EmptyListWidget(
40-
image : null,
36+
child: Container(
37+
height: 500,
38+
width: 350,
39+
child: EmptyListWidget(
40+
image: null,
4141
packageImage: PackageImage.Image_1,
4242
title: 'Title here',
4343
subTitle: 'Some text here',
44-
titleTextStyle: Theme.of(context).typography.dense.display1.copyWith(color: Color(0xff9da9c7)),
45-
subtitleTextStyle: Theme.of(context).typography.dense.body2.copyWith(color: Color(0xffabb8d6))
46-
),
47-
)
48-
),
44+
titleTextStyle: Theme.of(context)
45+
.typography
46+
.dense
47+
.headline5
48+
.copyWith(color: Color(0xff9da9c7)),
49+
subtitleTextStyle: Theme.of(context)
50+
.typography
51+
.dense
52+
.bodyText1
53+
.copyWith(color: Color(0xffabb8d6))),
54+
)),
4955
);
5056
}
5157
}

example/pubspec.lock

Lines changed: 37 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -7,28 +7,42 @@ packages:
77
name: async
88
url: "https://pub.dartlang.org"
99
source: hosted
10-
version: "2.3.0"
10+
version: "2.5.0"
1111
boolean_selector:
1212
dependency: transitive
1313
description:
1414
name: boolean_selector
1515
url: "https://pub.dartlang.org"
1616
source: hosted
17-
version: "1.0.5"
17+
version: "2.1.0"
18+
characters:
19+
dependency: transitive
20+
description:
21+
name: characters
22+
url: "https://pub.dartlang.org"
23+
source: hosted
24+
version: "1.1.0"
1825
charcode:
1926
dependency: transitive
2027
description:
2128
name: charcode
2229
url: "https://pub.dartlang.org"
2330
source: hosted
24-
version: "1.1.2"
31+
version: "1.2.0"
32+
clock:
33+
dependency: transitive
34+
description:
35+
name: clock
36+
url: "https://pub.dartlang.org"
37+
source: hosted
38+
version: "1.1.0"
2539
collection:
2640
dependency: transitive
2741
description:
2842
name: collection
2943
url: "https://pub.dartlang.org"
3044
source: hosted
31-
version: "1.14.11"
45+
version: "1.15.0"
3246
cupertino_icons:
3347
dependency: "direct main"
3448
description:
@@ -43,6 +57,13 @@ packages:
4357
relative: true
4458
source: path
4559
version: "0.0.1"
60+
fake_async:
61+
dependency: transitive
62+
description:
63+
name: fake_async
64+
url: "https://pub.dartlang.org"
65+
source: hosted
66+
version: "1.2.0"
4667
flutter:
4768
dependency: "direct main"
4869
description: flutter
@@ -59,35 +80,21 @@ packages:
5980
name: matcher
6081
url: "https://pub.dartlang.org"
6182
source: hosted
62-
version: "0.12.5"
83+
version: "0.12.10"
6384
meta:
6485
dependency: transitive
6586
description:
6687
name: meta
6788
url: "https://pub.dartlang.org"
6889
source: hosted
69-
version: "1.1.7"
90+
version: "1.3.0"
7091
path:
7192
dependency: transitive
7293
description:
7394
name: path
7495
url: "https://pub.dartlang.org"
7596
source: hosted
76-
version: "1.6.4"
77-
pedantic:
78-
dependency: transitive
79-
description:
80-
name: pedantic
81-
url: "https://pub.dartlang.org"
82-
source: hosted
83-
version: "1.8.0+1"
84-
quiver:
85-
dependency: transitive
86-
description:
87-
name: quiver
88-
url: "https://pub.dartlang.org"
89-
source: hosted
90-
version: "2.0.5"
97+
version: "1.8.0"
9198
sky_engine:
9299
dependency: transitive
93100
description: flutter
@@ -99,55 +106,55 @@ packages:
99106
name: source_span
100107
url: "https://pub.dartlang.org"
101108
source: hosted
102-
version: "1.5.5"
109+
version: "1.8.0"
103110
stack_trace:
104111
dependency: transitive
105112
description:
106113
name: stack_trace
107114
url: "https://pub.dartlang.org"
108115
source: hosted
109-
version: "1.9.3"
116+
version: "1.10.0"
110117
stream_channel:
111118
dependency: transitive
112119
description:
113120
name: stream_channel
114121
url: "https://pub.dartlang.org"
115122
source: hosted
116-
version: "2.0.0"
123+
version: "2.1.0"
117124
string_scanner:
118125
dependency: transitive
119126
description:
120127
name: string_scanner
121128
url: "https://pub.dartlang.org"
122129
source: hosted
123-
version: "1.0.5"
130+
version: "1.1.0"
124131
term_glyph:
125132
dependency: transitive
126133
description:
127134
name: term_glyph
128135
url: "https://pub.dartlang.org"
129136
source: hosted
130-
version: "1.1.0"
137+
version: "1.2.0"
131138
test_api:
132139
dependency: transitive
133140
description:
134141
name: test_api
135142
url: "https://pub.dartlang.org"
136143
source: hosted
137-
version: "0.2.5"
144+
version: "0.2.19"
138145
typed_data:
139146
dependency: transitive
140147
description:
141148
name: typed_data
142149
url: "https://pub.dartlang.org"
143150
source: hosted
144-
version: "1.1.6"
151+
version: "1.3.0"
145152
vector_math:
146153
dependency: transitive
147154
description:
148155
name: vector_math
149156
url: "https://pub.dartlang.org"
150157
source: hosted
151-
version: "2.0.8"
158+
version: "2.1.0"
152159
sdks:
153-
dart: ">=2.2.2 <3.0.0"
160+
dart: ">=2.12.0-0.0 <3.0.0"

example/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ description: A new Flutter project.
1414
version: 1.0.0+1
1515

1616
environment:
17-
sdk: ">=2.1.0 <3.0.0"
17+
sdk: ">=2.7.0 <3.0.0"
1818

1919
dependencies:
2020
flutter:

0 commit comments

Comments
 (0)