Skip to content

Commit

Permalink
Adding "Leave a feedback" option in settings
Browse files Browse the repository at this point in the history
  • Loading branch information
theperu committed Nov 7, 2024
1 parent b607e8b commit 46ad19c
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion lib/pages/settings_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -163,7 +170,13 @@ class _SettingsPageState extends ConsumerState<SettingsPage> {
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(
Expand Down

0 comments on commit 46ad19c

Please sign in to comment.