diff --git a/android/app/build.gradle b/android/app/build.gradle index 77ec2347..db17319a 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -56,38 +56,38 @@ android { versionCode flutterVersionCode.toInteger() versionName flutterVersionName - if (System.getenv("KEYSTORE_PATH")) { + if (System.getenv("KEYSTORE_PATH")) { resValue "string", "app_name", "3DPass" println "Release properties" - } else { - applicationIdSuffix '.debug' - versionNameSuffix '-DEBUG' - resValue "string", "app_name", "3DPass debug" + } else { + applicationIdSuffix '.debug' + versionNameSuffix '-DEBUG' + resValue "string", "app_name", "3DPass debug" - println "Debug properties" - } + println "Debug properties" + } } signingConfigs { release { -// storeFile file('aaaaa') -// keyPassword 'aaa' -// storePassword 'aaa' -// keyAlias 'aaaa' - - if (System.getenv("KEYSTORE_PATH")){ - println("signingConfigs release") - // If you are reading these lines check the link: - // https://proandroiddev.com/how-to-securely-build-and-sign-your-android-app-with-github-actions-ad5323452ce - storeFile = file(System.getenv("KEYSTORE_PATH")) - storePassword System.getenv("SIGNING_STORE_PASSWORD") - keyAlias System.getenv("SIGNING_KEY_ALIAS") - keyPassword System.getenv("SIGNING_KEY_PASSWORD") - } else{ - println("signingConfigs debug") - } + // keyAlias keystoreProperties['keyAlias'] + // keyPassword keystoreProperties['keyPassword'] + // storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null + // storePassword keystoreProperties['storePassword'] + +// if (System.getenv("KEYSTORE_PATH")){ +// println("signingConfigs release") +// // If you are reading these lines check the link: +// // https://proandroiddev.com/how-to-securely-build-and-sign-your-android-app-with-github-actions-ad5323452ce +// storeFile = file(System.getenv("KEYSTORE_PATH")) +// storePassword System.getenv("SIGNING_STORE_PASSWORD") +// keyAlias System.getenv("SIGNING_KEY_ALIAS") +// keyPassword System.getenv("SIGNING_KEY_PASSWORD") +// } else{ +// println("signingConfigs debug") +// } } } } diff --git a/assets/translations/en.json b/assets/translations/en.json index 67c1c277..507deeca 100644 --- a/assets/translations/en.json +++ b/assets/translations/en.json @@ -379,13 +379,36 @@ "local_snapshots_with_same_hashes": "Local snapshots with same hashes:", "file_hash_subtitle_scan_list": "Local file hash: ", "poscan_object_title": "PoScan object", - "reset_objects_cache_plural": { - "zero": "No objects cached", - "one": "{} object cached", - "two": "{} objects cached", - "few": "{} objects cached", - "many": "{} objects cached", - "other": "{} objects cached" + + "no_owned_objects_found": "No objects owned by this account found", + + "@2.12.0":{ + }, + "bottom_label_explorer": "Explorer", + "objects_plural": { + "zero": "No objects", + "one": "{} object", + "two": "{} objects", + "few": "{} objects", + "many": "{} objects", + "other": "{} objects" + }, + "reset_objects_cache_plural": "{} cached", + "objects_list_appbar_title": "{} in storage", + "no_objects": "No cached objects", + "bad_address": "Wrong address format", + "delete_snapshots_dialog_title": "Delete snapshots", + "delete_snapshots_dialog_content": "Do you want to delete {}?", + "snapshots_plural": { + "zero": "0 snapshots", + "one": "{} snapshot", + "two": "{} snapshots", + "few": "{} snapshots", + "many": "{} snapshots", + "other": "{} snapshots" }, - "no_owned_objects_found": "No objects owned by this account found" + "uploaded_object_id": "id: ", + "uploaded_object_status": "Status: ", + "uploaded_object_owner": "Owner: ", + "uploaded_object_hashes": "Object's hashes: " } \ No newline at end of file diff --git a/integration_test/scan_page_test.dart b/integration_test/scan_page_test.dart new file mode 100644 index 00000000..06aca55a --- /dev/null +++ b/integration_test/scan_page_test.dart @@ -0,0 +1,84 @@ +import 'dart:io'; + +import 'package:auto_route/auto_route.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:integration_test/integration_test.dart'; +import 'package:threedpass/core/widgets/buttons/elevated_button.dart'; +import 'package:threedpass/features/hashes_list/bloc/hashes_list_bloc.dart'; +import 'package:threedpass/features/hashes_list/domain/entities/snapshot_create_from_file/snapshot_create_from_file.dart'; +import 'package:threedpass/features/scan_page/bloc/scan_isolate_cubit.dart'; +import 'package:threedpass/features/scan_page/presentation/widgets/get_object_from_file_button.dart'; +import 'package:threedpass/features/settings_page/bloc/settings_page_cubit.dart'; +import 'package:threedpass/router/router.gr.dart'; + +import './test_app.dart'; + +void main() { + // config(); + final app = TestApp.instance; + + group('Example test', () { + testWidgets('MyWidget has a title and message', (tester) async { + print('aaaaaaa1'); + // Initial pump + await tester.pumpWidget(app); + print('aaaaaaa2'); + + final filePath = '${Directory.current.path}/resources/3dpass-487203.obj'; + // final Uri basedir = (goldenFileComparator. as LocalFileComparator).basedir; + // matchesGoldenFile(key) + // print(basedir.path); + + // final file = await rootBundle.load(filePath); + // print(file.lengthInBytes); + + var dir = Directory.current; + while (!await dir + .list() + .any((entity) => entity.path.endsWith('pubspec.yaml'))) { + dir = dir.parent; + } + + print(dir.absolute); + print(Directory.current.listSync(recursive: true)); + print(filePath); + print(File(filePath).existsSync()); + // for (var i in tester.allElements) { + // print(i.widget.runtimeType); + // } + final BuildContext context = tester.element(find.byType(SizedBox)); + + final snapFactory = SnapshotFileFactory( + showLoader: () {}, + hashesListBloc: BlocProvider.of(context), + scanSettings: + BlocProvider.of(context).state.scanSettings, + // objectsDirectory: getIt(), + scanIsolateCubit: BlocProvider.of(context), + // recievePort: recievePort, + ); + + final pair = await snapFactory.createSnapshotFromFile( + pickedFilePath: filePath, + relativePath: filePath, + ); + + await context.router.push( + PreviewRouteWrapper( + hashObject: pair.left, + snapshot: pair.right, + createNewAnyway: true, + ), + ); + + print('aaaaaaa3'); + + await tester.pumpAndSettle(); + + print('aaaaaaa4'); + }); + }); +} diff --git a/integration_test/test.dart b/integration_test/test.dart new file mode 100644 index 00000000..c4cd1b9f --- /dev/null +++ b/integration_test/test.dart @@ -0,0 +1,26 @@ +import 'package:easy_localization/easy_localization.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:threedpass/features/wallet_screen/assets_page/widgets/balance_card/locked_balance_card.dart'; +import 'package:threedpass/main.dart'; + +import '../test/test_config.dart'; + +// import 'test_config.dart'; +import './scan_page_test.dart' as scan_page; +// import 'utils/assets_formatting.dart' as assets_formating; + +/// Test all +void main() { + config(); + + // assets_formating.main(); + + scan_page.main(); + + // Prepare to widget-testing + // setUpAll(() async { + // SharedPreferences.setMockInitialValues({}); + // await service_locator.setup(); + // }); +} diff --git a/integration_test/test_app.dart b/integration_test/test_app.dart new file mode 100644 index 00000000..0622738f --- /dev/null +++ b/integration_test/test_app.dart @@ -0,0 +1,18 @@ +import 'package:easy_localization/easy_localization.dart'; +import 'package:flutter/widgets.dart'; +import 'package:threedpass/main.dart'; + +class TestApp { + TestApp._(); + + static final Widget instance = EasyLocalization( + supportedLocales: const [ + Locale('en'), + Locale('es'), + Locale('sr'), + ], + path: 'assets/translations', + fallbackLocale: const Locale('en'), + child: ThreeDApp(), + ); +} diff --git a/integration_test/test_config.dart b/integration_test/test_config.dart new file mode 100644 index 00000000..c81e34e3 --- /dev/null +++ b/integration_test/test_config.dart @@ -0,0 +1,15 @@ +import 'package:easy_localization/easy_localization.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:integration_test/integration_test.dart'; +import 'package:threedpass/core/persistence/hive_setup.dart' as hive_setup; +import 'package:threedpass/setup.dart' as di_setup; + +Future config() async { + setUpAll(() async { + IntegrationTestWidgetsFlutterBinding.ensureInitialized(); + + await hive_setup.hiveSetup(); + await di_setup.setup(); + await EasyLocalization.ensureInitialized(); + }); +} diff --git a/lib/core/theme/d3p_card_theme.dart b/lib/core/theme/d3p_card_theme.dart index b8c69716..16f67665 100644 --- a/lib/core/theme/d3p_card_theme.dart +++ b/lib/core/theme/d3p_card_theme.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; class D3pCardTheme { - static Radius get radius => const Radius.circular(4.0); + static const Radius radius = Radius.circular(4.0); } diff --git a/lib/core/utils/formatters.dart b/lib/core/utils/formatters.dart index 0b4638a8..e304bc3c 100644 --- a/lib/core/utils/formatters.dart +++ b/lib/core/utils/formatters.dart @@ -2,6 +2,8 @@ import 'package:easy_localization/easy_localization.dart'; class Fmt { static DateFormat basicDateFormat = DateFormat('yyyy-MM-dd HH:mm:ss'); + static DateFormat shortDateFormat = DateFormat('yyyy-MM-dd HH:mm'); + static DateFormat transferDateFormat = DateFormat('kk:mm – dd-MM-yyyy'); static String shorterAddress(final String? addr, {final int pad = 6}) { if (addr == null || addr.isEmpty) { diff --git a/lib/core/utils/show_text_snackbar.dart b/lib/core/utils/show_text_snackbar.dart index da3c4d82..54582862 100644 --- a/lib/core/utils/show_text_snackbar.dart +++ b/lib/core/utils/show_text_snackbar.dart @@ -1,5 +1,3 @@ -import 'dart:io'; - import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:fluttertoast/fluttertoast.dart'; @@ -14,14 +12,6 @@ class FastSnackBar { final BuildContext context; void show() { - if (Platform.isIOS) { - Fluttertoast.showToast(msg: textCode.tr()); - } else { - ScaffoldMessenger.of(context).showSnackBar( - SnackBar( - content: Text(textCode.tr()), - ), - ); - } + Fluttertoast.showToast(msg: textCode.tr()); } } diff --git a/lib/core/widgets/appbars/title_n_button_appbar.dart b/lib/core/widgets/appbars/title_n_button_appbar.dart new file mode 100644 index 00000000..4b58efe1 --- /dev/null +++ b/lib/core/widgets/appbars/title_n_button_appbar.dart @@ -0,0 +1,35 @@ +import 'package:easy_localization/easy_localization.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_platform_widgets/flutter_platform_widgets.dart'; +import 'package:threedpass/core/theme/d3p_appbar_theme.dart'; + +class TitleNButtonAppBar extends PlatformAppBar { + TitleNButtonAppBar({ + required final String titleText, + required final Widget trailingAction, + final bool translateAppbar = true, + super.key, + }) : super( + automaticallyImplyLeading: false, + backgroundColor: const D3pAppBarTheme().backgroundColor, + cupertino: (final context, final platform) => + CupertinoNavigationBarData(padding: EdgeInsetsDirectional.zero), + material: (final context, final platform) => MaterialAppBarData( + titleSpacing: 0, + ), + title: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Padding( + padding: const EdgeInsets.only(left: 16), + child: Text( + translateAppbar ? titleText.tr() : titleText, + textAlign: TextAlign.start, + style: const TextStyle(color: Colors.white), + ), + ), + trailingAction, + ], + ), + ); +} diff --git a/lib/core/widgets/buttons/clickable_card.dart b/lib/core/widgets/buttons/clickable_card.dart index 675c62d0..ed8ccd7d 100644 --- a/lib/core/widgets/buttons/clickable_card.dart +++ b/lib/core/widgets/buttons/clickable_card.dart @@ -5,15 +5,21 @@ class ClickableCard extends StatelessWidget { const ClickableCard({ required this.child, required this.onTap, + this.side, + this.radius, super.key, }); final void Function()? onTap; final Widget child; + final BorderSide? side; + final Radius? radius; @override Widget build(final BuildContext context) { return D3pCard( + side: side, + // radius: radius, child: InkWell( onTap: onTap, child: Padding( diff --git a/lib/core/widgets/buttons/floating_action_button.dart b/lib/core/widgets/buttons/floating_action_button.dart deleted file mode 100644 index e7c39b05..00000000 --- a/lib/core/widgets/buttons/floating_action_button.dart +++ /dev/null @@ -1,50 +0,0 @@ -import 'package:easy_localization/easy_localization.dart'; -import 'package:flutter/material.dart'; -import 'package:threedpass/core/theme/d3p_elevated_button_theme.dart'; -import 'package:threedpass/core/theme/d3p_special_styles.dart'; - -class D3pFloatingActionButton extends StatelessWidget { - const D3pFloatingActionButton({ - required this.onPressed, - required this.icons, - required this.text, - required this.heroTag, - super.key, - }); - - final void Function()? onPressed; - final IconData icons; - final String text; - final String heroTag; - - Set calcSets() { - final disableSets = {MaterialState.disabled}; - return onPressed != null ? {} : disableSets; - } - - @override - Widget build(final BuildContext context) { - final theme = Theme.of(context); - final style = theme.customTextStyles.d3pFloatingButton; - final buttonTheme = D3pElevatedButtonTheme.theme(theme); - - final bgColor = buttonTheme.style!.backgroundColor!.resolve(calcSets()); - final fgColor = buttonTheme.style!.foregroundColor!.resolve(calcSets()); - return FloatingActionButton.extended( - heroTag: heroTag, - backgroundColor: bgColor, - foregroundColor: fgColor, - elevation: 2, - disabledElevation: 0, - shape: const RoundedRectangleBorder( - borderRadius: BorderRadius.all(Radius.circular(4.0)), - ), - icon: Icon(icons), - label: Text( - text.tr(), - style: style.copyWith(color: fgColor), - ), - onPressed: onPressed, - ); - } -} diff --git a/lib/core/widgets/buttons/icon_button.dart b/lib/core/widgets/buttons/icon_button.dart index 50fe49f9..d5157ab1 100644 --- a/lib/core/widgets/buttons/icon_button.dart +++ b/lib/core/widgets/buttons/icon_button.dart @@ -4,13 +4,15 @@ import 'package:flutter_platform_widgets/flutter_platform_widgets.dart'; class D3pIconButton extends StatelessWidget { const D3pIconButton({ required this.iconData, + this.padding, this.onPressed, this.iconColor, this.size, this.splashRadius, this.emptyContraints = false, - super.key, this.text, + this.cupertinoIcon, + super.key, }); const D3pIconButton.fake({ @@ -21,6 +23,8 @@ class D3pIconButton extends StatelessWidget { iconColor = Colors.transparent, emptyContraints = false, splashRadius = null, + padding = EdgeInsets.zero, + cupertinoIcon = null, onPressed = null; final IconData iconData; @@ -30,6 +34,8 @@ class D3pIconButton extends StatelessWidget { final bool emptyContraints; final double? splashRadius; final String? text; + final EdgeInsets? padding; + final IconData? cupertinoIcon; @override Widget build(final BuildContext context) { @@ -42,13 +48,23 @@ class D3pIconButton extends StatelessWidget { size: size, color: iconColor, ), + cupertinoIcon: cupertinoIcon != null + ? Icon( + cupertinoIcon, + size: size, + color: iconColor, + ) + : null, onPressed: onPressed, material: (final _, final __) => MaterialIconButtonData( - padding: EdgeInsets.zero, + padding: padding ?? EdgeInsets.zero, constraints: emptyContraints ? const BoxConstraints() : null, splashRadius: splashRadius, iconSize: size, ), + cupertino: (context, platform) => CupertinoIconButtonData( + padding: padding ?? EdgeInsets.zero, + ), ), if (text != null) Text(text!), ], diff --git a/lib/core/widgets/d3p_card.dart b/lib/core/widgets/d3p_card.dart index 902c2d50..a25d083b 100644 --- a/lib/core/widgets/d3p_card.dart +++ b/lib/core/widgets/d3p_card.dart @@ -5,10 +5,14 @@ import 'package:threedpass/core/theme/d3p_special_colors.dart'; class D3pCard extends StatelessWidget { final Widget child; final CardShape cardShape; + final BorderSide? side; + final Radius? radius; const D3pCard({ required this.child, this.cardShape = CardShape.all, + this.side, + this.radius, super.key, }); @@ -17,7 +21,11 @@ class D3pCard extends StatelessWidget { final bgColor = Theme.of(context).customColors.cardBackground; return Card( margin: EdgeInsets.zero, - shape: MapperCardShapeToBorder(cardShape).border(), + shape: MapperCardShapeToBorder( + cardShape: cardShape, + side: side, + radius: radius, + ).border(), color: bgColor, child: child, ); @@ -28,27 +36,37 @@ enum CardShape { top, middle, bottom, all } class MapperCardShapeToBorder { final CardShape cardShape; + final BorderSide? side; + final Radius radius; - const MapperCardShapeToBorder(this.cardShape); + const MapperCardShapeToBorder({ + required this.cardShape, + required this.side, + final Radius? radius, + }) : this.radius = radius ?? D3pCardTheme.radius; ShapeBorder border() { - final radius = D3pCardTheme.radius; - switch (cardShape) { case CardShape.top: return RoundedRectangleBorder( borderRadius: BorderRadius.only(topLeft: radius, topRight: radius), + side: side ?? BorderSide.none, ); case CardShape.bottom: return RoundedRectangleBorder( borderRadius: BorderRadius.only(bottomLeft: radius, bottomRight: radius), + side: side ?? BorderSide.none, ); case CardShape.middle: - return const RoundedRectangleBorder(borderRadius: BorderRadius.zero); + return RoundedRectangleBorder( + borderRadius: BorderRadius.zero, + side: side ?? BorderSide.none, + ); case CardShape.all: return RoundedRectangleBorder( borderRadius: BorderRadius.all(radius), + side: side ?? BorderSide.none, ); } } diff --git a/lib/core/widgets/utc_time.dart b/lib/core/widgets/utc_time.dart new file mode 100644 index 00000000..3533cab1 --- /dev/null +++ b/lib/core/widgets/utc_time.dart @@ -0,0 +1,37 @@ +import 'package:flutter/material.dart'; +import 'package:intl/intl.dart'; +import 'package:threedpass/core/theme/d3p_colors.dart'; +import 'package:threedpass/core/theme/d3p_special_styles.dart'; + +class UTCTime extends StatelessWidget { + const UTCTime({required this.dateTime, required this.formatter, super.key}); + + final DateTime dateTime; + final DateFormat formatter; + + @override + Widget build(BuildContext context) { + final medium = Theme.of(context).customTextStyles.d3pBodyMedium; + final small = Theme.of(context).customTextStyles.d3pBodySmall; + + return RichText( + text: TextSpan( + children: [ + TextSpan( + text: formatter.format(dateTime), + style: medium, + ), + WidgetSpan( + child: Text( + ' UTC', + textScaleFactor: 0.8, + style: small.copyWith( + color: D3pColors.disabled, + ), + ), + ), + ], + ), + ); + } +} diff --git a/lib/features/app/presentation/global_states_provider.dart b/lib/features/app/presentation/global_states_provider.dart index ec0291e5..2361d402 100644 --- a/lib/features/app/presentation/global_states_provider.dart +++ b/lib/features/app/presentation/global_states_provider.dart @@ -7,6 +7,7 @@ import 'package:threedpass/features/poscan_objects_query/bloc/poscan_objects_cub import 'package:threedpass/features/scan_page/bloc/scan_isolate_cubit.dart'; import 'package:threedpass/features/settings_page/bloc/settings_page_cubit.dart'; import 'package:threedpass/features/wallet_screen/add_contact_page/bloc/contacts_bloc.dart'; +import 'package:threedpass/features/wallet_screen/notifications_page/bloc/notifications_bloc.dart'; import 'package:threedpass/setup.dart' as di_setup; class GlobalStatesProvider extends StatelessWidget { @@ -43,6 +44,9 @@ class GlobalStatesProvider extends StatelessWidget { create: (final _) => di_setup.getIt(), lazy: false, ), + BlocProvider( + create: (_) => di_setup.getIt(), + ), ], child: PlatformProvider( settings: PlatformSettingsData( diff --git a/lib/features/explorer_page/explorer_page_wrapper.dart b/lib/features/explorer_page/explorer_page_wrapper.dart new file mode 100644 index 00000000..8f1f19dc --- /dev/null +++ b/lib/features/explorer_page/explorer_page_wrapper.dart @@ -0,0 +1,32 @@ +import 'package:auto_route/auto_route.dart'; +import 'package:flutter/material.dart'; + +@RoutePage() +class ExplorerPageWrapper extends StatelessWidget implements AutoRouteWrapper { + const ExplorerPageWrapper({ + final Key? key, + }) : super(key: key); + + @override + Widget wrappedRoute(final BuildContext context) { + return this; + // return MultiBlocProvider( + // providers: [ + // // Context to show global dialogs + // BlocProvider( + // create: (final _) => OuterContextCubit(context), + // lazy: false, + // ), + // BlocProvider( + // create: (_) => getIt(), + // ), + // ], + // child: this, + // ); + } + + @override + Widget build(final BuildContext context) { + return const AutoRouter(); + } +} diff --git a/lib/features/explorer_page/objects_list_page/objects_list_page.dart b/lib/features/explorer_page/objects_list_page/objects_list_page.dart new file mode 100644 index 00000000..11bafc83 --- /dev/null +++ b/lib/features/explorer_page/objects_list_page/objects_list_page.dart @@ -0,0 +1,32 @@ +import 'package:auto_route/auto_route.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_platform_widgets/flutter_platform_widgets.dart'; +import 'package:threedpass/core/widgets/paddings.dart'; +import 'package:threedpass/features/explorer_page/objects_list_page/presentation/explorer_uploaded_objects_list.dart'; +import 'package:threedpass/features/explorer_page/objects_list_page/presentation/objects_list_appbar.dart'; + +@RoutePage() +class ObjectsListPage extends StatelessWidget { + const ObjectsListPage({super.key}); + + @override + Widget build(final BuildContext context) { + return PlatformScaffold( + appBar: PlatformAppBar( + title: const ObjectsListAppbar(), + cupertino: (final context, final platform) => + CupertinoNavigationBarData(padding: EdgeInsetsDirectional.zero), + material: (final context, final platform) => MaterialAppBarData( + titleSpacing: 0, + ), + ), + body: ListView( + children: const [ + SizedBoxH16(), + ExplorerUploadedObjectsList(), + SizedBoxH16(), + ], + ), + ); + } +} diff --git a/lib/features/explorer_page/objects_list_page/presentation/explorer_uploaded_objects_list.dart b/lib/features/explorer_page/objects_list_page/presentation/explorer_uploaded_objects_list.dart new file mode 100644 index 00000000..853482b7 --- /dev/null +++ b/lib/features/explorer_page/objects_list_page/presentation/explorer_uploaded_objects_list.dart @@ -0,0 +1,53 @@ +import 'package:flutter/material.dart'; +import 'package:flutter/widgets.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:threedpass/core/widgets/progress_indicator/thin_progress_indicator.dart'; +import 'package:threedpass/core/widgets/text/d3p_body_medium_text.dart'; +import 'package:threedpass/features/poscan_objects_query/bloc/poscan_objects_cubit.dart'; +import 'package:threedpass/features/poscan_objects_query/domain/entities/uploaded_object.dart'; +import 'package:threedpass/features/wallet_screen/assets_page/widgets/objects_list/objects_list_pure.dart'; + +class ExplorerUploadedObjectsList extends StatelessWidget { + const ExplorerUploadedObjectsList({ + super.key, + }); + + @override + Widget build(final BuildContext context) { + return BlocBuilder( + builder: (final context, final state) { + final relatedObjects = []; + + state.objects.forEach((final obj) { + // if (true) { + relatedObjects.add(obj); + // } + }); + + if (relatedObjects.isEmpty) { + // return const SizedBox(); + return const Padding( + padding: EdgeInsets.only( + left: 16, + right: 16, + ), + child: D3pBodyMediumText('no_objects'), + ); + } + + return Column( + mainAxisSize: MainAxisSize.min, + children: [ + Flexible( + child: ObjectsListPure( + objects: relatedObjects, + ), + ), + if (state.status == PoscanObjectStateStatus.loading) + const ThinProgressIndicator(), + ], + ); + }, + ); + } +} diff --git a/lib/features/explorer_page/objects_list_page/presentation/objects_list_appbar.dart b/lib/features/explorer_page/objects_list_page/presentation/objects_list_appbar.dart new file mode 100644 index 00000000..cfae75cb --- /dev/null +++ b/lib/features/explorer_page/objects_list_page/presentation/objects_list_appbar.dart @@ -0,0 +1,38 @@ +import 'package:easy_localization/easy_localization.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:threedpass/features/explorer_page/objects_list_page/presentation/reload_objects_icon_button.dart'; +import 'package:threedpass/features/poscan_objects_query/bloc/poscan_objects_cubit.dart'; + +class ObjectsListAppbar extends StatelessWidget { + const ObjectsListAppbar({super.key}); + + @override + Widget build(final BuildContext context) { + return BlocBuilder( + builder: (final context, final state) { + final objectsCount = state.storageCount ?? state.objects.length; + return Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Padding( + padding: const EdgeInsets.only(left: 16), + child: Text( + objectsCount == 0 + ? 'No info about storage...' + : 'objects_list_appbar_title'.tr( + args: [ + 'objects_plural'.plural(objectsCount), + ], + ), + textAlign: TextAlign.start, + style: const TextStyle(color: Colors.white), + ), + ), + const ReloadObjectsIconButton(), + ], + ); + }, + ); + } +} diff --git a/lib/features/explorer_page/objects_list_page/presentation/reload_objects_icon_button.dart b/lib/features/explorer_page/objects_list_page/presentation/reload_objects_icon_button.dart new file mode 100644 index 00000000..a823aa7c --- /dev/null +++ b/lib/features/explorer_page/objects_list_page/presentation/reload_objects_icon_button.dart @@ -0,0 +1,23 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:threedpass/core/widgets/buttons/icon_button.dart'; +import 'package:threedpass/features/poscan_objects_query/bloc/poscan_objects_cubit.dart'; + +class ReloadObjectsIconButton extends StatelessWidget { + const ReloadObjectsIconButton({super.key}); + + @override + Widget build(final BuildContext context) { + return D3pIconButton( + iconData: Icons.refresh, + onPressed: () => reloadCache(context), + ); + } + + Future reloadCache(final BuildContext context) async { + final bloc = BlocProvider.of(context); + + await bloc.clear(); + await bloc.loadAll(); + } +} diff --git a/lib/features/explorer_page/router/explorer_page_route.dart b/lib/features/explorer_page/router/explorer_page_route.dart new file mode 100644 index 00000000..a309fcec --- /dev/null +++ b/lib/features/explorer_page/router/explorer_page_route.dart @@ -0,0 +1,12 @@ +import 'package:auto_route/auto_route.dart'; +import 'package:threedpass/router/router.gr.dart'; + +AutoRoute explorerPageRoute = AutoRoute( + page: ExplorerRouteWrapper.page, + children: [ + AutoRoute( + page: ObjectsListRoute.page, + path: '', + ), + ], +); diff --git a/lib/features/hashes_list/bloc/hashes_list_bloc.dart b/lib/features/hashes_list/bloc/hashes_list_bloc.dart index 404a8cf8..7e27593b 100644 --- a/lib/features/hashes_list/bloc/hashes_list_bloc.dart +++ b/lib/features/hashes_list/bloc/hashes_list_bloc.dart @@ -1,6 +1,7 @@ import 'dart:io'; import 'package:bloc/bloc.dart'; +import 'package:flutter/material.dart'; import 'package:logger/logger.dart'; import 'package:threedpass/features/hashes_list/domain/entities/hash_object.dart'; import 'package:threedpass/features/hashes_list/domain/entities/objects_directory.dart'; @@ -22,6 +23,7 @@ class HashesListBloc extends Bloc { on(_saveSnapshot); on(_replaceSnapshot); on<_LoadHashesList>(_loadList); + on(_unmarkNewSnap); } final HashesRepository hashesRepository; @@ -32,11 +34,27 @@ class HashesListBloc extends Bloc { add(_LoadHashesList(objects: objects)); } + Map buildMap( + final List objects, + ) { + final Map res = {}; + objects.forEach( + (final obj) => + obj.snapshots.forEach((final snap) => res[snap] = GlobalKey()), + ); + return res; + } + Future _loadList( final _LoadHashesList event, final Emitter emit, ) async { - emit(HashesListLoaded(objects: event.objects)); + emit( + HashesListLoaded( + objects: event.objects, + globalKeyMap: buildMap(event.objects), + ), + ); } Future _deleteHash( @@ -46,12 +64,15 @@ class HashesListBloc extends Bloc { if (state is HashesListLoaded) { final list = (state as HashesListLoaded).objects; bool f = false; + HashObject? hashObject; for (final obj in list) { - if (obj == event.object) { + if (obj.snapshots.contains(event.hash)) { + hashObject = obj; // get snapshot to remove - final snapshotToRemove = obj.snapshots.firstWhere( - (final snap) => snap == event.hash, - ); + final snapshotToRemove = event.hash; + // final snapshotToRemove = obj.snapshots.firstWhere( + // (final snap) => snap == event.hash, + // ); final shouldDeleteFile = obj.isObjectFileCanBeDeletedWithSnapshot(snapshotToRemove); @@ -75,12 +96,17 @@ class HashesListBloc extends Bloc { if (!f) { getIt().e( - 'Not found an object with id=${event.object} name=${event.object.name}', + 'Could not found snapshot ${event.hash.name}', ); } else { - await hashesRepository.replaceObject(event.object); + await hashesRepository.replaceObject(hashObject!); } - emit(HashesListLoaded(objects: list)); + emit( + HashesListLoaded( + objects: list, + globalKeyMap: buildMap(list), + ), + ); } } @@ -95,7 +121,12 @@ class HashesListBloc extends Bloc { list.removeWhere( (final element) => element == event.object, ); - emit(HashesListLoaded(objects: list)); + emit( + HashesListLoaded( + objects: list, + globalKeyMap: buildMap(list), + ), + ); } } @@ -108,7 +139,15 @@ class HashesListBloc extends Bloc { if (state is HashesListLoaded) { final list = (state as HashesListLoaded).objects; list.add(event.object); - emit(HashesListLoaded(objects: list)); + + final gmap = buildMap(list); + emit( + HashesListLoaded( + objects: list, + globalKeyMap: gmap, + requiresScroll: true, + ), + ); } } @@ -133,7 +172,13 @@ class HashesListBloc extends Bloc { } else { await hashesRepository.replaceObject(event.object); } - emit(HashesListLoaded(objects: list)); + emit( + HashesListLoaded( + objects: list, + globalKeyMap: buildMap(list), + requiresScroll: true, + ), + ); } } @@ -168,7 +213,39 @@ class HashesListBloc extends Bloc { } else { await hashesRepository.replaceObject(event.object); } - emit(HashesListLoaded(objects: list)); + emit( + HashesListLoaded( + objects: list, + globalKeyMap: buildMap(list), + ), + ); + } + } + + Future _unmarkNewSnap( + final UnmarkNewSnap event, + final Emitter emit, + ) async { + if (state is HashesListLoaded) { + final list = (state as HashesListLoaded).objects; + final obj = event.object; + + // find old snapshot place + final oldSnapIndex = obj.snapshots.indexOf(event.snap); + // replace it with new one + if (oldSnapIndex != -1) { + obj.snapshots[oldSnapIndex] = event.snap.copyWith(isNew: false); + } else { + getIt().e( + 'Not found a snapshot in object ${obj.name}. Snapshot name=${event.snap.name}', + ); + } + emit( + HashesListLoaded( + objects: list, + globalKeyMap: buildMap(list), + ), + ); } } } diff --git a/lib/features/hashes_list/bloc/hashes_list_event.dart b/lib/features/hashes_list/bloc/hashes_list_event.dart index 48a015f5..1ac824a8 100644 --- a/lib/features/hashes_list/bloc/hashes_list_event.dart +++ b/lib/features/hashes_list/bloc/hashes_list_event.dart @@ -7,11 +7,11 @@ abstract class HashesListEvent { class DeleteHash extends HashesListEvent { const DeleteHash({ required this.hash, - required this.object, + // required this.object, }); final Snapshot hash; - final HashObject object; + // final HashObject object; } class DeleteObject extends HashesListEvent { @@ -59,3 +59,13 @@ class _LoadHashesList extends HashesListEvent { final List objects; } + +class UnmarkNewSnap extends HashesListEvent { + const UnmarkNewSnap({ + required this.object, + required this.snap, + }); + + final Snapshot snap; + final HashObject object; +} diff --git a/lib/features/hashes_list/bloc/hashes_list_state.dart b/lib/features/hashes_list/bloc/hashes_list_state.dart index 9e1b91e2..61df5fdc 100644 --- a/lib/features/hashes_list/bloc/hashes_list_state.dart +++ b/lib/features/hashes_list/bloc/hashes_list_state.dart @@ -9,7 +9,12 @@ class HashesListInitial extends HashesListState {} class HashesListLoaded extends HashesListState { const HashesListLoaded({ required this.objects, + required this.globalKeyMap, + this.requiresScroll = false, }); final List objects; + + final Map globalKeyMap; + final bool requiresScroll; } diff --git a/lib/features/hashes_list/domain/entities/snapshot.dart b/lib/features/hashes_list/domain/entities/snapshot.dart index ed5408f8..b7a1e8f0 100644 --- a/lib/features/hashes_list/domain/entities/snapshot.dart +++ b/lib/features/hashes_list/domain/entities/snapshot.dart @@ -36,6 +36,8 @@ class Snapshot { @HiveField(5) final int fileHash; + final bool isNew; + const Snapshot({ required this.name, required this.stamp, @@ -44,6 +46,7 @@ class Snapshot { required this.fileHash, this.relativePath, this.externalPathToObj, + this.isNew = false, }); String get shareText => hashes.join('\n'); diff --git a/lib/features/hashes_list/domain/entities/snapshot.g.dart b/lib/features/hashes_list/domain/entities/snapshot.g.dart index 884a1cd4..39015770 100644 --- a/lib/features/hashes_list/domain/entities/snapshot.g.dart +++ b/lib/features/hashes_list/domain/entities/snapshot.g.dart @@ -21,6 +21,8 @@ abstract class _$SnapshotCWProxy { Snapshot externalPathToObj(String? externalPathToObj); + Snapshot isNew(bool isNew); + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `Snapshot(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. /// /// Usage @@ -35,6 +37,7 @@ abstract class _$SnapshotCWProxy { int? fileHash, String? relativePath, String? externalPathToObj, + bool? isNew, }); } @@ -68,6 +71,9 @@ class _$SnapshotCWProxyImpl implements _$SnapshotCWProxy { Snapshot externalPathToObj(String? externalPathToObj) => this(externalPathToObj: externalPathToObj); + @override + Snapshot isNew(bool isNew) => this(isNew: isNew); + @override /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `Snapshot(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. @@ -84,6 +90,7 @@ class _$SnapshotCWProxyImpl implements _$SnapshotCWProxy { Object? fileHash = const $CopyWithPlaceholder(), Object? relativePath = const $CopyWithPlaceholder(), Object? externalPathToObj = const $CopyWithPlaceholder(), + Object? isNew = const $CopyWithPlaceholder(), }) { return Snapshot( name: name == const $CopyWithPlaceholder() || name == null @@ -115,6 +122,10 @@ class _$SnapshotCWProxyImpl implements _$SnapshotCWProxy { ? _value.externalPathToObj // ignore: cast_nullable_to_non_nullable : externalPathToObj as String?, + isNew: isNew == const $CopyWithPlaceholder() || isNew == null + ? _value.isNew + // ignore: cast_nullable_to_non_nullable + : isNew as bool, ); } } diff --git a/lib/features/hashes_list/domain/entities/snapshot_create_from_file/snapshot_create_from_file.dart b/lib/features/hashes_list/domain/entities/snapshot_create_from_file/snapshot_create_from_file.dart index 74c890d0..72525c03 100644 --- a/lib/features/hashes_list/domain/entities/snapshot_create_from_file/snapshot_create_from_file.dart +++ b/lib/features/hashes_list/domain/entities/snapshot_create_from_file/snapshot_create_from_file.dart @@ -17,7 +17,7 @@ part './trans_bytes.dart'; class SnapshotFileFactory { final ScanSettings scanSettings; final HashesListBloc hashesListBloc; - final void Function() showLoader; + // final void Function() showLoader; // final ObjectsDirectory objectsDirectory; final ScanIsolateCubit scanIsolateCubit; // final void Function() hideLoader; @@ -25,7 +25,7 @@ class SnapshotFileFactory { SnapshotFileFactory({ required this.scanSettings, required this.hashesListBloc, - required this.showLoader, + // required this.showLoader, // required this.objectsDirectory, required this.scanIsolateCubit, // required this.hideLoader, @@ -103,8 +103,8 @@ class SnapshotFileFactory { final snapName = snapshotName(rawObjName); if (hashListState is HashesListLoaded) { - final newSnapshot = Snapshot( - name: snapName, + Snapshot newSnapshot = Snapshot( + name: '1 $snapName', hashes: hashes.split('\n'), stamp: DateTime.now(), relativePath: relativePath, @@ -112,10 +112,16 @@ class SnapshotFileFactory { transBytes: transBytes, ), fileHash: hashFile(filePath), + isNew: true, ); final hashObject = insertSnapIntoHashObject(hashListState, newSnapshot); + if (hashObject != null) { + final i = hashObject.snapshots.length; + newSnapshot = newSnapshot.copyWith(name: '${i + 1} $snapName'); + } + return Pair(hashObject, newSnapshot); } else { throw Exception('Hashes list is not initalized :('); @@ -138,8 +144,11 @@ class SnapshotFileFactory { filePath: filePath, transBytes: transBytes, algorithm: algo, + // updateIsolateListener: scanIsolateCubit.setData, ); - return calculator.calcHashes(scanIsolateCubit.setData); + return calculator.calcHashes( + scanIsolateCubit.setData, + ); } } diff --git a/lib/features/home_page/presentation/home_nav_bar.dart b/lib/features/home_page/presentation/home_nav_bar.dart index 663ad9ec..d7ebc741 100644 --- a/lib/features/home_page/presentation/home_nav_bar.dart +++ b/lib/features/home_page/presentation/home_nav_bar.dart @@ -2,6 +2,7 @@ import 'package:auto_route/auto_route.dart'; import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:flutter_platform_widgets/flutter_platform_widgets.dart'; +import 'package:unicons/unicons.dart'; class HomeNavBar { Widget build( @@ -20,6 +21,7 @@ class HomeNavBar { type: BottomNavigationBarType.fixed, itemChanged: tabsRouter.setActiveIndex, elevation: 3, + height: kBottomNavigationBarHeight, ), cupertino: (final _, final __) => CupertinoTabBarData( itemChanged: tabsRouter.setActiveIndex, @@ -40,6 +42,12 @@ class HomeNavBar { Icons.account_balance_wallet, ), ), + BottomNavigationBarItem( + label: 'bottom_label_explorer'.tr(), + icon: const Icon( + UniconsLine.object_group, + ), + ), BottomNavigationBarItem( label: 'bottom_label_settings'.tr(), icon: const Icon( diff --git a/lib/features/home_page/presentation/home_page.dart b/lib/features/home_page/presentation/home_page.dart index f1fd082d..0c6db803 100644 --- a/lib/features/home_page/presentation/home_page.dart +++ b/lib/features/home_page/presentation/home_page.dart @@ -19,6 +19,7 @@ class HomePage extends StatelessWidget { routes: const [ ScanRouteWrapper(), WalletRouteWrapper(), + ExplorerRouteWrapper(), SettingsRoute(), ], builder: HomeNavBar().build, diff --git a/lib/features/home_page/router/home_page_route.dart b/lib/features/home_page/router/home_page_route.dart index 0323c9c4..244dbbf1 100644 --- a/lib/features/home_page/router/home_page_route.dart +++ b/lib/features/home_page/router/home_page_route.dart @@ -1,4 +1,5 @@ import 'package:auto_route/auto_route.dart'; +import 'package:threedpass/features/explorer_page/router/explorer_page_route.dart'; import 'package:threedpass/features/home_page/router/pin_code_guard.dart'; import 'package:threedpass/features/scan_page/router/scan_page_route.dart'; import 'package:threedpass/features/settings_page/router/settings_page_route.dart'; @@ -18,6 +19,7 @@ AutoRoute initialAutoRoute = AutoRoute( children: [ scanPageRoute, walletPageRoute, + explorerPageRoute, settingsAutoRoute, ], ), diff --git a/lib/features/poscan_objects_query/bloc/poscan_objects_cubit.dart b/lib/features/poscan_objects_query/bloc/poscan_objects_cubit.dart index c3099bab..1e6ff83a 100644 --- a/lib/features/poscan_objects_query/bloc/poscan_objects_cubit.dart +++ b/lib/features/poscan_objects_query/bloc/poscan_objects_cubit.dart @@ -13,16 +13,19 @@ class PoscanObjectsState { final List objects; final PoscanObjectStateStatus status; final String? message; + final int? storageCount; // Objects in storage const PoscanObjectsState({ required this.objects, required this.status, this.message, + this.storageCount, }); const PoscanObjectsState.initial() : objects = const [], message = null, + storageCount = null, status = PoscanObjectStateStatus.loaded; } @@ -68,9 +71,17 @@ class PoscanObjectsCubit extends Cubit { state.copyWith( status: PoscanObjectStateStatus.loaded, objects: objects.toList(), + storageCount: realValue, ), ); } else { + emit( + state.copyWith( + status: PoscanObjectStateStatus.loading, + objects: objects.toList(), + storageCount: realValue, + ), + ); logV( 'Loaded ${objects.length} poScan objects from cache. Need $realValue', ); @@ -133,6 +144,12 @@ class PoscanObjectsCubit extends Cubit { Future clear() async { await objectsStore?.clear(); - emit(const PoscanObjectsState.initial()); + emit( + state.copyWith( + message: null, + objects: [], + status: PoscanObjectStateStatus.loaded, + ), + ); } } diff --git a/lib/features/poscan_objects_query/bloc/poscan_objects_cubit.g.dart b/lib/features/poscan_objects_query/bloc/poscan_objects_cubit.g.dart index 52d7dd3a..791ece17 100644 --- a/lib/features/poscan_objects_query/bloc/poscan_objects_cubit.g.dart +++ b/lib/features/poscan_objects_query/bloc/poscan_objects_cubit.g.dart @@ -13,6 +13,8 @@ abstract class _$PoscanObjectsStateCWProxy { PoscanObjectsState message(String? message); + PoscanObjectsState storageCount(int? storageCount); + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `PoscanObjectsState(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. /// /// Usage @@ -23,6 +25,7 @@ abstract class _$PoscanObjectsStateCWProxy { List? objects, PoscanObjectStateStatus? status, String? message, + int? storageCount, }); } @@ -43,6 +46,10 @@ class _$PoscanObjectsStateCWProxyImpl implements _$PoscanObjectsStateCWProxy { @override PoscanObjectsState message(String? message) => this(message: message); + @override + PoscanObjectsState storageCount(int? storageCount) => + this(storageCount: storageCount); + @override /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `PoscanObjectsState(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. @@ -55,6 +62,7 @@ class _$PoscanObjectsStateCWProxyImpl implements _$PoscanObjectsStateCWProxy { Object? objects = const $CopyWithPlaceholder(), Object? status = const $CopyWithPlaceholder(), Object? message = const $CopyWithPlaceholder(), + Object? storageCount = const $CopyWithPlaceholder(), }) { return PoscanObjectsState( objects: objects == const $CopyWithPlaceholder() || objects == null @@ -69,6 +77,10 @@ class _$PoscanObjectsStateCWProxyImpl implements _$PoscanObjectsStateCWProxy { ? _value.message // ignore: cast_nullable_to_non_nullable : message as String?, + storageCount: storageCount == const $CopyWithPlaceholder() + ? _value.storageCount + // ignore: cast_nullable_to_non_nullable + : storageCount as int?, ); } } diff --git a/lib/features/poscan_objects_query/data/uploaded_object_fabric.dart b/lib/features/poscan_objects_query/data/uploaded_object_fabric.dart index 6e970cde..10a15a2a 100644 --- a/lib/features/poscan_objects_query/data/uploaded_object_fabric.dart +++ b/lib/features/poscan_objects_query/data/uploaded_object_fabric.dart @@ -9,27 +9,10 @@ class _UploadedObjectFabric { required this.raw, }); - String owner() { - return raw['owner'] as String; - } - - List hashes() { - return (raw['hashes'] as List) - .map((final dynamic e) => e.toString().substring(2)) - .toList(); - } - - String status() { - return (raw['state'] as Map).keys.first.toString(); - } - UploadedObject object() { return UploadedObject( id: id, raw: raw, - owner: owner(), - hashes: hashes(), - status: status(), cacheDate: DateTime.now(), ); } diff --git a/lib/features/poscan_objects_query/domain/entities/uploaded_object.dart b/lib/features/poscan_objects_query/domain/entities/uploaded_object.dart index 501ad920..d6abf2cd 100644 --- a/lib/features/poscan_objects_query/domain/entities/uploaded_object.dart +++ b/lib/features/poscan_objects_query/domain/entities/uploaded_object.dart @@ -8,21 +8,42 @@ class UploadedObject { final Map raw; @HiveField(1) final int id; - @HiveField(2) - final String owner; - @HiveField(3) - final List hashes; - @HiveField(4) - final String status; + // @HiveField(2) + // final String owner; + // @HiveField(3) + // final List hashes; + // @HiveField(4) + // final String status; @HiveField(5) final DateTime cacheDate; + // @HiveField(6) + // final DateTime? statusDateUTC; const UploadedObject({ required this.id, required this.raw, - required this.owner, - required this.hashes, - required this.status, + // required this.owner, + // required this.hashes, + // required this.status, required this.cacheDate, + // required this.statusDateUTC, }); + + DateTime get statusDateUTC { + final d1 = + (raw['state'] as Map).values.first.toString().replaceAll(',', ''); + final d2 = int.parse(d1); + final initialDate = DateTime(2022, DateTime.august, 30, 21, 36); + final realStatus = initialDate.add(Duration(minutes: d2)); + + return realStatus; + } + + String get owner => raw['owner'] as String; + + List get hashes => (raw['hashes'] as List) + .map((final dynamic e) => e.toString().substring(2)) + .toList(); + + String get status => (raw['state'] as Map).keys.first.toString(); } diff --git a/lib/features/poscan_objects_query/domain/entities/uploaded_object.g.dart b/lib/features/poscan_objects_query/domain/entities/uploaded_object.g.dart index 05a92d50..757401ec 100644 --- a/lib/features/poscan_objects_query/domain/entities/uploaded_object.g.dart +++ b/lib/features/poscan_objects_query/domain/entities/uploaded_object.g.dart @@ -19,9 +19,6 @@ class UploadedObjectAdapter extends TypeAdapter { return UploadedObject( id: fields[1] as int, raw: (fields[0] as Map).cast(), - owner: fields[2] as String, - hashes: (fields[3] as List).cast(), - status: fields[4] as String, cacheDate: fields[5] as DateTime, ); } @@ -29,17 +26,11 @@ class UploadedObjectAdapter extends TypeAdapter { @override void write(BinaryWriter writer, UploadedObject obj) { writer - ..writeByte(6) + ..writeByte(3) ..writeByte(0) ..write(obj.raw) ..writeByte(1) ..write(obj.id) - ..writeByte(2) - ..write(obj.owner) - ..writeByte(3) - ..write(obj.hashes) - ..writeByte(4) - ..write(obj.status) ..writeByte(5) ..write(obj.cacheDate); } diff --git a/lib/features/poscan_objects_query/domain/usecase/get_obj_count_usecase.dart b/lib/features/poscan_objects_query/domain/usecase/get_obj_count_usecase.dart index bb6a5c3e..64af8f54 100644 --- a/lib/features/poscan_objects_query/domain/usecase/get_obj_count_usecase.dart +++ b/lib/features/poscan_objects_query/domain/usecase/get_obj_count_usecase.dart @@ -1,5 +1,4 @@ import 'package:super_core/super_core.dart'; -import 'package:threedpass/core/utils/usecase.dart'; import 'package:threedpass/features/poscan_objects_query/data/storage_poscan_repo.dart'; class GetObjCount extends UseCase { diff --git a/lib/features/poscan_objects_query/domain/usecase/get_uploaded_object.dart b/lib/features/poscan_objects_query/domain/usecase/get_uploaded_object.dart index 47bd2e06..0e5fcd3e 100644 --- a/lib/features/poscan_objects_query/domain/usecase/get_uploaded_object.dart +++ b/lib/features/poscan_objects_query/domain/usecase/get_uploaded_object.dart @@ -1,5 +1,4 @@ import 'package:super_core/super_core.dart'; -import 'package:threedpass/core/utils/usecase.dart'; import 'package:threedpass/features/poscan_objects_query/data/storage_poscan_repo.dart'; import 'package:threedpass/features/poscan_objects_query/domain/entities/uploaded_object.dart'; diff --git a/lib/features/poscan_putobject/domain/usecases/put_object_usecase.dart b/lib/features/poscan_putobject/domain/usecases/put_object_usecase.dart index 7f4afc3a..519d9dca 100644 --- a/lib/features/poscan_putobject/domain/usecases/put_object_usecase.dart +++ b/lib/features/poscan_putobject/domain/usecases/put_object_usecase.dart @@ -3,7 +3,6 @@ import 'package:polkawallet_sdk/storage/types/keyPairData.dart'; import 'package:super_core/super_core.dart'; import 'package:threedpass/core/polkawallet/bloc/app_service_cubit.dart'; import 'package:threedpass/core/polkawallet/utils/extrinsic_status.dart'; -import 'package:threedpass/core/utils/usecase.dart'; import 'package:threedpass/features/poscan_putobject/data/poscan_repository.dart'; import 'package:threedpass/features/poscan_putobject/domain/entities/poscan_categories.dart'; import 'package:threedpass/features/poscan_putobject/domain/entities/put_object_global_handler.dart'; diff --git a/lib/features/preview_page/presentation/widgets/copy_text_card.dart b/lib/features/preview_page/presentation/widgets/copy_text_card.dart index 4e26a178..3a0c96ba 100644 --- a/lib/features/preview_page/presentation/widgets/copy_text_card.dart +++ b/lib/features/preview_page/presentation/widgets/copy_text_card.dart @@ -17,6 +17,8 @@ class CopyTextCard extends StatelessWidget { @override Widget build(final BuildContext context) { return ClickableCard( + // side: BorderSide(color: Colors.grey), + radius: Radius.circular(16), onTap: () => copyAndNotify( textToCopy: textToCopy, textToShow: textToShow, diff --git a/lib/features/preview_page/presentation/widgets/delete_snapshot_dialog.dart b/lib/features/preview_page/presentation/widgets/delete_snapshot_dialog.dart index 5fe87003..5d43a28f 100644 --- a/lib/features/preview_page/presentation/widgets/delete_snapshot_dialog.dart +++ b/lib/features/preview_page/presentation/widgets/delete_snapshot_dialog.dart @@ -22,7 +22,7 @@ class DeleteSnapshotDialog extends StatelessWidget { BlocProvider.of(context).add( DeleteHash( hash: state.snapshot, - object: state.hashObject!, + // object: state.hashObject!, ), ); } diff --git a/lib/features/preview_page/presentation/widgets/preview_page_body.dart b/lib/features/preview_page/presentation/widgets/preview_page_body.dart index a2072eb0..e49e5dd3 100644 --- a/lib/features/preview_page/presentation/widgets/preview_page_body.dart +++ b/lib/features/preview_page/presentation/widgets/preview_page_body.dart @@ -56,6 +56,7 @@ class PreviewPageBody extends StatelessWidget { const PoscanResult(), const SizedBoxH16(), const TopHashesTitle(), + const SizedBox(height: 2), TopHashesCard(hashes: previewPageCubitState.snapshot.hashes), const SizedBoxH16(), RenameSnapshotButton(state: previewPageCubitState), diff --git a/lib/features/scan_page/bloc/scan_isolate_cubit.dart b/lib/features/scan_page/bloc/scan_isolate_cubit.dart index 0e32f274..623e691f 100644 --- a/lib/features/scan_page/bloc/scan_isolate_cubit.dart +++ b/lib/features/scan_page/bloc/scan_isolate_cubit.dart @@ -1,6 +1,8 @@ import 'dart:isolate'; import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:logger/logger.dart'; +import 'package:threedpass/setup.dart'; class ScanIsolateData { const ScanIsolateData({ @@ -28,6 +30,11 @@ class ScanIsolateCubit extends Cubit { } void setNull() { + if (state != null) { + getIt().i('Stop scan'); + state?.isolate.removeOnExitListener(state!.port.sendPort); + state?.isolate.kill(); + } emit(null); } } diff --git a/lib/features/scan_page/bloc/select_snapshots_cubit.dart b/lib/features/scan_page/bloc/select_snapshots_cubit.dart new file mode 100644 index 00000000..2b51d6fb --- /dev/null +++ b/lib/features/scan_page/bloc/select_snapshots_cubit.dart @@ -0,0 +1,64 @@ +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:threedpass/features/hashes_list/domain/entities/snapshot.dart'; + +class SelectSnapshotsState { + final List snaps; + final bool areSelectable; + + const SelectSnapshotsState({ + required this.areSelectable, + required this.snaps, + }); + + SelectSnapshotsState copyWith({ + final List? snaps, + final bool? areSelectable, + }) { + return SelectSnapshotsState( + areSelectable: areSelectable ?? this.areSelectable, + snaps: snaps ?? this.snaps, + ); + } + + SelectSnapshotsState.initial() + : areSelectable = false, + snaps = []; +} + +class SelectSnapshotsCubit extends Cubit { + SelectSnapshotsCubit() : super(SelectSnapshotsState.initial()); + + void toggle(final Snapshot snap) { + if (state.snaps.contains(snap)) { + remove(snap); + } else { + add(snap); + } + } + + void add(final Snapshot snap) { + final newList = List.from(state.snaps)..add(snap); + emit( + state.copyWith(snaps: newList), + ); + } + + void remove(final Snapshot snap) { + final newList = List.from(state.snaps)..remove(snap); + emit( + state.copyWith(snaps: newList), + ); + } + + void makeSelectable() { + emit( + state.copyWith(areSelectable: true), + ); + } + + void makeUnselectable() { + emit( + state.copyWith(areSelectable: false, snaps: []), + ); + } +} diff --git a/lib/features/scan_page/bloc/snapshots_has_new_extension.dart b/lib/features/scan_page/bloc/snapshots_has_new_extension.dart new file mode 100644 index 00000000..2cce9b7d --- /dev/null +++ b/lib/features/scan_page/bloc/snapshots_has_new_extension.dart @@ -0,0 +1,15 @@ +import 'package:threedpass/features/hashes_list/bloc/hashes_list_bloc.dart'; +import 'package:threedpass/features/hashes_list/domain/entities/snapshot.dart'; + +extension HasNew on HashesListLoaded { + bool get hasNew => objects.any( + (final element) => + element.snapshots.any((final element) => element.isNew), + ); + + Snapshot get firstNew => objects + .firstWhere((final element) => + element.snapshots.any((final element) => element.isNew)) + .snapshots + .firstWhere((final element) => element.isNew); +} diff --git a/lib/features/scan_page/presentation/pages/scan_page.dart b/lib/features/scan_page/presentation/pages/scan_page.dart index fdab68d2..c3184595 100644 --- a/lib/features/scan_page/presentation/pages/scan_page.dart +++ b/lib/features/scan_page/presentation/pages/scan_page.dart @@ -1,7 +1,8 @@ import 'package:auto_route/auto_route.dart'; import 'package:flutter/material.dart'; -import 'package:threedpass/core/widgets/d3p_scaffold.dart'; -import 'package:threedpass/features/scan_page/presentation/widgets/get_object_from_file_button.dart'; +import 'package:flutter_platform_widgets/flutter_platform_widgets.dart'; +import 'package:threedpass/features/scan_page/presentation/widgets/floating_action_button/scan_page_floating_action_button.dart'; +import 'package:threedpass/features/scan_page/presentation/widgets/scan_appbar.dart'; import 'package:threedpass/features/scan_page/presentation/widgets/scan_page_content.dart'; @RoutePage() @@ -10,11 +11,20 @@ class ScanPage extends StatelessWidget { @override Widget build(final BuildContext context) { - return const D3pScaffold( - removeBackButton: true, - appbarTitle: 'recognize_your_objects', - body: ScanPageContent(), - floatingActionButton: GetObjectFromFileFloatingButton(), + return PlatformScaffold( + appBar: ScanAppBar(), + body: const Stack( + children: [ + ScanPageContent(), + Align( + alignment: Alignment.bottomRight, + child: Padding( + padding: EdgeInsets.all(24), + child: ScanPageFloatinActionButton(), + ), + ), + ], + ), ); } } diff --git a/lib/features/scan_page/presentation/pages/scan_page_wrapper.dart b/lib/features/scan_page/presentation/pages/scan_page_wrapper.dart index ca7a1be0..3922ab44 100644 --- a/lib/features/scan_page/presentation/pages/scan_page_wrapper.dart +++ b/lib/features/scan_page/presentation/pages/scan_page_wrapper.dart @@ -2,6 +2,7 @@ import 'package:auto_route/auto_route.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:threedpass/features/preview_page/bloc/outer_context_cubit.dart'; +import 'package:threedpass/features/scan_page/bloc/select_snapshots_cubit.dart'; @RoutePage() class ScanPageWrapper extends StatelessWidget implements AutoRouteWrapper { @@ -18,6 +19,9 @@ class ScanPageWrapper extends StatelessWidget implements AutoRouteWrapper { create: (final _) => OuterContextCubit(context), lazy: false, ), + BlocProvider( + create: (final _) => SelectSnapshotsCubit(), + ), ], child: this, ); diff --git a/lib/features/scan_page/presentation/widgets/calc_hash_loading_dialog.dart b/lib/features/scan_page/presentation/widgets/calc_hash_loading_dialog.dart index 36af0c4b..811708e1 100644 --- a/lib/features/scan_page/presentation/widgets/calc_hash_loading_dialog.dart +++ b/lib/features/scan_page/presentation/widgets/calc_hash_loading_dialog.dart @@ -1,83 +1,83 @@ -import 'package:auto_route/auto_route.dart'; -import 'package:easy_localization/easy_localization.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_bloc/flutter_bloc.dart'; -import 'package:flutter_platform_widgets/flutter_platform_widgets.dart'; -import 'package:logger/logger.dart'; -import 'package:threedpass/core/widgets/buttons/text_button.dart'; -import 'package:threedpass/core/widgets/paddings.dart'; -import 'package:threedpass/features/scan_page/bloc/scan_isolate_cubit.dart'; -import 'package:threedpass/setup.dart'; +// import 'package:auto_route/auto_route.dart'; +// import 'package:easy_localization/easy_localization.dart'; +// import 'package:flutter/material.dart'; +// import 'package:flutter_bloc/flutter_bloc.dart'; +// import 'package:flutter_platform_widgets/flutter_platform_widgets.dart'; +// import 'package:logger/logger.dart'; +// import 'package:threedpass/core/widgets/buttons/text_button.dart'; +// import 'package:threedpass/core/widgets/paddings.dart'; +// import 'package:threedpass/features/scan_page/bloc/scan_isolate_cubit.dart'; +// import 'package:threedpass/setup.dart'; -@RoutePage() -class CalcHashLoadingDialog extends StatelessWidget { - const CalcHashLoadingDialog({ - final Key? key, - }) : super(key: key); +// @RoutePage() +// class CalcHashLoadingDialog extends StatelessWidget { +// const CalcHashLoadingDialog({ +// final Key? key, +// }) : super(key: key); - static const indicatorSize = 26.0; +// static const indicatorSize = 26.0; - @override - Widget build(final BuildContext context) { - return PlatformAlertDialog( - content: Column( - mainAxisSize: MainAxisSize.min, - children: [ - Row( - mainAxisSize: MainAxisSize.max, - children: [ - SizedBox( - width: indicatorSize, - height: indicatorSize, - child: PlatformCircularProgressIndicator(), - ), - const SizedBox(width: 8), - Flexible( - child: Container( - width: double.infinity, - // color: Colors.amber, - // margin: const EdgeInsets.only(left: 16), - child: Text( - 'calc_hashes_loader_text'.tr(), - textAlign: TextAlign.center, - ), - ), - ), - const SizedBox(width: 8), - const SizedBox( - width: indicatorSize, - ), - ], - ), - const SizedBoxH16(), - SizedBox( - // height: 52, - child: BlocBuilder( - buildWhen: (final previous, final current) => - !(previous != null && current == null), - builder: - (final BuildContext context, final ScanIsolateData? value) => - D3pTextButton( - text: 'Cancel'.tr(), - onPressed: value != null - ? () { - // value.isolate. - // value.isolate - value.port.sendPort.send(ScanIsolateCubit.cancelMsg); - value.isolate.removeOnExitListener(value.port.sendPort); - value.isolate.kill(); - // Isolate.exit(value.port.sendPort, 'cancel'); +// @override +// Widget build(final BuildContext context) { +// return PlatformAlertDialog( +// content: Column( +// mainAxisSize: MainAxisSize.min, +// children: [ +// Row( +// mainAxisSize: MainAxisSize.max, +// children: [ +// SizedBox( +// width: indicatorSize, +// height: indicatorSize, +// child: PlatformCircularProgressIndicator(), +// ), +// const SizedBox(width: 8), +// Flexible( +// child: Container( +// width: double.infinity, +// // color: Colors.amber, +// // margin: const EdgeInsets.only(left: 16), +// child: Text( +// 'calc_hashes_loader_text'.tr(), +// textAlign: TextAlign.center, +// ), +// ), +// ), +// const SizedBox(width: 8), +// const SizedBox( +// width: indicatorSize, +// ), +// ], +// ), +// const SizedBoxH16(), +// SizedBox( +// // height: 52, +// child: BlocBuilder( +// buildWhen: (final previous, final current) => +// !(previous != null && current == null), +// builder: +// (final BuildContext context, final ScanIsolateData? value) => +// D3pTextButton( +// text: 'Cancel'.tr(), +// onPressed: value != null +// ? () { +// // value.isolate. +// // value.isolate +// value.port.sendPort.send(ScanIsolateCubit.cancelMsg); +// value.isolate.removeOnExitListener(value.port.sendPort); +// value.isolate.kill(); +// // Isolate.exit(value.port.sendPort, 'cancel'); - getIt().i('Stop scan'); - BlocProvider.of(context).setNull(); - // context.router.pop(); - } - : null, - ), - ), - ), - ], - ), - ); - } -} +// getIt().i('Stop scan'); +// BlocProvider.of(context).setNull(); +// // context.router.pop(); +// } +// : null, +// ), +// ), +// ), +// ], +// ), +// ); +// } +// } diff --git a/lib/features/scan_page/presentation/widgets/floating_action_button/delete_snapshots_button.dart b/lib/features/scan_page/presentation/widgets/floating_action_button/delete_snapshots_button.dart new file mode 100644 index 00000000..8eea3cf8 --- /dev/null +++ b/lib/features/scan_page/presentation/widgets/floating_action_button/delete_snapshots_button.dart @@ -0,0 +1,24 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:threedpass/features/scan_page/bloc/select_snapshots_cubit.dart'; +import 'package:threedpass/features/scan_page/presentation/widgets/floating_action_button/delete_snapshots_dialog.dart'; + +class DeleteSnaphotsButton extends StatelessWidget { + const DeleteSnaphotsButton({super.key}); + + @override + Widget build(final BuildContext context) { + final selectBloc = BlocProvider.of(context); + return FloatingActionButton( + heroTag: 'delete_snapshots', + backgroundColor: Colors.red, + child: const Icon(Icons.delete), + onPressed: () => showDialog( + context: context, + builder: (final context) => DeleteSnapshotsDialog( + selectSnapshotsCubit: selectBloc, + ), + ), + ); + } +} diff --git a/lib/features/scan_page/presentation/widgets/floating_action_button/delete_snapshots_dialog.dart b/lib/features/scan_page/presentation/widgets/floating_action_button/delete_snapshots_dialog.dart new file mode 100644 index 00000000..5ad4261e --- /dev/null +++ b/lib/features/scan_page/presentation/widgets/floating_action_button/delete_snapshots_dialog.dart @@ -0,0 +1,52 @@ +// import 'package:auto_route/auto_route.dart'; +import 'package:easy_localization/easy_localization.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:threedpass/core/widgets/buttons/text_button.dart'; +import 'package:threedpass/core/widgets/dialog/d3p_platform_dialog.dart'; +import 'package:threedpass/features/hashes_list/bloc/hashes_list_bloc.dart'; +import 'package:threedpass/features/scan_page/bloc/select_snapshots_cubit.dart'; + +// @RoutePage() +class DeleteSnapshotsDialog extends StatelessWidget { + const DeleteSnapshotsDialog({required this.selectSnapshotsCubit, super.key}); + + final SelectSnapshotsCubit selectSnapshotsCubit; + + void deleteSnap(final BuildContext context) { + final hashesBloc = BlocProvider.of(context); + for (final snap in selectSnapshotsCubit.state.snaps) { + hashesBloc.add( + DeleteHash( + hash: snap, + ), + ); + } + selectSnapshotsCubit.makeUnselectable(); + Navigator.of(context).pop(); + } + + @override + Widget build(final BuildContext context) { + return D3pPlatformDialog( + title: 'delete_snapshots_dialog_title'.tr(), + content: Text( + 'delete_snapshots_dialog_content'.tr( + args: [ + 'snapshots_plural'.plural(selectSnapshotsCubit.state.snaps.length), + ], + ), + ), + actions: [ + D3pTextButton( + text: 'Cancel'.tr(), + onPressed: () => Navigator.of(context).pop(), + ), + D3pTextButton( + text: 'Delete'.tr(), + onPressed: () => deleteSnap(context), + ), + ], + ); + } +} diff --git a/lib/features/scan_page/presentation/widgets/get_object_from_file_button.dart b/lib/features/scan_page/presentation/widgets/floating_action_button/get_object_from_file_button.dart similarity index 59% rename from lib/features/scan_page/presentation/widgets/get_object_from_file_button.dart rename to lib/features/scan_page/presentation/widgets/floating_action_button/get_object_from_file_button.dart index 9199d110..4a87bbde 100644 --- a/lib/features/scan_page/presentation/widgets/get_object_from_file_button.dart +++ b/lib/features/scan_page/presentation/widgets/floating_action_button/get_object_from_file_button.dart @@ -1,20 +1,17 @@ import 'dart:async'; -import 'package:auto_route/auto_route.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:fluttertoast/fluttertoast.dart'; import 'package:logger/logger.dart'; import 'package:threedpass/features/hashes_list/bloc/hashes_list_bloc.dart'; +import 'package:threedpass/features/hashes_list/domain/entities/hash_object.dart'; import 'package:threedpass/features/hashes_list/domain/entities/objects_directory.dart'; import 'package:threedpass/features/hashes_list/domain/entities/snapshot_create_from_file/file_copy.dart'; import 'package:threedpass/features/hashes_list/domain/entities/snapshot_create_from_file/file_picker.dart'; import 'package:threedpass/features/hashes_list/domain/entities/snapshot_create_from_file/snapshot_create_from_file.dart'; -import 'package:threedpass/features/home_page/bloc/home_context_cubit.dart'; import 'package:threedpass/features/scan_page/bloc/scan_isolate_cubit.dart'; -import 'package:threedpass/features/scan_page/presentation/widgets/calc_hash_loading_dialog.dart'; import 'package:threedpass/features/settings_page/bloc/settings_page_cubit.dart'; -import 'package:threedpass/router/router.gr.dart'; import 'package:threedpass/setup.dart'; class GetObjectFromFileFloatingButton extends StatelessWidget { @@ -24,31 +21,33 @@ class GetObjectFromFileFloatingButton extends StatelessWidget { Fluttertoast.showToast(msg: text); } - void showLoader(final BuildContext context) { - final homeContext = BlocProvider.of(context); + // void showLoader(final BuildContext context) { + // final homeContext = BlocProvider.of(context); - // homeContext.router.push( - // const CalcHashLoadingDialogRoute(), - // ); - unawaited( - homeContext.showDialogC( - (final __) => const CalcHashLoadingDialog(), - ), - ); - } + // // homeContext.router.push( + // // const CalcHashLoadingDialogRoute(), + // // ); + // unawaited( + // homeContext.showDialogC( + // (final __) => const CalcHashLoadingDialog(), + // ), + // ); + // } - void hideLoader(final BuildContext context) { - final homeContext = BlocProvider.of(context); - // homeContext.state.context.router.pop(); - homeContext.hideDialogC(); - } + // void hideLoader(final BuildContext context) { + // final homeContext = BlocProvider.of(context); + // // homeContext.state.context.router.pop(); + // homeContext.hideDialogC(); + // } /// Calc object Future createHashFromFile( final BuildContext context, ) async { + final isolateCubit = BlocProvider.of(context); + final hashesListBloc = BlocProvider.of(context); final snapFactory = SnapshotFileFactory( - showLoader: () => showLoader(context), + // showLoader: () => showLoader(context), hashesListBloc: BlocProvider.of(context), scanSettings: BlocProvider.of(context).state.scanSettings, @@ -61,7 +60,7 @@ class GetObjectFromFileFloatingButton extends StatelessWidget { final objectsDirectory = getIt(); final pickedFilePath = await FilePickerShortCut().pickFile(); - showLoader(context); + // showLoader(context); final relativePath = await FileCopy(objectsDirectory).write(pickedFilePath); @@ -71,17 +70,40 @@ class GetObjectFromFileFloatingButton extends StatelessWidget { pickedFilePath: pickedFilePath, ); - hideLoader(context); + // hideLoader(context); + isolateCubit.setNull(); - unawaited( - context.router.push( - PreviewRouteWrapper( - hashObject: pair.left, - snapshot: pair.right, - createNewAnyway: true, - ), - ), - ); + if (pair.left == null) { + // Create new object + final newObj = HashObject( + name: 'Object ${pair.right.fileHash}', + snapshots: [ + pair.right, + ], + ); + hashesListBloc.add(AddObject(object: newObj)); + } else { + // Add snapshot + hashesListBloc.add(SaveSnapshot(hash: pair.right, object: pair.left!)); + } + + // BlocProvider.of(context).add( + // AddObject(HashObject.fromSnapshot(pair.right)), + // // SaveSnapshot( + // // object: pair.left, + // // hash: pair.right, + // // ), + // ); + + // unawaited( + // context.router.push( + // PreviewRouteWrapper( + // hashObject: pair.left, + // snapshot: pair.right, + // createNewAnyway: true, + // ), + // ), + // ); } on FilePickerException catch (e) { showToast(e.message, context); getIt().e('Caught FilePickerException: $e'); @@ -90,7 +112,7 @@ class GetObjectFromFileFloatingButton extends StatelessWidget { if (e.toString().contains(ScanIsolateCubit.cancelMsg)) { showToast('Scanning canceled by user.', context); - hideLoader(context); + // hideLoader(context); } else { showToast('Error during file pick. $e', context); } @@ -100,6 +122,7 @@ class GetObjectFromFileFloatingButton extends StatelessWidget { @override Widget build(final BuildContext context) { return FloatingActionButton( + heroTag: 'get_object_from_file', child: const Icon(Icons.folder_open_rounded), onPressed: () => createHashFromFile( context, diff --git a/lib/features/scan_page/presentation/widgets/floating_action_button/scan_page_floating_action_button.dart b/lib/features/scan_page/presentation/widgets/floating_action_button/scan_page_floating_action_button.dart new file mode 100644 index 00000000..fec3f336 --- /dev/null +++ b/lib/features/scan_page/presentation/widgets/floating_action_button/scan_page_floating_action_button.dart @@ -0,0 +1,20 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:threedpass/features/scan_page/bloc/select_snapshots_cubit.dart'; +import 'package:threedpass/features/scan_page/presentation/widgets/floating_action_button/delete_snapshots_button.dart'; +import 'package:threedpass/features/scan_page/presentation/widgets/floating_action_button/get_object_from_file_button.dart'; + +class ScanPageFloatinActionButton extends StatelessWidget { + const ScanPageFloatinActionButton({super.key}); + + @override + Widget build(final BuildContext context) { + return BlocBuilder( + buildWhen: (final previous, final current) => + previous.areSelectable != current.areSelectable, + builder: (final _, final state) => state.areSelectable + ? const DeleteSnaphotsButton() + : const GetObjectFromFileFloatingButton(), + ); + } +} diff --git a/lib/features/scan_page/presentation/widgets/object_list/hash_card.dart b/lib/features/scan_page/presentation/widgets/object_list/hash_card.dart index f9899eff..36659669 100644 --- a/lib/features/scan_page/presentation/widgets/object_list/hash_card.dart +++ b/lib/features/scan_page/presentation/widgets/object_list/hash_card.dart @@ -1,14 +1,17 @@ import 'package:auto_route/auto_route.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:threedpass/core/theme/d3p_colors.dart'; import 'package:threedpass/core/theme/d3p_special_styles.dart'; +import 'package:threedpass/core/theme/d3p_theme.dart'; import 'package:threedpass/core/utils/formatters.dart'; import 'package:threedpass/core/widgets/buttons/clickable_card.dart'; import 'package:threedpass/core/widgets/paddings.dart'; import 'package:threedpass/core/widgets/text/d3p_body_medium_text.dart'; +import 'package:threedpass/features/hashes_list/bloc/hashes_list_bloc.dart'; import 'package:threedpass/features/hashes_list/domain/entities/hash_object.dart'; import 'package:threedpass/features/hashes_list/domain/entities/snapshot.dart'; -import 'package:threedpass/features/scan_page/presentation/widgets/object_list/hash_card_popup_menu.dart'; +import 'package:threedpass/features/scan_page/bloc/select_snapshots_cubit.dart'; import 'package:threedpass/features/settings_page/presentation/widgets/settings_text.dart'; import 'package:threedpass/router/router.gr.dart'; @@ -16,52 +19,93 @@ class SnapshotCard extends StatelessWidget { const SnapshotCard({ required this.snapshot, required this.hashObject, + this.onTap, final Key? key, }) : super(key: key); final Snapshot snapshot; final HashObject hashObject; + final void Function()? onTap; @override Widget build(final BuildContext context) { final theme = Theme.of(context).customTextStyles; - return ClickableCard( - onTap: () => context.router.push( - PreviewRouteWrapper( - hashObject: hashObject, - snapshot: snapshot, - ), - ), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Flexible( - child: Column( - mainAxisSize: MainAxisSize.min, + final hashesListBloc = BlocProvider.of(context); + final hashesListState = hashesListBloc.state as HashesListLoaded; + + return BlocBuilder( + buildWhen: (final previous, final current) => + previous.areSelectable != current.areSelectable || + previous.snaps.contains(snapshot) != current.snaps.contains(snapshot), + builder: (final _, final state) => ClickableCard( + key: hashesListState.globalKeyMap[snapshot], + onTap: state.areSelectable + ? () => + BlocProvider.of(context).toggle(snapshot) + : () async { + await context.router.push( + PreviewRouteWrapper( + hashObject: hashObject, + snapshot: snapshot, + ), + ); + if (snapshot.isNew) { + hashesListBloc.add( + UnmarkNewSnap( + object: hashObject, + snap: snapshot, + ), + ); + } + }, + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - snapshot.name, - style: theme.d3pBodyLarge, - ), - const SizedBoxH8(), - Text.rich( - snapshot.settingsConfig.toShort(context), - ), - const SizedBoxH8(), - D3pBodyMediumText( - Fmt.basicDateFormat.format(snapshot.stamp), - translate: false, - color: D3pColors.disabled, + children: [ + Flexible( + child: Text( + snapshot.name, + style: theme.d3pBodyLarge, + ), ), + if (snapshot.isNew) + Icon( + Icons.fiber_new_outlined, + color: D3pThemeData.mainColor, + ), ], ), - ), - HashCardPopUpMenuButton( - hashObject: hashObject, - snapshot: snapshot, - ), - ], + const SizedBoxH8(), + Text.rich( + snapshot.settingsConfig.toShort(context), + ), + const SizedBoxH8(), + SizedBox( + height: 24, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + D3pBodyMediumText( + Fmt.basicDateFormat.format(snapshot.stamp), + translate: false, + color: D3pColors.disabled, + ), + if (state.areSelectable) + Icon( + state.snaps.contains(snapshot) + ? Icons.check_box_rounded + : Icons.check_box_outline_blank_rounded, + color: D3pThemeData.mainColor, + ), + ], + ), + ), + ], + ), ), ); } diff --git a/lib/features/scan_page/presentation/widgets/object_list/hash_card_popup_menu.dart b/lib/features/scan_page/presentation/widgets/object_list/hash_card_popup_menu.dart index 80489253..65f4c85a 100644 --- a/lib/features/scan_page/presentation/widgets/object_list/hash_card_popup_menu.dart +++ b/lib/features/scan_page/presentation/widgets/object_list/hash_card_popup_menu.dart @@ -1,89 +1,89 @@ -import 'package:easy_localization/easy_localization.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_bloc/flutter_bloc.dart'; -import 'package:flutter_platform_widgets/flutter_platform_widgets.dart'; -import 'package:share_plus/share_plus.dart'; -import 'package:threedpass/core/theme/d3p_special_colors.dart'; -import 'package:threedpass/core/widgets/text/d3p_body_medium_text.dart'; -import 'package:threedpass/features/hashes_list/bloc/hashes_list_bloc.dart'; -import 'package:threedpass/features/hashes_list/domain/entities/hash_object.dart'; -import 'package:threedpass/features/hashes_list/domain/entities/snapshot.dart'; +// import 'package:easy_localization/easy_localization.dart'; +// import 'package:flutter/material.dart'; +// import 'package:flutter_bloc/flutter_bloc.dart'; +// import 'package:flutter_platform_widgets/flutter_platform_widgets.dart'; +// import 'package:share_plus/share_plus.dart'; +// import 'package:threedpass/core/theme/d3p_special_colors.dart'; +// import 'package:threedpass/core/widgets/text/d3p_body_medium_text.dart'; +// import 'package:threedpass/features/hashes_list/bloc/hashes_list_bloc.dart'; +// import 'package:threedpass/features/hashes_list/domain/entities/hash_object.dart'; +// import 'package:threedpass/features/hashes_list/domain/entities/snapshot.dart'; -class HashCardPopUpMenuButton extends StatelessWidget { - const HashCardPopUpMenuButton({ - required this.snapshot, - required this.hashObject, - final Key? key, - }) : super(key: key); +// class HashCardPopUpMenuButton extends StatelessWidget { +// const HashCardPopUpMenuButton({ +// required this.snapshot, +// required this.hashObject, +// final Key? key, +// }) : super(key: key); - final Snapshot snapshot; - final HashObject hashObject; +// final Snapshot snapshot; +// final HashObject hashObject; - void onSelected(final int? value, final BuildContext context) { - switch (value) { - case 1: - Share.share(snapshot.hashes.join('\n')); - break; - case 2: - BlocProvider.of(context).add( - DeleteHash( - hash: snapshot, - object: hashObject, - ), - ); - break; - } - } +// void onSelected(final int? value, final BuildContext context) { +// switch (value) { +// case 1: +// Share.share(snapshot.hashes.join('\n')); +// break; +// case 2: +// BlocProvider.of(context).add( +// DeleteHash( +// hash: snapshot, +// object: hashObject, +// ), +// ); +// break; +// } +// } - @override - Widget build(final BuildContext context) { - final customColors = Theme.of(context).customColors; - return PlatformPopupMenu( - icon: Icon(Icons.more_vert, color: customColors.popMenuIcon), - options: [ - _PopupMenuOption( - onTap: () => onSelected(1, context), - label: 'Share', - isDestructiveActioniOS: false, - iconColorAndroid: customColors.popMenuIcon, - iconDataAndroid: Icons.share, - ), - _PopupMenuOption( - onTap: () => onSelected(2, context), - label: 'Delete', - isDestructiveActioniOS: true, - iconColorAndroid: customColors.popMenuIcon, - iconDataAndroid: Icons.delete, - ), - ], - ); - } -} +// @override +// Widget build(final BuildContext context) { +// final customColors = Theme.of(context).customColors; +// return PlatformPopupMenu( +// icon: Icon(Icons.more_vert, color: customColors.popMenuIcon), +// options: [ +// _PopupMenuOption( +// onTap: () => onSelected(1, context), +// label: 'Share', +// isDestructiveActioniOS: false, +// iconColorAndroid: customColors.popMenuIcon, +// iconDataAndroid: Icons.share, +// ), +// _PopupMenuOption( +// onTap: () => onSelected(2, context), +// label: 'Delete', +// isDestructiveActioniOS: true, +// iconColorAndroid: customColors.popMenuIcon, +// iconDataAndroid: Icons.delete, +// ), +// ], +// ); +// } +// } -class _PopupMenuOption extends PopupMenuOption { - _PopupMenuOption({ - required final void Function() onTap, - required final String label, - required final IconData iconDataAndroid, - required final Color iconColorAndroid, - final bool isDestructiveActioniOS = false, - }) : super( - label: label.tr(), - onTap: (final _) => onTap(), - material: (final context, final platform) => - MaterialPopupMenuOptionData( - child: Row( - children: [ - Padding( - padding: const EdgeInsets.fromLTRB(2, 2, 8, 2), - child: Icon(iconDataAndroid, color: iconColorAndroid), - ), - D3pBodyMediumText(label.tr()), - ], - ), - ), - cupertino: (final _, final __) => CupertinoPopupMenuOptionData( - isDestructiveAction: isDestructiveActioniOS, - ), - ); -} +// class _PopupMenuOption extends PopupMenuOption { +// _PopupMenuOption({ +// required final void Function() onTap, +// required final String label, +// required final IconData iconDataAndroid, +// required final Color iconColorAndroid, +// final bool isDestructiveActioniOS = false, +// }) : super( +// label: label.tr(), +// onTap: (final _) => onTap(), +// material: (final context, final platform) => +// MaterialPopupMenuOptionData( +// child: Row( +// children: [ +// Padding( +// padding: const EdgeInsets.fromLTRB(2, 2, 8, 2), +// child: Icon(iconDataAndroid, color: iconColorAndroid), +// ), +// D3pBodyMediumText(label.tr()), +// ], +// ), +// ), +// cupertino: (final _, final __) => CupertinoPopupMenuOptionData( +// isDestructiveAction: isDestructiveActioniOS, +// ), +// ); +// } diff --git a/lib/features/scan_page/presentation/widgets/objects_list.dart b/lib/features/scan_page/presentation/widgets/objects_list.dart index f1a91864..a5678920 100644 --- a/lib/features/scan_page/presentation/widgets/objects_list.dart +++ b/lib/features/scan_page/presentation/widgets/objects_list.dart @@ -11,20 +11,21 @@ class ObjectsList extends StatelessWidget { final Key? key, }) : super(key: key); - final HashesListState state; + final HashesListLoaded state; @override Widget build(final BuildContext context) { - if (state is HashesListLoaded) { - final realState = state as HashesListLoaded; - final objects = realState.objects; + final objects = state.objects; - return ListView.builder( - padding: const EdgeInsets.only(bottom: 16, left: 16, right: 16), - physics: const NeverScrollableScrollPhysics(), - shrinkWrap: true, - itemCount: objects.length, - itemBuilder: (final context, final objIndex) { + return ListView( + padding: const EdgeInsets.only(bottom: 16, left: 16, right: 16), + physics: const NeverScrollableScrollPhysics(), + shrinkWrap: true, + // itemCount: objects.length, + // itemBuilder: (final context, final objIndex) { + children: List.generate( + objects.length, + (objIndex) { final currentObject = objects[objIndex]; final fileHashes = currentObject.fileHashes.toList(); @@ -34,35 +35,39 @@ class ObjectsList extends StatelessWidget { children: [ _ObjectTitle(currentObject.name), const SizedBoxH4(), - ListView.builder( + ListView( + primary: false, shrinkWrap: true, physics: const NeverScrollableScrollPhysics(), padding: EdgeInsets.zero, - itemCount: fileHashes.length, - itemBuilder: (final _, final index) { - return Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisSize: MainAxisSize.min, - children: [ - FileHashHeader( - fileHash: fileHashes[index], - ), - Flexible( - child: SnapshotsList( - currentObject: currentObject, - allowedFileHash: fileHashes[index], + // itemCount: fileHashes.length, + // itemBuilder: (final _, final index) { + children: List.generate( + fileHashes.length, + (index) { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + FileHashHeader( + fileHash: fileHashes[index], ), - ), - ], - ); - }, + Flexible( + child: SnapshotsList( + currentObject: currentObject, + allowedFileHash: fileHashes[index], + ), + ), + ], + ); + }, + ), ), ], ); }, - ); - } - return const SizedBox(); + ), + ); } } diff --git a/lib/features/scan_page/presentation/widgets/scan_appbar.dart b/lib/features/scan_page/presentation/widgets/scan_appbar.dart new file mode 100644 index 00000000..e2501353 --- /dev/null +++ b/lib/features/scan_page/presentation/widgets/scan_appbar.dart @@ -0,0 +1,10 @@ +import 'package:threedpass/core/widgets/appbars/title_n_button_appbar.dart'; +import 'package:threedpass/features/scan_page/presentation/widgets/select_many_icon_button.dart'; + +class ScanAppBar extends TitleNButtonAppBar { + ScanAppBar({super.key}) + : super( + titleText: 'recognize_your_objects', + trailingAction: const SelectManyIconButton(), + ); +} diff --git a/lib/features/scan_page/presentation/widgets/scan_indicator.dart b/lib/features/scan_page/presentation/widgets/scan_indicator.dart new file mode 100644 index 00000000..281c87a7 --- /dev/null +++ b/lib/features/scan_page/presentation/widgets/scan_indicator.dart @@ -0,0 +1,49 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:threedpass/core/widgets/buttons/text_button.dart'; +import 'package:threedpass/core/widgets/paddings.dart'; +import 'package:threedpass/core/widgets/text/d3p_body_large_text.dart'; +import 'package:threedpass/features/scan_page/bloc/scan_isolate_cubit.dart'; + +class ScanIndicator extends StatelessWidget { + const ScanIndicator({final Key? key}) : super(key: key); + + @override + Widget build(final BuildContext context) { + return BlocBuilder( + builder: (final context, final state) => AnimatedSize( + duration: const Duration(milliseconds: 1000), + child: state != null + ? Column( + children: [ + const SizedBoxH8(), + Row( + children: [ + const SizedBox(width: 16), + const SizedBox( + height: 24, + width: 24, + child: CircularProgressIndicator.adaptive(), + ), + const SizedBox(width: 16), + const D3pBodyLargeText('Scanning...'), + const Spacer(), + Flexible( + child: D3pTextButton( + text: 'Cancel', + onPressed: () => + BlocProvider.of(context) + .setNull(), + ), + ), + const SizedBox(width: 16), + ], + ), + const Divider(), + ], + ) + : const SizedBox(), + ), + ); + } +} diff --git a/lib/features/scan_page/presentation/widgets/scan_page_content.dart b/lib/features/scan_page/presentation/widgets/scan_page_content.dart index 0b361f64..421f108c 100644 --- a/lib/features/scan_page/presentation/widgets/scan_page_content.dart +++ b/lib/features/scan_page/presentation/widgets/scan_page_content.dart @@ -2,40 +2,67 @@ import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_platform_widgets/flutter_platform_widgets.dart'; import 'package:threedpass/features/hashes_list/bloc/hashes_list_bloc.dart'; +import 'package:threedpass/features/scan_page/bloc/snapshots_has_new_extension.dart'; import 'package:threedpass/features/scan_page/presentation/widgets/no_saved_objects_placeholder.dart'; import 'package:threedpass/features/scan_page/presentation/widgets/objects_list.dart'; +import 'package:threedpass/features/scan_page/presentation/widgets/scan_indicator.dart'; class ScanPageContent extends StatelessWidget { const ScanPageContent({final Key? key}) : super(key: key); @override Widget build(final BuildContext context) { - return BlocBuilder( - builder: (final context, final state) { - if (state is HashesListLoaded) { - if (state.objects.isEmpty) { - return const NoSavedObjectsPlaceholder(); - } else { - return SingleChildScrollView( - child: Column( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Flexible( + return Column( + children: [ + const ScanIndicator(), + Flexible( + child: BlocBuilder( + builder: (final context, final state) { + if (state is HashesListLoaded) { + if (state.objects.isEmpty) { + return const NoSavedObjectsPlaceholder(); + } else { + if (state.requiresScroll) { + // TODO. IF PERFOMANCE IS POOR. REWRITE THIS USING LISTVIEW.BUILDER AND MANUAL OFFSET SCROLL + WidgetsBinding.instance.addPostFrameCallback((final _) { + debugPrint('try scroll to new obj'); + try { + // await Future.delayed(Duration(seconds: 5)); + // state.objects.forEach((element) {element.snapshots.forEach((element) {element.isNew });}); + if (state.hasNew) { + final snap = state.firstNew; + final gKey = state.globalKeyMap[snap]; + // final snap = event.object.snapshots.first; + Scrollable.ensureVisible( + gKey!.currentContext!, + duration: Duration(seconds: 1), + ); + debugPrint('SCROLL SCROLL'); + } else { + debugPrint('No new snapshots'); + } + } on Object catch (e) { + debugPrint('SCROLL ERROR: $e'); + } + }); + } + + // Map keys + return SingleChildScrollView( child: ObjectsList( state: state, ), - ), - ], - ), - ); - } - } else { - return Center( - child: PlatformCircularProgressIndicator(), - ); - } - }, + ); + } + } else { + return Center( + child: PlatformCircularProgressIndicator(), + ); + } + }, + ), + ), + ], ); } } diff --git a/lib/features/scan_page/presentation/widgets/select_many_icon_button.dart b/lib/features/scan_page/presentation/widgets/select_many_icon_button.dart new file mode 100644 index 00000000..a09f2998 --- /dev/null +++ b/lib/features/scan_page/presentation/widgets/select_many_icon_button.dart @@ -0,0 +1,34 @@ +import 'package:flutter/material.dart'; +import 'package:flutter/widgets.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:threedpass/core/widgets/buttons/icon_button.dart'; +import 'package:threedpass/features/scan_page/bloc/select_snapshots_cubit.dart'; + +class SelectManyIconButton extends StatelessWidget { + const SelectManyIconButton({super.key}); + + @override + Widget build(final BuildContext context) { + return BlocBuilder( + builder: (final context, final state) { + if (state.areSelectable) { + return D3pIconButton( + padding: const EdgeInsets.symmetric(horizontal: 14), + // emptyContraints: false, + iconData: Icons.close, + onPressed: () => BlocProvider.of(context) + .makeUnselectable(), + ); + } else { + return D3pIconButton( + padding: const EdgeInsets.symmetric(horizontal: 14), + // emptyContraints: true, + iconData: Icons.check_box_outline_blank, + onPressed: () => + BlocProvider.of(context).makeSelectable(), + ); + } + }, + ); + } +} diff --git a/lib/features/scan_page/presentation/widgets/snapshots_list.dart b/lib/features/scan_page/presentation/widgets/snapshots_list.dart index 948ae2f0..aa19757e 100644 --- a/lib/features/scan_page/presentation/widgets/snapshots_list.dart +++ b/lib/features/scan_page/presentation/widgets/snapshots_list.dart @@ -23,16 +23,25 @@ class SnapshotsList extends StatelessWidget { } } - return ListView.builder( + return ListView( physics: const NeverScrollableScrollPhysics(), + primary: false, shrinkWrap: true, - itemCount: listToShow.length, - itemBuilder: (final context, final index) => Padding( - padding: const EdgeInsets.symmetric(vertical: 4), - child: SnapshotCard( - snapshot: listToShow[index], - hashObject: currentObject, - ), + // itemCount: listToShow.length, + // itemBuilder: (final context, final index) { + children: List.generate( + listToShow.length, + (index) { + // final areSelectable = + // BlocProvider.of(context).state.areSelectable; + return Padding( + padding: const EdgeInsets.symmetric(vertical: 4), + child: SnapshotCard( + snapshot: listToShow[index], + hashObject: currentObject, + ), + ); + }, ), ); } diff --git a/lib/features/scan_page/router/calc_hash_loading_widget_route.dart b/lib/features/scan_page/router/calc_hash_loading_widget_route.dart index a0391211..94d8c7eb 100644 --- a/lib/features/scan_page/router/calc_hash_loading_widget_route.dart +++ b/lib/features/scan_page/router/calc_hash_loading_widget_route.dart @@ -1,8 +1,8 @@ -import 'package:auto_route/auto_route.dart'; -import 'package:threedpass/router/router.dart'; -import 'package:threedpass/router/router.gr.dart'; +// import 'package:auto_route/auto_route.dart'; +// import 'package:threedpass/router/router.dart'; +// import 'package:threedpass/router/router.gr.dart'; -AutoRoute calcHashLoadingWidgetRoute = CustomRoute( - page: CalcHashLoadingRoute.page, - customRouteBuilder: dialogBuilder, -); +// AutoRoute calcHashLoadingWidgetRoute = CustomRoute( +// page: CalcHashLoadingRoute.page, +// customRouteBuilder: dialogBuilder, +// ); diff --git a/lib/features/settings_page/presentation/settings_sub_page/setting_sub_page.dart b/lib/features/settings_page/presentation/settings_sub_page/setting_sub_page.dart index 12f3b0ee..c1e62c49 100644 --- a/lib/features/settings_page/presentation/settings_sub_page/setting_sub_page.dart +++ b/lib/features/settings_page/presentation/settings_sub_page/setting_sub_page.dart @@ -29,7 +29,8 @@ abstract class SettingSubPage extends StatelessWidget { textAlign: TextAlign.center, titleText: appbarTitle, leading: D3pIconButton( - iconData: Icons.close, + iconData: Icons.arrow_back, + cupertinoIcon: Icons.arrow_back_ios_new, onPressed: () => Navigator.of(context).pop(), ), trailingActions: [ diff --git a/lib/features/settings_page/presentation/widgets/app_settings/reset_objects_cache_button.dart b/lib/features/settings_page/presentation/widgets/app_settings/reset_objects_cache_button.dart index 7ed1afa3..cde158ea 100644 --- a/lib/features/settings_page/presentation/widgets/app_settings/reset_objects_cache_button.dart +++ b/lib/features/settings_page/presentation/widgets/app_settings/reset_objects_cache_button.dart @@ -10,11 +10,11 @@ import 'package:threedpass/features/poscan_objects_query/bloc/poscan_objects_cub class ResetObjectsCacheButton extends StatelessWidget { const ResetObjectsCacheButton({super.key}); - Future reloadCache(final BuildContext context) async { + Future clearCache(final BuildContext context) async { final bloc = BlocProvider.of(context); await bloc.clear(); - await bloc.loadAll(); + // await bloc.loadAll(); } @override @@ -35,7 +35,11 @@ class ResetObjectsCacheButton extends StatelessWidget { ), const SizedBox(width: 16), D3pBodyMediumText( - 'reset_objects_cache_plural'.plural(state.objects.length), + 'reset_objects_cache_plural'.tr( + args: [ + 'objects_plural'.plural(state.objects.length), + ], + ), translate: false, ), // This structure of insided rows may seem dirty, but they are required to make things work =) @@ -54,9 +58,9 @@ class ResetObjectsCacheButton extends StatelessWidget { child: D3pTextButton( // width: 105, mainAxisAlignment: MainAxisAlignment.end, - icon: Icons.refresh, - text: 'Reset'.tr(), - onPressed: () => reloadCache(context), + icon: Icons.clear, + text: 'Clear'.tr(), + onPressed: () => clearCache(context), ), ), const SizedBox(width: 16), diff --git a/lib/features/uploaded_object_page/uploaded_object_page.dart b/lib/features/uploaded_object_page/uploaded_object_page.dart index 61f9cf10..d7a30c13 100644 --- a/lib/features/uploaded_object_page/uploaded_object_page.dart +++ b/lib/features/uploaded_object_page/uploaded_object_page.dart @@ -1,12 +1,15 @@ import 'package:auto_route/auto_route.dart'; +import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; +import 'package:threedpass/core/utils/formatters.dart'; import 'package:threedpass/core/widgets/d3p_scaffold.dart'; +import 'package:threedpass/core/widgets/other/fast_rich_text.dart'; import 'package:threedpass/core/widgets/paddings.dart'; -import 'package:threedpass/core/widgets/text/d3p_body_medium_text.dart'; +import 'package:threedpass/core/widgets/utc_time.dart'; import 'package:threedpass/features/poscan_objects_query/domain/entities/uploaded_object.dart'; -import 'package:threedpass/features/uploaded_object_page/widgets/raw_uploaded_object_content.dart'; import 'package:threedpass/features/uploaded_object_page/widgets/snapshot_connected_to_uploaded.dart'; import 'package:threedpass/features/uploaded_object_page/widgets/uploaded_object_id_text.dart'; +import 'package:threedpass/features/uploaded_object_page/widgets/uploaded_object_owner_text.dart'; import 'package:threedpass/features/uploaded_object_page/widgets/uploaded_object_status_text.dart'; @RoutePage() @@ -19,26 +22,34 @@ class UploadedObjectPage extends StatelessWidget { Widget build(final BuildContext context) { return D3pScaffold( appbarTitle: 'uploaded_object_title', - body: SingleChildScrollView( - child: Padding( - padding: const EdgeInsets.symmetric(horizontal: 16), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, + body: ListView( + padding: const EdgeInsets.symmetric(horizontal: 16), + children: [ + const SizedBoxH16(), + UploadedObjectIdText(uploadedObject: uploadedObject), + const SizedBoxH16(), + Row( children: [ - const SizedBoxH16(), - UploadedObjectIdText(uploadedObject: uploadedObject), - const SizedBoxH16(), UploadedObjectStatusText(uploadedObject: uploadedObject), - SnapshotConnectedToUploaded( - uploadedObject: uploadedObject, - topPadding: 16, + const SizedBox(width: 16), + UTCTime( + dateTime: uploadedObject.statusDateUTC, + formatter: Fmt.shortDateFormat, ), - const SizedBoxH24(), - const D3pBodyMediumText('Raw:'), // TODO LOCALIZE - RawUploadedObjectContent(uploadedObject: uploadedObject), ], ), - ), + const SizedBoxH16(), + UploadedObjectOwnerText(uploadedObject: uploadedObject), + SnapshotConnectedToUploaded( + uploadedObject: uploadedObject, + topPadding: 16, + ), + const SizedBoxH16(), + FastRichText( + mainText: '\n' + uploadedObject.hashes.join('\n'), + secondaryText: 'uploaded_object_hashes'.tr(), + ), + ], ), ); } diff --git a/lib/features/uploaded_object_page/widgets/snapshot_connected_to_uploaded.dart b/lib/features/uploaded_object_page/widgets/snapshot_connected_to_uploaded.dart index e73d0138..96ce5a30 100644 --- a/lib/features/uploaded_object_page/widgets/snapshot_connected_to_uploaded.dart +++ b/lib/features/uploaded_object_page/widgets/snapshot_connected_to_uploaded.dart @@ -53,6 +53,7 @@ class SnapshotConnectedToUploaded extends StatelessWidget { color: D3pColors.disabled, ), ListView.builder( + padding: EdgeInsets.zero, physics: const NeverScrollableScrollPhysics(), shrinkWrap: true, itemCount: similarSnapshots.length, diff --git a/lib/features/uploaded_object_page/widgets/uploaded_object_id_text.dart b/lib/features/uploaded_object_page/widgets/uploaded_object_id_text.dart index 82f9d0f3..8f7d0f16 100644 --- a/lib/features/uploaded_object_page/widgets/uploaded_object_id_text.dart +++ b/lib/features/uploaded_object_page/widgets/uploaded_object_id_text.dart @@ -1,3 +1,4 @@ +import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:threedpass/core/widgets/other/fast_rich_text.dart'; import 'package:threedpass/features/poscan_objects_query/domain/entities/uploaded_object.dart'; @@ -11,7 +12,7 @@ class UploadedObjectIdText extends StatelessWidget { Widget build(final BuildContext context) { return FastRichText( mainText: uploadedObject.id.toString(), - secondaryText: 'id: ', // TODO LOCALIZE + secondaryText: 'uploaded_object_id'.tr(), ); } } diff --git a/lib/features/uploaded_object_page/widgets/uploaded_object_owner_text.dart b/lib/features/uploaded_object_page/widgets/uploaded_object_owner_text.dart new file mode 100644 index 00000000..217829e4 --- /dev/null +++ b/lib/features/uploaded_object_page/widgets/uploaded_object_owner_text.dart @@ -0,0 +1,26 @@ +import 'package:easy_localization/easy_localization.dart'; +import 'package:flutter/material.dart'; +import 'package:threedpass/core/utils/formatters.dart'; +import 'package:threedpass/core/widgets/other/fast_rich_text.dart'; +import 'package:threedpass/features/poscan_objects_query/domain/entities/uploaded_object.dart'; + +class UploadedObjectOwnerText extends StatelessWidget { + const UploadedObjectOwnerText({ + required this.uploadedObject, + this.short = false, + super.key, + }); + + final UploadedObject uploadedObject; + final bool short; + + @override + Widget build(final BuildContext context) { + return FastRichText( + mainText: short + ? Fmt.shorterAddress(uploadedObject.owner) + : uploadedObject.owner, + secondaryText: 'uploaded_object_owner'.tr(), + ); + } +} diff --git a/lib/features/uploaded_object_page/widgets/uploaded_object_status_text.dart b/lib/features/uploaded_object_page/widgets/uploaded_object_status_text.dart index b83b4481..0e7446c0 100644 --- a/lib/features/uploaded_object_page/widgets/uploaded_object_status_text.dart +++ b/lib/features/uploaded_object_page/widgets/uploaded_object_status_text.dart @@ -1,3 +1,4 @@ +import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/widgets.dart'; import 'package:threedpass/core/widgets/other/fast_rich_text.dart'; import 'package:threedpass/features/poscan_objects_query/domain/entities/uploaded_object.dart'; @@ -8,10 +9,10 @@ class UploadedObjectStatusText extends StatelessWidget { final UploadedObject uploadedObject; @override - Widget build(BuildContext context) { + Widget build(final BuildContext context) { return FastRichText( mainText: uploadedObject.status, - secondaryText: 'status: ', // TODO LOCALIZE + secondaryText: 'uploaded_object_status'.tr(), ); } } diff --git a/lib/features/wallet_screen/add_contact_page/add_contact_page.dart b/lib/features/wallet_screen/add_contact_page/add_contact_page.dart index 3f9c5816..fa6c9f78 100644 --- a/lib/features/wallet_screen/add_contact_page/add_contact_page.dart +++ b/lib/features/wallet_screen/add_contact_page/add_contact_page.dart @@ -91,7 +91,7 @@ class AddContactPage extends StatelessWidget { } } else { FastSnackBar( - textCode: 'invalid_input', + textCode: 'bad_address', context: context, ).show(); } diff --git a/lib/features/wallet_screen/assets_page/assets_page.dart b/lib/features/wallet_screen/assets_page/assets_page.dart index f940dddc..b77510a3 100644 --- a/lib/features/wallet_screen/assets_page/assets_page.dart +++ b/lib/features/wallet_screen/assets_page/assets_page.dart @@ -8,7 +8,7 @@ import 'package:threedpass/features/wallet_screen/assets_page/widgets/accounts_d import 'package:threedpass/features/wallet_screen/assets_page/widgets/asset_page_appbar.dart'; import 'package:threedpass/features/wallet_screen/assets_page/widgets/buttons_panel.dart'; import 'package:threedpass/features/wallet_screen/assets_page/widgets/coins_balance.dart'; -import 'package:threedpass/features/wallet_screen/assets_page/widgets/objects_list/objects_list.dart'; +import 'package:threedpass/features/wallet_screen/assets_page/widgets/objects_list/objects_list_assets.dart'; class AssetsPage extends StatelessWidget { const AssetsPage({final Key? key}) : super(key: key); @@ -30,9 +30,10 @@ class AssetsPage extends StatelessWidget { context: context, theme: theme, ), - body: const Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ + body: ListView( + shrinkWrap: true, + // crossAxisAlignment: CrossAxisAlignment.center, + children: const [ // SizedBoxH24(), SizedBoxH8(), CoinsBalance(), @@ -41,9 +42,9 @@ class AssetsPage extends StatelessWidget { // Flexible( // child: NonNativeTokens(), // ), - Flexible( - child: UploadedObjectsList(), - ), + SizedBoxH16(), + ObjectsListAssets(), + SizedBoxH16(), ], ), ); diff --git a/lib/features/wallet_screen/assets_page/widgets/objects_list/objects_list.dart b/lib/features/wallet_screen/assets_page/widgets/objects_list/objects_list.dart index 5e26cecb..78bf3ae1 100644 --- a/lib/features/wallet_screen/assets_page/widgets/objects_list/objects_list.dart +++ b/lib/features/wallet_screen/assets_page/widgets/objects_list/objects_list.dart @@ -2,97 +2,67 @@ import 'package:flutter/material.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:threedpass/core/polkawallet/app_service.dart'; -import 'package:threedpass/core/polkawallet/bloc/app_service_cubit.dart'; import 'package:threedpass/core/widgets/other/padding_16.dart'; -import 'package:threedpass/core/widgets/paddings.dart'; import 'package:threedpass/core/widgets/progress_indicator/thin_progress_indicator.dart'; -import 'package:threedpass/core/widgets/text/d3p_body_medium_text.dart'; import 'package:threedpass/features/poscan_objects_query/bloc/poscan_objects_cubit.dart'; import 'package:threedpass/features/poscan_objects_query/domain/entities/uploaded_object.dart'; +import 'package:threedpass/features/wallet_screen/assets_page/widgets/objects_list/objects_list_empty_refresh_widget.dart'; import 'package:threedpass/features/wallet_screen/assets_page/widgets/objects_list/objects_list_header_full.dart'; -import 'package:threedpass/features/wallet_screen/assets_page/widgets/objects_list/objects_list_item.dart'; +import 'package:threedpass/features/wallet_screen/assets_page/widgets/objects_list/objects_list_pure.dart'; import 'package:threedpass/features/wallet_screen/notifications_page/bloc/notifications_bloc.dart'; -class UploadedObjectsList extends StatelessWidget { - const UploadedObjectsList({super.key}); +class AssetsUploadedObjectsList extends StatelessWidget { + const AssetsUploadedObjectsList({ + required this.appService, + super.key, + }); + + final AppService appService; @override Widget build(final BuildContext context) { - return BlocBuilder( - builder: (final context, final appService) => - BlocBuilder( - builder: (final context, final state) => - BlocBuilder( - buildWhen: (final previous, final current) => - hasPutObj(previous) != hasPutObj(current), - builder: (final context, final notifState) { - final relatedObjects = []; - - state.objects.forEach((final obj) { - if (obj.owner == appService.keyring.current.address) { - relatedObjects.add(obj); - } - }); + return BlocBuilder( + builder: (final context, final state) => + BlocBuilder( + buildWhen: (final previous, final current) => + hasPutObj(previous) != hasPutObj(current), + builder: (final context, final notifState) { + final relatedObjects = []; - if (relatedObjects.isEmpty && hasPutObj(notifState)) { - return const Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBoxH16(), - Padding( - padding: EdgeInsets.symmetric(horizontal: 16), - child: ObjectsListHeaderFull(), - ), - Padding16( - child: D3pBodyMediumText('no_owned_objects_found'), - ), - ], - ); + state.objects.forEach((final obj) { + if (obj.owner == appService.keyring.current.address) { + relatedObjects.add(obj); } + }); - if (relatedObjects.isEmpty) { - return const SizedBox(); - } + if (relatedObjects.isEmpty && hasPutObj(notifState)) { + return const ObjectsListEmptyRefresh(); + } - return Column( - children: [ - const SizedBoxH16(), - const Padding( - padding: EdgeInsets.symmetric(horizontal: 16), - child: ObjectsListHeaderFull(), - ), - Flexible( - child: ListView.builder( - physics: const NeverScrollableScrollPhysics(), - padding: - const EdgeInsets.symmetric(horizontal: 16, vertical: 0), - shrinkWrap: true, - itemCount: relatedObjects.length, - itemBuilder: (final context, final index) => Padding( - padding: const EdgeInsets.symmetric(vertical: 4), - child: ObjectsListItem( - uploadedObject: relatedObjects[index], - ), - ), - ), + if (relatedObjects.isEmpty) { + return const SizedBox(); + } + + return Column( + mainAxisSize: MainAxisSize.min, + children: [ + const Padding16( + child: ObjectsListHeaderFull(), + ), + Flexible( + child: ObjectsListPure( + objects: relatedObjects, ), - if (state.status == PoscanObjectStateStatus.loading) - const ThinProgressIndicator(), - ], - ); - }, - ), + ), + if (state.status == PoscanObjectStateStatus.loading) + const ThinProgressIndicator(), + ], + ); + }, ), ); } - Future reloadCache(final BuildContext context) async { - final bloc = BlocProvider.of(context); - - await bloc.clear(); - await bloc.loadAll(); - } - static bool hasPutObj(final NotificationsState state) { final types = state.notifications.map((final e) => e.type).toList(); return types.contains(NotificationType.putObject); diff --git a/lib/features/wallet_screen/assets_page/widgets/objects_list/objects_list_assets.dart b/lib/features/wallet_screen/assets_page/widgets/objects_list/objects_list_assets.dart new file mode 100644 index 00000000..0b190b3d --- /dev/null +++ b/lib/features/wallet_screen/assets_page/widgets/objects_list/objects_list_assets.dart @@ -0,0 +1,18 @@ +import 'package:flutter/widgets.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:threedpass/core/polkawallet/app_service.dart'; +import 'package:threedpass/core/polkawallet/bloc/app_service_cubit.dart'; +import 'package:threedpass/features/wallet_screen/assets_page/widgets/objects_list/objects_list.dart'; + +class ObjectsListAssets extends StatelessWidget { + const ObjectsListAssets({super.key}); + + @override + Widget build(final BuildContext context) { + return BlocBuilder( + builder: (final context, final appService) => AssetsUploadedObjectsList( + appService: appService, + ), + ); + } +} diff --git a/lib/features/wallet_screen/assets_page/widgets/objects_list/objects_list_empty_refresh_widget.dart b/lib/features/wallet_screen/assets_page/widgets/objects_list/objects_list_empty_refresh_widget.dart new file mode 100644 index 00000000..4d4d9027 --- /dev/null +++ b/lib/features/wallet_screen/assets_page/widgets/objects_list/objects_list_empty_refresh_widget.dart @@ -0,0 +1,26 @@ +import 'package:flutter/widgets.dart'; +import 'package:threedpass/core/widgets/other/padding_16.dart'; +import 'package:threedpass/core/widgets/paddings.dart'; +import 'package:threedpass/core/widgets/text/d3p_body_medium_text.dart'; +import 'package:threedpass/features/wallet_screen/assets_page/widgets/objects_list/objects_list_header_full.dart'; + +class ObjectsListEmptyRefresh extends StatelessWidget { + const ObjectsListEmptyRefresh({super.key}); + + @override + Widget build(final BuildContext context) { + return const Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBoxH16(), + Padding( + padding: EdgeInsets.symmetric(horizontal: 16), + child: ObjectsListHeaderFull(), + ), + Padding16( + child: D3pBodyMediumText('no_owned_objects_found'), + ), + ], + ); + } +} diff --git a/lib/features/wallet_screen/assets_page/widgets/objects_list/objects_list_header_full.dart b/lib/features/wallet_screen/assets_page/widgets/objects_list/objects_list_header_full.dart index dcb18206..3f747d57 100644 --- a/lib/features/wallet_screen/assets_page/widgets/objects_list/objects_list_header_full.dart +++ b/lib/features/wallet_screen/assets_page/widgets/objects_list/objects_list_header_full.dart @@ -11,7 +11,7 @@ class ObjectsListHeaderFull extends StatelessWidget { Future refreshObjectsList(final BuildContext context) async { final objectsCubit = BlocProvider.of(context); - objectsCubit.clear(); + await objectsCubit.clear(); return objectsCubit.loadAll(); } diff --git a/lib/features/wallet_screen/assets_page/widgets/objects_list/objects_list_item.dart b/lib/features/wallet_screen/assets_page/widgets/objects_list/objects_list_item.dart index 17a6bb52..c99e2086 100644 --- a/lib/features/wallet_screen/assets_page/widgets/objects_list/objects_list_item.dart +++ b/lib/features/wallet_screen/assets_page/widgets/objects_list/objects_list_item.dart @@ -1,9 +1,13 @@ import 'package:auto_route/auto_route.dart'; import 'package:flutter/widgets.dart'; +import 'package:threedpass/core/utils/formatters.dart'; import 'package:threedpass/core/widgets/buttons/clickable_card.dart'; +import 'package:threedpass/core/widgets/paddings.dart'; +import 'package:threedpass/core/widgets/utc_time.dart'; import 'package:threedpass/features/poscan_objects_query/domain/entities/uploaded_object.dart'; import 'package:threedpass/features/uploaded_object_page/widgets/snapshot_connected_to_uploaded.dart'; import 'package:threedpass/features/uploaded_object_page/widgets/uploaded_object_id_text.dart'; +import 'package:threedpass/features/uploaded_object_page/widgets/uploaded_object_owner_text.dart'; import 'package:threedpass/features/uploaded_object_page/widgets/uploaded_object_status_text.dart'; import 'package:threedpass/router/router.gr.dart'; @@ -16,19 +20,27 @@ class ObjectsListItem extends StatelessWidget { Widget build(final BuildContext context) { return ClickableCard( child: Column( + crossAxisAlignment: CrossAxisAlignment.start, children: [ + UploadedObjectIdText(uploadedObject: uploadedObject), + const SizedBoxH8(), Row( // mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - UploadedObjectIdText( - uploadedObject: uploadedObject, - ), - const SizedBox(width: 16), - UploadedObjectStatusText( - uploadedObject: uploadedObject, + UploadedObjectStatusText(uploadedObject: uploadedObject), + const SizedBox(width: 8), + UTCTime( + dateTime: uploadedObject.statusDateUTC, + formatter: Fmt.shortDateFormat, ), ], ), + const SizedBoxH8(), + UploadedObjectOwnerText( + uploadedObject: uploadedObject, + short: true, + ), + const SizedBoxH8(), SnapshotConnectedToUploaded( uploadedObject: uploadedObject, topPadding: 8, diff --git a/lib/features/wallet_screen/assets_page/widgets/objects_list/objects_list_pure.dart b/lib/features/wallet_screen/assets_page/widgets/objects_list/objects_list_pure.dart new file mode 100644 index 00000000..f1687dd3 --- /dev/null +++ b/lib/features/wallet_screen/assets_page/widgets/objects_list/objects_list_pure.dart @@ -0,0 +1,25 @@ +import 'package:flutter/material.dart'; +import 'package:threedpass/features/poscan_objects_query/domain/entities/uploaded_object.dart'; +import 'package:threedpass/features/wallet_screen/assets_page/widgets/objects_list/objects_list_item.dart'; + +class ObjectsListPure extends StatelessWidget { + const ObjectsListPure({required this.objects, super.key}); + + final List objects; + + @override + Widget build(final BuildContext context) { + return ListView.builder( + physics: const NeverScrollableScrollPhysics(), + padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 0), + shrinkWrap: true, + itemCount: objects.length, + itemBuilder: (final context, final index) => Padding( + padding: const EdgeInsets.symmetric(vertical: 4), + child: ObjectsListItem( + uploadedObject: objects[index], + ), + ), + ); + } +} diff --git a/lib/features/wallet_screen/contacts_page/contacts_page.dart b/lib/features/wallet_screen/contacts_page/contacts_page.dart index d4335217..67844fdc 100644 --- a/lib/features/wallet_screen/contacts_page/contacts_page.dart +++ b/lib/features/wallet_screen/contacts_page/contacts_page.dart @@ -20,6 +20,7 @@ class ContactsPage extends StatelessWidget { }, ), floatingActionButton: FloatingActionButton( + heroTag: 'add_contact', child: const Icon(Icons.add), onPressed: () => onTapAddContact(context), ), diff --git a/lib/features/wallet_screen/non_native_token_screen/domain/usecases/assets_get_extrinsics.dart b/lib/features/wallet_screen/non_native_token_screen/domain/usecases/assets_get_extrinsics.dart index ed076aff..d195d95e 100644 --- a/lib/features/wallet_screen/non_native_token_screen/domain/usecases/assets_get_extrinsics.dart +++ b/lib/features/wallet_screen/non_native_token_screen/domain/usecases/assets_get_extrinsics.dart @@ -1,6 +1,5 @@ import 'package:super_core/super_core.dart'; import 'package:threedp_graphql/features/extrinsics/domain/extrisincs_request_params.dart'; -import 'package:threedpass/core/utils/usecase.dart'; import 'package:threedpass/features/wallet_screen/non_native_token_screen/data/repositories/assets_extrinsics_repository.dart'; import 'package:threedpass/features/wallet_screen/non_native_token_screen/domain/entities/get_extrinsics_usecase_params.dart'; import 'package:threedpass/features/wallet_screen/non_native_token_screen/domain/entities/transfer_non_native_tokens_dto.dart'; diff --git a/lib/features/wallet_screen/non_native_token_screen/domain/usecases/get_events_usecase.dart b/lib/features/wallet_screen/non_native_token_screen/domain/usecases/get_events_usecase.dart index dafc9804..77696b75 100644 --- a/lib/features/wallet_screen/non_native_token_screen/domain/usecases/get_events_usecase.dart +++ b/lib/features/wallet_screen/non_native_token_screen/domain/usecases/get_events_usecase.dart @@ -1,6 +1,5 @@ import 'package:super_core/super_core.dart'; import 'package:threedp_graphql/features/events/domain/events_request_params.dart'; -import 'package:threedpass/core/utils/usecase.dart'; import 'package:threedpass/features/wallet_screen/non_native_token_screen/data/repositories/events_repository.dart'; import 'package:threedpass/features/wallet_screen/non_native_token_screen/domain/entities/success_event_type.dart'; diff --git a/lib/features/wallet_screen/transactions_history/domain/usecases/get_transfers.dart b/lib/features/wallet_screen/transactions_history/domain/usecases/get_transfers.dart index 2678e7dd..ce9d025f 100644 --- a/lib/features/wallet_screen/transactions_history/domain/usecases/get_transfers.dart +++ b/lib/features/wallet_screen/transactions_history/domain/usecases/get_transfers.dart @@ -1,6 +1,6 @@ import 'package:super_core/super_core.dart'; import 'package:threedp_graphql/features/transfers_history/domain/entities/transfers_request_params.dart'; -import 'package:threedpass/core/utils/usecase.dart'; +import 'package:super_core/usecase.dart'; import 'package:threedpass/features/wallet_screen/transactions_history/data/repositories/transfers_repository.dart'; import 'package:threedpass/features/wallet_screen/transactions_history/domain/entities/transfers_dto.dart'; diff --git a/lib/features/wallet_screen/transfer_page/domain/usecases/transfer_usecase.dart b/lib/features/wallet_screen/transfer_page/domain/usecases/transfer_usecase.dart index 84a0ae79..a7f40971 100644 --- a/lib/features/wallet_screen/transfer_page/domain/usecases/transfer_usecase.dart +++ b/lib/features/wallet_screen/transfer_page/domain/usecases/transfer_usecase.dart @@ -4,13 +4,11 @@ import 'package:easy_localization/easy_localization.dart'; import 'package:fluttertoast/fluttertoast.dart'; import 'package:polkawallet_sdk/p3d/tx_info.dart'; import 'package:polkawallet_sdk/p3d/tx_params.dart'; -import 'package:super_core/either.dart'; -import 'package:super_core/failure.dart'; +import 'package:super_core/super_core.dart'; import 'package:threedpass/core/polkawallet/app_service.dart'; import 'package:threedpass/core/polkawallet/utils/extrinsic_status.dart'; import 'package:threedpass/core/polkawallet/utils/log.dart'; import 'package:threedpass/core/polkawallet/utils/tx_update_event_logs_handler.dart'; -import 'package:threedpass/core/utils/usecase.dart'; import 'package:threedpass/features/wallet_screen/notifications_page/bloc/notifications_bloc.dart'; import 'package:threedpass/features/wallet_screen/transfer_page/data/repositories/transaction.dart'; import 'package:threedpass/features/wallet_screen/transfer_page/domain/entities/transfer_type_enum.dart'; diff --git a/lib/features/wallet_screen/transfer_page/widgets/basic_transfer_block.dart b/lib/features/wallet_screen/transfer_page/widgets/basic_transfer_block.dart index 6b76609e..52a60e21 100644 --- a/lib/features/wallet_screen/transfer_page/widgets/basic_transfer_block.dart +++ b/lib/features/wallet_screen/transfer_page/widgets/basic_transfer_block.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:threedpass/core/widgets/buttons/icon_button.dart'; class BasicTransferBlock extends StatelessWidget { const BasicTransferBlock({ @@ -46,23 +47,11 @@ class _DismissIcon extends StatelessWidget { return Row( mainAxisAlignment: MainAxisAlignment.end, children: [ - SizedBox( - height: 24, - child: InkWell( - onTap: dismiss, - customBorder: const CircleBorder(), - child: Ink( - decoration: const BoxDecoration(shape: BoxShape.circle), - height: 24, - width: 24, - child: const Icon( - Icons.horizontal_rule_outlined, - size: 18, - ), - ), - ), + D3pIconButton( + onPressed: dismiss, + iconData: Icons.horizontal_rule_outlined, + emptyContraints: true, ), - const SizedBox(width: 8), ], ); } else { diff --git a/lib/features/wallet_screen/wallet_page/wallet_page_wrapper.dart b/lib/features/wallet_screen/wallet_page/wallet_page_wrapper.dart index 29e1e0a0..25234b78 100644 --- a/lib/features/wallet_screen/wallet_page/wallet_page_wrapper.dart +++ b/lib/features/wallet_screen/wallet_page/wallet_page_wrapper.dart @@ -2,8 +2,6 @@ import 'package:auto_route/auto_route.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:threedpass/features/preview_page/bloc/outer_context_cubit.dart'; -import 'package:threedpass/features/wallet_screen/notifications_page/bloc/notifications_bloc.dart'; -import 'package:threedpass/setup.dart'; @RoutePage() class WalletPageWrapper extends StatelessWidget implements AutoRouteWrapper { @@ -20,9 +18,6 @@ class WalletPageWrapper extends StatelessWidget implements AutoRouteWrapper { create: (final _) => OuterContextCubit(context), lazy: false, ), - BlocProvider( - create: (_) => getIt(), - ), ], child: this, ); diff --git a/lib/features/wallet_screen/wallet_page_route.dart b/lib/features/wallet_screen/wallet_page_route.dart index 155af555..d00285b5 100644 --- a/lib/features/wallet_screen/wallet_page_route.dart +++ b/lib/features/wallet_screen/wallet_page_route.dart @@ -44,8 +44,5 @@ AutoRoute walletPageRoute = AutoRoute( page: RemoveAccountRoute.page, customRouteBuilder: dialogBuilder, ), - AutoRoute( - page: UploadedObjectRoute.page, - ), ], ); diff --git a/lib/features/wallet_screen/widgets/block_datetime_w.dart b/lib/features/wallet_screen/widgets/block_datetime_w.dart index 017fbfb3..601a8f44 100644 --- a/lib/features/wallet_screen/widgets/block_datetime_w.dart +++ b/lib/features/wallet_screen/widgets/block_datetime_w.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; -import 'package:intl/intl.dart'; -import 'package:threedpass/core/widgets/text/d3p_body_medium_text.dart'; +import 'package:threedpass/core/utils/formatters.dart'; +import 'package:threedpass/core/widgets/utc_time.dart'; class BlockDateTimeW extends StatelessWidget { const BlockDateTimeW(this.dateTime, {super.key}); @@ -10,10 +10,9 @@ class BlockDateTimeW extends StatelessWidget { Widget build(final BuildContext context) { // final dt = DateTime.parse(dateTime.value); if (dateTime != null) { - final fmt = DateFormat('kk:mm – dd-MM-yyyy').format(dateTime!); - return D3pBodyMediumText( - fmt, - translate: false, + return UTCTime( + dateTime: dateTime!, + formatter: Fmt.transferDateFormat, ); } else { return const SizedBox(); diff --git a/lib/router/router.dart b/lib/router/router.dart index 0f33bf7b..3536d994 100644 --- a/lib/router/router.dart +++ b/lib/router/router.dart @@ -6,7 +6,6 @@ import 'package:threedpass/core/widgets/error_page.dart'; import 'package:threedpass/features/accounts/router/create_account_page_route.dart'; import 'package:threedpass/features/home_page/router/home_page_route.dart'; import 'package:threedpass/features/preview_page/router/preview_page_route.dart'; -import 'package:threedpass/features/scan_page/router/calc_hash_loading_widget_route.dart'; import 'package:threedpass/router/router.gr.dart'; // part 'router.gr.dart'; @@ -26,8 +25,10 @@ class RootRouter extends $RootRouter { errorPageRoute, // Create account route createAccountPageRoute, - // Loader for scan page - calcHashLoadingWidgetRoute, + // Uploaded objecy page + AutoRoute( + page: UploadedObjectRoute.page, + ), // Default loader defaultLoadingDialog, ]; diff --git a/lib/router/router.gr.dart b/lib/router/router.gr.dart index 98e837dd..8f6fc3dd 100644 --- a/lib/router/router.gr.dart +++ b/lib/router/router.gr.dart @@ -8,51 +8,55 @@ // coverage:ignore-file // ignore_for_file: no_leading_underscores_for_library_prefixes -import 'package:auto_route/auto_route.dart' as _i51; -import 'package:flutter/material.dart' as _i52; -import 'package:flutter/widgets.dart' as _i58; +import 'package:auto_route/auto_route.dart' as _i52; +import 'package:flutter/material.dart' as _i53; +import 'package:flutter/widgets.dart' as _i59; import 'package:threedpass/core/widgets/default_loading_dialog.dart' as _i2; import 'package:threedpass/core/widgets/error_page.dart' as _i1; import 'package:threedpass/features/accounts/presentation/pages/create_account/create_account_credentials.dart' - as _i37; + as _i36; import 'package:threedpass/features/accounts/presentation/pages/create_account/create_account_from_object/create_account_from_object.dart' - as _i32; + as _i31; import 'package:threedpass/features/accounts/presentation/pages/create_account/create_account_info_page.dart' - as _i34; + as _i33; import 'package:threedpass/features/accounts/presentation/pages/create_account/create_account_loader.dart' - as _i39; + as _i38; import 'package:threedpass/features/accounts/presentation/pages/create_account/create_account_mnemonic_backup.dart' - as _i35; + as _i34; import 'package:threedpass/features/accounts/presentation/pages/create_account/create_account_mnemonic_confirm.dart' - as _i36; + as _i35; import 'package:threedpass/features/accounts/presentation/pages/create_account/create_account_type.dart' - as _i38; + as _i37; import 'package:threedpass/features/accounts/presentation/pages/create_account/create_account_wrapper.dart' - as _i31; + as _i30; import 'package:threedpass/features/accounts/presentation/pages/create_account/import_mnemonic_form.dart' - as _i33; + as _i32; import 'package:threedpass/features/accounts/presentation/pages/create_account/import_rawseed_form.dart' - as _i30; + as _i29; import 'package:threedpass/features/accounts/presentation/pages/no_stable_hash_dialog.dart' - as _i40; + as _i39; import 'package:threedpass/features/compare_page/presentation/pages/compare_page_wrapper.dart' as _i3; +import 'package:threedpass/features/explorer_page/explorer_page_wrapper.dart' + as _i51; +import 'package:threedpass/features/explorer_page/objects_list_page/objects_list_page.dart' + as _i50; import 'package:threedpass/features/hashes_list/domain/entities/hash_object.dart' - as _i54; + as _i55; import 'package:threedpass/features/hashes_list/domain/entities/snapshot.dart' - as _i53; + as _i54; import 'package:threedpass/features/home_page/presentation/home_page.dart' - as _i14; -import 'package:threedpass/features/home_page/presentation/login_page.dart' as _i13; +import 'package:threedpass/features/home_page/presentation/login_page.dart' + as _i12; import 'package:threedpass/features/home_page/router/empty_initial_route.dart' - as _i15; + as _i14; import 'package:threedpass/features/poscan_objects_query/domain/entities/uploaded_object.dart' - as _i59; + as _i60; import 'package:threedpass/features/poscan_putobject/presentation/d3prpc_page.dart' - as _i16; + as _i15; import 'package:threedpass/features/poscan_putobject/presentation/d3rpc_page_wrapper.dart' - as _i17; + as _i16; import 'package:threedpass/features/preview_page/presentation/preview_page.dart' as _i5; import 'package:threedpass/features/preview_page/presentation/preview_page_wrapper.dart' @@ -69,69 +73,67 @@ import 'package:threedpass/features/scan_page/presentation/pages/scan_page.dart' as _i11; import 'package:threedpass/features/scan_page/presentation/pages/scan_page_wrapper.dart' as _i10; -import 'package:threedpass/features/scan_page/presentation/widgets/calc_hash_loading_dialog.dart' - as _i12; import 'package:threedpass/features/settings_page/domain/entities/global_settings.dart' - as _i60; + as _i61; import 'package:threedpass/features/settings_page/presentation/settings_page.dart' - as _i42; + as _i41; import 'package:threedpass/features/settings_page/presentation/settings_sub_page/choose_algorithm_subpage.dart' - as _i48; + as _i47; import 'package:threedpass/features/settings_page/presentation/settings_sub_page/grid_size_subpage.dart' - as _i45; + as _i44; import 'package:threedpass/features/settings_page/presentation/settings_sub_page/pixel_ratio_subpage.dart' - as _i46; + as _i45; import 'package:threedpass/features/settings_page/presentation/settings_sub_page/sections_subpage.dart' - as _i43; + as _i42; import 'package:threedpass/features/settings_page/presentation/settings_sub_page/stable_hash_subpage.dart' - as _i49; + as _i48; import 'package:threedpass/features/settings_page/presentation/settings_sub_page/trans_bytes_subpage.dart' - as _i44; + as _i43; import 'package:threedpass/features/settings_page/presentation/settings_sub_page/wallet_node_subpage.dart' - as _i47; + as _i46; import 'package:threedpass/features/settings_page/router/empty_settings_route.dart' - as _i50; + as _i49; import 'package:threedpass/features/uploaded_object_page/uploaded_object_page.dart' - as _i41; + as _i40; import 'package:threedpass/features/wallet_screen/add_contact_page/add_contact_page.dart' - as _i23; + as _i22; import 'package:threedpass/features/wallet_screen/add_contact_page/domain/entities/contact.dart' - as _i55; + as _i56; import 'package:threedpass/features/wallet_screen/assets_page/remove_account_dialog.dart' - as _i20; + as _i19; import 'package:threedpass/features/wallet_screen/contacts_page/contacts_page.dart' - as _i18; + as _i17; import 'package:threedpass/features/wallet_screen/contacts_page/widgets/delete_contact_dialog.dart' - as _i19; + as _i18; import 'package:threedpass/features/wallet_screen/non_native_token_screen/domain/entities/get_extrinsics_usecase_params.dart' - as _i57; + as _i58; import 'package:threedpass/features/wallet_screen/non_native_token_screen/presentation/non_native_token_wrapper.dart' - as _i28; + as _i27; import 'package:threedpass/features/wallet_screen/notifications_page/presentation/notifications_page.dart' - as _i22; -import 'package:threedpass/features/wallet_screen/recieve_page/recieve_page.dart' as _i21; +import 'package:threedpass/features/wallet_screen/recieve_page/recieve_page.dart' + as _i20; import 'package:threedpass/features/wallet_screen/transactions_history/presentation/transactions_history_wrapper.dart' - as _i29; + as _i28; import 'package:threedpass/features/wallet_screen/transfer_page/domain/entities/transfer_meta_dto.dart' - as _i56; + as _i57; import 'package:threedpass/features/wallet_screen/transfer_page/transfer_page.dart' - as _i27; -import 'package:threedpass/features/wallet_screen/transfer_page/transfer_page_wrapper.dart' as _i26; +import 'package:threedpass/features/wallet_screen/transfer_page/transfer_page_wrapper.dart' + as _i25; import 'package:threedpass/features/wallet_screen/wallet_page/wallet_page.dart' - as _i24; + as _i23; import 'package:threedpass/features/wallet_screen/wallet_page/wallet_page_wrapper.dart' - as _i25; + as _i24; -abstract class $RootRouter extends _i51.RootStackRouter { +abstract class $RootRouter extends _i52.RootStackRouter { $RootRouter({super.navigatorKey}); @override - final Map pagesMap = { + final Map pagesMap = { ErrorRoute.name: (routeData) { final args = routeData.argsAs(); - return _i51.AutoRoutePage( + return _i52.AutoRoutePage( routeData: routeData, child: _i1.ErrorPage( error: args.error, @@ -142,7 +144,7 @@ abstract class $RootRouter extends _i51.RootStackRouter { DefaultLoadingRoute.name: (routeData) { final args = routeData.argsAs( orElse: () => const DefaultLoadingRouteArgs()); - return _i51.AutoRoutePage( + return _i52.AutoRoutePage( routeData: routeData, child: _i2.DefaultLoadingDialog( key: args.key, @@ -152,7 +154,7 @@ abstract class $RootRouter extends _i51.RootStackRouter { }, CompareRouteWrapper.name: (routeData) { final args = routeData.argsAs(); - return _i51.AutoRoutePage( + return _i52.AutoRoutePage( routeData: routeData, child: _i3.ComparePageWrapper( origObj: args.origObj, @@ -163,9 +165,9 @@ abstract class $RootRouter extends _i51.RootStackRouter { }, PreviewRouteWrapper.name: (routeData) { final args = routeData.argsAs(); - return _i51.AutoRoutePage( + return _i52.AutoRoutePage( routeData: routeData, - child: _i51.WrappedRoute( + child: _i52.WrappedRoute( child: _i4.PreviewPageWrapper( hashObject: args.hashObject, snapshot: args.snapshot, @@ -175,14 +177,14 @@ abstract class $RootRouter extends _i51.RootStackRouter { ); }, PreviewRoute.name: (routeData) { - return _i51.AutoRoutePage( + return _i52.AutoRoutePage( routeData: routeData, child: const _i5.PreviewPage(), ); }, RenameSnapshotRoute.name: (routeData) { final args = routeData.argsAs(); - return _i51.AutoRoutePage( + return _i52.AutoRoutePage( routeData: routeData, child: _i6.RenameSnapshotDialog( snapshot: args.snapshot, @@ -193,7 +195,7 @@ abstract class $RootRouter extends _i51.RootStackRouter { }, SaveHashRoute.name: (routeData) { final args = routeData.argsAs(); - return _i51.AutoRoutePage( + return _i52.AutoRoutePage( routeData: routeData, child: _i7.SaveHashDialog( snapshot: args.snapshot, @@ -203,14 +205,14 @@ abstract class $RootRouter extends _i51.RootStackRouter { ); }, DeleteSnapshotRoute.name: (routeData) { - return _i51.AutoRoutePage( + return _i52.AutoRoutePage( routeData: routeData, child: const _i8.DeleteSnapshotDialog(), ); }, SaveObjectRoute.name: (routeData) { final args = routeData.argsAs(); - return _i51.AutoRoutePage( + return _i52.AutoRoutePage( routeData: routeData, child: _i9.SaveObjectDialog( snapshot: args.snapshot, @@ -219,118 +221,112 @@ abstract class $RootRouter extends _i51.RootStackRouter { ); }, ScanRouteWrapper.name: (routeData) { - return _i51.AutoRoutePage( + return _i52.AutoRoutePage( routeData: routeData, - child: _i51.WrappedRoute(child: const _i10.ScanPageWrapper()), + child: _i52.WrappedRoute(child: const _i10.ScanPageWrapper()), ); }, ScanRoute.name: (routeData) { - return _i51.AutoRoutePage( + return _i52.AutoRoutePage( routeData: routeData, child: const _i11.ScanPage(), ); }, - CalcHashLoadingRoute.name: (routeData) { - return _i51.AutoRoutePage( - routeData: routeData, - child: const _i12.CalcHashLoadingDialog(), - ); - }, LoginRoute.name: (routeData) { final args = routeData.argsAs( orElse: () => const LoginRouteArgs()); - return _i51.AutoRoutePage( + return _i52.AutoRoutePage( routeData: routeData, - child: _i13.LoginPage( + child: _i12.LoginPage( key: args.key, onLoginResult: args.onLoginResult, ), ); }, HomeRoute.name: (routeData) { - return _i51.AutoRoutePage( + return _i52.AutoRoutePage( routeData: routeData, - child: const _i14.HomePage(), + child: const _i13.HomePage(), ); }, InitialWrapperRoute.name: (routeData) { - return _i51.AutoRoutePage( + return _i52.AutoRoutePage( routeData: routeData, - child: const _i15.EmptyInitialRoute(), + child: const _i14.EmptyInitialRoute(), ); }, D3PRPCRoute.name: (routeData) { - return _i51.AutoRoutePage( + return _i52.AutoRoutePage( routeData: routeData, - child: const _i16.D3PRPCPage(), + child: const _i15.D3PRPCPage(), ); }, D3PRPCRouteWrapper.name: (routeData) { - return _i51.AutoRoutePage( + return _i52.AutoRoutePage( routeData: routeData, - child: _i51.WrappedRoute(child: const _i17.D3PRPCPageWrapper()), + child: _i52.WrappedRoute(child: const _i16.D3PRPCPageWrapper()), ); }, ContactsRoute.name: (routeData) { - return _i51.AutoRoutePage( + return _i52.AutoRoutePage( routeData: routeData, - child: const _i18.ContactsPage(), + child: const _i17.ContactsPage(), ); }, DeleteContactRoute.name: (routeData) { final args = routeData.argsAs(); - return _i51.AutoRoutePage( + return _i52.AutoRoutePage( routeData: routeData, - child: _i19.DeleteContactDialog( + child: _i18.DeleteContactDialog( contact: args.contact, key: args.key, ), ); }, RemoveAccountRoute.name: (routeData) { - return _i51.AutoRoutePage( + return _i52.AutoRoutePage( routeData: routeData, - child: const _i20.RemoveAccountDialog(), + child: const _i19.RemoveAccountDialog(), ); }, RecieveRoute.name: (routeData) { - return _i51.AutoRoutePage( + return _i52.AutoRoutePage( routeData: routeData, - child: const _i21.RecievePage(), + child: const _i20.RecievePage(), ); }, NotificationsRoute.name: (routeData) { - return _i51.AutoRoutePage( + return _i52.AutoRoutePage( routeData: routeData, - child: const _i22.NotificationsPage(), + child: const _i21.NotificationsPage(), ); }, AddContactRoute.name: (routeData) { final args = routeData.argsAs( orElse: () => const AddContactRouteArgs()); - return _i51.AutoRoutePage( + return _i52.AutoRoutePage( routeData: routeData, - child: _i23.AddContactPage(key: args.key), + child: _i22.AddContactPage(key: args.key), ); }, WalletRoute.name: (routeData) { - return _i51.AutoRoutePage( + return _i52.AutoRoutePage( routeData: routeData, - child: const _i24.WalletPage(), + child: const _i23.WalletPage(), ); }, WalletRouteWrapper.name: (routeData) { - return _i51.AutoRoutePage( + return _i52.AutoRoutePage( routeData: routeData, - child: _i51.WrappedRoute(child: const _i25.WalletPageWrapper()), + child: _i52.WrappedRoute(child: const _i24.WalletPageWrapper()), ); }, TransferRouteWrapper.name: (routeData) { final args = routeData.argsAs(); - return _i51.AutoRoutePage( + return _i52.AutoRoutePage( routeData: routeData, - child: _i51.WrappedRoute( - child: _i26.TransferPageWrapper( + child: _i52.WrappedRoute( + child: _i25.TransferPageWrapper( metadata: args.metadata, key: args.key, )), @@ -339,122 +335,122 @@ abstract class $RootRouter extends _i51.RootStackRouter { TransferRoute.name: (routeData) { final args = routeData.argsAs( orElse: () => const TransferRouteArgs()); - return _i51.AutoRoutePage( + return _i52.AutoRoutePage( routeData: routeData, - child: _i27.TransferPage(key: args.key), + child: _i26.TransferPage(key: args.key), ); }, NonNativeTokenRouteWrapper.name: (routeData) { final args = routeData.argsAs(); - return _i51.AutoRoutePage( + return _i52.AutoRoutePage( routeData: routeData, - child: _i28.NonNativeTokenPageWrapper( + child: _i27.NonNativeTokenPageWrapper( args.params, key: args.key, ), ); }, TransactionsHistoryRouteWrapper.name: (routeData) { - return _i51.AutoRoutePage( + return _i52.AutoRoutePage( routeData: routeData, - child: const _i29.TransactionsHistoryPageWrapper(), + child: const _i28.TransactionsHistoryPageWrapper(), ); }, ImportRawseedFormRoute.name: (routeData) { final args = routeData.argsAs( orElse: () => const ImportRawseedFormRouteArgs()); - return _i51.AutoRoutePage( + return _i52.AutoRoutePage( routeData: routeData, - child: _i30.ImportRawseedFormPage(key: args.key), + child: _i29.ImportRawseedFormPage(key: args.key), ); }, CreateAccountRouteWrapper.name: (routeData) { - return _i51.AutoRoutePage( + return _i52.AutoRoutePage( routeData: routeData, - child: _i51.WrappedRoute(child: const _i31.CreateAccountPageWrapper()), + child: _i52.WrappedRoute(child: const _i30.CreateAccountPageWrapper()), ); }, CreateAccountFromObjectRoute.name: (routeData) { - return _i51.AutoRoutePage( + return _i52.AutoRoutePage( routeData: routeData, - child: const _i32.CreateAccountFromObjectPage(), + child: const _i31.CreateAccountFromObjectPage(), ); }, ImportMnemonicFormRoute.name: (routeData) { final args = routeData.argsAs( orElse: () => const ImportMnemonicFormRouteArgs()); - return _i51.AutoRoutePage( + return _i52.AutoRoutePage( routeData: routeData, - child: _i33.ImportMnemonicFormPage(key: args.key), + child: _i32.ImportMnemonicFormPage(key: args.key), ); }, CreateAccountInfoRoute.name: (routeData) { - return _i51.AutoRoutePage( + return _i52.AutoRoutePage( routeData: routeData, - child: const _i34.CreateAccountInfoPage(), + child: const _i33.CreateAccountInfoPage(), ); }, CreateAccountMnemonicBackupRoute.name: (routeData) { - return _i51.AutoRoutePage( + return _i52.AutoRoutePage( routeData: routeData, - child: const _i35.CreateAccountMnemonicBackupPage(), + child: const _i34.CreateAccountMnemonicBackupPage(), ); }, CreateAccountMnemonicConfirmRoute.name: (routeData) { - return _i51.AutoRoutePage( + return _i52.AutoRoutePage( routeData: routeData, - child: const _i36.CreateAccountMnemonicConfirmPage(), + child: const _i35.CreateAccountMnemonicConfirmPage(), ); }, CreateAccountCredentialsRoute.name: (routeData) { final args = routeData.argsAs(); - return _i51.AutoRoutePage( + return _i52.AutoRoutePage( routeData: routeData, - child: _i37.CreateAccountCredentialsPage( + child: _i36.CreateAccountCredentialsPage( appbarText: args.appbarText, key: args.key, ), ); }, CreateAccountTypeRoute.name: (routeData) { - return _i51.AutoRoutePage( + return _i52.AutoRoutePage( routeData: routeData, - child: const _i38.CreateAccountTypePage(), + child: const _i37.CreateAccountTypePage(), ); }, CreateAccountLoaderRoute.name: (routeData) { - return _i51.AutoRoutePage( + return _i52.AutoRoutePage( routeData: routeData, - child: const _i39.CreateAccountLoaderPage(), + child: const _i38.CreateAccountLoaderPage(), ); }, NoStableHashRoute.name: (routeData) { - return _i51.AutoRoutePage( + return _i52.AutoRoutePage( routeData: routeData, - child: const _i40.NoStableHashDialog(), + child: const _i39.NoStableHashDialog(), ); }, UploadedObjectRoute.name: (routeData) { final args = routeData.argsAs(); - return _i51.AutoRoutePage( + return _i52.AutoRoutePage( routeData: routeData, - child: _i41.UploadedObjectPage( + child: _i40.UploadedObjectPage( uploadedObject: args.uploadedObject, key: args.key, ), ); }, SettingsRoute.name: (routeData) { - return _i51.AutoRoutePage( + return _i52.AutoRoutePage( routeData: routeData, - child: const _i42.SettingsPage(), + child: const _i41.SettingsPage(), ); }, SectionsSubRoute.name: (routeData) { final args = routeData.argsAs(); - return _i51.AutoRoutePage( + return _i52.AutoRoutePage( routeData: routeData, - child: _i43.SectionsSubPage( + child: _i42.SectionsSubPage( initialState: args.initialState, key: args.key, ), @@ -462,56 +458,68 @@ abstract class $RootRouter extends _i51.RootStackRouter { }, TransBytesSubRoute.name: (routeData) { final args = routeData.argsAs(); - return _i51.AutoRoutePage( + return _i52.AutoRoutePage( routeData: routeData, - child: _i44.TransBytesSubPage( + child: _i43.TransBytesSubPage( initialState: args.initialState, key: args.key, ), ); }, GridSizeSubRoute.name: (routeData) { - return _i51.AutoRoutePage( + return _i52.AutoRoutePage( routeData: routeData, - child: const _i45.GridSizeSubPage(), + child: const _i44.GridSizeSubPage(), ); }, PixelRatioSubRoute.name: (routeData) { - return _i51.AutoRoutePage( + return _i52.AutoRoutePage( routeData: routeData, - child: const _i46.PixelRatioSubPage(), + child: const _i45.PixelRatioSubPage(), ); }, WalletNodeSubRoute.name: (routeData) { final args = routeData.argsAs(); - return _i51.AutoRoutePage( + return _i52.AutoRoutePage( routeData: routeData, - child: _i47.WalletNodeSubPage( + child: _i46.WalletNodeSubPage( initialState: args.initialState, key: args.key, ), ); }, ChooseAlgorithmSubRoute.name: (routeData) { - return _i51.AutoRoutePage( + return _i52.AutoRoutePage( routeData: routeData, - child: const _i48.ChooseAlgorithmSubPage(), + child: const _i47.ChooseAlgorithmSubPage(), ); }, StableHashSubRoute.name: (routeData) { final args = routeData.argsAs(); - return _i51.AutoRoutePage( + return _i52.AutoRoutePage( routeData: routeData, - child: _i49.StableHashSubPage( + child: _i48.StableHashSubPage( initialState: args.initialState, key: args.key, ), ); }, SettingsWrapperRoute.name: (routeData) { - return _i51.AutoRoutePage( + return _i52.AutoRoutePage( routeData: routeData, - child: const _i50.EmptySettingsRoute(), + child: const _i49.EmptySettingsRoute(), + ); + }, + ObjectsListRoute.name: (routeData) { + return _i52.AutoRoutePage( + routeData: routeData, + child: const _i50.ObjectsListPage(), + ); + }, + ExplorerRouteWrapper.name: (routeData) { + return _i52.AutoRoutePage( + routeData: routeData, + child: _i52.WrappedRoute(child: const _i51.ExplorerPageWrapper()), ); }, }; @@ -519,11 +527,11 @@ abstract class $RootRouter extends _i51.RootStackRouter { /// generated route for /// [_i1.ErrorPage] -class ErrorRoute extends _i51.PageRouteInfo { +class ErrorRoute extends _i52.PageRouteInfo { ErrorRoute({ required Object error, - _i52.Key? key, - List<_i51.PageRouteInfo>? children, + _i53.Key? key, + List<_i52.PageRouteInfo>? children, }) : super( ErrorRoute.name, args: ErrorRouteArgs( @@ -535,8 +543,8 @@ class ErrorRoute extends _i51.PageRouteInfo { static const String name = 'ErrorRoute'; - static const _i51.PageInfo page = - _i51.PageInfo(name); + static const _i52.PageInfo page = + _i52.PageInfo(name); } class ErrorRouteArgs { @@ -547,7 +555,7 @@ class ErrorRouteArgs { final Object error; - final _i52.Key? key; + final _i53.Key? key; @override String toString() { @@ -557,11 +565,11 @@ class ErrorRouteArgs { /// generated route for /// [_i2.DefaultLoadingDialog] -class DefaultLoadingRoute extends _i51.PageRouteInfo { +class DefaultLoadingRoute extends _i52.PageRouteInfo { DefaultLoadingRoute({ - _i52.Key? key, + _i53.Key? key, String? text, - List<_i51.PageRouteInfo>? children, + List<_i52.PageRouteInfo>? children, }) : super( DefaultLoadingRoute.name, args: DefaultLoadingRouteArgs( @@ -573,8 +581,8 @@ class DefaultLoadingRoute extends _i51.PageRouteInfo { static const String name = 'DefaultLoadingRoute'; - static const _i51.PageInfo page = - _i51.PageInfo(name); + static const _i52.PageInfo page = + _i52.PageInfo(name); } class DefaultLoadingRouteArgs { @@ -583,7 +591,7 @@ class DefaultLoadingRouteArgs { this.text, }); - final _i52.Key? key; + final _i53.Key? key; final String? text; @@ -595,12 +603,12 @@ class DefaultLoadingRouteArgs { /// generated route for /// [_i3.ComparePageWrapper] -class CompareRouteWrapper extends _i51.PageRouteInfo { +class CompareRouteWrapper extends _i52.PageRouteInfo { CompareRouteWrapper({ - required _i53.Snapshot origObj, - required _i54.HashObject hashObject, - _i52.Key? key, - List<_i51.PageRouteInfo>? children, + required _i54.Snapshot origObj, + required _i55.HashObject hashObject, + _i53.Key? key, + List<_i52.PageRouteInfo>? children, }) : super( CompareRouteWrapper.name, args: CompareRouteWrapperArgs( @@ -613,8 +621,8 @@ class CompareRouteWrapper extends _i51.PageRouteInfo { static const String name = 'CompareRouteWrapper'; - static const _i51.PageInfo page = - _i51.PageInfo(name); + static const _i52.PageInfo page = + _i52.PageInfo(name); } class CompareRouteWrapperArgs { @@ -624,11 +632,11 @@ class CompareRouteWrapperArgs { this.key, }); - final _i53.Snapshot origObj; + final _i54.Snapshot origObj; - final _i54.HashObject hashObject; + final _i55.HashObject hashObject; - final _i52.Key? key; + final _i53.Key? key; @override String toString() { @@ -638,13 +646,13 @@ class CompareRouteWrapperArgs { /// generated route for /// [_i4.PreviewPageWrapper] -class PreviewRouteWrapper extends _i51.PageRouteInfo { +class PreviewRouteWrapper extends _i52.PageRouteInfo { PreviewRouteWrapper({ - required _i54.HashObject? hashObject, - required _i53.Snapshot snapshot, - _i52.Key? key, + required _i55.HashObject? hashObject, + required _i54.Snapshot snapshot, + _i53.Key? key, bool createNewAnyway = false, - List<_i51.PageRouteInfo>? children, + List<_i52.PageRouteInfo>? children, }) : super( PreviewRouteWrapper.name, args: PreviewRouteWrapperArgs( @@ -658,8 +666,8 @@ class PreviewRouteWrapper extends _i51.PageRouteInfo { static const String name = 'PreviewRouteWrapper'; - static const _i51.PageInfo page = - _i51.PageInfo(name); + static const _i52.PageInfo page = + _i52.PageInfo(name); } class PreviewRouteWrapperArgs { @@ -670,11 +678,11 @@ class PreviewRouteWrapperArgs { this.createNewAnyway = false, }); - final _i54.HashObject? hashObject; + final _i55.HashObject? hashObject; - final _i53.Snapshot snapshot; + final _i54.Snapshot snapshot; - final _i52.Key? key; + final _i53.Key? key; final bool createNewAnyway; @@ -686,8 +694,8 @@ class PreviewRouteWrapperArgs { /// generated route for /// [_i5.PreviewPage] -class PreviewRoute extends _i51.PageRouteInfo { - const PreviewRoute({List<_i51.PageRouteInfo>? children}) +class PreviewRoute extends _i52.PageRouteInfo { + const PreviewRoute({List<_i52.PageRouteInfo>? children}) : super( PreviewRoute.name, initialChildren: children, @@ -695,17 +703,17 @@ class PreviewRoute extends _i51.PageRouteInfo { static const String name = 'PreviewRoute'; - static const _i51.PageInfo page = _i51.PageInfo(name); + static const _i52.PageInfo page = _i52.PageInfo(name); } /// generated route for /// [_i6.RenameSnapshotDialog] -class RenameSnapshotRoute extends _i51.PageRouteInfo { +class RenameSnapshotRoute extends _i52.PageRouteInfo { RenameSnapshotRoute({ - required _i53.Snapshot snapshot, - required _i54.HashObject hashObject, - _i52.Key? key, - List<_i51.PageRouteInfo>? children, + required _i54.Snapshot snapshot, + required _i55.HashObject hashObject, + _i53.Key? key, + List<_i52.PageRouteInfo>? children, }) : super( RenameSnapshotRoute.name, args: RenameSnapshotRouteArgs( @@ -718,8 +726,8 @@ class RenameSnapshotRoute extends _i51.PageRouteInfo { static const String name = 'RenameSnapshotRoute'; - static const _i51.PageInfo page = - _i51.PageInfo(name); + static const _i52.PageInfo page = + _i52.PageInfo(name); } class RenameSnapshotRouteArgs { @@ -729,11 +737,11 @@ class RenameSnapshotRouteArgs { this.key, }); - final _i53.Snapshot snapshot; + final _i54.Snapshot snapshot; - final _i54.HashObject hashObject; + final _i55.HashObject hashObject; - final _i52.Key? key; + final _i53.Key? key; @override String toString() { @@ -743,12 +751,12 @@ class RenameSnapshotRouteArgs { /// generated route for /// [_i7.SaveHashDialog] -class SaveHashRoute extends _i51.PageRouteInfo { +class SaveHashRoute extends _i52.PageRouteInfo { SaveHashRoute({ - required _i53.Snapshot snapshot, - required _i54.HashObject hashObject, - _i52.Key? key, - List<_i51.PageRouteInfo>? children, + required _i54.Snapshot snapshot, + required _i55.HashObject hashObject, + _i53.Key? key, + List<_i52.PageRouteInfo>? children, }) : super( SaveHashRoute.name, args: SaveHashRouteArgs( @@ -761,8 +769,8 @@ class SaveHashRoute extends _i51.PageRouteInfo { static const String name = 'SaveHashRoute'; - static const _i51.PageInfo page = - _i51.PageInfo(name); + static const _i52.PageInfo page = + _i52.PageInfo(name); } class SaveHashRouteArgs { @@ -772,11 +780,11 @@ class SaveHashRouteArgs { this.key, }); - final _i53.Snapshot snapshot; + final _i54.Snapshot snapshot; - final _i54.HashObject hashObject; + final _i55.HashObject hashObject; - final _i52.Key? key; + final _i53.Key? key; @override String toString() { @@ -786,8 +794,8 @@ class SaveHashRouteArgs { /// generated route for /// [_i8.DeleteSnapshotDialog] -class DeleteSnapshotRoute extends _i51.PageRouteInfo { - const DeleteSnapshotRoute({List<_i51.PageRouteInfo>? children}) +class DeleteSnapshotRoute extends _i52.PageRouteInfo { + const DeleteSnapshotRoute({List<_i52.PageRouteInfo>? children}) : super( DeleteSnapshotRoute.name, initialChildren: children, @@ -795,16 +803,16 @@ class DeleteSnapshotRoute extends _i51.PageRouteInfo { static const String name = 'DeleteSnapshotRoute'; - static const _i51.PageInfo page = _i51.PageInfo(name); + static const _i52.PageInfo page = _i52.PageInfo(name); } /// generated route for /// [_i9.SaveObjectDialog] -class SaveObjectRoute extends _i51.PageRouteInfo { +class SaveObjectRoute extends _i52.PageRouteInfo { SaveObjectRoute({ - required _i53.Snapshot snapshot, - _i52.Key? key, - List<_i51.PageRouteInfo>? children, + required _i54.Snapshot snapshot, + _i53.Key? key, + List<_i52.PageRouteInfo>? children, }) : super( SaveObjectRoute.name, args: SaveObjectRouteArgs( @@ -816,8 +824,8 @@ class SaveObjectRoute extends _i51.PageRouteInfo { static const String name = 'SaveObjectRoute'; - static const _i51.PageInfo page = - _i51.PageInfo(name); + static const _i52.PageInfo page = + _i52.PageInfo(name); } class SaveObjectRouteArgs { @@ -826,9 +834,9 @@ class SaveObjectRouteArgs { this.key, }); - final _i53.Snapshot snapshot; + final _i54.Snapshot snapshot; - final _i52.Key? key; + final _i53.Key? key; @override String toString() { @@ -838,8 +846,8 @@ class SaveObjectRouteArgs { /// generated route for /// [_i10.ScanPageWrapper] -class ScanRouteWrapper extends _i51.PageRouteInfo { - const ScanRouteWrapper({List<_i51.PageRouteInfo>? children}) +class ScanRouteWrapper extends _i52.PageRouteInfo { + const ScanRouteWrapper({List<_i52.PageRouteInfo>? children}) : super( ScanRouteWrapper.name, initialChildren: children, @@ -847,13 +855,13 @@ class ScanRouteWrapper extends _i51.PageRouteInfo { static const String name = 'ScanRouteWrapper'; - static const _i51.PageInfo page = _i51.PageInfo(name); + static const _i52.PageInfo page = _i52.PageInfo(name); } /// generated route for /// [_i11.ScanPage] -class ScanRoute extends _i51.PageRouteInfo { - const ScanRoute({List<_i51.PageRouteInfo>? children}) +class ScanRoute extends _i52.PageRouteInfo { + const ScanRoute({List<_i52.PageRouteInfo>? children}) : super( ScanRoute.name, initialChildren: children, @@ -861,30 +869,16 @@ class ScanRoute extends _i51.PageRouteInfo { static const String name = 'ScanRoute'; - static const _i51.PageInfo page = _i51.PageInfo(name); + static const _i52.PageInfo page = _i52.PageInfo(name); } /// generated route for -/// [_i12.CalcHashLoadingDialog] -class CalcHashLoadingRoute extends _i51.PageRouteInfo { - const CalcHashLoadingRoute({List<_i51.PageRouteInfo>? children}) - : super( - CalcHashLoadingRoute.name, - initialChildren: children, - ); - - static const String name = 'CalcHashLoadingRoute'; - - static const _i51.PageInfo page = _i51.PageInfo(name); -} - -/// generated route for -/// [_i13.LoginPage] -class LoginRoute extends _i51.PageRouteInfo { +/// [_i12.LoginPage] +class LoginRoute extends _i52.PageRouteInfo { LoginRoute({ - _i52.Key? key, + _i53.Key? key, void Function(bool)? onLoginResult, - List<_i51.PageRouteInfo>? children, + List<_i52.PageRouteInfo>? children, }) : super( LoginRoute.name, args: LoginRouteArgs( @@ -896,8 +890,8 @@ class LoginRoute extends _i51.PageRouteInfo { static const String name = 'LoginRoute'; - static const _i51.PageInfo page = - _i51.PageInfo(name); + static const _i52.PageInfo page = + _i52.PageInfo(name); } class LoginRouteArgs { @@ -906,7 +900,7 @@ class LoginRouteArgs { this.onLoginResult, }); - final _i52.Key? key; + final _i53.Key? key; final void Function(bool)? onLoginResult; @@ -917,9 +911,9 @@ class LoginRouteArgs { } /// generated route for -/// [_i14.HomePage] -class HomeRoute extends _i51.PageRouteInfo { - const HomeRoute({List<_i51.PageRouteInfo>? children}) +/// [_i13.HomePage] +class HomeRoute extends _i52.PageRouteInfo { + const HomeRoute({List<_i52.PageRouteInfo>? children}) : super( HomeRoute.name, initialChildren: children, @@ -927,13 +921,13 @@ class HomeRoute extends _i51.PageRouteInfo { static const String name = 'HomeRoute'; - static const _i51.PageInfo page = _i51.PageInfo(name); + static const _i52.PageInfo page = _i52.PageInfo(name); } /// generated route for -/// [_i15.EmptyInitialRoute] -class InitialWrapperRoute extends _i51.PageRouteInfo { - const InitialWrapperRoute({List<_i51.PageRouteInfo>? children}) +/// [_i14.EmptyInitialRoute] +class InitialWrapperRoute extends _i52.PageRouteInfo { + const InitialWrapperRoute({List<_i52.PageRouteInfo>? children}) : super( InitialWrapperRoute.name, initialChildren: children, @@ -941,13 +935,13 @@ class InitialWrapperRoute extends _i51.PageRouteInfo { static const String name = 'InitialWrapperRoute'; - static const _i51.PageInfo page = _i51.PageInfo(name); + static const _i52.PageInfo page = _i52.PageInfo(name); } /// generated route for -/// [_i16.D3PRPCPage] -class D3PRPCRoute extends _i51.PageRouteInfo { - const D3PRPCRoute({List<_i51.PageRouteInfo>? children}) +/// [_i15.D3PRPCPage] +class D3PRPCRoute extends _i52.PageRouteInfo { + const D3PRPCRoute({List<_i52.PageRouteInfo>? children}) : super( D3PRPCRoute.name, initialChildren: children, @@ -955,13 +949,13 @@ class D3PRPCRoute extends _i51.PageRouteInfo { static const String name = 'D3PRPCRoute'; - static const _i51.PageInfo page = _i51.PageInfo(name); + static const _i52.PageInfo page = _i52.PageInfo(name); } /// generated route for -/// [_i17.D3PRPCPageWrapper] -class D3PRPCRouteWrapper extends _i51.PageRouteInfo { - const D3PRPCRouteWrapper({List<_i51.PageRouteInfo>? children}) +/// [_i16.D3PRPCPageWrapper] +class D3PRPCRouteWrapper extends _i52.PageRouteInfo { + const D3PRPCRouteWrapper({List<_i52.PageRouteInfo>? children}) : super( D3PRPCRouteWrapper.name, initialChildren: children, @@ -969,13 +963,13 @@ class D3PRPCRouteWrapper extends _i51.PageRouteInfo { static const String name = 'D3PRPCRouteWrapper'; - static const _i51.PageInfo page = _i51.PageInfo(name); + static const _i52.PageInfo page = _i52.PageInfo(name); } /// generated route for -/// [_i18.ContactsPage] -class ContactsRoute extends _i51.PageRouteInfo { - const ContactsRoute({List<_i51.PageRouteInfo>? children}) +/// [_i17.ContactsPage] +class ContactsRoute extends _i52.PageRouteInfo { + const ContactsRoute({List<_i52.PageRouteInfo>? children}) : super( ContactsRoute.name, initialChildren: children, @@ -983,16 +977,16 @@ class ContactsRoute extends _i51.PageRouteInfo { static const String name = 'ContactsRoute'; - static const _i51.PageInfo page = _i51.PageInfo(name); + static const _i52.PageInfo page = _i52.PageInfo(name); } /// generated route for -/// [_i19.DeleteContactDialog] -class DeleteContactRoute extends _i51.PageRouteInfo { +/// [_i18.DeleteContactDialog] +class DeleteContactRoute extends _i52.PageRouteInfo { DeleteContactRoute({ - required _i55.Contact contact, - _i52.Key? key, - List<_i51.PageRouteInfo>? children, + required _i56.Contact contact, + _i53.Key? key, + List<_i52.PageRouteInfo>? children, }) : super( DeleteContactRoute.name, args: DeleteContactRouteArgs( @@ -1004,8 +998,8 @@ class DeleteContactRoute extends _i51.PageRouteInfo { static const String name = 'DeleteContactRoute'; - static const _i51.PageInfo page = - _i51.PageInfo(name); + static const _i52.PageInfo page = + _i52.PageInfo(name); } class DeleteContactRouteArgs { @@ -1014,9 +1008,9 @@ class DeleteContactRouteArgs { this.key, }); - final _i55.Contact contact; + final _i56.Contact contact; - final _i52.Key? key; + final _i53.Key? key; @override String toString() { @@ -1025,9 +1019,9 @@ class DeleteContactRouteArgs { } /// generated route for -/// [_i20.RemoveAccountDialog] -class RemoveAccountRoute extends _i51.PageRouteInfo { - const RemoveAccountRoute({List<_i51.PageRouteInfo>? children}) +/// [_i19.RemoveAccountDialog] +class RemoveAccountRoute extends _i52.PageRouteInfo { + const RemoveAccountRoute({List<_i52.PageRouteInfo>? children}) : super( RemoveAccountRoute.name, initialChildren: children, @@ -1035,13 +1029,13 @@ class RemoveAccountRoute extends _i51.PageRouteInfo { static const String name = 'RemoveAccountRoute'; - static const _i51.PageInfo page = _i51.PageInfo(name); + static const _i52.PageInfo page = _i52.PageInfo(name); } /// generated route for -/// [_i21.RecievePage] -class RecieveRoute extends _i51.PageRouteInfo { - const RecieveRoute({List<_i51.PageRouteInfo>? children}) +/// [_i20.RecievePage] +class RecieveRoute extends _i52.PageRouteInfo { + const RecieveRoute({List<_i52.PageRouteInfo>? children}) : super( RecieveRoute.name, initialChildren: children, @@ -1049,13 +1043,13 @@ class RecieveRoute extends _i51.PageRouteInfo { static const String name = 'RecieveRoute'; - static const _i51.PageInfo page = _i51.PageInfo(name); + static const _i52.PageInfo page = _i52.PageInfo(name); } /// generated route for -/// [_i22.NotificationsPage] -class NotificationsRoute extends _i51.PageRouteInfo { - const NotificationsRoute({List<_i51.PageRouteInfo>? children}) +/// [_i21.NotificationsPage] +class NotificationsRoute extends _i52.PageRouteInfo { + const NotificationsRoute({List<_i52.PageRouteInfo>? children}) : super( NotificationsRoute.name, initialChildren: children, @@ -1063,15 +1057,15 @@ class NotificationsRoute extends _i51.PageRouteInfo { static const String name = 'NotificationsRoute'; - static const _i51.PageInfo page = _i51.PageInfo(name); + static const _i52.PageInfo page = _i52.PageInfo(name); } /// generated route for -/// [_i23.AddContactPage] -class AddContactRoute extends _i51.PageRouteInfo { +/// [_i22.AddContactPage] +class AddContactRoute extends _i52.PageRouteInfo { AddContactRoute({ - _i52.Key? key, - List<_i51.PageRouteInfo>? children, + _i53.Key? key, + List<_i52.PageRouteInfo>? children, }) : super( AddContactRoute.name, args: AddContactRouteArgs(key: key), @@ -1080,14 +1074,14 @@ class AddContactRoute extends _i51.PageRouteInfo { static const String name = 'AddContactRoute'; - static const _i51.PageInfo page = - _i51.PageInfo(name); + static const _i52.PageInfo page = + _i52.PageInfo(name); } class AddContactRouteArgs { const AddContactRouteArgs({this.key}); - final _i52.Key? key; + final _i53.Key? key; @override String toString() { @@ -1096,9 +1090,9 @@ class AddContactRouteArgs { } /// generated route for -/// [_i24.WalletPage] -class WalletRoute extends _i51.PageRouteInfo { - const WalletRoute({List<_i51.PageRouteInfo>? children}) +/// [_i23.WalletPage] +class WalletRoute extends _i52.PageRouteInfo { + const WalletRoute({List<_i52.PageRouteInfo>? children}) : super( WalletRoute.name, initialChildren: children, @@ -1106,13 +1100,13 @@ class WalletRoute extends _i51.PageRouteInfo { static const String name = 'WalletRoute'; - static const _i51.PageInfo page = _i51.PageInfo(name); + static const _i52.PageInfo page = _i52.PageInfo(name); } /// generated route for -/// [_i25.WalletPageWrapper] -class WalletRouteWrapper extends _i51.PageRouteInfo { - const WalletRouteWrapper({List<_i51.PageRouteInfo>? children}) +/// [_i24.WalletPageWrapper] +class WalletRouteWrapper extends _i52.PageRouteInfo { + const WalletRouteWrapper({List<_i52.PageRouteInfo>? children}) : super( WalletRouteWrapper.name, initialChildren: children, @@ -1120,17 +1114,17 @@ class WalletRouteWrapper extends _i51.PageRouteInfo { static const String name = 'WalletRouteWrapper'; - static const _i51.PageInfo page = _i51.PageInfo(name); + static const _i52.PageInfo page = _i52.PageInfo(name); } /// generated route for -/// [_i26.TransferPageWrapper] +/// [_i25.TransferPageWrapper] class TransferRouteWrapper - extends _i51.PageRouteInfo { + extends _i52.PageRouteInfo { TransferRouteWrapper({ - required _i56.TransferMetaDTO metadata, - _i52.Key? key, - List<_i51.PageRouteInfo>? children, + required _i57.TransferMetaDTO metadata, + _i53.Key? key, + List<_i52.PageRouteInfo>? children, }) : super( TransferRouteWrapper.name, args: TransferRouteWrapperArgs( @@ -1142,8 +1136,8 @@ class TransferRouteWrapper static const String name = 'TransferRouteWrapper'; - static const _i51.PageInfo page = - _i51.PageInfo(name); + static const _i52.PageInfo page = + _i52.PageInfo(name); } class TransferRouteWrapperArgs { @@ -1152,9 +1146,9 @@ class TransferRouteWrapperArgs { this.key, }); - final _i56.TransferMetaDTO metadata; + final _i57.TransferMetaDTO metadata; - final _i52.Key? key; + final _i53.Key? key; @override String toString() { @@ -1163,11 +1157,11 @@ class TransferRouteWrapperArgs { } /// generated route for -/// [_i27.TransferPage] -class TransferRoute extends _i51.PageRouteInfo { +/// [_i26.TransferPage] +class TransferRoute extends _i52.PageRouteInfo { TransferRoute({ - _i52.Key? key, - List<_i51.PageRouteInfo>? children, + _i53.Key? key, + List<_i52.PageRouteInfo>? children, }) : super( TransferRoute.name, args: TransferRouteArgs(key: key), @@ -1176,14 +1170,14 @@ class TransferRoute extends _i51.PageRouteInfo { static const String name = 'TransferRoute'; - static const _i51.PageInfo page = - _i51.PageInfo(name); + static const _i52.PageInfo page = + _i52.PageInfo(name); } class TransferRouteArgs { const TransferRouteArgs({this.key}); - final _i52.Key? key; + final _i53.Key? key; @override String toString() { @@ -1192,13 +1186,13 @@ class TransferRouteArgs { } /// generated route for -/// [_i28.NonNativeTokenPageWrapper] +/// [_i27.NonNativeTokenPageWrapper] class NonNativeTokenRouteWrapper - extends _i51.PageRouteInfo { + extends _i52.PageRouteInfo { NonNativeTokenRouteWrapper({ - required _i57.GetExtrinsicsUseCaseParams params, - _i58.Key? key, - List<_i51.PageRouteInfo>? children, + required _i58.GetExtrinsicsUseCaseParams params, + _i59.Key? key, + List<_i52.PageRouteInfo>? children, }) : super( NonNativeTokenRouteWrapper.name, args: NonNativeTokenRouteWrapperArgs( @@ -1210,8 +1204,8 @@ class NonNativeTokenRouteWrapper static const String name = 'NonNativeTokenRouteWrapper'; - static const _i51.PageInfo page = - _i51.PageInfo(name); + static const _i52.PageInfo page = + _i52.PageInfo(name); } class NonNativeTokenRouteWrapperArgs { @@ -1220,9 +1214,9 @@ class NonNativeTokenRouteWrapperArgs { this.key, }); - final _i57.GetExtrinsicsUseCaseParams params; + final _i58.GetExtrinsicsUseCaseParams params; - final _i58.Key? key; + final _i59.Key? key; @override String toString() { @@ -1231,9 +1225,9 @@ class NonNativeTokenRouteWrapperArgs { } /// generated route for -/// [_i29.TransactionsHistoryPageWrapper] -class TransactionsHistoryRouteWrapper extends _i51.PageRouteInfo { - const TransactionsHistoryRouteWrapper({List<_i51.PageRouteInfo>? children}) +/// [_i28.TransactionsHistoryPageWrapper] +class TransactionsHistoryRouteWrapper extends _i52.PageRouteInfo { + const TransactionsHistoryRouteWrapper({List<_i52.PageRouteInfo>? children}) : super( TransactionsHistoryRouteWrapper.name, initialChildren: children, @@ -1241,16 +1235,16 @@ class TransactionsHistoryRouteWrapper extends _i51.PageRouteInfo { static const String name = 'TransactionsHistoryRouteWrapper'; - static const _i51.PageInfo page = _i51.PageInfo(name); + static const _i52.PageInfo page = _i52.PageInfo(name); } /// generated route for -/// [_i30.ImportRawseedFormPage] +/// [_i29.ImportRawseedFormPage] class ImportRawseedFormRoute - extends _i51.PageRouteInfo { + extends _i52.PageRouteInfo { ImportRawseedFormRoute({ - _i52.Key? key, - List<_i51.PageRouteInfo>? children, + _i53.Key? key, + List<_i52.PageRouteInfo>? children, }) : super( ImportRawseedFormRoute.name, args: ImportRawseedFormRouteArgs(key: key), @@ -1259,14 +1253,14 @@ class ImportRawseedFormRoute static const String name = 'ImportRawseedFormRoute'; - static const _i51.PageInfo page = - _i51.PageInfo(name); + static const _i52.PageInfo page = + _i52.PageInfo(name); } class ImportRawseedFormRouteArgs { const ImportRawseedFormRouteArgs({this.key}); - final _i52.Key? key; + final _i53.Key? key; @override String toString() { @@ -1275,9 +1269,9 @@ class ImportRawseedFormRouteArgs { } /// generated route for -/// [_i31.CreateAccountPageWrapper] -class CreateAccountRouteWrapper extends _i51.PageRouteInfo { - const CreateAccountRouteWrapper({List<_i51.PageRouteInfo>? children}) +/// [_i30.CreateAccountPageWrapper] +class CreateAccountRouteWrapper extends _i52.PageRouteInfo { + const CreateAccountRouteWrapper({List<_i52.PageRouteInfo>? children}) : super( CreateAccountRouteWrapper.name, initialChildren: children, @@ -1285,13 +1279,13 @@ class CreateAccountRouteWrapper extends _i51.PageRouteInfo { static const String name = 'CreateAccountRouteWrapper'; - static const _i51.PageInfo page = _i51.PageInfo(name); + static const _i52.PageInfo page = _i52.PageInfo(name); } /// generated route for -/// [_i32.CreateAccountFromObjectPage] -class CreateAccountFromObjectRoute extends _i51.PageRouteInfo { - const CreateAccountFromObjectRoute({List<_i51.PageRouteInfo>? children}) +/// [_i31.CreateAccountFromObjectPage] +class CreateAccountFromObjectRoute extends _i52.PageRouteInfo { + const CreateAccountFromObjectRoute({List<_i52.PageRouteInfo>? children}) : super( CreateAccountFromObjectRoute.name, initialChildren: children, @@ -1299,16 +1293,16 @@ class CreateAccountFromObjectRoute extends _i51.PageRouteInfo { static const String name = 'CreateAccountFromObjectRoute'; - static const _i51.PageInfo page = _i51.PageInfo(name); + static const _i52.PageInfo page = _i52.PageInfo(name); } /// generated route for -/// [_i33.ImportMnemonicFormPage] +/// [_i32.ImportMnemonicFormPage] class ImportMnemonicFormRoute - extends _i51.PageRouteInfo { + extends _i52.PageRouteInfo { ImportMnemonicFormRoute({ - _i52.Key? key, - List<_i51.PageRouteInfo>? children, + _i53.Key? key, + List<_i52.PageRouteInfo>? children, }) : super( ImportMnemonicFormRoute.name, args: ImportMnemonicFormRouteArgs(key: key), @@ -1317,14 +1311,14 @@ class ImportMnemonicFormRoute static const String name = 'ImportMnemonicFormRoute'; - static const _i51.PageInfo page = - _i51.PageInfo(name); + static const _i52.PageInfo page = + _i52.PageInfo(name); } class ImportMnemonicFormRouteArgs { const ImportMnemonicFormRouteArgs({this.key}); - final _i52.Key? key; + final _i53.Key? key; @override String toString() { @@ -1333,9 +1327,9 @@ class ImportMnemonicFormRouteArgs { } /// generated route for -/// [_i34.CreateAccountInfoPage] -class CreateAccountInfoRoute extends _i51.PageRouteInfo { - const CreateAccountInfoRoute({List<_i51.PageRouteInfo>? children}) +/// [_i33.CreateAccountInfoPage] +class CreateAccountInfoRoute extends _i52.PageRouteInfo { + const CreateAccountInfoRoute({List<_i52.PageRouteInfo>? children}) : super( CreateAccountInfoRoute.name, initialChildren: children, @@ -1343,13 +1337,13 @@ class CreateAccountInfoRoute extends _i51.PageRouteInfo { static const String name = 'CreateAccountInfoRoute'; - static const _i51.PageInfo page = _i51.PageInfo(name); + static const _i52.PageInfo page = _i52.PageInfo(name); } /// generated route for -/// [_i35.CreateAccountMnemonicBackupPage] -class CreateAccountMnemonicBackupRoute extends _i51.PageRouteInfo { - const CreateAccountMnemonicBackupRoute({List<_i51.PageRouteInfo>? children}) +/// [_i34.CreateAccountMnemonicBackupPage] +class CreateAccountMnemonicBackupRoute extends _i52.PageRouteInfo { + const CreateAccountMnemonicBackupRoute({List<_i52.PageRouteInfo>? children}) : super( CreateAccountMnemonicBackupRoute.name, initialChildren: children, @@ -1357,13 +1351,13 @@ class CreateAccountMnemonicBackupRoute extends _i51.PageRouteInfo { static const String name = 'CreateAccountMnemonicBackupRoute'; - static const _i51.PageInfo page = _i51.PageInfo(name); + static const _i52.PageInfo page = _i52.PageInfo(name); } /// generated route for -/// [_i36.CreateAccountMnemonicConfirmPage] -class CreateAccountMnemonicConfirmRoute extends _i51.PageRouteInfo { - const CreateAccountMnemonicConfirmRoute({List<_i51.PageRouteInfo>? children}) +/// [_i35.CreateAccountMnemonicConfirmPage] +class CreateAccountMnemonicConfirmRoute extends _i52.PageRouteInfo { + const CreateAccountMnemonicConfirmRoute({List<_i52.PageRouteInfo>? children}) : super( CreateAccountMnemonicConfirmRoute.name, initialChildren: children, @@ -1371,17 +1365,17 @@ class CreateAccountMnemonicConfirmRoute extends _i51.PageRouteInfo { static const String name = 'CreateAccountMnemonicConfirmRoute'; - static const _i51.PageInfo page = _i51.PageInfo(name); + static const _i52.PageInfo page = _i52.PageInfo(name); } /// generated route for -/// [_i37.CreateAccountCredentialsPage] +/// [_i36.CreateAccountCredentialsPage] class CreateAccountCredentialsRoute - extends _i51.PageRouteInfo { + extends _i52.PageRouteInfo { CreateAccountCredentialsRoute({ required String appbarText, - _i52.Key? key, - List<_i51.PageRouteInfo>? children, + _i53.Key? key, + List<_i52.PageRouteInfo>? children, }) : super( CreateAccountCredentialsRoute.name, args: CreateAccountCredentialsRouteArgs( @@ -1393,8 +1387,8 @@ class CreateAccountCredentialsRoute static const String name = 'CreateAccountCredentialsRoute'; - static const _i51.PageInfo page = - _i51.PageInfo(name); + static const _i52.PageInfo page = + _i52.PageInfo(name); } class CreateAccountCredentialsRouteArgs { @@ -1405,7 +1399,7 @@ class CreateAccountCredentialsRouteArgs { final String appbarText; - final _i52.Key? key; + final _i53.Key? key; @override String toString() { @@ -1414,9 +1408,9 @@ class CreateAccountCredentialsRouteArgs { } /// generated route for -/// [_i38.CreateAccountTypePage] -class CreateAccountTypeRoute extends _i51.PageRouteInfo { - const CreateAccountTypeRoute({List<_i51.PageRouteInfo>? children}) +/// [_i37.CreateAccountTypePage] +class CreateAccountTypeRoute extends _i52.PageRouteInfo { + const CreateAccountTypeRoute({List<_i52.PageRouteInfo>? children}) : super( CreateAccountTypeRoute.name, initialChildren: children, @@ -1424,13 +1418,13 @@ class CreateAccountTypeRoute extends _i51.PageRouteInfo { static const String name = 'CreateAccountTypeRoute'; - static const _i51.PageInfo page = _i51.PageInfo(name); + static const _i52.PageInfo page = _i52.PageInfo(name); } /// generated route for -/// [_i39.CreateAccountLoaderPage] -class CreateAccountLoaderRoute extends _i51.PageRouteInfo { - const CreateAccountLoaderRoute({List<_i51.PageRouteInfo>? children}) +/// [_i38.CreateAccountLoaderPage] +class CreateAccountLoaderRoute extends _i52.PageRouteInfo { + const CreateAccountLoaderRoute({List<_i52.PageRouteInfo>? children}) : super( CreateAccountLoaderRoute.name, initialChildren: children, @@ -1438,13 +1432,13 @@ class CreateAccountLoaderRoute extends _i51.PageRouteInfo { static const String name = 'CreateAccountLoaderRoute'; - static const _i51.PageInfo page = _i51.PageInfo(name); + static const _i52.PageInfo page = _i52.PageInfo(name); } /// generated route for -/// [_i40.NoStableHashDialog] -class NoStableHashRoute extends _i51.PageRouteInfo { - const NoStableHashRoute({List<_i51.PageRouteInfo>? children}) +/// [_i39.NoStableHashDialog] +class NoStableHashRoute extends _i52.PageRouteInfo { + const NoStableHashRoute({List<_i52.PageRouteInfo>? children}) : super( NoStableHashRoute.name, initialChildren: children, @@ -1452,16 +1446,16 @@ class NoStableHashRoute extends _i51.PageRouteInfo { static const String name = 'NoStableHashRoute'; - static const _i51.PageInfo page = _i51.PageInfo(name); + static const _i52.PageInfo page = _i52.PageInfo(name); } /// generated route for -/// [_i41.UploadedObjectPage] -class UploadedObjectRoute extends _i51.PageRouteInfo { +/// [_i40.UploadedObjectPage] +class UploadedObjectRoute extends _i52.PageRouteInfo { UploadedObjectRoute({ - required _i59.UploadedObject uploadedObject, - _i52.Key? key, - List<_i51.PageRouteInfo>? children, + required _i60.UploadedObject uploadedObject, + _i53.Key? key, + List<_i52.PageRouteInfo>? children, }) : super( UploadedObjectRoute.name, args: UploadedObjectRouteArgs( @@ -1473,8 +1467,8 @@ class UploadedObjectRoute extends _i51.PageRouteInfo { static const String name = 'UploadedObjectRoute'; - static const _i51.PageInfo page = - _i51.PageInfo(name); + static const _i52.PageInfo page = + _i52.PageInfo(name); } class UploadedObjectRouteArgs { @@ -1483,9 +1477,9 @@ class UploadedObjectRouteArgs { this.key, }); - final _i59.UploadedObject uploadedObject; + final _i60.UploadedObject uploadedObject; - final _i52.Key? key; + final _i53.Key? key; @override String toString() { @@ -1494,9 +1488,9 @@ class UploadedObjectRouteArgs { } /// generated route for -/// [_i42.SettingsPage] -class SettingsRoute extends _i51.PageRouteInfo { - const SettingsRoute({List<_i51.PageRouteInfo>? children}) +/// [_i41.SettingsPage] +class SettingsRoute extends _i52.PageRouteInfo { + const SettingsRoute({List<_i52.PageRouteInfo>? children}) : super( SettingsRoute.name, initialChildren: children, @@ -1504,16 +1498,16 @@ class SettingsRoute extends _i51.PageRouteInfo { static const String name = 'SettingsRoute'; - static const _i51.PageInfo page = _i51.PageInfo(name); + static const _i52.PageInfo page = _i52.PageInfo(name); } /// generated route for -/// [_i43.SectionsSubPage] -class SectionsSubRoute extends _i51.PageRouteInfo { +/// [_i42.SectionsSubPage] +class SectionsSubRoute extends _i52.PageRouteInfo { SectionsSubRoute({ - required _i60.GlobalSettings initialState, - _i52.Key? key, - List<_i51.PageRouteInfo>? children, + required _i61.GlobalSettings initialState, + _i53.Key? key, + List<_i52.PageRouteInfo>? children, }) : super( SectionsSubRoute.name, args: SectionsSubRouteArgs( @@ -1525,8 +1519,8 @@ class SectionsSubRoute extends _i51.PageRouteInfo { static const String name = 'SectionsSubRoute'; - static const _i51.PageInfo page = - _i51.PageInfo(name); + static const _i52.PageInfo page = + _i52.PageInfo(name); } class SectionsSubRouteArgs { @@ -1535,9 +1529,9 @@ class SectionsSubRouteArgs { this.key, }); - final _i60.GlobalSettings initialState; + final _i61.GlobalSettings initialState; - final _i52.Key? key; + final _i53.Key? key; @override String toString() { @@ -1546,12 +1540,12 @@ class SectionsSubRouteArgs { } /// generated route for -/// [_i44.TransBytesSubPage] -class TransBytesSubRoute extends _i51.PageRouteInfo { +/// [_i43.TransBytesSubPage] +class TransBytesSubRoute extends _i52.PageRouteInfo { TransBytesSubRoute({ - required _i60.GlobalSettings initialState, - _i52.Key? key, - List<_i51.PageRouteInfo>? children, + required _i61.GlobalSettings initialState, + _i53.Key? key, + List<_i52.PageRouteInfo>? children, }) : super( TransBytesSubRoute.name, args: TransBytesSubRouteArgs( @@ -1563,8 +1557,8 @@ class TransBytesSubRoute extends _i51.PageRouteInfo { static const String name = 'TransBytesSubRoute'; - static const _i51.PageInfo page = - _i51.PageInfo(name); + static const _i52.PageInfo page = + _i52.PageInfo(name); } class TransBytesSubRouteArgs { @@ -1573,9 +1567,9 @@ class TransBytesSubRouteArgs { this.key, }); - final _i60.GlobalSettings initialState; + final _i61.GlobalSettings initialState; - final _i52.Key? key; + final _i53.Key? key; @override String toString() { @@ -1584,9 +1578,9 @@ class TransBytesSubRouteArgs { } /// generated route for -/// [_i45.GridSizeSubPage] -class GridSizeSubRoute extends _i51.PageRouteInfo { - const GridSizeSubRoute({List<_i51.PageRouteInfo>? children}) +/// [_i44.GridSizeSubPage] +class GridSizeSubRoute extends _i52.PageRouteInfo { + const GridSizeSubRoute({List<_i52.PageRouteInfo>? children}) : super( GridSizeSubRoute.name, initialChildren: children, @@ -1594,13 +1588,13 @@ class GridSizeSubRoute extends _i51.PageRouteInfo { static const String name = 'GridSizeSubRoute'; - static const _i51.PageInfo page = _i51.PageInfo(name); + static const _i52.PageInfo page = _i52.PageInfo(name); } /// generated route for -/// [_i46.PixelRatioSubPage] -class PixelRatioSubRoute extends _i51.PageRouteInfo { - const PixelRatioSubRoute({List<_i51.PageRouteInfo>? children}) +/// [_i45.PixelRatioSubPage] +class PixelRatioSubRoute extends _i52.PageRouteInfo { + const PixelRatioSubRoute({List<_i52.PageRouteInfo>? children}) : super( PixelRatioSubRoute.name, initialChildren: children, @@ -1608,16 +1602,16 @@ class PixelRatioSubRoute extends _i51.PageRouteInfo { static const String name = 'PixelRatioSubRoute'; - static const _i51.PageInfo page = _i51.PageInfo(name); + static const _i52.PageInfo page = _i52.PageInfo(name); } /// generated route for -/// [_i47.WalletNodeSubPage] -class WalletNodeSubRoute extends _i51.PageRouteInfo { +/// [_i46.WalletNodeSubPage] +class WalletNodeSubRoute extends _i52.PageRouteInfo { WalletNodeSubRoute({ - required _i60.GlobalSettings initialState, - _i52.Key? key, - List<_i51.PageRouteInfo>? children, + required _i61.GlobalSettings initialState, + _i53.Key? key, + List<_i52.PageRouteInfo>? children, }) : super( WalletNodeSubRoute.name, args: WalletNodeSubRouteArgs( @@ -1629,8 +1623,8 @@ class WalletNodeSubRoute extends _i51.PageRouteInfo { static const String name = 'WalletNodeSubRoute'; - static const _i51.PageInfo page = - _i51.PageInfo(name); + static const _i52.PageInfo page = + _i52.PageInfo(name); } class WalletNodeSubRouteArgs { @@ -1639,9 +1633,9 @@ class WalletNodeSubRouteArgs { this.key, }); - final _i60.GlobalSettings initialState; + final _i61.GlobalSettings initialState; - final _i52.Key? key; + final _i53.Key? key; @override String toString() { @@ -1650,9 +1644,9 @@ class WalletNodeSubRouteArgs { } /// generated route for -/// [_i48.ChooseAlgorithmSubPage] -class ChooseAlgorithmSubRoute extends _i51.PageRouteInfo { - const ChooseAlgorithmSubRoute({List<_i51.PageRouteInfo>? children}) +/// [_i47.ChooseAlgorithmSubPage] +class ChooseAlgorithmSubRoute extends _i52.PageRouteInfo { + const ChooseAlgorithmSubRoute({List<_i52.PageRouteInfo>? children}) : super( ChooseAlgorithmSubRoute.name, initialChildren: children, @@ -1660,16 +1654,16 @@ class ChooseAlgorithmSubRoute extends _i51.PageRouteInfo { static const String name = 'ChooseAlgorithmSubRoute'; - static const _i51.PageInfo page = _i51.PageInfo(name); + static const _i52.PageInfo page = _i52.PageInfo(name); } /// generated route for -/// [_i49.StableHashSubPage] -class StableHashSubRoute extends _i51.PageRouteInfo { +/// [_i48.StableHashSubPage] +class StableHashSubRoute extends _i52.PageRouteInfo { StableHashSubRoute({ - required _i60.GlobalSettings initialState, - _i52.Key? key, - List<_i51.PageRouteInfo>? children, + required _i61.GlobalSettings initialState, + _i53.Key? key, + List<_i52.PageRouteInfo>? children, }) : super( StableHashSubRoute.name, args: StableHashSubRouteArgs( @@ -1681,8 +1675,8 @@ class StableHashSubRoute extends _i51.PageRouteInfo { static const String name = 'StableHashSubRoute'; - static const _i51.PageInfo page = - _i51.PageInfo(name); + static const _i52.PageInfo page = + _i52.PageInfo(name); } class StableHashSubRouteArgs { @@ -1691,9 +1685,9 @@ class StableHashSubRouteArgs { this.key, }); - final _i60.GlobalSettings initialState; + final _i61.GlobalSettings initialState; - final _i52.Key? key; + final _i53.Key? key; @override String toString() { @@ -1702,9 +1696,9 @@ class StableHashSubRouteArgs { } /// generated route for -/// [_i50.EmptySettingsRoute] -class SettingsWrapperRoute extends _i51.PageRouteInfo { - const SettingsWrapperRoute({List<_i51.PageRouteInfo>? children}) +/// [_i49.EmptySettingsRoute] +class SettingsWrapperRoute extends _i52.PageRouteInfo { + const SettingsWrapperRoute({List<_i52.PageRouteInfo>? children}) : super( SettingsWrapperRoute.name, initialChildren: children, @@ -1712,5 +1706,33 @@ class SettingsWrapperRoute extends _i51.PageRouteInfo { static const String name = 'SettingsWrapperRoute'; - static const _i51.PageInfo page = _i51.PageInfo(name); + static const _i52.PageInfo page = _i52.PageInfo(name); +} + +/// generated route for +/// [_i50.ObjectsListPage] +class ObjectsListRoute extends _i52.PageRouteInfo { + const ObjectsListRoute({List<_i52.PageRouteInfo>? children}) + : super( + ObjectsListRoute.name, + initialChildren: children, + ); + + static const String name = 'ObjectsListRoute'; + + static const _i52.PageInfo page = _i52.PageInfo(name); +} + +/// generated route for +/// [_i51.ExplorerPageWrapper] +class ExplorerRouteWrapper extends _i52.PageRouteInfo { + const ExplorerRouteWrapper({List<_i52.PageRouteInfo>? children}) + : super( + ExplorerRouteWrapper.name, + initialChildren: children, + ); + + static const String name = 'ExplorerRouteWrapper'; + + static const _i52.PageInfo page = _i52.PageInfo(name); } diff --git a/packages/calc/example/pubspec.lock b/packages/calc/example/pubspec.lock index d99ba0a7..004fb699 100644 --- a/packages/calc/example/pubspec.lock +++ b/packages/calc/example/pubspec.lock @@ -5,10 +5,10 @@ packages: dependency: transitive description: name: async - sha256: bfe67ef28df125b7dddcea62755991f807aa39a2492a23e1550161692950bbe0 + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" url: "https://pub.dev" source: hosted - version: "2.10.0" + version: "2.11.0" boolean_selector: dependency: transitive description: @@ -28,10 +28,10 @@ packages: dependency: transitive description: name: characters - sha256: e6a326c8af69605aec75ed6c187d06b349707a27fbff8222ca9cc2cff167975c + sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" url: "https://pub.dev" source: hosted - version: "1.2.1" + version: "1.3.0" clock: dependency: transitive description: @@ -44,10 +44,10 @@ packages: dependency: transitive description: name: collection - sha256: cfc915e6923fe5ce6e153b0723c753045de46de1b4d63771530504004a45fae0 + sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c" url: "https://pub.dev" source: hosted - version: "1.17.0" + version: "1.17.1" convert: dependency: transitive description: @@ -86,18 +86,18 @@ packages: dependency: transitive description: name: js - sha256: "5528c2f391ededb7775ec1daa69e65a2d61276f7552de2b5f7b8d34ee9fd4ab7" + sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 url: "https://pub.dev" source: hosted - version: "0.6.5" + version: "0.6.7" matcher: dependency: transitive description: name: matcher - sha256: "16db949ceee371e9b99d22f88fa3a73c4e59fd0afed0bd25fc336eb76c198b72" + sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb" url: "https://pub.dev" source: hosted - version: "0.12.13" + version: "0.12.15" material_color_utilities: dependency: transitive description: @@ -110,18 +110,18 @@ packages: dependency: transitive description: name: meta - sha256: "6c268b42ed578a53088d834796959e4a1814b5e9e164f147f580a386e5decf42" + sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" url: "https://pub.dev" source: hosted - version: "1.8.0" + version: "1.9.1" path: dependency: transitive description: name: path - sha256: db9d4f58c908a4ba5953fcee2ae317c94889433e5024c27ce74a37f94267945b + sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" url: "https://pub.dev" source: hosted - version: "1.8.2" + version: "1.8.3" sky_engine: dependency: transitive description: flutter @@ -171,10 +171,10 @@ packages: dependency: transitive description: name: test_api - sha256: ad540f65f92caa91bf21dfc8ffb8c589d6e4dc0c2267818b4cc2792857706206 + sha256: eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfb url: "https://pub.dev" source: hosted - version: "0.4.16" + version: "0.5.1" typed_data: dependency: transitive description: @@ -192,4 +192,4 @@ packages: source: hosted version: "2.1.4" sdks: - dart: ">=2.18.0 <4.0.0" + dart: ">=3.0.0-0 <4.0.0" diff --git a/packages/calc/lib/calc.dart b/packages/calc/lib/calc.dart index 0aa62cdb..8304021b 100644 --- a/packages/calc/lib/calc.dart +++ b/packages/calc/lib/calc.dart @@ -17,6 +17,7 @@ class Calc2 { required this.filePath, required this.transBytes, required this.algorithm, + // required this.updateIsolateListener, }); final int gridSize; @@ -26,10 +27,11 @@ class Calc2 { final String algorithm; Future calcHashes( - void updateIsolateListener(final Isolate i, final ReceivePort p), - ) async { + void updateIsolateListener(Isolate i, ReceivePort p)) async { final p = ReceivePort(); + // print('a1'); final i = await Isolate.spawn(_callLib, p.sendPort); + // print('a2'); updateIsolateListener(i, p); return await p.first as String; } diff --git a/packages/calc/pubspec.lock b/packages/calc/pubspec.lock index c096153a..dd217143 100644 --- a/packages/calc/pubspec.lock +++ b/packages/calc/pubspec.lock @@ -13,10 +13,10 @@ packages: dependency: transitive description: name: async - sha256: bfe67ef28df125b7dddcea62755991f807aa39a2492a23e1550161692950bbe0 + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" url: "https://pub.dev" source: hosted - version: "2.10.0" + version: "2.11.0" boolean_selector: dependency: transitive description: @@ -29,10 +29,10 @@ packages: dependency: transitive description: name: characters - sha256: e6a326c8af69605aec75ed6c187d06b349707a27fbff8222ca9cc2cff167975c + sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" url: "https://pub.dev" source: hosted - version: "1.2.1" + version: "1.3.0" cli_util: dependency: transitive description: @@ -53,10 +53,10 @@ packages: dependency: transitive description: name: collection - sha256: cfc915e6923fe5ce6e153b0723c753045de46de1b4d63771530504004a45fae0 + sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c" url: "https://pub.dev" source: hosted - version: "1.17.0" + version: "1.17.1" convert: dependency: "direct main" description: @@ -127,10 +127,10 @@ packages: dependency: transitive description: name: js - sha256: "5528c2f391ededb7775ec1daa69e65a2d61276f7552de2b5f7b8d34ee9fd4ab7" + sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 url: "https://pub.dev" source: hosted - version: "0.6.5" + version: "0.6.7" lints: dependency: transitive description: @@ -151,10 +151,10 @@ packages: dependency: transitive description: name: matcher - sha256: "16db949ceee371e9b99d22f88fa3a73c4e59fd0afed0bd25fc336eb76c198b72" + sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb" url: "https://pub.dev" source: hosted - version: "0.12.13" + version: "0.12.15" material_color_utilities: dependency: transitive description: @@ -167,18 +167,18 @@ packages: dependency: transitive description: name: meta - sha256: "6c268b42ed578a53088d834796959e4a1814b5e9e164f147f580a386e5decf42" + sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" url: "https://pub.dev" source: hosted - version: "1.8.0" + version: "1.9.1" path: dependency: transitive description: name: path - sha256: db9d4f58c908a4ba5953fcee2ae317c94889433e5024c27ce74a37f94267945b + sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" url: "https://pub.dev" source: hosted - version: "1.8.2" + version: "1.8.3" quiver: dependency: transitive description: @@ -236,10 +236,10 @@ packages: dependency: transitive description: name: test_api - sha256: ad540f65f92caa91bf21dfc8ffb8c589d6e4dc0c2267818b4cc2792857706206 + sha256: eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfb url: "https://pub.dev" source: hosted - version: "0.4.16" + version: "0.5.1" typed_data: dependency: transitive description: @@ -265,4 +265,4 @@ packages: source: hosted version: "3.1.1" sdks: - dart: ">=2.18.0 <4.0.0" + dart: ">=3.0.0-0 <4.0.0" diff --git a/packages/super_core/lib/super_core.dart b/packages/super_core/lib/super_core.dart index fbefff23..1fbd5305 100644 --- a/packages/super_core/lib/super_core.dart +++ b/packages/super_core/lib/super_core.dart @@ -5,3 +5,4 @@ export 'failure.dart'; export 'di_module.dart'; export 'to_map_string_dynamic.dart'; export 'list_extentions.dart'; +export 'usecase.dart'; diff --git a/lib/core/utils/usecase.dart b/packages/super_core/lib/usecase.dart similarity index 59% rename from lib/core/utils/usecase.dart rename to packages/super_core/lib/usecase.dart index afc9f91c..7e244332 100644 --- a/lib/core/utils/usecase.dart +++ b/packages/super_core/lib/usecase.dart @@ -1,4 +1,5 @@ -import 'package:super_core/super_core.dart'; +import 'package:super_core/either.dart'; +import 'package:super_core/failure.dart'; abstract class UseCase { const UseCase(); diff --git a/pubspec.yaml b/pubspec.yaml index 46ec8598..6da86fbc 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -10,7 +10,7 @@ publish_to: 'none' # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 2.11.0+33 +version: 2.12.0+34 environment: sdk: ">=3.0.6 <3.0.7"