From 4f4b8d384406d4a9fe97b48bd1d0ef33106f3271 Mon Sep 17 00:00:00 2001 From: Damiano Ferrari Date: Sun, 4 Feb 2024 14:39:04 +0100 Subject: [PATCH] License page now has its own route --- lib/app_router.dart | 15 +++++++++++++++ lib/pages/settings_page.dart | 7 +------ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/lib/app_router.dart b/lib/app_router.dart index e0bdd541..d3d77ceb 100644 --- a/lib/app_router.dart +++ b/lib/app_router.dart @@ -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((ref) => ref.watch(SignificantFigures.provider).hasValue && @@ -85,6 +89,17 @@ final routerProvider = Provider( ), ], ), + 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, + ), + ), + ), ], ), ], diff --git a/lib/pages/settings_page.dart b/lib/pages/settings_page.dart index fe09af56..819203f8 100644 --- a/lib/pages/settings_page.dart +++ b/lib/pages/settings_page.dart @@ -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())) ]);