Skip to content

Commit

Permalink
License page now has its own route
Browse files Browse the repository at this point in the history
  • Loading branch information
ferraridamiano committed Feb 4, 2024
1 parent 63a4714 commit 4f4b8d3
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
15 changes: 15 additions & 0 deletions lib/app_router.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@ import 'package:converterpro/pages/settings_page.dart';
import 'package:converterpro/pages/splash_screen.dart';
import 'package:converterpro/utils/app_scaffold.dart';
import 'package:converterpro/utils/utils.dart';
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:go_router/go_router.dart';
import 'package:translations/app_localizations.dart';
import 'package:vector_graphics/vector_graphics.dart';

final isEverythingLoadedProvider = Provider<bool>((ref) =>
ref.watch(SignificantFigures.provider).hasValue &&
Expand Down Expand Up @@ -85,6 +89,17 @@ final routerProvider = Provider<GoRouter>(
),
],
),
GoRoute(
path: 'about',
name: 'about',
builder: (context, state) => LicensePage(
applicationName: AppLocalizations.of(context)!.appName,
applicationIcon: const SvgPicture(
AssetBytesLoader('assets/app_icons/logo.svg.vec'),
width: 50,
),
),
),
],
),
],
Expand Down
7 changes: 1 addition & 6 deletions lib/pages/settings_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -327,12 +327,7 @@ class SettingsPage extends ConsumerWidget {
style: textStyle,
),
shape: const RoundedRectangleBorder(borderRadius: borderRadius),
onTap: () {
showLicensePage(
context: context,
applicationName: AppLocalizations.of(context)!.appName,
);
},
onTap: () => context.goNamed('about'),
),
].map(ConstrainedContainer.new).toList()))
]);
Expand Down

0 comments on commit 4f4b8d3

Please sign in to comment.