Skip to content

Commit

Permalink
chore: clear text fields after shortening link
Browse files Browse the repository at this point in the history
  • Loading branch information
jatindotdev committed Feb 17, 2024
1 parent 96e22cf commit af2df15
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions lib/screens/home_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,9 @@ class _HomeScreenState extends State<HomeScreen> {
dismissDirection: DismissDirection.horizontal,
),
);
} finally {
linkIdController.clear();
shortCodeController.clear();
}
},
child: Container(
Expand Down Expand Up @@ -244,6 +247,13 @@ class _HomeScreenState extends State<HomeScreen> {
);
}

@override
void dispose() {
linkIdController.dispose();
shortCodeController.dispose(); // Dispose of the controller when done
super.dispose();
}

Widget searchBox() {
return Container(
height: 65,
Expand All @@ -264,13 +274,6 @@ class _HomeScreenState extends State<HomeScreen> {
);
}

@override
void dispose() {
linkIdController.dispose();
shortCodeController.dispose(); // Dispose of the controller when done
super.dispose();
}

AppBar _buildAppBar() {
return AppBar(
elevation: 0,
Expand Down

0 comments on commit af2df15

Please sign in to comment.