Skip to content

Commit

Permalink
October (#2768)
Browse files Browse the repository at this point in the history
* fix: Solve different issues of token #2750

* feat: Support talao4eu wallet type #2765

* feat: Add option to reset if wallet attestation is revoked #2759

* fix: Add image in pin code blocked screen page #2742

* fix: Overflow issue in blockchain accounts list

* feat: Add new wordings for did list #2707

* fix: Solve restoration failing in ios #2763

* feat: Set default theme value #2760

* fix: Update account name instantly #2667

* feat: Add auto in vcformat #2770

* linter update

* feat: Implement app theme in chat #2767
  • Loading branch information
bibash28 authored Jul 4, 2024
1 parent ebff23f commit 50a9508
Show file tree
Hide file tree
Showing 34 changed files with 322 additions and 127 deletions.
3 changes: 3 additions & 0 deletions lib/app/shared/constants/parameters.dart
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,7 @@ class Parameters {
static const Color seedColor = Color(0xff6600FF);
// Talao
// static const Color seedColor = Color(0xff1EAADC);

// ThemeMode.light for talao
static const ThemeMode defaultTheme = ThemeMode.dark;
}
2 changes: 1 addition & 1 deletion lib/app/shared/enum/status/app_status.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ enum AppStatus {
success,
idle,
goBack,
//gotTokenReward,
revoked,
}
2 changes: 1 addition & 1 deletion lib/app/shared/enum/type/profile/wallet_app_type.dart
Original file line number Diff line number Diff line change
@@ -1 +1 @@
enum WalletAppType { altme, talao }
enum WalletAppType { altme, talao, talao4eu }
74 changes: 73 additions & 1 deletion lib/chat_room/view/chat_room_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ class _ChatRoomViewState<B extends ChatRoomCubit> extends State<ChatRoomView> {
@override
Widget build(BuildContext context) {
final l10n = context.l10n;
final colorScheme = Theme.of(context).colorScheme;
return BasePage(
title: widget.appBarTitle,
scrollView: false,
Expand Down Expand Up @@ -103,7 +104,78 @@ class _ChatRoomViewState<B extends ChatRoomCubit> extends State<ChatRoomView> {
alignment: Alignment.topCenter,
children: [
Chat(
theme: const DarkChatTheme(),
theme: DefaultChatTheme(
primaryColor: colorScheme.primaryContainer,
secondaryColor: colorScheme.secondaryContainer,
backgroundColor: colorScheme.surface,
inputBackgroundColor: colorScheme.secondaryContainer,
inputTextColor: colorScheme.onSurface,
errorColor: colorScheme.error,
sentMessageBodyTextStyle: TextStyle(
color: colorScheme.onPrimary,
fontSize: 16,
fontWeight: FontWeight.w500,
height: 1.5,
),
sentMessageBodyBoldTextStyle: TextStyle(
color: colorScheme.onPrimary,
fontSize: 12,
fontWeight: FontWeight.w500,
height: 1.333,
),
sentMessageDocumentIconColor: colorScheme.onPrimary,
sentMessageLinkTitleTextStyle: TextStyle(
color: colorScheme.onPrimary,
fontSize: 16,
fontWeight: FontWeight.w800,
height: 1.375,
),
sentMessageCaptionTextStyle: TextStyle(
color: colorScheme.onPrimary,
fontSize: 12,
fontWeight: FontWeight.w500,
height: 1,
),
systemMessageTheme: SystemMessageTheme(
margin: const EdgeInsets.only(
bottom: 24,
top: 8,
left: 8,
right: 8,
),
textStyle: TextStyle(
color: colorScheme.onPrimary,
fontSize: 12,
fontWeight: FontWeight.w800,
height: 1.333,
),
),
receivedMessageBodyTextStyle: TextStyle(
color: colorScheme.onSurface,
fontSize: 16,
fontWeight: FontWeight.w500,
height: 1.5,
),
receivedMessageCaptionTextStyle: TextStyle(
color: colorScheme.onSurface,
fontSize: 12,
fontWeight: FontWeight.w500,
height: 1.333,
),
receivedMessageDocumentIconColor: colorScheme.onSurface,
receivedMessageLinkDescriptionTextStyle: TextStyle(
color: colorScheme.onSurface,
fontSize: 14,
fontWeight: FontWeight.w400,
height: 1.428,
),
receivedMessageLinkTitleTextStyle: TextStyle(
color: colorScheme.onSurface,
fontSize: 16,
fontWeight: FontWeight.w800,
height: 1.375,
),
),
messages: state.messages,
onSendPressed: (partialText) {
FocusManager.instance.primaryFocus?.unfocus();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ class ManageAccountsItem extends StatelessWidget {
return BackgroundCard(
child: Container(
margin: const EdgeInsets.only(bottom: Sizes.spaceSmall),
padding: const EdgeInsets.symmetric(horizontal: Sizes.spaceSmall),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
Expand Down Expand Up @@ -114,50 +113,51 @@ class ManageAccountsItem extends StatelessWidget {
Row(
mainAxisSize: MainAxisSize.min,
children: [
SeeAddressButton(
onTap: () {
Navigator.of(context).push<void>(
AccountPublicAddressPage.route(
accountName: accountName,
accountAddress: cryptoAccountData.walletAddress,
),
);
},
Expanded(
child: SeeAddressButton(
onTap: () {
Navigator.of(context).push<void>(
AccountPublicAddressPage.route(
accountName: accountName,
accountAddress: cryptoAccountData.walletAddress,
),
);
},
),
),
const SizedBox(width: Sizes.spaceSmall),
RevealPrivateKeyButton(
onTap: () async {
final confirm = await showDialog<bool>(
context: context,
builder: (context) => ConfirmDialog(
title: l10n.warningDialogTitle,
subtitle: l10n.accountPrivateKeyAlert,
yes: l10n.showDialogYes,
no: l10n.showDialogNo,
),
) ??
false;

if (confirm) {
await securityCheck(
context: context,
localAuthApi: LocalAuthApi(),
onSuccess: () {
Navigator.of(context).push<void>(
AccountPrivateKeyPage.route(
privateKey: cryptoAccountData.secretKey,
Expanded(
child: RevealPrivateKeyButton(
onTap: () async {
final confirm = await showDialog<bool>(
context: context,
builder: (context) => ConfirmDialog(
title: l10n.warningDialogTitle,
subtitle: l10n.accountPrivateKeyAlert,
yes: l10n.showDialogYes,
no: l10n.showDialogNo,
),
);
},
);
}
},
) ??
false;

if (confirm) {
await securityCheck(
context: context,
localAuthApi: LocalAuthApi(),
onSuccess: () {
Navigator.of(context).push<void>(
AccountPrivateKeyPage.route(
privateKey: cryptoAccountData.secretKey,
),
);
},
);
}
},
),
),
],
),
const SizedBox(
height: Sizes.spaceSmall,
),
],
),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,13 @@ class RevealPrivateKeyButton extends StatelessWidget {
width: Sizes.icon,
color: Theme.of(context).colorScheme.onSurface,
),
Text(
l10n.revealPrivateKey.toUpperCase(),
style: Theme.of(context).textTheme.bodyMedium!.copyWith(
color: Theme.of(context).colorScheme.onSurface,
),
Expanded(
child: MyText(
l10n.revealPrivateKey.toUpperCase(),
style: Theme.of(context).textTheme.bodyMedium!.copyWith(
color: Theme.of(context).colorScheme.onSurface,
),
),
),
],
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,13 @@ class SeeAddressButton extends StatelessWidget {
color: Theme.of(context).colorScheme.onPrimaryContainer,
),
),
Text(
l10n.seeAddress.toUpperCase(),
style: Theme.of(context).textTheme.bodyMedium!.copyWith(
color: Theme.of(context).colorScheme.onPrimaryContainer,
),
Expanded(
child: MyText(
l10n.seeAddress.toUpperCase(),
style: Theme.of(context).textTheme.bodyMedium!.copyWith(
color: Theme.of(context).colorScheme.onPrimaryContainer,
),
),
),
],
),
Expand Down
1 change: 1 addition & 0 deletions lib/dashboard/drawer/reset_wallet/reset_wallet.dart
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export 'cubit/reset_wallet_cubit.dart';
export 'helper_functions/reset_wallet.dart';
export 'view/reset_wallet_menu.dart';
2 changes: 0 additions & 2 deletions lib/dashboard/drawer/reset_wallet/view/reset_wallet_menu.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import 'package:altme/app/app.dart';
import 'package:altme/dashboard/dashboard.dart';
import 'package:altme/dashboard/drawer/reset_wallet/helper_functions/reset_wallet.dart';
import 'package:altme/l10n/l10n.dart';

import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,9 @@ class _ManageDidEbsiPageState extends State<ManageDidPage> {
@override
Widget build(BuildContext context) {
final l10n = context.l10n;
final title = widget.didKeyType.getTitle(l10n);
return BasePage(
title: l10n.decentralizedIDKey,
title: title,
titleAlignment: Alignment.topCenter,
scrollView: false,
titleLeading: const BackLeadingButton(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class ManageDidPolygonIdPage extends StatelessWidget {
Widget build(BuildContext context) {
final l10n = context.l10n;
return BasePage(
title: l10n.polygonIdDecentralizedId,
title: l10n.polygonDecentralizedID,
titleAlignment: Alignment.topCenter,
scrollView: false,
titleLeading: const BackLeadingButton(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class _JWKThumbprintP256KeyPageState extends State<JWKThumbprintP256KeyPage>
mainAxisAlignment: MainAxisAlignment.start,
children: [
Text(
l10n.jwkThumbprintP256Key,
l10n.did,
style: Theme.of(context).textTheme.headlineSmall,
),
const SizedBox(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ class _RestoreCredentialViewState extends State<RestoreCredentialView> {
UploadFile(
filePath: state.backupFilePath,
onTap: () async {
if (Platform.isAndroid) {
if (isAndroid) {
final appDir = (await getTemporaryDirectory()).path;
await Directory(appDir).delete(recursive: true);
}
Expand Down Expand Up @@ -159,15 +159,21 @@ class _RestoreCredentialViewState extends State<RestoreCredentialView> {
Future<void> _pickRestoreFile() async {
final l10n = context.l10n;
final DeviceInfoPlugin deviceInfo = DeviceInfoPlugin();
final AndroidDeviceInfo androidInfo = await deviceInfo.androidInfo;

/// storage permission has changed with android 13
late final PermissionStatus storagePermission;
if (int.parse(androidInfo.version.release) > 12) {
storagePermission = await Permission.photos.request();

if (isAndroid) {
final AndroidDeviceInfo androidInfo = await deviceInfo.androidInfo;
if (int.parse(androidInfo.version.release) > 12) {
storagePermission = await Permission.photos.request();
} else {
storagePermission = await Permission.storage.request();
}
} else {
storagePermission = await Permission.storage.request();
}

if (storagePermission.isDenied) {
AlertMessage.showStateMessage(
context: context,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,15 @@ class UploadFile extends StatelessWidget {
width: Sizes.icon,
height: Sizes.icon,
),
const SizedBox(
width: Sizes.space2XSmall,
),
MyText(
filePath == null ? l10n.uploadFile : filePath!.split('/').last,
minFontSize: 12,
style: Theme.of(context).textTheme.headlineSmall,
const SizedBox(width: Sizes.space2XSmall),
Expanded(
child: MyText(
filePath == null
? l10n.uploadFile
: filePath!.split('/').last,
minFontSize: 12,
style: Theme.of(context).textTheme.bodyLarge,
),
),
],
),
Expand Down
Loading

0 comments on commit 50a9508

Please sign in to comment.