Skip to content

Commit

Permalink
feat: Update activity log and reset screen #3183
Browse files Browse the repository at this point in the history
  • Loading branch information
bibash28 committed Dec 12, 2024
1 parent c4cdbd9 commit da7945d
Show file tree
Hide file tree
Showing 2 changed files with 83 additions and 71 deletions.
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
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

0 comments on commit da7945d

Please sign in to comment.