Skip to content

Commit

Permalink
feat: mpl widgets of MasterPassword screen (inProgress) #41
Browse files Browse the repository at this point in the history
  • Loading branch information
PouriaMoradi021 committed Dec 20, 2024
1 parent 619a160 commit ae5c7d7
Show file tree
Hide file tree
Showing 15 changed files with 438 additions and 19 deletions.
3 changes: 3 additions & 0 deletions assets/icons/ic_lock.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
48 changes: 48 additions & 0 deletions assets/icons/ic_master_password.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed assets/icons/lock.png
Binary file not shown.
3 changes: 2 additions & 1 deletion assets/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
"subtitle": "Welcome to Localization",
"description": "You have pushed the button this many times:",
"switch_language": "Switch language",
"applications": "Applications"
"applications": "Applications",
"enter_master_password_to_unlock": "Enter the master password to unlock"
}
3 changes: 2 additions & 1 deletion assets/translations/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"subtitle": "Bienvenido a Localización",
"description": "Has pulsado el botón tantas veces:",
"switchLanguage": "Cambiar idioma",
"applications": "Applications"
"applications": "Applications",
"enter_master_password_to_unlock": "Introduzca la contraseña maestra para desbloquear"

}
4 changes: 3 additions & 1 deletion assets/translations/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@
"subtitle": "Bienvenue dans Localisation",
"description": "Vous avez appuyé sur le bouton autant de fois :",
"switchLanguage": "Changer de langue",
"applications": "Applications"
"applications": "Applications",
"enter_master_password_to_unlock": "Entrez le mot de passe principal pour déverrouiller"

}
2 changes: 2 additions & 0 deletions lib/src/core/common/colors/app_colors.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@ class AppColors {
AppColors._();
static const primaryDark = Color(0xFF242424);
static const splashBackground = Color(0xFF00142E);
static const primaryGrey = Color(0xFF707070);
static const compoundRest = Color(0xFF0F6CBD);
}
55 changes: 55 additions & 0 deletions lib/src/core/common/widgets/custom_filled_button.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import 'package:flutter/material.dart';

class CustomFilledButton extends StatelessWidget {
const CustomFilledButton(
{super.key,
required this.label,
required this.onPressed,
this.backgroundColor,
this.textColor,
required this.borderRadius,
required this.elevation,
required this.padding,
this.icon});
final String label;
final VoidCallback onPressed;
final Color? backgroundColor;
final Color? textColor;
final double borderRadius;
final double elevation;
final EdgeInsets padding;
final IconData? icon;

@override
Widget build(BuildContext context) {
return ElevatedButton(
style: ElevatedButton.styleFrom(
backgroundColor: backgroundColor ?? Theme.of(context).primaryColor,
foregroundColor: textColor ?? Colors.white,
padding: padding,
elevation: elevation,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(borderRadius),
),
),
onPressed: onPressed,
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
if (icon != null) ...[
Icon(icon, color: textColor ?? Colors.white),
const SizedBox(width: 8),
],
Text(
label,
style: TextStyle(
color: textColor ?? Colors.white,
fontSize: 16,
fontWeight: FontWeight.w600,
),
),
],
),
);
}
}
181 changes: 181 additions & 0 deletions lib/src/core/utils/assets/assets.gen.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions lib/src/core/utils/assets/fonts.gen.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

35 changes: 20 additions & 15 deletions lib/src/core/utils/gen/localization/codegen_loader.g.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,30 +14,35 @@ class CodegenLoader extends AssetLoader {
return Future.value(mapLocales[locale.toString()]);
}

static const Map<String, dynamic> fr = {
"title": "Bonjour",
"subtitle": "Bienvenue dans Localisation",
"description": "Vous avez appuyé sur le bouton autant de fois :",
"switchLanguage": "Changer de langue",
"applications": "Applications"
static const Map<String, dynamic> en = {
"title": "Hello, World!",
"subtitle": "Welcome to Localization",
"description": "You have pushed the button this many times:",
"switch_language": "Switch language",
"applications": "Applications",
"enter_master_password_to_unlock": "Enter the master password to unlock"
};
static const Map<String, dynamic> es = {
"title": "¡Hola, Mundo!",
"subtitle": "Bienvenido a Localización",
"description": "Has pulsado el botón tantas veces:",
"switchLanguage": "Cambiar idioma",
"applications": "Applications"
"applications": "Applications",
"enter_master_password_to_unlock":
"Introduzca la contraseña maestra para desbloquear"
};
static const Map<String, dynamic> en = {
"title": "Hello, World!",
"subtitle": "Welcome to Localization",
"description": "You have pushed the button this many times:",
"switch_language": "Switch language",
"applications": "Applications"
static const Map<String, dynamic> fr = {
"title": "Bonjour",
"subtitle": "Bienvenue dans Localisation",
"description": "Vous avez appuyé sur le bouton autant de fois :",
"switchLanguage": "Changer de langue",
"applications": "Applications",
"enter_master_password_to_unlock":
"Entrez le mot de passe principal pour déverrouiller"
};
static const Map<String, Map<String, dynamic>> mapLocales = {
"fr": fr,
"en": en,
"es": es,
"en": en
"fr": fr
};
}
4 changes: 3 additions & 1 deletion lib/src/core/utils/gen/localization/locale_keys.g.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ abstract class LocaleKeys {
static const title = 'title';
static const subtitle = 'subtitle';
static const description = 'description';
static const switchLanguage = 'switchLanguage';
static const switch_language = 'switch_language';
static const applications = 'applications';
static const enter_master_password_to_unlock =
'enter_master_password_to_unlock';
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import 'package:flutter_bloc/flutter_bloc.dart';

class MasterPasswordHandlerCubit extends Cubit<bool> {
MasterPasswordHandlerCubit() : super(true);

void toggleVisibility() => emit(!state);
}
Loading

0 comments on commit ae5c7d7

Please sign in to comment.