From 2d61c65c54b66268fadb9d847c8a99b70c59c2c0 Mon Sep 17 00:00:00 2001 From: Ethan Lee <125412902+ethan-tbd@users.noreply.github.com> Date: Thu, 15 Aug 2024 13:24:27 -0700 Subject: [PATCH] chore: add qr folder (#265) --- lib/features/account/account_page.dart | 4 ++-- lib/features/dap/dap_qr_tile.dart | 4 ++-- lib/features/did/did_form.dart | 4 ++-- .../did_qr_code_page.dart => qr/qr_code_page.dart} | 4 ++-- .../did_qr_scan_page.dart => qr/qr_scan_page.dart} | 4 ++-- .../{did/did_qr_tabs.dart => qr/qr_tabs.dart} | 12 ++++++------ .../{did/did_qr_tile.dart => qr/qr_tile.dart} | 8 ++++---- test/features/account/account_page_test.dart | 4 ++-- 8 files changed, 22 insertions(+), 22 deletions(-) rename lib/features/{did/did_qr_code_page.dart => qr/qr_code_page.dart} (98%) rename lib/features/{did/did_qr_scan_page.dart => qr/qr_scan_page.dart} (97%) rename lib/features/{did/did_qr_tabs.dart => qr/qr_tabs.dart} (87%) rename lib/features/{did/did_qr_tile.dart => qr/qr_tile.dart} (91%) diff --git a/lib/features/account/account_page.dart b/lib/features/account/account_page.dart index fdce6435..5dd7f3f3 100644 --- a/lib/features/account/account_page.dart +++ b/lib/features/account/account_page.dart @@ -1,10 +1,10 @@ import 'package:auto_size_text/auto_size_text.dart'; -import 'package:didpay/features/did/did_qr_tabs.dart'; import 'package:didpay/features/feature_flags/feature_flag.dart'; import 'package:didpay/features/feature_flags/feature_flags_notifier.dart'; import 'package:didpay/features/pfis/pfi.dart'; import 'package:didpay/features/pfis/pfis_add_page.dart'; import 'package:didpay/features/pfis/pfis_notifier.dart'; +import 'package:didpay/features/qr/qr_tabs.dart'; import 'package:didpay/features/vcs/vcs_notifier.dart'; import 'package:didpay/l10n/app_localizations.dart'; import 'package:didpay/shared/modal/modal_manage_item.dart'; @@ -97,7 +97,7 @@ class AccountPage extends HookConsumerWidget { icon: const Icon(Icons.qr_code, size: Grid.sm), onPressed: () => Navigator.of(context).push( MaterialPageRoute( - builder: (_) => DidQrTabs(dap: dap), + builder: (_) => QrTabs(dap: dap), fullscreenDialog: true, ), ), diff --git a/lib/features/dap/dap_qr_tile.dart b/lib/features/dap/dap_qr_tile.dart index 7179e9e8..83df7606 100644 --- a/lib/features/dap/dap_qr_tile.dart +++ b/lib/features/dap/dap_qr_tile.dart @@ -1,5 +1,5 @@ import 'package:didpay/features/device/device_info_service.dart'; -import 'package:didpay/features/did/did_qr_tabs.dart'; +import 'package:didpay/features/qr/qr_tabs.dart'; import 'package:didpay/l10n/app_localizations.dart'; import 'package:didpay/shared/snackbar/snackbar_service.dart'; import 'package:didpay/shared/theme/grid.dart'; @@ -61,7 +61,7 @@ class DapQrTile extends HookConsumerWidget { ) async { final qrValue = await Navigator.of(context).push( MaterialPageRoute( - builder: (context) => DidQrTabs(dap: Loc.of(context).placeholderDap), + builder: (context) => QrTabs(dap: Loc.of(context).placeholderDap), ), ); diff --git a/lib/features/did/did_form.dart b/lib/features/did/did_form.dart index 284dab21..4d9b496d 100644 --- a/lib/features/did/did_form.dart +++ b/lib/features/did/did_form.dart @@ -1,4 +1,4 @@ -import 'package:didpay/features/did/did_qr_tile.dart'; +import 'package:didpay/features/qr/qr_tile.dart'; import 'package:didpay/l10n/app_localizations.dart'; import 'package:didpay/shared/next_button.dart'; import 'package:didpay/shared/theme/grid.dart'; @@ -49,7 +49,7 @@ class DidForm extends HookConsumerWidget { ), ), ), - DidQrTile(didTextController: textController), + QrTile(didTextController: textController), NextButton( onPressed: () async => onSubmit(textController.text), title: buttonTitle, diff --git a/lib/features/did/did_qr_code_page.dart b/lib/features/qr/qr_code_page.dart similarity index 98% rename from lib/features/did/did_qr_code_page.dart rename to lib/features/qr/qr_code_page.dart index ea1873d2..deca2804 100644 --- a/lib/features/did/did_qr_code_page.dart +++ b/lib/features/qr/qr_code_page.dart @@ -13,9 +13,9 @@ import 'package:flutter/services.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:qr_flutter/qr_flutter.dart'; -class DidQrCodePage extends HookConsumerWidget { +class QrCodePage extends HookConsumerWidget { final String dap; - const DidQrCodePage({required this.dap, super.key}); + const QrCodePage({required this.dap, super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/lib/features/did/did_qr_scan_page.dart b/lib/features/qr/qr_scan_page.dart similarity index 97% rename from lib/features/did/did_qr_scan_page.dart rename to lib/features/qr/qr_scan_page.dart index 51189539..5fea2a0b 100644 --- a/lib/features/did/did_qr_scan_page.dart +++ b/lib/features/qr/qr_scan_page.dart @@ -6,8 +6,8 @@ import 'package:flutter/material.dart'; import 'package:flutter_hooks/flutter_hooks.dart'; import 'package:mobile_scanner/mobile_scanner.dart'; -class DidQrScanPage extends HookWidget { - const DidQrScanPage({super.key}); +class QrScanPage extends HookWidget { + const QrScanPage({super.key}); @override Widget build(BuildContext context) { diff --git a/lib/features/did/did_qr_tabs.dart b/lib/features/qr/qr_tabs.dart similarity index 87% rename from lib/features/did/did_qr_tabs.dart rename to lib/features/qr/qr_tabs.dart index 8e3a5192..12029ce6 100644 --- a/lib/features/did/did_qr_tabs.dart +++ b/lib/features/qr/qr_tabs.dart @@ -1,14 +1,14 @@ -import 'package:didpay/features/did/did_qr_code_page.dart'; -import 'package:didpay/features/did/did_qr_scan_page.dart'; +import 'package:didpay/features/qr/qr_code_page.dart'; +import 'package:didpay/features/qr/qr_scan_page.dart'; import 'package:didpay/l10n/app_localizations.dart'; import 'package:didpay/shared/theme/grid.dart'; import 'package:flutter/material.dart'; import 'package:flutter_hooks/flutter_hooks.dart'; -class DidQrTabs extends HookWidget { +class QrTabs extends HookWidget { final String dap; - const DidQrTabs({required this.dap, super.key}); + const QrTabs({required this.dap, super.key}); @override Widget build(BuildContext context) { @@ -27,8 +27,8 @@ class DidQrTabs extends HookWidget { controller: tabController, physics: const NeverScrollableScrollPhysics(), children: [ - const DidQrScanPage(), - DidQrCodePage(dap: dap), + const QrScanPage(), + QrCodePage(dap: dap), ], ), Positioned( diff --git a/lib/features/did/did_qr_tile.dart b/lib/features/qr/qr_tile.dart similarity index 91% rename from lib/features/did/did_qr_tile.dart rename to lib/features/qr/qr_tile.dart index 6a6bb2ac..c73094af 100644 --- a/lib/features/did/did_qr_tile.dart +++ b/lib/features/qr/qr_tile.dart @@ -1,5 +1,5 @@ import 'package:didpay/features/device/device_info_service.dart'; -import 'package:didpay/features/did/did_qr_tabs.dart'; +import 'package:didpay/features/qr/qr_tabs.dart'; import 'package:didpay/l10n/app_localizations.dart'; import 'package:didpay/shared/snackbar/snackbar_service.dart'; import 'package:didpay/shared/theme/grid.dart'; @@ -8,10 +8,10 @@ import 'package:flutter_hooks/flutter_hooks.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:web5/web5.dart'; -class DidQrTile extends HookConsumerWidget { +class QrTile extends HookConsumerWidget { final TextEditingController didTextController; - const DidQrTile({ + const QrTile({ required this.didTextController, super.key, }); @@ -62,7 +62,7 @@ class DidQrTile extends HookConsumerWidget { ) async { final qrValue = await Navigator.of(context).push( MaterialPageRoute( - builder: (context) => DidQrTabs(dap: Loc.of(context).placeholderDap), + builder: (context) => QrTabs(dap: Loc.of(context).placeholderDap), ), ); diff --git a/test/features/account/account_page_test.dart b/test/features/account/account_page_test.dart index 4a908c6a..20d1b19f 100644 --- a/test/features/account/account_page_test.dart +++ b/test/features/account/account_page_test.dart @@ -1,7 +1,7 @@ import 'package:didpay/features/account/account_page.dart'; -import 'package:didpay/features/did/did_qr_tabs.dart'; import 'package:didpay/features/feature_flags/feature_flags_notifier.dart'; import 'package:didpay/features/pfis/pfis_notifier.dart'; +import 'package:didpay/features/qr/qr_tabs.dart'; import 'package:didpay/features/vcs/vcs_notifier.dart'; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; @@ -70,7 +70,7 @@ void main() { await tester.tap(find.widgetWithIcon(IconButton, Icons.qr_code)); await tester.pumpAndSettle(); - expect(find.byType(DidQrTabs), findsOneWidget); + expect(find.byType(QrTabs), findsOneWidget); }); }); }