Skip to content

Commit

Permalink
add args kwargs in register action
Browse files Browse the repository at this point in the history
  • Loading branch information
shakeebkhan66 committed Jun 4, 2024
1 parent 0526968 commit e30f053
Showing 1 changed file with 17 additions and 10 deletions.
27 changes: 17 additions & 10 deletions lib/screens/mobile/mobile_home.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,6 @@ class _MobileHomeScaffoldState extends State<MobileHomeScaffold> with TickerProv
final List<ArgsProvider> _argsProviders = [];
final List<KwargsProvider> _kwargsProviders = [];

@override
void initState() {
super.initState();
_initializeTabController();
_initializeProviders();
}

void _initializeTabController() {
_tabController = TabController(length: _tabNames.length, vsync: this);
_tabController.addListener(_handleTabSelection);
Expand Down Expand Up @@ -86,6 +79,13 @@ class _MobileHomeScaffoldState extends State<MobileHomeScaffold> with TickerProv
}
}

@override
void initState() {
super.initState();
_initializeTabController();
_initializeProviders();
}

@override
void dispose() {
_tabController
Expand Down Expand Up @@ -161,7 +161,10 @@ class _MobileHomeScaffoldState extends State<MobileHomeScaffold> with TickerProv
padding: const EdgeInsets.only(right: 15),
child: IconButton(
onPressed: _addTab,
icon: const Icon(Icons.add_box_sharp),
icon: Icon(
Icons.add_box_sharp,
color: blackColor,
),
),
),
],
Expand Down Expand Up @@ -776,6 +779,8 @@ class _MobileHomeScaffoldState extends State<MobileHomeScaffold> with TickerProv
_tabData[index].linkController.clear();
_tabData[index].realmController.clear();
_tabData[index].selectedSerializer = "";
_argsProviders[index].controllers.clear();
_kwargsProviders[index].tableData.clear();
});
} on Exception catch (error) {
throw Future.error(error);
Expand Down Expand Up @@ -870,13 +875,15 @@ class _MobileHomeScaffoldState extends State<MobileHomeScaffold> with TickerProv
}

Widget buildArgs(String argsSendButton, ArgsProvider argsProvider) {
return argsSendButton.contains("Publish") || argsSendButton.contains("Call")
return argsSendButton.contains("Publish") || argsSendButton.contains("Call") || argsSendButton.contains("Register")
? ArgsTextFormFields(provider: argsProvider)
: Container();
}

Widget buildKwargs(String kWargSendButton, KwargsProvider kwargsProvider) {
return kWargSendButton.contains("Publish") || kWargSendButton.contains("Call")
return kWargSendButton.contains("Publish") ||
kWargSendButton.contains("Call") ||
kWargSendButton.contains("Register")
? DynamicKeyValuePairs(provider: kwargsProvider)
: Container();
}
Expand Down

0 comments on commit e30f053

Please sign in to comment.