diff --git a/lib/app/shared/widget/button/my_elevated_button.dart b/lib/app/shared/widget/button/my_elevated_button.dart index ef9f4f0d0..9689c74a6 100644 --- a/lib/app/shared/widget/button/my_elevated_button.dart +++ b/lib/app/shared/widget/button/my_elevated_button.dart @@ -53,7 +53,7 @@ class MyElevatedButton extends StatelessWidget { onPressed: onPressed, ), onPressed: onPressed, - child: Text( + child: MyText( text.toUpperCase(), style: Theme.of(context).textTheme.titleLarge!.copyWith( fontWeight: FontWeight.bold, diff --git a/lib/app/shared/widget/wallet_logo.dart b/lib/app/shared/widget/wallet_logo.dart index aec22abbf..bb040c436 100644 --- a/lib/app/shared/widget/wallet_logo.dart +++ b/lib/app/shared/widget/wallet_logo.dart @@ -1,6 +1,7 @@ import 'package:altme/app/app.dart'; import 'package:altme/dashboard/dashboard.dart'; import 'package:altme/flavor/flavor.dart'; +import 'package:altme/theme/theme_cubit.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; @@ -35,11 +36,19 @@ class WalletLogo extends StatelessWidget { case ProfileType.ebsiV3: image = ImageStrings.ebsiLogo; case ProfileType.enterprise: - image = profileModel.profileSetting.generalOptions.companyLogo; + final isLightTheme = + Theme.of(context).brightness == Brightness.light; + + final generalOptions = profileModel.profileSetting.generalOptions; + image = isLightTheme + ? generalOptions.companyLogoLight + : generalOptions.companyLogo; + case ProfileType.diipv2point1: case ProfileType.diipv3: image = ImageStrings.diipLogo; } + return Column( children: [ Center( diff --git a/lib/dashboard/profile/cubit/profile_cubit.dart b/lib/dashboard/profile/cubit/profile_cubit.dart index c5764f385..593261759 100644 --- a/lib/dashboard/profile/cubit/profile_cubit.dart +++ b/lib/dashboard/profile/cubit/profile_cubit.dart @@ -532,10 +532,28 @@ class ProfileCubit extends Cubit { } } + String? companyLogoLight = profileSetting.generalOptions.companyLogoLight; + + ///company Logo Light + + if (isURL(companyLogoLight)) { + try { + final http.Response response = + await http.get(Uri.parse(companyLogoLight)); + if (response.statusCode == 200) { + companyLogoLight = base64Encode(response.bodyBytes); + } + } catch (e) { + // + } + } + final profileModel = state.model.copyWith( profileSetting: profileSetting.copyWith( - generalOptions: - profileSetting.generalOptions.copyWith(companyLogo: companyLogo), + generalOptions: profileSetting.generalOptions.copyWith( + companyLogo: companyLogo, + companyLogoLight: companyLogoLight, + ), discoverCardsOptions: profileSetting.discoverCardsOptions?.copyWith( displayExternalIssuer: updatedExternalIssuer, ), diff --git a/lib/dashboard/profile/models/profile_setting.dart b/lib/dashboard/profile/models/profile_setting.dart index 9f25be133..0e2786993 100644 --- a/lib/dashboard/profile/models/profile_setting.dart +++ b/lib/dashboard/profile/models/profile_setting.dart @@ -348,6 +348,7 @@ class GeneralOptions extends Equatable { required this.companyName, required this.companyWebsite, required this.companyLogo, + required this.companyLogoLight, required this.tagLine, this.splashScreenTitle, required this.profileName, @@ -366,6 +367,7 @@ class GeneralOptions extends Equatable { companyName: '', companyWebsite: '', companyLogo: '', + companyLogoLight: '', tagLine: '', splashScreenTitle: '', profileName: '', @@ -380,6 +382,7 @@ class GeneralOptions extends Equatable { final String companyName; final String companyWebsite; final String companyLogo; + final String companyLogoLight; final String tagLine; final String? splashScreenTitle; final String profileName; @@ -396,6 +399,7 @@ class GeneralOptions extends Equatable { String? companyName, String? companyWebsite, String? companyLogo, + String? companyLogoLight, String? splashScreenTitle, String? tagLine, String? profileName, @@ -410,6 +414,7 @@ class GeneralOptions extends Equatable { companyName: companyName ?? this.companyName, companyWebsite: companyWebsite ?? this.companyWebsite, companyLogo: companyLogo ?? this.companyLogo, + companyLogoLight: companyLogoLight ?? this.companyLogoLight, tagLine: tagLine ?? this.tagLine, splashScreenTitle: splashScreenTitle ?? this.splashScreenTitle, profileName: profileName ?? this.profileName, diff --git a/test/app/shared/widget/wallet_logo_test.dart b/test/app/shared/widget/wallet_logo_test.dart index e4daa27a8..8eba30fa1 100644 --- a/test/app/shared/widget/wallet_logo_test.dart +++ b/test/app/shared/widget/wallet_logo_test.dart @@ -326,6 +326,7 @@ void main() { companyName: '', companyWebsite: '', companyLogo: 'https://www.demo.com', + companyLogoLight: 'https://www.demo.com', tagLine: '', splashScreenTitle: '', profileName: '',