Skip to content

Commit

Permalink
design improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
hawkbee1 committed Jun 28, 2024
1 parent 04d1d9b commit 114db86
Show file tree
Hide file tree
Showing 10 changed files with 97 additions and 92 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ class BlockchainSettingsView extends StatelessWidget {
Navigator.of(context).push<void>(ManageAccountsPage.route());
},
),
const SizedBox(height: Sizes.spaceSmall),
DrawerItem(
title: l10n.manageConnectedApps,
onTap: () {
Expand All @@ -61,7 +60,6 @@ class BlockchainSettingsView extends StatelessWidget {
);
},
),
const SizedBox(height: Sizes.spaceSmall),
DrawerItem(
title: l10n.blockchainNetwork,
onTap: () async {
Expand Down
3 changes: 0 additions & 3 deletions lib/dashboard/drawer/src/view/check_linkedin_profile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,6 @@ class CheckForLinkedInProfileView extends StatelessWidget {
width: MediaQuery.of(context).size.shortestSide * 0.5,
showPoweredBy: true,
),
const SizedBox(
height: Sizes.spaceSmall,
),
DrawerItem(
title: l10n.scanAndDisplay,
onTap: () async {
Expand Down
128 changes: 68 additions & 60 deletions lib/dashboard/drawer/src/widgets/drawer_item.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,73 +20,81 @@ class DrawerItem extends StatelessWidget {

@override
Widget build(BuildContext context) {
return TransparentInkWell(
onTap: onTap,
child: Container(
padding: const EdgeInsets.all(Sizes.spaceSmall),
decoration: BoxDecoration(
color: Theme.of(context).colorScheme.surfaceContainer,
borderRadius: const BorderRadius.all(
Radius.circular(
Sizes.normalRadius,
return Padding(
padding: const EdgeInsets.all(Sizes.spaceSmall / 2),
child: TransparentInkWell(
onTap: onTap,
child: Container(
padding: const EdgeInsets.all(Sizes.spaceSmall),
decoration: BoxDecoration(
color: Theme.of(context).colorScheme.surfaceContainer,
borderRadius: const BorderRadius.all(
Radius.circular(
Sizes.normalRadius,
),
),
),
),
child: SizedBox(
width: double.infinity,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
title,
style: Theme.of(context).textTheme.titleMedium!.copyWith(
color: isDisabled
? Theme.of(context)
.colorScheme
.onSurface
.withOpacity(0.6)
: null,
fontWeight: FontWeight.bold,
),
),
if (subtitle != null) ...[
const SizedBox(height: Sizes.space2XSmall),
child: SizedBox(
width: double.infinity,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
subtitle!,
style: Theme.of(context).textTheme.bodyMedium!.copyWith(
color: isDisabled
? Theme.of(context)
.colorScheme
.onSurface
.withOpacity(0.6)
: null,
),
title,
style:
Theme.of(context).textTheme.titleMedium!.copyWith(
color: isDisabled
? Theme.of(context)
.colorScheme
.onSurface
.withOpacity(0.6)
: null,
fontWeight: FontWeight.bold,
),
),
if (subtitle != null) ...[
const SizedBox(height: Sizes.space2XSmall),
Text(
subtitle!,
style:
Theme.of(context).textTheme.bodyMedium!.copyWith(
color: isDisabled
? Theme.of(context)
.colorScheme
.onSurface
.withOpacity(0.6)
: null,
),
),
],
],
],
),
),
if (trailing != null)
trailing!
else ...[
const SizedBox(width: 16),
Icon(
Icons.chevron_right,
size: Sizes.icon2x,
color: isDisabled
? Theme.of(context).colorScheme.onSurface.withOpacity(0.6)
: Theme.of(context)
.colorScheme
.onSurface
.withOpacity(0.6),
),
),
if (trailing != null)
trailing!
else ...[
const SizedBox(width: 16),
Icon(
Icons.chevron_right,
size: Sizes.icon2x,
color: isDisabled
? Theme.of(context)
.colorScheme
.onSurface
.withOpacity(0.6)
: Theme.of(context)
.colorScheme
.onSurface
.withOpacity(0.6),
),
],
],
],
),
),
),
),
Expand Down
1 change: 0 additions & 1 deletion lib/dashboard/drawer/ssi/backup/src/view/backup_menu.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ class BackupView extends StatelessWidget {
width: MediaQuery.of(context).size.shortestSide * 0.5,
showPoweredBy: true,
),
const SizedBox(height: Sizes.spaceSmall),
DrawerItem(
title: l10n.backupCredential,
onTap: () async {
Expand Down
3 changes: 0 additions & 3 deletions lib/dashboard/drawer/ssi/restore/src/view/restore_menu.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@ class RestoreView extends StatelessWidget {
width: MediaQuery.of(context).size.shortestSide * 0.5,
showPoweredBy: true,
),
const SizedBox(
height: Sizes.spaceSmall,
),
DrawerItem(
title: l10n.restoreCredential,
onTap: () async {
Expand Down
20 changes: 5 additions & 15 deletions lib/dashboard/drawer/ssi/src/view/ssi_menu.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,39 +49,30 @@ class SSIView extends StatelessWidget {
),
const DrawerLogo(),
if (displayManageDecentralizedId)
Column(
children: [
DrawerItem(
title: l10n.manageDecentralizedID,
onTap: () {
Navigator.of(context).push<void>(DidMenu.route());
},
),
const SizedBox(height: Sizes.spaceSmall),

],
DrawerItem(
title: l10n.manageDecentralizedID,
onTap: () {
Navigator.of(context).push<void>(DidMenu.route());
},
),
DrawerItem(
title: l10n.backup,
onTap: () async {
await Navigator.of(context).push<void>(BackupMenu.route());
},
),
const SizedBox(height: Sizes.spaceSmall),
DrawerItem(
title: l10n.restore,
onTap: () async {
await Navigator.of(context).push<void>(RestoreMenu.route());
},
),
const SizedBox(height: Sizes.spaceSmall),
DrawerItem(
title: l10n.searchCredentials,
onTap: () {
Navigator.of(context).push<void>(SearchPage.route());
},
),
const SizedBox(height: Sizes.spaceSmall),
if (context.read<ProfileCubit>().state.model.profileType ==
ProfileType.custom) ...[
DrawerItem(
Expand All @@ -90,7 +81,6 @@ class SSIView extends StatelessWidget {
Navigator.of(context).push<void>(Oidc4vcSettingMenu.route());
},
),
const SizedBox(height: Sizes.spaceSmall),
DrawerItem(
title: l10n.trustFramework,
onTap: () async {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,17 @@ class TrustFrameworkPage extends StatelessWidget {
);
},
),
Padding(
padding: const EdgeInsets.symmetric(
horizontal: Sizes.spaceSmall,
),
child: Divider(
color: Theme.of(context)
.colorScheme
.onSurface
.withOpacity(0.12),
),
),
],
),
Padding(
Expand All @@ -102,12 +113,23 @@ class TrustFrameworkPage extends StatelessWidget {
style: Theme.of(context).textTheme.labelMedium,
),
),
const GroupedSection(
GroupedSection(
children: [
IssuerVerifierSelector(
const IssuerVerifierSelector(
title: 'EBSI',
isChecked: true,
),
Padding(
padding: const EdgeInsets.symmetric(
horizontal: Sizes.spaceSmall,
),
child: Divider(
color: Theme.of(context)
.colorScheme
.onSurface
.withOpacity(0.12),
),
),
],
),
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ class WalletSecurityView extends StatelessWidget {
);
},
),
const SizedBox(height: Sizes.spaceSmall),
DrawerItem(
title: l10n.showWalletRecoveryPhrase,
subtitle: l10n.showWalletRecoveryPhraseSubtitle,
Expand Down Expand Up @@ -85,7 +84,6 @@ class WalletSecurityView extends StatelessWidget {
}
},
),
const SizedBox(height: Sizes.spaceSmall),
if (context.read<ProfileCubit>().state.model.profileType ==
ProfileType.custom)
DrawerItem(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ class WalletSettingsMenuView extends StatelessWidget {
await Navigator.of(context).push<void>(LanguageSettings.route());
},
),
const SizedBox(height: Sizes.spaceSmall),
DrawerItem(
title: l10n.themeSettings,
subtitle: l10n.themeSettingsDescription,
Expand Down
3 changes: 0 additions & 3 deletions test/app/shared/widget/custom_listtile_card_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ void main() {
expect(find.text('Test Title'), findsOneWidget);
expect(find.text('Test Subtitle'), findsOneWidget);
expect(find.byType(Image), findsOneWidget);
expect(find.byType(Icon), findsOneWidget);

expect(find.byIcon(Icons.thumb_up), findsOneWidget);

await tester.tap(find.byType(ListTile));
expect(triggerred, isTrue);
Expand Down

0 comments on commit 114db86

Please sign in to comment.