Skip to content

Commit

Permalink
Merge branch 'main' into TALAO
Browse files Browse the repository at this point in the history
  • Loading branch information
hawkbee1 committed Jun 28, 2024
2 parents 6f41914 + 6ad0642 commit fcedae0
Show file tree
Hide file tree
Showing 90 changed files with 1,241 additions and 1,028 deletions.
2 changes: 1 addition & 1 deletion lib/app/shared/constants/sizes.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ abstract class Sizes {
///borderRadius
static const double credentialBorderRadius = 16;
static const double smallRadius = 8;
static const double normalRadius = 12;
static const double normalRadius = 10;
static const double largeRadius = 18;

static const double credentialAspectRatio = 500 / 300;
Expand Down
25 changes: 20 additions & 5 deletions lib/app/shared/helper_functions/helper_functions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import 'package:key_generator/key_generator.dart';
import 'package:oidc4vc/oidc4vc.dart';
import 'package:permission_handler/permission_handler.dart';
import 'package:secure_storage/secure_storage.dart';
import 'package:uuid/uuid.dart';
import 'package:x509/x509.dart' as x509;
import 'package:x509/x509.dart';

Expand Down Expand Up @@ -1568,7 +1569,12 @@ bool supportCryptoCredential(ProfileModel profileModel) {
return supportAssociatedCredential;
}

Future<(String?, String?, String?, String?)> getClientDetails({
// clientId,
// clientSecret,
// authorization,
// oAuthClientAttestation,
// oAuthClientAttestationPop
Future<(String?, String?, String?, String?, String?)> getClientDetails({
required ProfileCubit profileCubit,
required bool isEBSIV3,
required String issuer,
Expand All @@ -1577,7 +1583,8 @@ Future<(String?, String?, String?, String?)> getClientDetails({
String? clientId;
String? clientSecret;
String? authorization;
String? clientAssertion;
String? oAuthClientAttestation;
String? oAuthClientAttestationPop;

final customOidc4vcProfile = profileCubit.state.model.profileSetting
.selfSovereignIdentityOptions.customOidc4vcProfile;
Expand Down Expand Up @@ -1663,6 +1670,7 @@ Future<(String?, String?, String?, String?)> getClientDetails({
'aud': issuer,
'nbf': nbf,
'exp': nbf + 60,
'jti': const Uuid().v4(),
};

final jwtProofOfPossession = profileCubit.oidc4vc.generateToken(
Expand All @@ -1671,12 +1679,19 @@ Future<(String?, String?, String?, String?)> getClientDetails({
ignoreProofHeaderType: true,
);

clientAssertion = '$walletAttestationData~$jwtProofOfPossession';
oAuthClientAttestation = walletAttestationData;
oAuthClientAttestationPop = jwtProofOfPossession;
}

return (clientId, clientSecret, authorization, clientAssertion);
return (
clientId,
clientSecret,
authorization,
oAuthClientAttestation,
oAuthClientAttestationPop
);
} catch (e) {
return (null, null, null, null);
return (null, null, null, null, null);
}
}

Expand Down
3 changes: 0 additions & 3 deletions lib/app/shared/loading/loading_view.dart
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import 'dart:async';

import 'package:altme/app/app.dart';
import 'package:altme/dashboard/dashboard.dart';
import 'package:altme/l10n/l10n.dart';

import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';

class LoadingView {
factory LoadingView() => _shared;
Expand Down Expand Up @@ -67,7 +65,6 @@ class LoadingView {
children: [
const SizedBox(height: 10),
WalletLogo(
profileModel: context.read<ProfileCubit>().state.model,
height: Sizes.logoNormal,
width: MediaQuery.of(context).size.shortestSide * 0.5,
showPoweredBy: true,
Expand Down
4 changes: 3 additions & 1 deletion lib/app/shared/widget/base/background_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ class BackgroundCard extends StatelessWidget {
this.color,
this.height,
this.width,
this.borderRadius = 10,
});

final Widget? child;
Expand All @@ -17,6 +18,7 @@ class BackgroundCard extends StatelessWidget {
final Color? color;
final double? height;
final double? width;
final double borderRadius;

@override
Widget build(BuildContext context) {
Expand All @@ -27,7 +29,7 @@ class BackgroundCard extends StatelessWidget {
width: width,
decoration: BoxDecoration(
color: color ?? Theme.of(context).colorScheme.surfaceContainer,
borderRadius: const BorderRadius.all(Radius.circular(15)),
borderRadius: BorderRadius.all(Radius.circular(borderRadius)),
),
child: child,
);
Expand Down
4 changes: 2 additions & 2 deletions lib/app/shared/widget/base/page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,8 @@ class _BasePageState extends State<BasePage> with WidgetsBindingObserver {
floatingActionButton: widget.floatingActionButton,
floatingActionButtonLocation: widget.floatingActionButtonLocation,
extendBody: widget.extendBelow ?? false,
backgroundColor: widget.backgroundColor ??
Theme.of(context).colorScheme.surface,
backgroundColor:
widget.backgroundColor ?? Theme.of(context).colorScheme.surface,
appBar: (widget.title == null &&
widget.titleLeading == null &&
widget.titleTrailing == null)
Expand Down
14 changes: 12 additions & 2 deletions lib/app/shared/widget/button/my_elevated_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,14 @@ class MyElevatedButton extends StatelessWidget {
text.toUpperCase(),
style: Theme.of(context).textTheme.titleLarge!.copyWith(
fontWeight: FontWeight.bold,
color: Theme.of(context).colorScheme.onPrimaryContainer,
),
),
)
: ElevatedButton.icon(
icon: ColorFiltered(
colorFilter: ColorFilter.mode(
textColor ?? Theme.of(context).textTheme.titleLarge!.color!,
textColor ?? Theme.of(context).colorScheme.onPrimaryContainer,
BlendMode.srcIn,
),
child: icon,
Expand All @@ -80,6 +81,7 @@ class MyElevatedButton extends StatelessWidget {
text.toUpperCase(),
style: Theme.of(context).textTheme.titleLarge!.copyWith(
fontWeight: FontWeight.bold,
color: Theme.of(context).colorScheme.onPrimaryContainer,
),
),
),
Expand All @@ -103,7 +105,15 @@ ButtonStyle elevatedStyleFrom({
backgroundColor: WidgetStateProperty.all(
onPressed == null
? Theme.of(context).colorScheme.outline
: backgroundColor ?? Theme.of(context).colorScheme.secondaryContainer,
: backgroundColor ?? Theme.of(context).colorScheme.primaryContainer,
),
side: WidgetStatePropertyAll(
BorderSide(
color: onPressed == null
? Theme.of(context).colorScheme.outline
: Theme.of(context).colorScheme.primaryContainer,
width: 2,
),
),
shape: WidgetStateProperty.all(
RoundedRectangleBorder(
Expand Down
10 changes: 5 additions & 5 deletions lib/app/shared/widget/button/my_outlined_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@ class MyOutlinedButton extends StatelessWidget {
color: onPressed == null
? Theme.of(context)
.colorScheme
.onSurface
.inverseSurface
.withOpacity(0.12)
: textColor ??
Theme.of(context).colorScheme.secondaryContainer,
Theme.of(context).colorScheme.inverseSurface,
),
),
)
Expand Down Expand Up @@ -118,11 +118,11 @@ ButtonStyle outlinedStyleFrom({
return OutlinedButton.styleFrom(
padding: EdgeInsets.symmetric(vertical: verticalSpacing),
elevation: elevation,
backgroundColor: backgroundColor ?? Theme.of(context).colorScheme.surface,
backgroundColor: backgroundColor ?? Colors.transparent,
side: BorderSide(
color: onPressed == null
? Theme.of(context).colorScheme.onSurface.withOpacity(0.12)
: borderColor ?? Theme.of(context).colorScheme.secondaryContainer,
? Theme.of(context).colorScheme.inverseSurface.withOpacity(0.12)
: borderColor ?? Theme.of(context).colorScheme.inverseSurface,
width: 2,
),
shape: RoundedRectangleBorder(
Expand Down
11 changes: 9 additions & 2 deletions lib/app/shared/widget/custom_app_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,12 @@ class CustomAppBar extends PreferredSize {
color: Theme.of(context).colorScheme.surface,
child: SafeArea(
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 12),
padding: const EdgeInsets.fromLTRB(
10,
0,
15,
0,
),
child: Stack(
alignment: Alignment.topCenter,
children: [
Expand All @@ -50,7 +55,9 @@ class CustomAppBar extends PreferredSize {
title ?? '',
maxLines: 2,
textAlign: TextAlign.center,
style: Theme.of(context).textTheme.headlineSmall,
style: Theme.of(context).textTheme.headlineSmall!.copyWith(
fontWeight: FontWeight.bold,
),
),
),
],
Expand Down
15 changes: 2 additions & 13 deletions lib/app/shared/widget/custom_listtile_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,13 @@ class CustomListTileCard extends StatelessWidget {
required this.title,
required this.subTitle,
required this.imageAssetPath,
this.recommended = false,
this.onTap,
});

final String title;
final String subTitle;
final String imageAssetPath;
final VoidCallback? onTap;
final bool recommended;

@override
Widget build(BuildContext context) {
Expand All @@ -27,8 +25,8 @@ class CustomListTileCard extends StatelessWidget {
Radius.circular(Sizes.normalRadius),
),
),
contentPadding: const EdgeInsets.all(Sizes.spaceNormal),
tileColor: Theme.of(context).colorScheme.secondaryContainer,
contentPadding: const EdgeInsets.all(Sizes.spaceSmall),
tileColor: Theme.of(context).colorScheme.surfaceContainer,
title: Row(
children: [
Expanded(
Expand All @@ -40,14 +38,6 @@ class CustomListTileCard extends StatelessWidget {
),
),
const SizedBox(width: 10),
if (recommended)
const Icon(
Icons.thumb_up,
// size: 38,
color: Colors.white,
)
else
const SizedBox.shrink(),
],
),
subtitle: Text(
Expand All @@ -59,7 +49,6 @@ class CustomListTileCard extends StatelessWidget {
imageAssetPath,
width: Sizes.icon5x,
height: Sizes.icon5x,
fit: BoxFit.fitHeight,
),
);
}
Expand Down
18 changes: 18 additions & 0 deletions lib/app/shared/widget/divider_for_radio_list.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import 'package:flutter/material.dart';

class DividerForRadioList extends StatelessWidget {
const DividerForRadioList({
super.key,
});

@override
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 8),
child: Divider(
height: 0,
color: Theme.of(context).colorScheme.onSurface.withOpacity(0.12),
),
);
}
}
Loading

0 comments on commit fcedae0

Please sign in to comment.