Skip to content

Commit

Permalink
Merge pull request #181 from theperu/main
Browse files Browse the repository at this point in the history
Adding "Leave a feedback" option in settings
  • Loading branch information
mikev-cw authored Nov 8, 2024
2 parents b607e8b + 46ad19c commit d5ab286
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 d5ab286

Please sign in to comment.