Skip to content

Commit

Permalink
October (#2773)
Browse files Browse the repository at this point in the history
* fix: Update account name instantly #2667

* linter update

* feat: Add green color for card valid status #2764

* Fix: Solve overflow issue in credential details

* fix: Use close instead of skip when wallet attestation is revoked #2759

* fix: Instantly show chat bottom bar after portal supports it

* feat: Make filter optional for presentation #2769

* color adjustment

---------

Co-authored-by: Bibash Shrestha <bibashshrestha@gmail.com>
  • Loading branch information
hawkbee1 and bibash28 authored Jul 6, 2024
1 parent 6096c1a commit 1f659e3
Show file tree
Hide file tree
Showing 6 changed files with 169 additions and 154 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ extension CredentialStatusExtension on CredentialStatus {
Color color(BuildContext context) {
switch (this) {
case CredentialStatus.active:
return Theme.of(context).colorScheme.onTertiary;
return Colors.green;
case CredentialStatus.invalidStatus:
case CredentialStatus.expired:
case CredentialStatus.pending:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ List<CredentialModel> getCredentialsFromFilterList({
(searchParameter) {
String? pattern;

if (field.filter?.pattern != null) {
if (field.filter == null) {
//ascs case
return false;
} else if (field.filter?.pattern != null) {
pattern = field.filter!.pattern;
} else if (field.filter?.contains?.containsConst != null) {
pattern = field.filter?.contains?.containsConst;
Expand All @@ -39,9 +42,9 @@ List<CredentialModel> getCredentialsFromFilterList({
if (searchParameter == 'true') return false;
}

if (pattern == null) return true;

if (pattern.endsWith(r'$')) {
if (pattern == null) {
return true;
} else if (pattern.endsWith(r'$')) {
final RegExp regEx = RegExp(pattern);
final Match? match = regEx.firstMatch(searchParameter);

Expand Down
263 changes: 132 additions & 131 deletions lib/dashboard/src/view/dashboard_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -148,150 +148,151 @@ class _DashboardViewState extends State<DashboardView> {
),
],
child: BlocBuilder<DashboardCubit, DashboardState>(
builder: (context, state) {
if (state.selectedIndex == 3) {
builder: (context, dashboardState) {
if (dashboardState.selectedIndex == 3) {
context.read<AltmeChatSupportCubit>().setMessagesAsRead();
}

final displayChatSupport = context
.read<ProfileCubit>()
.state
.model
.profileSetting
.helpCenterOptions
.displayChatSupport;
return BlocBuilder<ProfileCubit, ProfileState>(
builder: (context, profileState) {
final displayChatSupport = profileState
.model.profileSetting.helpCenterOptions.displayChatSupport;

final isEnterprise =
context.read<ProfileCubit>().state.model.walletType ==
WalletType.enterprise;
final isEnterprise =
profileState.model.walletType == WalletType.enterprise;

return PopScope(
canPop: false,
onPopInvoked: (_) async {
if (scaffoldKey.currentState!.isDrawerOpen) {
// Navigator.of(context).pop();
}
},
child: BasePage(
scrollView: false,
title: _getTitle(state.selectedIndex, l10n),
scaffoldKey: scaffoldKey,
padding: EdgeInsets.zero,
drawer: const DrawerPage(),
titleLeading: HomeTitleLeading(
onPressed: () {
if (context.read<HomeCubit>().state.homeStatus ==
HomeStatus.hasNoWallet) {
showDialog<void>(
context: context,
builder: (_) => const WalletDialog(),
);
return;
return PopScope(
canPop: false,
onPopInvoked: (_) async {
if (scaffoldKey.currentState!.isDrawerOpen) {
// Navigator.of(context).pop();
}
scaffoldKey.currentState!.openDrawer();
},
),
titleTrailing: Parameters.walletHandlesCrypto
? const CryptoAccountSwitcherButton()
: const SizedBox.shrink(),
body: Stack(
children: [
Column(
child: BasePage(
scrollView: false,
title: _getTitle(dashboardState.selectedIndex, l10n),
scaffoldKey: scaffoldKey,
padding: EdgeInsets.zero,
drawer: const DrawerPage(),
titleLeading: HomeTitleLeading(
onPressed: () {
if (context.read<HomeCubit>().state.homeStatus ==
HomeStatus.hasNoWallet) {
showDialog<void>(
context: context,
builder: (_) => const WalletDialog(),
);
return;
}
scaffoldKey.currentState!.openDrawer();
},
),
titleTrailing: Parameters.walletHandlesCrypto
? const CryptoAccountSwitcherButton()
: const SizedBox.shrink(),
body: Stack(
children: [
Expanded(
child: PageView(
controller: pageController,
onPageChanged:
context.read<DashboardCubit>().onPageChanged,
physics: const NeverScrollableScrollPhysics(),
children: [
const HomePage(),
if (Parameters.walletHandlesCrypto)
const DiscoverTabPage()
else
const DiscoverPage(),
if (Parameters.walletHandlesCrypto)
const WertPage()
else
const SearchPage(),
if (displayChatSupport && isEnterprise)
const AltmeSupportChatPage()
else
Container(),
],
),
),
BottomBarDecoration(
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
BottomBarItem(
icon: IconStrings.home,
text: l10n.home,
onTap: () => bottomTapped(0),
isSelected: state.selectedIndex == 0,
Column(
children: [
Expanded(
child: PageView(
controller: pageController,
onPageChanged:
context.read<DashboardCubit>().onPageChanged,
physics: const NeverScrollableScrollPhysics(),
children: [
const HomePage(),
if (Parameters.walletHandlesCrypto)
const DiscoverTabPage()
else
const DiscoverPage(),
if (Parameters.walletHandlesCrypto)
const WertPage()
else
const SearchPage(),
if (displayChatSupport && isEnterprise)
const AltmeSupportChatPage()
else
Container(),
],
),
BottomBarItem(
icon: IconStrings.discover,
text: l10n.discover,
onTap: () => bottomTapped(1),
isSelected: state.selectedIndex == 1,
),
BottomBarDecoration(
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
BottomBarItem(
icon: IconStrings.home,
text: l10n.home,
onTap: () => bottomTapped(0),
isSelected: dashboardState.selectedIndex == 0,
),
BottomBarItem(
icon: IconStrings.discover,
text: l10n.discover,
onTap: () => bottomTapped(1),
isSelected: dashboardState.selectedIndex == 1,
),
const SizedBox(width: 60),
if (Parameters.walletHandlesCrypto)
BottomBarItem(
icon: IconStrings.cashInHand,
text: l10n.buy,
onTap: () => bottomTapped(2),
isSelected:
dashboardState.selectedIndex == 2,
)
else
BottomBarItem(
icon: IconStrings.searchNormal,
text: l10n.search,
onTap: () => bottomTapped(2),
isSelected:
dashboardState.selectedIndex == 2,
),
if (displayChatSupport && isEnterprise) ...[
StreamBuilder(
initialData: context
.read<AltmeChatSupportCubit>()
.unreadMessageCount,
stream: context
.read<AltmeChatSupportCubit>()
.unreadMessageCountStream,
builder: (_, snapShot) {
return BottomBarItem(
icon: IconStrings.messaging,
text: l10n.chat,
badgeCount: snapShot.data ?? 0,
onTap: () => bottomTapped(3),
isSelected:
dashboardState.selectedIndex == 3,
);
},
),
] else ...[
BottomBarItem(
icon: IconStrings.settings,
text: l10n.settings,
onTap: () =>
scaffoldKey.currentState!.openDrawer(),
isSelected: false,
),
],
],
),
const SizedBox(width: 60),
if (Parameters.walletHandlesCrypto)
BottomBarItem(
icon: IconStrings.cashInHand,
text: l10n.buy,
onTap: () => bottomTapped(2),
isSelected: state.selectedIndex == 2,
)
else
BottomBarItem(
icon: IconStrings.searchNormal,
text: l10n.search,
onTap: () => bottomTapped(2),
isSelected: state.selectedIndex == 2,
),
if (displayChatSupport && isEnterprise) ...[
StreamBuilder(
initialData: context
.read<AltmeChatSupportCubit>()
.unreadMessageCount,
stream: context
.read<AltmeChatSupportCubit>()
.unreadMessageCountStream,
builder: (_, snapShot) {
return BottomBarItem(
icon: IconStrings.messaging,
text: l10n.chat,
badgeCount: snapShot.data ?? 0,
onTap: () => bottomTapped(3),
isSelected: state.selectedIndex == 3,
);
},
),
] else ...[
BottomBarItem(
icon: IconStrings.settings,
text: l10n.settings,
onTap: () =>
scaffoldKey.currentState!.openDrawer(),
isSelected: false,
),
],
],
),
),
const SizedBox(height: 1),
],
),
const Align(
alignment: Alignment.bottomCenter,
child: QRIcon(),
),
const SizedBox(height: 1),
],
),
const Align(
alignment: Alignment.bottomCenter,
child: QRIcon(),
),
],
),
),
),
);
},
);
},
),
Expand Down
2 changes: 1 addition & 1 deletion lib/enterprise/widget/wallet_revoked_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class WalletRevokedDialog extends StatelessWidget {
Navigator.of(context).pop();
},
child: Text(
l10n.skip.toUpperCase(),
l10n.close.toUpperCase(),
style: Theme.of(context)
.textTheme
.bodyLarge!
Expand Down
17 changes: 10 additions & 7 deletions lib/selective_disclosure/widget/display_selective_disclosure.dart
Original file line number Diff line number Diff line change
Expand Up @@ -180,13 +180,16 @@ class DisplaySelectiveDisclosure extends StatelessWidget {
child: Row(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
CredentialField(
padding: EdgeInsets.only(top: isFirstElement ? 10 : 0),
title: title,
value: claims.data,
titleColor: Theme.of(context).colorScheme.onSurface,
valueColor: Theme.of(context).colorScheme.onSurface,
showVertically: showVertically,
Flexible(
child: CredentialField(
padding:
EdgeInsets.only(top: isFirstElement ? 10 : 0),
title: title,
value: claims.data,
titleColor: Theme.of(context).colorScheme.onSurface,
valueColor: Theme.of(context).colorScheme.onSurface,
showVertically: showVertically,
),
),
if (selectiveDisclosureState != null &&
claims.isfromDisclosureOfJWT) ...[
Expand Down
Loading

0 comments on commit 1f659e3

Please sign in to comment.