Skip to content

Commit

Permalink
feat: Add logo in second level setting of drawer #2249
Browse files Browse the repository at this point in the history
  • Loading branch information
bibash28 committed Mar 5, 2024
1 parent 23ef323 commit b705e90
Show file tree
Hide file tree
Showing 13 changed files with 348 additions and 351 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,100 +34,85 @@ class AboutAltmeView extends StatelessWidget {
final profileModel = context.read<ProfileCubit>().state.model;

final profileSetting = profileModel.profileSetting;
return Drawer(
return BasePage(
backgroundColor: Theme.of(context).colorScheme.drawerBackground,
child: SafeArea(
child: SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 15),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
BackLeadingButton(
padding: EdgeInsets.zero,
color: Theme.of(context).colorScheme.onPrimary,
),
WalletLogo(
profileModel: profileModel,
height: 90,
width: MediaQuery.of(context).size.shortestSide * 0.5,
showPoweredBy: true,
),
const SizedBox(height: Sizes.spaceSmall),
const AppVersionDrawer(),
if (profileModel.profileType == ProfileType.enterprise) ...[
const SizedBox(height: Sizes.spaceLarge),
Padding(
padding: const EdgeInsets.symmetric(
horizontal: Sizes.spaceXSmall,
),
child: Text(
profileSetting.generalOptions.companyName,
style: Theme.of(context)
.textTheme
.drawerItemTitle
.copyWith(
fontSize: 18,
),
),
),
const SizedBox(height: Sizes.spaceXSmall),
EnterpriseData(
title: l10n.profileName,
value: profileSetting.generalOptions.profileName,
),
// EnterpriseData(
// title: l10n.companyName,
// value: profileSetting.generalOptions.companyName,
// ),
EnterpriseData(
title: l10n.configFileIdentifier,
value: profileSetting.generalOptions.profileId,
),
const SizedBox(height: Sizes.spaceSmall),
Padding(
padding: const EdgeInsets.symmetric(
horizontal: Sizes.spaceXSmall,
useSafeArea: true,
scrollView: true,
titleAlignment: Alignment.topCenter,
padding: const EdgeInsets.symmetric(horizontal: Sizes.spaceSmall),
body: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
BackLeadingButton(
padding: EdgeInsets.zero,
color: Theme.of(context).colorScheme.onPrimary,
),
const DrawerLogo(),
const AppVersionDrawer(),
if (profileModel.profileType == ProfileType.enterprise) ...[
const SizedBox(height: Sizes.spaceLarge),
Padding(
padding: const EdgeInsets.symmetric(
horizontal: Sizes.spaceXSmall,
),
child: Text(
profileSetting.generalOptions.companyName,
style: Theme.of(context).textTheme.drawerItemTitle.copyWith(
fontSize: 18,
),
child: Text(
l10n.about,
style: Theme.of(context)
.textTheme
.drawerItemTitle
.copyWith(
fontSize: 18,
),
),
),
const SizedBox(height: Sizes.spaceXSmall),
EnterpriseData(
title: l10n.profileName,
value: profileSetting.generalOptions.profileName,
),
// EnterpriseData(
// title: l10n.companyName,
// value: profileSetting.generalOptions.companyName,
// ),
EnterpriseData(
title: l10n.configFileIdentifier,
value: profileSetting.generalOptions.profileId,
),
const SizedBox(height: Sizes.spaceSmall),
Padding(
padding: const EdgeInsets.symmetric(
horizontal: Sizes.spaceXSmall,
),
child: Text(
l10n.about,
style: Theme.of(context).textTheme.drawerItemTitle.copyWith(
fontSize: 18,
),
),
],
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: const Center(),
);
},
),
DrawerItem(
title: l10n.termsOfUse,
onTap: () =>
Navigator.of(context).push<void>(TermsPage.route()),
),
DrawerItem(
title: l10n.softwareLicenses,
onTap: () => Navigator.of(context)
.push<void>(SoftwareLicensePage.route()),
),
],
),
),
],
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: const Center(),
);
},
),
DrawerItem(
title: l10n.termsOfUse,
onTap: () =>
Navigator.of(context).push<void>(TermsPage.route()),
),
DrawerItem(
title: l10n.softwareLicenses,
onTap: () => Navigator.of(context)
.push<void>(SoftwareLicensePage.route()),
),
),
],
),
);
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,58 +28,47 @@ class BlockchainSettingsView extends StatelessWidget {
@override
Widget build(BuildContext context) {
final l10n = context.l10n;
return Drawer(
return BasePage(
backgroundColor: Theme.of(context).colorScheme.drawerBackground,
child: SafeArea(
child: SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 15),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
BackLeadingButton(
padding: EdgeInsets.zero,
color: Theme.of(context).colorScheme.onPrimary,
),
WalletLogo(
profileModel: context.read<ProfileCubit>().state.model,
height: 90,
width: MediaQuery.of(context).size.shortestSide * 0.5,
showPoweredBy: true,
),
const SizedBox(height: Sizes.spaceSmall),
DrawerItem(
title: l10n.manageAccounts,
onTap: () {
Navigator.of(context)
.push<void>(ManageAccountsPage.route());
},
),
DrawerItem(
title: l10n.manageConnectedApps,
onTap: () {
Navigator.of(context).push<void>(
ConnectedDappsPage.route(
walletAddress: context
.read<WalletCubit>()
.state
.currentAccount!
.walletAddress,
),
);
},
),
DrawerItem(
title: l10n.blockchainNetwork,
onTap: () async {
await Navigator.of(context)
.push<void>(ManageNetworkPage.route());
},
useSafeArea: true,
scrollView: true,
titleAlignment: Alignment.topCenter,
padding: const EdgeInsets.symmetric(horizontal: Sizes.spaceSmall),
body: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
BackLeadingButton(
padding: EdgeInsets.zero,
color: Theme.of(context).colorScheme.onPrimary,
),
const DrawerLogo(),
DrawerItem(
title: l10n.manageAccounts,
onTap: () {
Navigator.of(context).push<void>(ManageAccountsPage.route());
},
),
DrawerItem(
title: l10n.manageConnectedApps,
onTap: () {
Navigator.of(context).push<void>(
ConnectedDappsPage.route(
walletAddress: context
.read<WalletCubit>()
.state
.currentAccount!
.walletAddress,
),
],
),
);
},
),
DrawerItem(
title: l10n.blockchainNetwork,
onTap: () async {
await Navigator.of(context).push<void>(ManageNetworkPage.route());
},
),
),
],
),
);
}
Expand Down
2 changes: 2 additions & 0 deletions lib/dashboard/drawer/drawer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ export 'reset_wallet/reset_wallet.dart';
export 'src/src.dart';
export 'ssi/ssi.dart';
export 'wallet_security/wallet_security.dart';
export 'wallet_settings/wallet_settings.dart';
export 'widget/widget.dart';
Original file line number Diff line number Diff line change
Expand Up @@ -51,69 +51,59 @@ class HelpCenterView extends StatelessWidget {
customChatSupportName = helpCenterOptions.customChatSupportName!;
}

return Drawer(
return BasePage(
backgroundColor: Theme.of(context).colorScheme.drawerBackground,
child: SafeArea(
child: SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 15),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
BackLeadingButton(
padding: EdgeInsets.zero,
color: Theme.of(context).colorScheme.onPrimary,
),
WalletLogo(
profileModel: context.read<ProfileCubit>().state.model,
height: 90,
width: MediaQuery.of(context).size.shortestSide * 0.5,
showPoweredBy: true,
),
if (helpCenterOptions.displayChatSupport) ...[
const SizedBox(height: Sizes.spaceSmall),
DrawerItem(
title: '${l10n.chatWith} $customChatSupportName',
onTap: () {
Navigator.of(context).push<void>(
AltmeSupportChatPage.route(
appBarTitle:
'${l10n.chatWith} $customChatSupportName',
),
);
},
useSafeArea: true,
scrollView: true,
titleAlignment: Alignment.topCenter,
padding: const EdgeInsets.symmetric(horizontal: Sizes.spaceSmall),
body: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
BackLeadingButton(
padding: EdgeInsets.zero,
color: Theme.of(context).colorScheme.onPrimary,
),
const DrawerLogo(),
if (helpCenterOptions.displayChatSupport) ...[
DrawerItem(
title: '${l10n.chatWith} $customChatSupportName',
onTap: () {
Navigator.of(context).push<void>(
AltmeSupportChatPage.route(
appBarTitle: '${l10n.chatWith} $customChatSupportName',
),
],
if (helpCenterOptions.displayEmailSupport) ...[
DrawerItem(
title: l10n.sendAnEmail,
onTap: () {
Navigator.of(context).push<void>(
ContactUsPage.route(
email: email,
),
);
},
);
},
),
],
if (helpCenterOptions.displayEmailSupport) ...[
DrawerItem(
title: l10n.sendAnEmail,
onTap: () {
Navigator.of(context).push<void>(
ContactUsPage.route(
email: email,
),
],
DrawerItem(
title: l10n.faqs,
onTap: () {
Navigator.of(context).push<void>(FAQsPage.route());
},
),
DrawerItem(
onTap: () {
LaunchUrl.launch(
'https://${AltMeStrings.appContactWebsiteName}',
);
},
title: l10n.officialWebsite,
),
],
);
},
),
],
DrawerItem(
title: l10n.faqs,
onTap: () {
Navigator.of(context).push<void>(FAQsPage.route());
},
),
DrawerItem(
onTap: () {
LaunchUrl.launch(
'https://${AltMeStrings.appContactWebsiteName}',
);
},
title: l10n.officialWebsite,
),
),
],
),
);
}
Expand Down
Loading

0 comments on commit b705e90

Please sign in to comment.