added about dialog
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
import 'package:package_info_plus/package_info_plus.dart';
|
||||
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
||||
|
||||
part 'package_info_repository.g.dart';
|
||||
|
||||
@Riverpod(keepAlive: true)
|
||||
Future<PackageInfo> packageInfo(PackageInfoRef ref) {
|
||||
return PackageInfo.fromPlatform();
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'package_info_repository.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// RiverpodGenerator
|
||||
// **************************************************************************
|
||||
|
||||
String _$packageInfoHash() => r'f7bd90882137aac7a9f28e9d10eae6efeee8c9d0';
|
||||
|
||||
/// See also [packageInfo].
|
||||
@ProviderFor(packageInfo)
|
||||
final packageInfoProvider = FutureProvider<PackageInfo>.internal(
|
||||
packageInfo,
|
||||
name: r'packageInfoProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product') ? null : _$packageInfoHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
typedef PackageInfoRef = FutureProviderRef<PackageInfo>;
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member
|
||||
@@ -0,0 +1,27 @@
|
||||
import 'package:bang_navigator/features/about/data/repositories/package_info_repository.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
|
||||
class AboutDialogScreen extends HookConsumerWidget {
|
||||
const AboutDialogScreen();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final packageInfo = ref.watch(
|
||||
packageInfoProvider.select(
|
||||
//During startup we make sure
|
||||
(value) => value.value!,
|
||||
),
|
||||
);
|
||||
|
||||
return AboutDialog(
|
||||
applicationIcon: SizedBox.square(
|
||||
dimension: IconTheme.of(context).size,
|
||||
child: Image.asset('assets/icon/icon.png'),
|
||||
),
|
||||
applicationName: packageInfo.appName,
|
||||
applicationVersion: packageInfo.version,
|
||||
applicationLegalese: 'Copyright © Fabian Freund, 2024',
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -215,6 +215,14 @@ class KagiScreen extends HookConsumerWidget {
|
||||
leadingIcon: const Icon(MdiIcons.text),
|
||||
child: const Text('Summarizer'),
|
||||
),
|
||||
const Divider(),
|
||||
MenuItemButton(
|
||||
onPressed: () async {
|
||||
await context.push(AboutRoute().location);
|
||||
},
|
||||
leadingIcon: const Icon(Icons.info),
|
||||
child: const Text('About'),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
|
||||
@@ -7,7 +7,7 @@ part of 'sharing_intent.dart';
|
||||
// **************************************************************************
|
||||
|
||||
String _$sharingIntentStreamHash() =>
|
||||
r'6fca6ca6b4ac983397245a09cb61144cd5a4715d';
|
||||
r'4b285bac1537aa03007a6e932ddb50f24b2db873';
|
||||
|
||||
/// See also [sharingIntentStream].
|
||||
@ProviderFor(sharingIntentStream)
|
||||
|
||||
Reference in New Issue
Block a user