Skip to content

Commit

Permalink
KCC issuance - take 1 (#170)
Browse files Browse the repository at this point in the history
Co-authored-by: Wes <[email protected]>
  • Loading branch information
mistermoe and wesbillman authored May 25, 2024
1 parent 9a2b786 commit b869279
Show file tree
Hide file tree
Showing 28 changed files with 2,015 additions and 195 deletions.
20 changes: 17 additions & 3 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@ PODS:
- device_info_plus (0.0.1):
- Flutter
- Flutter (1.0.0)
- flutter_inappwebview_ios (0.0.1):
- Flutter
- flutter_inappwebview_ios/Core (= 0.0.1)
- OrderedSet (~> 5.0)
- flutter_inappwebview_ios/Core (0.0.1):
- Flutter
- OrderedSet (~> 5.0)
- flutter_secure_storage (6.0.0):
- Flutter
- GoogleDataTransport (9.3.0):
Expand Down Expand Up @@ -60,6 +67,7 @@ PODS:
- nanopb/encode (= 2.30909.1)
- nanopb/decode (2.30909.1)
- nanopb/encode (2.30909.1)
- OrderedSet (5.0.0)
- path_provider_foundation (0.0.1):
- Flutter
- FlutterMacOS
Expand All @@ -75,6 +83,7 @@ PODS:
DEPENDENCIES:
- device_info_plus (from `.symlinks/plugins/device_info_plus/ios`)
- Flutter (from `Flutter`)
- flutter_inappwebview_ios (from `.symlinks/plugins/flutter_inappwebview_ios/ios`)
- flutter_secure_storage (from `.symlinks/plugins/flutter_secure_storage/ios`)
- mobile_scanner (from `.symlinks/plugins/mobile_scanner/ios`)
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
Expand All @@ -95,13 +104,16 @@ SPEC REPOS:
- MLKitCommon
- MLKitVision
- nanopb
- OrderedSet
- PromisesObjC

EXTERNAL SOURCES:
device_info_plus:
:path: ".symlinks/plugins/device_info_plus/ios"
Flutter:
:path: Flutter
flutter_inappwebview_ios:
:path: ".symlinks/plugins/flutter_inappwebview_ios/ios"
flutter_secure_storage:
:path: ".symlinks/plugins/flutter_secure_storage/ios"
mobile_scanner:
Expand All @@ -118,6 +130,7 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS:
device_info_plus: c6fb39579d0f423935b0c9ce7ee2f44b71b9fce6
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
flutter_inappwebview_ios: 97215cf7d4677db55df76782dbd2930c5e1c1ea0
flutter_secure_storage: 23fc622d89d073675f2eaa109381aefbcf5a49be
GoogleDataTransport: 57c22343ab29bc686febbf7cbb13bad167c2d8fe
GoogleMLKit: 2bd0dc6253c4d4f227aad460f69215a504b2980e
Expand All @@ -131,12 +144,13 @@ SPEC CHECKSUMS:
MLKitVision: 8baa5f46ee3352614169b85250574fde38c36f49
mobile_scanner: 38dcd8a49d7d485f632b7de65e4900010187aef2
nanopb: d4d75c12cd1316f4a64e3c6963f879ecd4b5e0d5
OrderedSet: aaeb196f7fef5a9edf55d89760da9176ad40b93c
path_provider_foundation: 3784922295ac71e43754bd15e0653ccfd36a147c
PromisesObjC: c50d2056b5253dadbd6c2bea79b0674bd5a52fa4
shared_preferences_foundation: b4c3b4cddf1c21f02770737f147a3f5da9d39695
url_launcher_ios: 6116280ddcfe98ab8820085d8d76ae7449447586
webview_flutter_wkwebview: be0f0d33777f1bfd0c9fdcb594786704dbf65f36
url_launcher_ios: bbd758c6e7f9fd7b5b1d4cde34d2b95fcce5e812
webview_flutter_wkwebview: 4f3e50f7273d31e5500066ed267e3ae4309c5ae4

PODFILE CHECKSUM: 819463e6a0290f5a72f145ba7cde16e8b6ef0796

COCOAPODS: 1.15.2
COCOAPODS: 1.13.0
1 change: 1 addition & 0 deletions lib/features/app/app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'package:didpay/features/app/app_tabs.dart';
import 'package:didpay/features/pfis/add_pfi_page.dart';
import 'package:didpay/features/pfis/pfis_notifier.dart';
import 'package:didpay/l10n/app_localizations.dart';
import 'package:didpay/shared/modal_flow.dart';
import 'package:didpay/shared/theme/theme.dart';
import 'package:flutter/material.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
Expand Down
19 changes: 0 additions & 19 deletions lib/features/idv/idv_request.dart

This file was deleted.

122 changes: 0 additions & 122 deletions lib/features/idv/idv_service.dart

This file was deleted.

137 changes: 137 additions & 0 deletions lib/features/kcc/kcc_consent_page.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
import 'package:didpay/features/kcc/kcc_webview_page.dart';
import 'package:didpay/features/pfis/pfi.dart';
import 'package:didpay/l10n/app_localizations.dart';
import 'package:didpay/shared/theme/grid.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';

class KccConsentPage extends HookConsumerWidget {
final Pfi pfi;

const KccConsentPage({required this.pfi, super.key});

@override
Widget build(BuildContext context, WidgetRef ref) {
final hasAgreed = useState(false);

return Scaffold(
appBar: AppBar(),
body: SafeArea(
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
_buildHeader(
context,
Loc.of(context).termsOfService,
Loc.of(context).exampleTerms,
),
const Spacer(),
_buildUserAndPrivacyAgreement(context, hasAgreed),
_buildNextButton(context, ref, hasAgreed.value),
],
),
),
);
}

Widget _buildHeader(BuildContext context, String title, String subtitle) =>
Padding(
padding: const EdgeInsets.symmetric(
horizontal: Grid.side,
vertical: Grid.xs,
),
child: Column(
children: [
Align(
alignment: Alignment.topLeft,
child: Text(
title,
style: Theme.of(context).textTheme.headlineSmall?.copyWith(
fontWeight: FontWeight.bold,
),
),
),
const SizedBox(height: Grid.xs),
Align(
alignment: Alignment.topLeft,
child: Text(
subtitle,
style: Theme.of(context).textTheme.bodyMedium,
),
),
],
),
);

Widget _buildUserAndPrivacyAgreement(
BuildContext context,
ValueNotifier<bool> hasAgreed,
) =>
Padding(
padding:
const EdgeInsets.only(left: 5, right: Grid.side, bottom: Grid.xs),
child: GestureDetector(
onTapUp: (_) => hasAgreed.value = !hasAgreed.value,
child: Row(
children: [
Checkbox(
value: hasAgreed.value,
onChanged: (newValue) => hasAgreed.value = newValue ?? false,
),
const SizedBox(
width: Grid.xxs,
),
Expanded(
child: RichText(
text: TextSpan(
style: Theme.of(context).textTheme.bodySmall,
children: <TextSpan>[
TextSpan(text: Loc.of(context).iCertifyThatIAgreeToThe),
TextSpan(
text: Loc.of(context).userAgreement,
style: TextStyle(
color: Theme.of(context).colorScheme.primary,
),
recognizer: TapGestureRecognizer(),
),
TextSpan(text: Loc.of(context).andIHaveReadThe),
TextSpan(
text: Loc.of(context).privacyPolicy,
style: TextStyle(
color: Theme.of(context).colorScheme.primary,
),
recognizer: TapGestureRecognizer(),
),
const TextSpan(text: '.'),
],
),
),
),
],
),
),
);

Widget _buildNextButton(
BuildContext context,
WidgetRef ref,
bool hasAgreed,
) =>
Padding(
padding: const EdgeInsets.symmetric(horizontal: Grid.side),
child: FilledButton(
onPressed: !hasAgreed
? null
: () {
Navigator.of(context).push(
MaterialPageRoute(
builder: (_) => KccWebviewPage(pfi: pfi),
),
);
},
child: Text(Loc.of(context).next),
),
);
}
Loading

0 comments on commit b869279

Please sign in to comment.