Skip to content

Commit cf8a0cb

Browse files
authored
chore: clear text fields after shortening link (#39)
1 parent 96e22cf commit cf8a0cb

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

lib/screens/home_screen.dart

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,9 @@ class _HomeScreenState extends State<HomeScreen> {
179179
dismissDirection: DismissDirection.horizontal,
180180
),
181181
);
182+
} finally {
183+
linkIdController.clear();
184+
shortCodeController.clear();
182185
}
183186
},
184187
child: Container(
@@ -244,6 +247,13 @@ class _HomeScreenState extends State<HomeScreen> {
244247
);
245248
}
246249

250+
@override
251+
void dispose() {
252+
linkIdController.dispose();
253+
shortCodeController.dispose(); // Dispose of the controller when done
254+
super.dispose();
255+
}
256+
247257
Widget searchBox() {
248258
return Container(
249259
height: 65,
@@ -264,13 +274,6 @@ class _HomeScreenState extends State<HomeScreen> {
264274
);
265275
}
266276

267-
@override
268-
void dispose() {
269-
linkIdController.dispose();
270-
shortCodeController.dispose(); // Dispose of the controller when done
271-
super.dispose();
272-
}
273-
274277
AppBar _buildAppBar() {
275278
return AppBar(
276279
elevation: 0,

0 commit comments

Comments
 (0)