generated from TBD54566975/tbd-project-template
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1742c13
commit bf0e880
Showing
20 changed files
with
375 additions
and
188 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,4 @@ analyzer: | |
|
||
linter: | ||
rules: | ||
- prefer_single_quotes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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))), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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(), | ||
), | ||
); | ||
}), | ||
], | ||
), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import 'package:hooks_riverpod/hooks_riverpod.dart'; | ||
|
||
final didProvider = Provider<String>((ref) => throw UnimplementedError()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<void> _launchUrl(String url) async { | ||
if (!await launchUrl(Uri.parse(url))) { | ||
throw Exception('Could not launch $url'); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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, | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import 'package:flutter_starter/features/pfis/pfi.dart'; | ||
import 'package:hooks_riverpod/hooks_riverpod.dart'; | ||
|
||
final pfisProvider = Provider<List<Pfi>>( | ||
(ref) => [ | ||
Pfi(id: 'africa', name: 'Africa', widgetUrl: 'https://tbd.website'), | ||
Pfi(id: 'mexico', name: 'Mexico', widgetUrl: 'https://block.xyz'), | ||
], | ||
); |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.