From b63fa03aeffaeb5ce1bcf394ffcca5722ee23ec6 Mon Sep 17 00:00:00 2001 From: Jonathan Ma Date: Mon, 13 Nov 2023 14:05:42 -0500 Subject: [PATCH] update routename when using suggested name --- lib/admin/pm_details.dart | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/admin/pm_details.dart b/lib/admin/pm_details.dart index 67c895e..b3948e4 100644 --- a/lib/admin/pm_details.dart +++ b/lib/admin/pm_details.dart @@ -433,7 +433,7 @@ class _PMDetailsState extends State { suffixIcon: IconButton( onPressed: () { templateNotifier.setRouteName( - pmNameFieldController.text, + routeNameFieldController.text, selected.selectedFile!, selected.selectedTemplate!, // hasRouteCode, @@ -520,10 +520,20 @@ class _PMDetailsState extends State { if (suggestNameFieldController.text != '') { pmNameFieldController.text = suggestNameFieldController.text; + if (routeNameFieldController.text.isNotEmpty) { + routeNameFieldController.text = + suggestNameFieldController.text; + } templateNotifier.setPMName( pmNameFieldController.text, selected.selectedFile!, selected.selectedTemplate!); + templateNotifier.setRouteName( + routeNameFieldController.text, + selected.selectedFile!, + selected.selectedTemplate!, + // hasRouteCode, + ); } }, icon: const Icon(Icons.eject),