From 46ad19ca216c80a18bd49b640530bfd2419dd558 Mon Sep 17 00:00:00 2001 From: Marco Perugini Date: Thu, 7 Nov 2024 20:07:10 +0100 Subject: [PATCH] Adding "Leave a feedback" option in settings --- lib/pages/settings_page.dart | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/lib/pages/settings_page.dart b/lib/pages/settings_page.dart index ac79809..f796328 100644 --- a/lib/pages/settings_page.dart +++ b/lib/pages/settings_page.dart @@ -6,6 +6,7 @@ import 'dart:io'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:url_launcher/url_launcher.dart'; import '../constants/style.dart'; import '../custom_widgets/alert_dialog.dart'; @@ -56,6 +57,12 @@ var settingsOptions = [ "Manage your notifications settings", Platform.isAndroid ? "/notifications-settings" : null, ], + [ + Icons.feedback, + "Leave a feedback", + "Complete a small form to report a bug or leave a feedback", + "https://feedback.sossoldi.com", + ], [ Icons.info, "App Info", @@ -163,7 +170,13 @@ class _SettingsPageState extends ConsumerState { child: DefaultCard( onTap: () { if (setting[3] != null) { - Navigator.of(context).pushNamed(setting[3] as String); + final link = setting[3] as String; + if(link.startsWith("http")) { + Uri url = Uri.parse(link); + launchUrl(url); + } else { + Navigator.of(context).pushNamed(link); + } } }, child: Row(