Skip to content

Commit 9a01437

Browse files
authored
Merge pull request #225 from amitamrutiya2210/issue-198-rss-textfield
fix: clear the textFields after saving on rssfeedhomepage
2 parents a2535b9 + 36c801f commit 9a01437

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

lib/Components/RSSFeedHomePage.dart

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,24 @@ class _RSSFeedHomePageState extends State<RSSFeedHomePage>
7676
super.initState();
7777
}
7878

79+
// clearing the fields in Feeds tabs after tappping save button
80+
void clearFeedsFields() {
81+
labelController.clear();
82+
urlController.clear();
83+
intervalController.clear();
84+
}
85+
86+
void clearDownloadRulesFields() {
87+
labelRulesController.clear();
88+
matchpatternController.clear();
89+
excludepatternController.clear();
90+
destinationController.clear();
91+
tagsController.clear();
92+
startOnLoad = false;
93+
useAsBasePath = false;
94+
applicableFeedSelected = null;
95+
}
96+
7997
@override
8098
Widget build(BuildContext context) {
8199
return Consumer<ClientSettingsProvider>(
@@ -710,6 +728,7 @@ class _RSSFeedHomePageState extends State<RSSFeedHomePage>
710728
FeedsApi
711729
.listAllFeedsAndRules(
712730
context: context);
731+
clearFeedsFields();
713732
if (isUpdateFeedSelected) {
714733
UpdateFeedApi.updateFeed(
715734
type: "feed",
@@ -1756,6 +1775,7 @@ class _RSSFeedHomePageState extends State<RSSFeedHomePage>
17561775
MainAxisAlignment.center,
17571776
children: [
17581777
DropdownButtonFormField2(
1778+
value: applicableFeedSelected,
17591779
decoration: InputDecoration(
17601780
//Add isDense true and zero Padding.
17611781
//Add Horizontal padding using buttonPadding and Vertical padding by increasing buttonHeight instead of add Padding here so that The whole TextFormField Button become clickable, and also the dropdown menu open under The whole TextFormField Button.
@@ -2240,6 +2260,7 @@ class _RSSFeedHomePageState extends State<RSSFeedHomePage>
22402260
FeedsApi
22412261
.listAllFeedsAndRules(
22422262
context: context);
2263+
clearDownloadRulesFields();
22432264
});
22442265
}
22452266
},

0 commit comments

Comments
 (0)