Skip to content

Commit

Permalink
Add URLs (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
hkamran80 authored Nov 17, 2022
1 parent 38916fe commit eadf568
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 5 deletions.
4 changes: 2 additions & 2 deletions lib/constants.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ Uri schedulesLink =
Uri.parse("https://raw.unisontech.org/schedules/$schedulesVersion");

Uri requestLink = Uri.parse("https://go.unisontech.org/schreq");
Uri feedbackLink = Uri.parse("https://go.unisontech.org/sch-mobile-feedback");
Uri discordLink = Uri.parse("https://discord.com/invite/M586RvpCWP");

Uri repositoryLink =
Uri.parse("https://github.com/hkamran80/schedules-flutter");
Uri newIssueLink =
Uri.parse("https://github.com/hkamran80/schedules-flutter/issues/new");

Uri tosLink = Uri.parse("https://unisontech.org/legal/terms");
Uri privacyPolicyLink = Uri.parse("https://unisontech.org/legal/privacy");
16 changes: 13 additions & 3 deletions lib/screens/about.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'package:flutter/material.dart';
import 'package:lucide_icons/lucide_icons.dart';
import 'package:package_info_plus/package_info_plus.dart';
import 'package:simple_icons/simple_icons.dart';
import 'package:url_launcher/url_launcher.dart';

import '../constants.dart';
Expand All @@ -17,10 +18,10 @@ class AboutScreen extends StatefulWidget {
}

class _AboutScreenState extends State<AboutScreen> {
void _launchUrl(Uri uri) async {
void _launchUrl(Uri uri, {LaunchMode? launchMode}) async {
if (!await launchUrl(
uri,
mode: LaunchMode.externalApplication,
mode: launchMode ?? LaunchMode.externalApplication,
)) {
throw 'Could not launch $uri';
}
Expand Down Expand Up @@ -93,7 +94,16 @@ class _AboutScreenState extends State<AboutScreen> {
title: "Feedback",
subtitle: "Report a bug or request a feature",
),
onTap: () => _launchUrl(newIssueLink),
onTap: () => _launchUrl(feedbackLink, launchMode: LaunchMode.inAppWebView),
),
InkWell(
child: const AboutCard(
icon: SimpleIcons.discord,
title: "Discord",
subtitle:
"Join the Discord server, get quick support, and join a community",
),
onTap: () => _launchUrl(discordLink),
),
InkWell(
child: const AboutCard(
Expand Down
7 changes: 7 additions & 0 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.1"
simple_icons:
dependency: "direct main"
description:
name: simple_icons
url: "https://pub.dartlang.org"
source: hosted
version: "7.10.0"
sky_engine:
dependency: transitive
description: flutter
Expand Down
1 change: 1 addition & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ dependencies:
crypto: ^3.0.2
lucide_icons: ^0.98.0
fluttertoast: ^8.1.1
simple_icons: ^7.10.0

dev_dependencies:
flutter_test:
Expand Down

0 comments on commit eadf568

Please sign in to comment.