Skip to content

Commit

Permalink
Talao logo #2744 (#2748)
Browse files Browse the repository at this point in the history
* Talao logo #2744

* feat: Update logo instantly and test update

---------

Co-authored-by: Bibash Shrestha <[email protected]>
  • Loading branch information
hawkbee1 and bibash28 authored Jun 27, 2024
1 parent 5cf4775 commit 2f8c4bc
Show file tree
Hide file tree
Showing 17 changed files with 315 additions and 233 deletions.
3 changes: 0 additions & 3 deletions lib/app/shared/loading/loading_view.dart
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import 'dart:async';

import 'package:altme/app/app.dart';
import 'package:altme/dashboard/dashboard.dart';
import 'package:altme/l10n/l10n.dart';

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

class LoadingView {
factory LoadingView() => _shared;
Expand Down Expand Up @@ -67,7 +65,6 @@ class LoadingView {
children: [
const SizedBox(height: 10),
WalletLogo(
profileModel: context.read<ProfileCubit>().state.model,
height: Sizes.logoNormal,
width: MediaQuery.of(context).size.shortestSide * 0.5,
showPoweredBy: true,
Expand Down
129 changes: 47 additions & 82 deletions lib/app/shared/widget/wallet_logo.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,102 +7,67 @@ import 'package:flutter_bloc/flutter_bloc.dart';
class WalletLogo extends StatelessWidget {
const WalletLogo({
super.key,
required this.profileModel,
this.height,
this.width,
this.showPoweredBy = false,
});

final ProfileModel profileModel;
final double? height;
final double? width;
final bool showPoweredBy;

@override
Widget build(BuildContext context) {
final FlavorCubit flavorCubit = context.read<FlavorCubit>();
String image = '';
return BlocBuilder<ProfileCubit, ProfileState>(
builder: (context, state) {
final FlavorCubit flavorCubit = context.read<FlavorCubit>();
String image = '';

switch (profileModel.profileType) {
case ProfileType.custom:
case ProfileType.dutch:
case ProfileType.defaultOne:
image = flavorCubit.state == FlavorMode.development
? ImageStrings.appLogoDev
: flavorCubit.state == FlavorMode.staging
? ImageStrings.appLogoStage
: ImageStrings.appLogo;
case ProfileType.ebsiV3:
image = ImageStrings.ebsiLogo;
case ProfileType.enterprise:
image = profileModel.profileSetting.generalOptions.companyLogo;
case ProfileType.owfBaselineProfile:
image = ImageStrings.owfBaselineProfileLogo;
}
final profileModel = state.model;

return Column(
children: [
Center(
child: profileModel.profileType != ProfileType.enterprise
? ColorFiltered(
colorFilter: ColorFilter.mode(
Theme.of(context).colorScheme.primaryContainer,
BlendMode.srcIn,
),
child: Logo(
width: width,
height: height,
profileModel: profileModel,
image: image,
),
)
: Logo(
width: width,
height: height,
profileModel: profileModel,
image: image,
),
),
],
);
}
}

class Logo extends StatelessWidget {
const Logo({
super.key,
required this.width,
required this.height,
required this.profileModel,
required this.image,
});

final double? width;
final double? height;
final ProfileModel profileModel;
final String image;

@override
Widget build(BuildContext context) {
return SizedBox(
width: width,
height: height,
child: profileModel.profileType == ProfileType.enterprise
? CachedImageFromNetwork(
image,
fit: BoxFit.contain,
width: width,
bgColor: Colors.transparent,
height: height,
errorMessage: '',
showLoading: false,
)
: Image.asset(
image,
fit: BoxFit.contain,
width: width,
height: height,
switch (profileModel.profileType) {
case ProfileType.custom:
case ProfileType.dutch:
case ProfileType.defaultOne:
image = flavorCubit.state == FlavorMode.development
? ImageStrings.appLogoDev
: flavorCubit.state == FlavorMode.staging
? ImageStrings.appLogoStage
: ImageStrings.appLogo;
case ProfileType.ebsiV3:
image = ImageStrings.ebsiLogo;
case ProfileType.enterprise:
image = profileModel.profileSetting.generalOptions.companyLogo;
case ProfileType.owfBaselineProfile:
image = ImageStrings.owfBaselineProfileLogo;
}
return Column(
children: [
Center(
child: SizedBox(
width: width,
height: height,
child: profileModel.profileType == ProfileType.enterprise
? CachedImageFromNetwork(
image,
fit: BoxFit.contain,
width: width,
bgColor: Colors.transparent,
height: height,
errorMessage: '',
showLoading: false,
)
: Image.asset(
image,
fit: BoxFit.contain,
width: width,
height: height,
),
),
),
],
);
},
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import 'package:altme/dashboard/dashboard.dart';
import 'package:altme/l10n/l10n.dart';
import 'package:confetti/confetti.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:key_generator/key_generator.dart';

class CongratulationsAccountCreationPage extends StatelessWidget {
Expand Down Expand Up @@ -106,7 +105,6 @@ class _CongratulationsAccountCreationViewState
crossAxisAlignment: CrossAxisAlignment.center,
children: [
WalletLogo(
profileModel: context.read<ProfileCubit>().state.model,
height: Sizes.logo2XLarge,
width: MediaQuery.of(context).size.shortestSide * 0.5,
showPoweredBy: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import 'package:altme/dashboard/dashboard.dart';
import 'package:altme/l10n/l10n.dart';
import 'package:confetti/confetti.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';

class CongratulationsAccountImportPage extends StatelessWidget {
const CongratulationsAccountImportPage({
Expand Down Expand Up @@ -68,7 +67,6 @@ class _CongratulationsAccountImportViewState
crossAxisAlignment: CrossAxisAlignment.center,
children: [
WalletLogo(
profileModel: context.read<ProfileCubit>().state.model,
height: Sizes.logo2XLarge,
width: MediaQuery.of(context).size.shortestSide * 0.5,
showPoweredBy: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ class SuccessWidget extends StatelessWidget {
children: [
const Spacer(),
WalletLogo(
profileModel: context.read<ProfileCubit>().state.model,
height: Sizes.logo2XLarge,
width: MediaQuery.of(context).size.shortestSide * 0.5,
showPoweredBy: true,
Expand Down Expand Up @@ -176,7 +175,6 @@ class FailureWidget extends StatelessWidget {
children: [
const Spacer(),
WalletLogo(
profileModel: context.read<ProfileCubit>().state.model,
height: Sizes.logo2XLarge,
width: MediaQuery.of(context).size.shortestSide * 0.5,
showPoweredBy: true,
Expand Down
2 changes: 0 additions & 2 deletions lib/dashboard/drawer/src/view/check_linkedin_profile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import 'package:altme/app/app.dart';
import 'package:altme/dashboard/dashboard.dart';
import 'package:altme/l10n/l10n.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';

class CheckForLinkedInProfile extends StatelessWidget {
const CheckForLinkedInProfile({super.key});
Expand Down Expand Up @@ -41,7 +40,6 @@ class CheckForLinkedInProfileView extends StatelessWidget {
padding: EdgeInsets.zero,
),
WalletLogo(
profileModel: context.read<ProfileCubit>().state.model,
height: 90,
width: MediaQuery.of(context).size.shortestSide * 0.5,
showPoweredBy: true,
Expand Down
2 changes: 0 additions & 2 deletions lib/dashboard/drawer/ssi/backup/src/view/backup_menu.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import 'package:altme/app/app.dart';
import 'package:altme/dashboard/dashboard.dart';
import 'package:altme/l10n/l10n.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';

class BackupMenu extends StatelessWidget {
const BackupMenu({super.key});
Expand Down Expand Up @@ -39,7 +38,6 @@ class BackupView extends StatelessWidget {
padding: EdgeInsets.zero,
),
WalletLogo(
profileModel: context.read<ProfileCubit>().state.model,
height: 90,
width: MediaQuery.of(context).size.shortestSide * 0.5,
showPoweredBy: true,
Expand Down
1 change: 0 additions & 1 deletion lib/dashboard/drawer/ssi/manage_did/view/did_menu.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ class DidView extends StatelessWidget {
padding: EdgeInsets.zero,
),
WalletLogo(
profileModel: context.read<ProfileCubit>().state.model,
height: 90,
width: MediaQuery.of(context).size.shortestSide * 0.5,
showPoweredBy: true,
Expand Down
2 changes: 0 additions & 2 deletions lib/dashboard/drawer/ssi/restore/src/view/restore_menu.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import 'package:altme/app/app.dart';
import 'package:altme/dashboard/dashboard.dart';
import 'package:altme/l10n/l10n.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';

class RestoreMenu extends StatelessWidget {
const RestoreMenu({super.key});
Expand Down Expand Up @@ -39,7 +38,6 @@ class RestoreView extends StatelessWidget {
padding: EdgeInsets.zero,
),
WalletLogo(
profileModel: context.read<ProfileCubit>().state.model,
height: 90,
width: MediaQuery.of(context).size.shortestSide * 0.5,
showPoweredBy: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ class AdvancedSecuritySettingsView extends StatelessWidget {
padding: EdgeInsets.zero,
),
WalletLogo(
profileModel: context.read<ProfileCubit>().state.model,
height: 90,
width: MediaQuery.of(context).size.shortestSide * 0.5,
showPoweredBy: true,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import 'package:altme/app/app.dart';
import 'package:altme/dashboard/dashboard.dart';
import 'package:altme/l10n/l10n.dart';
//import 'package:confetti/confetti.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';

class KeyVerifiedPage extends StatelessWidget {
const KeyVerifiedPage({super.key});
Expand Down Expand Up @@ -37,7 +34,6 @@ class KeyVerifiedView extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.center,
children: [
WalletLogo(
profileModel: context.read<ProfileCubit>().state.model,
height: 90,
width: MediaQuery.of(context).size.shortestSide * 0.5,
showPoweredBy: true,
Expand Down
3 changes: 0 additions & 3 deletions lib/dashboard/drawer/widget/drawer_logo.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:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';

class DrawerLogo extends StatelessWidget {
const DrawerLogo({super.key});
Expand All @@ -13,7 +11,6 @@ class DrawerLogo extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
WalletLogo(
profileModel: context.read<ProfileCubit>().state.model,
height: 90,
width: MediaQuery.of(context).size.shortestSide * 0.5,
showPoweredBy: true,
Expand Down
1 change: 0 additions & 1 deletion lib/onboarding/starter/view/starter_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ class StarterView extends StatelessWidget {
children: [
const Spacer(flex: 5),
WalletLogo(
profileModel: state.model,
width: MediaQuery.of(context).size.shortestSide * 0.6,
height: MediaQuery.of(context).size.longestSide * 0.2,
),
Expand Down
1 change: 0 additions & 1 deletion lib/onboarding/wallet_ready/view/wallet_ready_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ class _WalletReadyViewState extends State<WalletReadyView> {
crossAxisAlignment: CrossAxisAlignment.center,
children: [
WalletLogo(
profileModel: widget.profileCubit.state.model,
height: 90,
width: MediaQuery.of(context).size.shortestSide * 0.5,
showPoweredBy: true,
Expand Down
4 changes: 0 additions & 4 deletions lib/pin_code/widgets/pin_code_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,6 @@ class _PinCodeWidgetState extends State<PinCodeWidget>
widget.header!
else
WalletLogo(
profileModel: context
.read<ProfileCubit>()
.state
.model,
height: 90,
width: MediaQuery.of(context)
.size
Expand Down
1 change: 0 additions & 1 deletion lib/splash/view/splash_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,6 @@ class _SplashViewState extends State<SplashView> {
children: [
const Spacer(flex: 2),
WalletLogo(
profileModel: state.model,
width: MediaQuery.of(context).size.shortestSide * 0.6,
height: MediaQuery.of(context).size.longestSide * 0.2,
),
Expand Down
Loading

0 comments on commit 2f8c4bc

Please sign in to comment.