Skip to content

Commit

Permalink
Added github and issue links to settings #138
Browse files Browse the repository at this point in the history
  • Loading branch information
guyluz11 committed Jun 26, 2024
1 parent af37856 commit ee7f098
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 6 deletions.
4 changes: 1 addition & 3 deletions lib/domain/wake_lock_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ part 'package:infinite_horizons/infrastructure/wake_lock_repository.dart';
abstract class WakeLockController {
static WakeLockController? _instance;

static WakeLockController get instance {
return _instance ??= _WakeLockRepository();
}
static WakeLockController get instance => _instance ??= _WakeLockRepository();

Future<bool> getWakeLock();

Expand Down
12 changes: 12 additions & 0 deletions lib/domain/web_browser_controller.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import 'package:url_launcher/url_launcher.dart';

part 'package:infinite_horizons/infrastructure/web_browser_repository.dart';

abstract class WebBrowserController {
static WebBrowserController? _instance;

static WebBrowserController get instance =>
_instance ??= _WebBrowserRepository();

Future<bool> lunchLink(String url);
}
6 changes: 6 additions & 0 deletions lib/infrastructure/web_browser_repository.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
part of 'package:infinite_horizons/domain/web_browser_controller.dart';

class _WebBrowserRepository extends WebBrowserController {
@override
Future<bool> lunchLink(String url) => launchUrl(Uri.parse(url));
}
23 changes: 21 additions & 2 deletions lib/presentation/pages/settings_page.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:infinite_horizons/domain/player_controller.dart';
import 'package:infinite_horizons/domain/preferences_controller.dart';
import 'package:infinite_horizons/domain/wake_lock_controller.dart';
import 'package:infinite_horizons/domain/web_browser_controller.dart';
import 'package:infinite_horizons/presentation/atoms/atoms.dart';
import 'package:infinite_horizons/presentation/molecules/molecules.dart';

Expand Down Expand Up @@ -52,9 +54,26 @@ class _SettingsPageState extends State<SettingsPage> {
initialValue: lockScreen,
),
),
const SeparatorAtom(
variant: SeparatorVariant.farApart,
const SeparatorAtom(),
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
ButtonAtom(
variant: ButtonVariant.lowEmphasisIcon,
onPressed: () => WebBrowserController.instance.lunchLink(
'https://github.com/guyluz11/infinite_horizons/issues',
),
icon: FontAwesomeIcons.circleDot,
),
ButtonAtom(
variant: ButtonVariant.lowEmphasisIcon,
onPressed: () => WebBrowserController.instance
.lunchLink('https://github.com/guyluz11/infinite_horizons'),
icon: FontAwesomeIcons.github,
),
],
),
const SeparatorAtom(variant: SeparatorVariant.farApart),
],
),
);
Expand Down
2 changes: 1 addition & 1 deletion lib/presentation/pages/tip_information_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class _TipInformationPageState extends State<TipInformationPage> {
],
),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const TextAtom('tip:'),
const SeparatorAtom(
Expand Down

0 comments on commit ee7f098

Please sign in to comment.