diff --git a/transitrack_web/lib/components/right_panel/feedback_form.dart b/transitrack_web/lib/components/right_panel/feedback_form.dart index 58566fb..efb26ac 100644 --- a/transitrack_web/lib/components/right_panel/feedback_form.dart +++ b/transitrack_web/lib/components/right_panel/feedback_form.dart @@ -266,12 +266,7 @@ class _FeedbackFormState extends State { const SizedBox(height: Constants.defaultPadding), ], ), - Button( - onTap: () => sendFeedback(), - text: _drivingRating + _jeepRating == 0 - ? "Rate Driver or PUV" - : "Send Feedback for ${_drivingRating != 0 && _jeepRating != 0 ? "Driver and PUV" : _jeepRating != 0 ? "PUV" : "Driver"}", - ), + Button(onTap: () => sendFeedback(), text: "Submit"), ], ), ); diff --git a/transitrack_web/lib/components/right_panel/report_form.dart b/transitrack_web/lib/components/right_panel/report_form.dart index dcfd959..f1a31e3 100644 --- a/transitrack_web/lib/components/right_panel/report_form.dart +++ b/transitrack_web/lib/components/right_panel/report_form.dart @@ -267,7 +267,7 @@ class _ReportFormState extends State { ), Button( onTap: () => sendReport(), - text: "Send Report", + text: "Submit", ), ], ), diff --git a/transitrack_web/lib/components/right_panel/selected_jeep_info.dart b/transitrack_web/lib/components/right_panel/selected_jeep_info.dart index 2d4648f..edea726 100644 --- a/transitrack_web/lib/components/right_panel/selected_jeep_info.dart +++ b/transitrack_web/lib/components/right_panel/selected_jeep_info.dart @@ -227,10 +227,15 @@ class _SelectedJeepInfoBoxState extends State { final shareUrl = '${Uri.base.origin}/#/share?share_id=${docRef.id}'; currentShareDocId = docRef.id; - await Clipboard.setData(ClipboardData(text: shareUrl)); - - if (context.mounted) { - message('Copied Live Location Link'); + try { + await Clipboard.setData(ClipboardData(text: shareUrl)); + if (context.mounted) { + message('Link copied'); + } + } catch (e) { + if (context.mounted) { + messageWithUrl('Copy and share this link', shareUrl); + } } } else { // Stop sharing by updating Firestore @@ -242,7 +247,7 @@ class _SelectedJeepInfoBoxState extends State { } currentShareDocId = null; - message('Stopped Sharing Live Location'); + message('Sharing stopped'); } } @@ -291,6 +296,28 @@ class _SelectedJeepInfoBoxState extends State { }); } + void messageWithUrl(String title, String url) { + showDialog( + context: context, + builder: (context) { + return AlertDialog( + backgroundColor: Constants.bgColor, + title: Center( + child: Text( + title, + style: const TextStyle(color: Colors.white), + textAlign: TextAlign.center, + ), + ), + content: SelectableText( + url, + style: const TextStyle(color: Colors.white70), + ), + ); + }, + ); + } + @override Widget build(BuildContext context) { return Column( diff --git a/transitrack_web/lib/pages/share_page.dart b/transitrack_web/lib/pages/share_page.dart index 89b5d96..5b5aed0 100644 --- a/transitrack_web/lib/pages/share_page.dart +++ b/transitrack_web/lib/pages/share_page.dart @@ -167,7 +167,7 @@ class _SharePageState extends State { drivers = []; routeChoice = -1; }); - errorMessage("The live share has ended."); + errorMessage("Live sharing ended"); // Navigate back to home after delay Future.delayed(const Duration(seconds: 2), () { if (mounted) {