From c1c06b3f9c378ebe7b0c2ef77fb07456016cd214 Mon Sep 17 00:00:00 2001 From: Praveen Kumar Date: Sun, 20 Oct 2024 21:46:13 +0530 Subject: [PATCH] Make appId Assignable only once --- lib/pages/add_app.dart | 16 ++++++++++++++++ lib/providers/source_provider.dart | 1 - 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/lib/pages/add_app.dart b/lib/pages/add_app.dart index bdeb203..029e406 100644 --- a/lib/pages/add_app.dart +++ b/lib/pages/add_app.dart @@ -538,6 +538,22 @@ class AddAppPageState extends State { }); } }), + if (pickedSource != null) + GeneratedForm( + key: const Key('appId'), + items: [ + [ + GeneratedFormTextField('appId', + label: tr('appId'), required: false), + ] + ], + onValueChanges: (values, valid, isBuilding) { + if (!isBuilding) { + setState(() { + additionalSettings['appId'] = values['appId']; + }); + } + }), ], ); diff --git a/lib/providers/source_provider.dart b/lib/providers/source_provider.dart index 74052df..29dff11 100644 --- a/lib/providers/source_provider.dart +++ b/lib/providers/source_provider.dart @@ -572,7 +572,6 @@ abstract class AppSource { label: tr('skipUpdateNotifications')) ], [GeneratedFormTextField('about', label: tr('about'), required: false)], - [GeneratedFormTextField('appId', label: tr('appId'), required: false)] ]; // Previous 2 variables combined into one at runtime for convenient usage