Skip to content

Commit

Permalink
Merge branch 'october'
Browse files Browse the repository at this point in the history
  • Loading branch information
hawkbee1 committed Dec 12, 2024
2 parents 9a7e59c + 2d4bd64 commit 9d633e3
Show file tree
Hide file tree
Showing 20 changed files with 290 additions and 155 deletions.
7 changes: 7 additions & 0 deletions lib/app/shared/helper_functions/helper_functions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1301,6 +1301,13 @@ MessageHandler getMessageHandler(dynamic e) {
'error_description': 'Kid does not match the did document.',
},
);
} else if (stringException.contains('C_NONCE_NOT_AVAILABLE')) {
return ResponseMessage(
data: {
'error': 'invalid_request',
'error_description': 'c_nonce is not avaiable.',
},
);
} else {
return ResponseMessage(
message:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,19 +86,19 @@ class AboutAltmeView extends StatelessWidget {
),
],
const SizedBox(height: Sizes.spaceXSmall),
FutureBuilder<PackageInfo>(
future: PackageInfo.fromPlatform(),
builder: (_, snapShot) {
var appVersion = '...';
if (snapShot.connectionState == ConnectionState.done) {
appVersion = snapShot.data?.version ?? '0.1.0';
}
return DrawerItem(
title: '${l10n.yourAppVersion} : $appVersion',
trailing: Container(),
);
},
),
// FutureBuilder<PackageInfo>(
// future: PackageInfo.fromPlatform(),
// builder: (_, snapShot) {
// var appVersion = '...';
// if (snapShot.connectionState == ConnectionState.done) {
// appVersion = snapShot.data?.version ?? '0.1.0';
// }
// return DrawerItem(
// title: '${l10n.yourAppVersion} : $appVersion',
// trailing: Container(),
// );
// },
// ),
DrawerItem(
title: l10n.termsOfUse,
onTap: () =>
Expand Down
146 changes: 78 additions & 68 deletions lib/dashboard/drawer/activity_log/view/activity_log_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -61,85 +61,95 @@ class _ActivityLogViewState extends State<ActivityLogView> {
builder: (context, state) {
return BasePage(
scrollView: false,
title: l10n.activityLog,
titleAlignment: Alignment.topCenter,
titleLeading: const BackLeadingButton(),
body: ListView.builder(
itemCount: state.logDatas.length,
padding: EdgeInsets.zero,
shrinkWrap: true,
physics: const ScrollPhysics(),
itemBuilder: (context, index) {
final LogData logData = state.logDatas[index];
body: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const BackLeadingButton(padding: EdgeInsets.zero),
const DrawerLogo(),
const AppVersionDrawer(),
const SizedBox(height: Sizes.spaceNormal),
Expanded(
child: ListView.builder(
itemCount: state.logDatas.length,
padding: EdgeInsets.zero,
shrinkWrap: true,
physics: const ScrollPhysics(),
itemBuilder: (context, index) {
final LogData logData = state.logDatas[index];

var message = '';
var message = '';

var credentialName = '';
var domainName = '';
var credentialName = '';
var domainName = '';

if (logData.vcInfo != null) {
credentialName = logData.vcInfo!.name;
domainName = logData.vcInfo!.domain ?? '';
}
if (logData.vcInfo != null) {
credentialName = logData.vcInfo!.name;
domainName = logData.vcInfo!.domain ?? '';
}

switch (logData.type) {
case LogType.walletInit:
message = l10n.walletInitialized;
case LogType.backupData:
message = l10n.backupCredentials;
case LogType.restoreWallet:
message = l10n.restoredCredentials;
case LogType.addVC:
message = l10n.addedCredential(credentialName, domainName);
case LogType.deleteVC:
message = l10n.deletedCredential(credentialName);
case LogType.presentVC:
message =
l10n.presentedCredential(credentialName, domainName);
case LogType.importKey:
message = l10n.keysImported;
}
switch (logData.type) {
case LogType.walletInit:
message = l10n.walletInitialized;
case LogType.backupData:
message = l10n.backupCredentials;
case LogType.restoreWallet:
message = l10n.restoredCredentials;
case LogType.addVC:
message =
l10n.addedCredential(credentialName, domainName);
case LogType.deleteVC:
message = l10n.deletedCredential(credentialName);
case LogType.presentVC:
message = l10n.presentedCredential(
credentialName, domainName);
case LogType.importKey:
message = l10n.keysImported;
}

return Column(
children: [
BackgroundCard(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
return Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Text(
UiDate.formatDatetime(logData.timestamp),
style: TextStyle(
color: colorScheme.onSurface,
fontSize: 12,
fontWeight: FontWeight.w500,
height: 1.333,
BackgroundCard(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Text(
UiDate.formatDatetime(logData.timestamp),
style: TextStyle(
color: colorScheme.onSurface,
fontSize: 12,
fontWeight: FontWeight.w500,
height: 1.333,
),
),
],
),
),
],
),
const SizedBox(height: 4),
Container(
alignment: Alignment.centerLeft,
child: Text(
message,
style: TextStyle(
color: colorScheme.onSurface,
fontSize: 16,
fontWeight: FontWeight.w500,
height: 1.5,
),
const SizedBox(height: 4),
Container(
alignment: Alignment.centerLeft,
child: Text(
message,
style: TextStyle(
color: colorScheme.onSurface,
fontSize: 16,
fontWeight: FontWeight.w500,
height: 1.5,
),
),
),
],
),
),
const SizedBox(height: 10),
],
),
),
const SizedBox(height: 10),
],
);
},
);
},
),
),
],
),
);
},
Expand Down
4 changes: 1 addition & 3 deletions lib/dashboard/drawer/profile/view/pick_profile_menu.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ class PickProfileMenuView extends StatelessWidget {
body: const Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
BackLeadingButton(
padding: EdgeInsets.zero,
),
BackLeadingButton(padding: EdgeInsets.zero),
DrawerLogo(),
ProfileSelectorWidget(),
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class ProfileSelectorWidget extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'Choose your SSI profile or customize your own',
context.l10n.chooseYourSSIProfileOrCustomizeYourOwn,
style: Theme.of(context).textTheme.titleMedium,
),
],
Expand Down
8 changes: 5 additions & 3 deletions lib/dashboard/drawer/reset_wallet/view/reset_wallet_menu.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,21 @@ class ResetWalletView extends StatelessWidget {
Widget build(BuildContext context) {
final l10n = context.l10n;
return BasePage(
title: l10n.resetWallet,
useSafeArea: true,
scrollView: false,
titleAlignment: Alignment.topCenter,
padding: const EdgeInsets.symmetric(horizontal: Sizes.spaceSmall),
titleLeading: const BackLeadingButton(),
backgroundColor: Theme.of(context).colorScheme.surface,
body: BlocBuilder<ResetWalletCubit, ResetWalletState>(
builder: (context, state) {
return Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
const BackLeadingButton(padding: EdgeInsets.zero),
const DrawerLogo(),
const AppVersionDrawer(),
const SizedBox(height: Sizes.spaceNormal),
Text(
l10n.resetWalletTitle,
textAlign: TextAlign.center,
Expand Down
20 changes: 0 additions & 20 deletions lib/dashboard/profile/models/profile_setting.dart
Original file line number Diff line number Diff line change
Expand Up @@ -746,11 +746,6 @@ class CustomOidc4VcProfile extends Equatable {
final String? clientSecret;
final bool cryptoHolderBinding;
final DidKeyType defaultDid;
// TODO(bibash): temporary solution to avoid who have chosen 12
@JsonKey(
includeFromJson: true,
fromJson: oidc4vciDraftFromJson,
)
final OIDC4VCIDraftType oidc4vciDraft;
final OIDC4VPDraftType oidc4vpDraft;
final bool scope;
Expand All @@ -769,21 +764,6 @@ class CustomOidc4VcProfile extends Equatable {

Map<String, dynamic> toJson() => _$CustomOidc4VcProfileToJson(this);

static OIDC4VCIDraftType oidc4vciDraftFromJson(dynamic value) {
if (value == '11') {
return OIDC4VCIDraftType.draft11;
} else if (value == '12' || value == '13') {
return OIDC4VCIDraftType.draft13;
} else {
throw ResponseMessage(
data: {
'error': 'invalid_format',
'error_description': 'Error with oidc4vc draft type.',
},
);
}
}

CustomOidc4VcProfile copyWith({
ClientAuthentication? clientAuthentication,
bool? credentialManifestSupport,
Expand Down
13 changes: 7 additions & 6 deletions lib/dashboard/profile/models/profile_setting.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 9d633e3

Please sign in to comment.