diff --git a/frontend/analysis_options.yaml b/frontend/analysis_options.yaml index 3610009c..1934c044 100644 --- a/frontend/analysis_options.yaml +++ b/frontend/analysis_options.yaml @@ -6,3 +6,4 @@ analyzer: linter: rules: + - prefer_single_quotes diff --git a/frontend/ios/Podfile.lock b/frontend/ios/Podfile.lock index b2d92b98..099abaec 100644 --- a/frontend/ios/Podfile.lock +++ b/frontend/ios/Podfile.lock @@ -1,20 +1,39 @@ PODS: - Flutter (1.0.0) + - flutter_secure_storage (6.0.0): + - Flutter + - path_provider_foundation (0.0.1): + - Flutter + - FlutterMacOS + - url_launcher_ios (0.0.1): + - Flutter - webview_flutter_wkwebview (0.0.1): - Flutter DEPENDENCIES: - Flutter (from `Flutter`) + - flutter_secure_storage (from `.symlinks/plugins/flutter_secure_storage/ios`) + - path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`) + - url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`) - webview_flutter_wkwebview (from `.symlinks/plugins/webview_flutter_wkwebview/ios`) EXTERNAL SOURCES: Flutter: :path: Flutter + flutter_secure_storage: + :path: ".symlinks/plugins/flutter_secure_storage/ios" + path_provider_foundation: + :path: ".symlinks/plugins/path_provider_foundation/darwin" + url_launcher_ios: + :path: ".symlinks/plugins/url_launcher_ios/ios" webview_flutter_wkwebview: :path: ".symlinks/plugins/webview_flutter_wkwebview/ios" SPEC CHECKSUMS: Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854 + flutter_secure_storage: 23fc622d89d073675f2eaa109381aefbcf5a49be + path_provider_foundation: 29f094ae23ebbca9d3d0cec13889cd9060c0e943 + url_launcher_ios: bf5ce03e0e2088bad9cc378ea97fa0ed5b49673b webview_flutter_wkwebview: 2e2d318f21a5e036e2c3f26171342e95908bd60a PODFILE CHECKSUM: 70d9d25280d0dd177a5f637cdb0f0b0b12c6a189 diff --git a/frontend/lib/features/account/account_did_page.dart b/frontend/lib/features/account/account_did_page.dart new file mode 100644 index 00000000..53e8d145 --- /dev/null +++ b/frontend/lib/features/account/account_did_page.dart @@ -0,0 +1,19 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_starter/features/account/account_providers.dart'; +import 'package:hooks_riverpod/hooks_riverpod.dart'; + +class AccountDidPage extends HookConsumerWidget { + const AccountDidPage({super.key}); + + @override + Widget build(BuildContext context, WidgetRef ref) { + final did = ref.watch(didProvider); + + return Scaffold( + appBar: AppBar(title: const Text('My DID')), + body: Padding( + padding: const EdgeInsets.symmetric(horizontal: 20.0), + child: Center(child: SelectableText(did))), + ); + } +} diff --git a/frontend/lib/features/account/account_page.dart b/frontend/lib/features/account/account_page.dart new file mode 100644 index 00000000..93660424 --- /dev/null +++ b/frontend/lib/features/account/account_page.dart @@ -0,0 +1,27 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_starter/features/account/account_did_page.dart'; + +class AccountPage extends StatelessWidget { + const AccountPage({super.key}); + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar(title: const Text('Account')), + body: ListView( + children: [ + ListTile( + title: const Text('My DID'), + trailing: const Icon(Icons.chevron_right), + onTap: () { + Navigator.of(context).push( + MaterialPageRoute( + builder: (context) => const AccountDidPage(), + ), + ); + }), + ], + ), + ); + } +} diff --git a/frontend/lib/features/account/account_providers.dart b/frontend/lib/features/account/account_providers.dart new file mode 100644 index 00000000..b240aa00 --- /dev/null +++ b/frontend/lib/features/account/account_providers.dart @@ -0,0 +1,3 @@ +import 'package:hooks_riverpod/hooks_riverpod.dart'; + +final didProvider = Provider((ref) => throw UnimplementedError()); diff --git a/frontend/lib/features/app/app.dart b/frontend/lib/features/app/app.dart index 7b2bc69d..62ea4f47 100644 --- a/frontend/lib/features/app/app.dart +++ b/frontend/lib/features/app/app.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:flutter_starter/features/auth/welcome_page.dart'; +import 'package:flutter_starter/features/app/app_tabs.dart'; import 'package:flutter_starter/l10n/app_localizations.dart'; import 'package:flutter_starter/shared/theme/theme.dart'; @@ -12,7 +12,7 @@ class App extends StatelessWidget { title: 'DIDPay', theme: lightTheme(context), darkTheme: darkTheme(context), - home: const WelcomePage(), + home: const AppTabs(), localizationsDelegates: Loc.localizationsDelegates, supportedLocales: const [ Locale('en', ''), diff --git a/frontend/lib/features/app/app_tabs.dart b/frontend/lib/features/app/app_tabs.dart index 2bda7ff3..e6e38c00 100644 --- a/frontend/lib/features/app/app_tabs.dart +++ b/frontend/lib/features/app/app_tabs.dart @@ -1,6 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_hooks/flutter_hooks.dart'; -import 'package:flutter_starter/features/sample/sample_page.dart'; +import 'package:flutter_starter/features/account/account_page.dart'; +import 'package:flutter_starter/features/home/home_page.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart'; class _TabItem { @@ -20,14 +21,14 @@ class AppTabs extends HookConsumerWidget { final tabs = [ _TabItem( - "Tab 1", - const Icon(Icons.numbers), - const SamplePage(title: "Page 1"), + 'Home', + const Icon(Icons.home_outlined), + const HomePage(), ), _TabItem( - "Tab 2", - const Icon(Icons.check), - const SamplePage(title: "Page 2"), + 'Account', + const Icon(Icons.person_outlined), + const AccountPage(), ), ]; diff --git a/frontend/lib/features/auth/auth_did_page.dart b/frontend/lib/features/auth/auth_did_page.dart deleted file mode 100644 index 371cc1ce..00000000 --- a/frontend/lib/features/auth/auth_did_page.dart +++ /dev/null @@ -1,77 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:flutter_hooks/flutter_hooks.dart'; -import 'package:flutter_starter/features/auth/auth_widget_page.dart'; -import 'package:flutter_starter/l10n/app_localizations.dart'; -import 'package:hooks_riverpod/hooks_riverpod.dart'; -import 'package:tbdex/tbdex.dart'; - -class AuthDidPage extends HookConsumerWidget { - const AuthDidPage({super.key}); - - @override - Widget build(BuildContext context, WidgetRef ref) { - final did = useState(null); - - useEffect(() { - Future.microtask(() async { - final keyManager = InMemoryKeyManager(); - final jwt = await DidJwk.create(keyManager: keyManager); - did.value = jwt.uri; - }); - - return null; - }, []); - - return Scaffold( - appBar: AppBar(title: Text(Loc.of(context).appName)), - body: SafeArea( - child: Stack( - children: [ - SingleChildScrollView( - child: Padding( - padding: const EdgeInsets.symmetric(horizontal: 20.0), - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Text( - Loc.of(context).congratsOnYourDid, - style: Theme.of(context).textTheme.headlineSmall, - ), - const SizedBox(height: 40), - if (did.value == null) const CircularProgressIndicator(), - if (did.value != null) ...[ - const SizedBox(height: 20), - Text( - did.value!, - style: Theme.of(context).textTheme.bodyLarge, - ), - ], - ], - ), - ), - ), - if (did.value != null) - Align( - alignment: Alignment.bottomCenter, - child: Padding( - padding: const EdgeInsets.symmetric(horizontal: 20.0), - child: SizedBox( - width: double.infinity, - child: FilledButton( - child: Text(Loc.of(context).verifyIdentity), - onPressed: () => Navigator.of(context).push( - MaterialPageRoute( - builder: (context) => const AuthWidgetPage(), - fullscreenDialog: true, - ), - ), - ), - ), - ), - ), - ], - ), - ), - ); - } -} diff --git a/frontend/lib/features/auth/auth_widget_page.dart b/frontend/lib/features/auth/auth_widget_page.dart deleted file mode 100644 index 77e7822d..00000000 --- a/frontend/lib/features/auth/auth_widget_page.dart +++ /dev/null @@ -1,34 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:webview_flutter/webview_flutter.dart'; - -class AuthWidgetPage extends StatelessWidget { - const AuthWidgetPage({super.key}); - - @override - Widget build(BuildContext context) { - final controller = WebViewController() - ..setBackgroundColor(Theme.of(context).colorScheme.background) - ..setNavigationDelegate( - NavigationDelegate( - onNavigationRequest: (NavigationRequest request) { - if (request.url.startsWith('didpay://')) { - _handleCallback(request.url, context); - } - return NavigationDecision.navigate; - }, - ), - ) - ..loadRequest(Uri.parse('https://tbd.website')); - - return Scaffold( - appBar: AppBar(title: const Text('Auth Widget')), - body: WebViewWidget( - controller: controller, - ), - ); - } - - void _handleCallback(String url, BuildContext context) { - // DIDPay stuff maybe - } -} diff --git a/frontend/lib/features/auth/welcome_page.dart b/frontend/lib/features/auth/welcome_page.dart deleted file mode 100644 index 5ee74af5..00000000 --- a/frontend/lib/features/auth/welcome_page.dart +++ /dev/null @@ -1,45 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:flutter_starter/features/auth/auth_did_page.dart'; -import 'package:flutter_starter/l10n/app_localizations.dart'; - -class WelcomePage extends StatelessWidget { - const WelcomePage({super.key}); - - @override - Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar(title: Text(Loc.of(context).appName)), - body: SafeArea( - child: Stack( - children: [ - SingleChildScrollView( - child: Padding( - padding: const EdgeInsets.symmetric(horizontal: 20.0), - child: Text( - Loc.of(context).toSendMoney, - style: Theme.of(context).textTheme.headlineSmall, - ), - ), - ), - Align( - alignment: Alignment.bottomCenter, - child: Padding( - padding: const EdgeInsets.symmetric(horizontal: 20.0), - child: SizedBox( - width: double.infinity, - child: FilledButton( - child: Text(Loc.of(context).getStarted), - onPressed: () => Navigator.of(context).push( - MaterialPageRoute( - builder: (context) => const AuthDidPage(), - ), - )), - ), - ), - ), - ], - ), - ), - ); - } -} diff --git a/frontend/lib/features/home/home_page.dart b/frontend/lib/features/home/home_page.dart new file mode 100644 index 00000000..c09949dd --- /dev/null +++ b/frontend/lib/features/home/home_page.dart @@ -0,0 +1,36 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_starter/features/pfis/pfi_providers.dart'; +import 'package:hooks_riverpod/hooks_riverpod.dart'; +import 'package:url_launcher/url_launcher.dart'; + +class HomePage extends HookConsumerWidget { + const HomePage({super.key}); + + @override + Widget build(BuildContext context, WidgetRef ref) { + final pfis = ref.watch(pfisProvider); + return Scaffold( + appBar: AppBar(title: const Text('Home')), + body: ListView( + children: [ + ...pfis.map( + (e) => ListTile( + title: Text(e.name), + subtitle: Text(e.id), + trailing: const Icon(Icons.chevron_right), + onTap: () { + _launchUrl(e.widgetUrl); + }, + ), + ) + ], + ), + ); + } + + Future _launchUrl(String url) async { + if (!await launchUrl(Uri.parse(url))) { + throw Exception('Could not launch $url'); + } + } +} diff --git a/frontend/lib/features/pfis/pfi.dart b/frontend/lib/features/pfis/pfi.dart new file mode 100644 index 00000000..232c79a1 --- /dev/null +++ b/frontend/lib/features/pfis/pfi.dart @@ -0,0 +1,11 @@ +class Pfi { + final String id; + final String name; + final String widgetUrl; + + Pfi({ + required this.id, + required this.name, + required this.widgetUrl, + }); +} diff --git a/frontend/lib/features/pfis/pfi_providers.dart b/frontend/lib/features/pfis/pfi_providers.dart new file mode 100644 index 00000000..31beef80 --- /dev/null +++ b/frontend/lib/features/pfis/pfi_providers.dart @@ -0,0 +1,9 @@ +import 'package:flutter_starter/features/pfis/pfi.dart'; +import 'package:hooks_riverpod/hooks_riverpod.dart'; + +final pfisProvider = Provider>( + (ref) => [ + Pfi(id: 'africa', name: 'Africa', widgetUrl: 'https://tbd.website'), + Pfi(id: 'mexico', name: 'Mexico', widgetUrl: 'https://block.xyz'), + ], +); diff --git a/frontend/lib/features/sample/sample_page.dart b/frontend/lib/features/sample/sample_page.dart deleted file mode 100644 index de35e428..00000000 --- a/frontend/lib/features/sample/sample_page.dart +++ /dev/null @@ -1,13 +0,0 @@ -import 'package:flutter/material.dart'; - -class SamplePage extends StatelessWidget { - final String title; - const SamplePage({required this.title, super.key}); - - @override - Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar(title: Text(title)), - ); - } -} diff --git a/frontend/lib/main.dart b/frontend/lib/main.dart index 54252d4d..2058c304 100644 --- a/frontend/lib/main.dart +++ b/frontend/lib/main.dart @@ -1,7 +1,40 @@ import 'package:flutter/material.dart'; +import 'package:flutter_secure_storage/flutter_secure_storage.dart'; +import 'package:flutter_starter/features/account/account_providers.dart'; import 'package:flutter_starter/features/app/app.dart'; +import 'package:flutter_starter/services/service_providers.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart'; +import 'package:tbdex/tbdex.dart'; -void main() { - runApp(const ProviderScope(child: App())); +void main() async { + WidgetsFlutterBinding.ensureInitialized(); + + FlutterSecureStorage storage = const FlutterSecureStorage( + iOptions: IOSOptions(accessibility: KeychainAccessibility.first_unlock), + aOptions: AndroidOptions(encryptedSharedPreferences: true), + ); + + final did = await getOrCreateDid(storage); + + runApp(ProviderScope( + overrides: [ + secureStorage.overrideWithValue(storage), + didProvider.overrideWithValue(did), + ], + child: const App(), + )); +} + +Future getOrCreateDid(FlutterSecureStorage storage) async { + const didKey = 'did'; + final did = await storage.read(key: didKey); + if (did != null) { + return did; + } + + final keyManager = InMemoryKeyManager(); + final jwt = await DidJwk.create(keyManager: keyManager); + await storage.write(key: didKey, value: jwt.uri); + + return jwt.uri; } diff --git a/frontend/lib/services/service_providers.dart b/frontend/lib/services/service_providers.dart new file mode 100644 index 00000000..d319e381 --- /dev/null +++ b/frontend/lib/services/service_providers.dart @@ -0,0 +1,5 @@ +import 'package:flutter_secure_storage/flutter_secure_storage.dart'; +import 'package:hooks_riverpod/hooks_riverpod.dart'; + +final secureStorage = + Provider((ref) => throw UnimplementedError()); diff --git a/frontend/pubspec.lock b/frontend/pubspec.lock index f4d6319a..7fc5bb90 100644 --- a/frontend/pubspec.lock +++ b/frontend/pubspec.lock @@ -107,11 +107,64 @@ packages: url: "https://pub.dev" source: hosted version: "2.4.9" + flutter_secure_storage: + dependency: "direct main" + description: + name: flutter_secure_storage + sha256: ffdbb60130e4665d2af814a0267c481bcf522c41ae2e43caf69fa0146876d685 + url: "https://pub.dev" + source: hosted + version: "9.0.0" + flutter_secure_storage_linux: + dependency: transitive + description: + name: flutter_secure_storage_linux + sha256: "3d5032e314774ee0e1a7d0a9f5e2793486f0dff2dd9ef5a23f4e3fb2a0ae6a9e" + url: "https://pub.dev" + source: hosted + version: "1.2.0" + flutter_secure_storage_macos: + dependency: transitive + description: + name: flutter_secure_storage_macos + sha256: bd33935b4b628abd0b86c8ca20655c5b36275c3a3f5194769a7b3f37c905369c + url: "https://pub.dev" + source: hosted + version: "3.0.1" + flutter_secure_storage_platform_interface: + dependency: transitive + description: + name: flutter_secure_storage_platform_interface + sha256: "0d4d3a5dd4db28c96ae414d7ba3b8422fd735a8255642774803b2532c9a61d7e" + url: "https://pub.dev" + source: hosted + version: "1.0.2" + flutter_secure_storage_web: + dependency: transitive + description: + name: flutter_secure_storage_web + sha256: "30f84f102df9dcdaa2241866a958c2ec976902ebdaa8883fbfe525f1f2f3cf20" + url: "https://pub.dev" + source: hosted + version: "1.1.2" + flutter_secure_storage_windows: + dependency: transitive + description: + name: flutter_secure_storage_windows + sha256: "5809c66f9dd3b4b93b0a6e2e8561539405322ee767ac2f64d084e2ab5429d108" + url: "https://pub.dev" + source: hosted + version: "3.0.0" flutter_test: dependency: "direct dev" description: flutter source: sdk version: "0.0.0" + flutter_web_plugins: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" hooks_riverpod: dependency: "direct main" description: @@ -184,6 +237,62 @@ packages: url: "https://pub.dev" source: hosted version: "1.8.3" + path_provider: + dependency: transitive + description: + name: path_provider + sha256: a1aa8aaa2542a6bc57e381f132af822420216c80d4781f7aa085ca3229208aaa + url: "https://pub.dev" + source: hosted + version: "2.1.1" + path_provider_android: + dependency: transitive + description: + name: path_provider_android + sha256: "477184d672607c0a3bf68fbbf601805f92ef79c82b64b4d6eb318cbca4c48668" + url: "https://pub.dev" + source: hosted + version: "2.2.2" + path_provider_foundation: + dependency: transitive + description: + name: path_provider_foundation + sha256: "19314d595120f82aca0ba62787d58dde2cc6b5df7d2f0daf72489e38d1b57f2d" + url: "https://pub.dev" + source: hosted + version: "2.3.1" + path_provider_linux: + dependency: transitive + description: + name: path_provider_linux + sha256: f7a1fe3a634fe7734c8d3f2766ad746ae2a2884abe22e241a8b301bf5cac3279 + url: "https://pub.dev" + source: hosted + version: "2.2.1" + path_provider_platform_interface: + dependency: transitive + description: + name: path_provider_platform_interface + sha256: "94b1e0dd80970c1ce43d5d4e050a9918fce4f4a775e6142424c30a29a363265c" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + path_provider_windows: + dependency: transitive + description: + name: path_provider_windows + sha256: "8bc9f22eee8690981c22aa7fc602f5c85b497a6fb2ceb35ee5a5e5ed85ad8170" + url: "https://pub.dev" + source: hosted + version: "2.2.1" + platform: + dependency: transitive + description: + name: platform + sha256: "0a279f0707af40c890e80b1e9df8bb761694c074ba7e1d4ab1bc4b728e200b59" + url: "https://pub.dev" + source: hosted + version: "3.1.3" plugin_platform_interface: dependency: transitive description: @@ -278,6 +387,70 @@ packages: url: "https://pub.dev" source: hosted version: "1.3.2" + url_launcher: + dependency: "direct main" + description: + name: url_launcher + sha256: e9aa5ea75c84cf46b3db4eea212523591211c3cf2e13099ee4ec147f54201c86 + url: "https://pub.dev" + source: hosted + version: "6.2.2" + url_launcher_android: + dependency: transitive + description: + name: url_launcher_android + sha256: "31222ffb0063171b526d3e569079cf1f8b294075ba323443fdc690842bfd4def" + url: "https://pub.dev" + source: hosted + version: "6.2.0" + url_launcher_ios: + dependency: transitive + description: + name: url_launcher_ios + sha256: bba3373219b7abb6b5e0d071b0fe66dfbe005d07517a68e38d4fc3638f35c6d3 + url: "https://pub.dev" + source: hosted + version: "6.2.1" + url_launcher_linux: + dependency: transitive + description: + name: url_launcher_linux + sha256: ab360eb661f8879369acac07b6bb3ff09d9471155357da8443fd5d3cf7363811 + url: "https://pub.dev" + source: hosted + version: "3.1.1" + url_launcher_macos: + dependency: transitive + description: + name: url_launcher_macos + sha256: b7244901ea3cf489c5335bdacda07264a6e960b1c1b1a9f91e4bc371d9e68234 + url: "https://pub.dev" + source: hosted + version: "3.1.0" + url_launcher_platform_interface: + dependency: transitive + description: + name: url_launcher_platform_interface + sha256: "980e8d9af422f477be6948bdfb68df8433be71f5743a188968b0c1b887807e50" + url: "https://pub.dev" + source: hosted + version: "2.2.0" + url_launcher_web: + dependency: transitive + description: + name: url_launcher_web + sha256: "7286aec002c8feecc338cc33269e96b73955ab227456e9fb2a91f7fab8a358e9" + url: "https://pub.dev" + source: hosted + version: "2.2.2" + url_launcher_windows: + dependency: transitive + description: + name: url_launcher_windows + sha256: ecf9725510600aa2bb6d7ddabe16357691b6d2805f66216a97d1b881e21beff7 + url: "https://pub.dev" + source: hosted + version: "3.1.1" vector_math: dependency: transitive description: @@ -326,6 +499,22 @@ packages: url: "https://pub.dev" source: hosted version: "3.10.0" + win32: + dependency: transitive + description: + name: win32 + sha256: b0f37db61ba2f2e9b7a78a1caece0052564d1bc70668156cf3a29d676fe4e574 + url: "https://pub.dev" + source: hosted + version: "5.1.1" + xdg_directories: + dependency: transitive + description: + name: xdg_directories + sha256: "589ada45ba9e39405c198fe34eb0f607cddb2108527e658136120892beac46d2" + url: "https://pub.dev" + source: hosted + version: "1.0.3" sdks: - dart: ">=3.2.0-194.0.dev <4.0.0" - flutter: ">=3.10.0" + dart: ">=3.2.0 <4.0.0" + flutter: ">=3.16.0" diff --git a/frontend/pubspec.yaml b/frontend/pubspec.yaml index 339fadd8..0018e0ea 100644 --- a/frontend/pubspec.yaml +++ b/frontend/pubspec.yaml @@ -18,8 +18,10 @@ dependencies: ref: main flutter_hooks: ^0.20.3 + flutter_secure_storage: ^9.0.0 hooks_riverpod: ^2.4.9 intl: ^0.18.1 + url_launcher: ^6.2.2 webview_flutter: ^4.4.2 dev_dependencies: diff --git a/frontend/test/features/app/app_tabs_test.dart b/frontend/test/features/app/app_tabs_test.dart index bce2e9a5..3f5d91f7 100644 --- a/frontend/test/features/app/app_tabs_test.dart +++ b/frontend/test/features/app/app_tabs_test.dart @@ -1,5 +1,6 @@ +import 'package:flutter_starter/features/account/account_page.dart'; import 'package:flutter_starter/features/app/app_tabs.dart'; -import 'package:flutter_starter/features/sample/sample_page.dart'; +import 'package:flutter_starter/features/home/home_page.dart'; import 'package:flutter_test/flutter_test.dart'; import '../../helpers/widget_helpers.dart'; @@ -10,7 +11,7 @@ void main() { WidgetHelpers.testableWidget(child: const AppTabs()), ); - expect(find.byType(SamplePage), findsOneWidget); + expect(find.byType(HomePage), findsOneWidget); }); testWidgets('should show TodosPage when tapped', (WidgetTester tester) async { @@ -18,8 +19,8 @@ void main() { WidgetHelpers.testableWidget(child: const AppTabs()), ); - await tester.tap(find.text('Tab 2')); + await tester.tap(find.text('Account')); await tester.pumpAndSettle(); - expect(find.byType(SamplePage), findsOneWidget); + expect(find.byType(AccountPage), findsOneWidget); }); } diff --git a/frontend/test/features/app/app_test.dart b/frontend/test/features/app/app_test.dart index 264e6822..652c14ba 100644 --- a/frontend/test/features/app/app_test.dart +++ b/frontend/test/features/app/app_test.dart @@ -1,5 +1,5 @@ import 'package:flutter_starter/features/app/app.dart'; -import 'package:flutter_starter/features/auth/welcome_page.dart'; +import 'package:flutter_starter/features/app/app_tabs.dart'; import 'package:flutter_test/flutter_test.dart'; import '../../helpers/widget_helpers.dart'; @@ -10,6 +10,6 @@ void main() { WidgetHelpers.testableWidget(child: const App()), ); - expect(find.byType(WelcomePage), findsOneWidget); + expect(find.byType(AppTabs), findsOneWidget); }); }