Merge remote-tracking branch 'origin/auth-login-and-2fa-login' into auth-recover-password

# Conflicts:
#	modules/auth/lib/src/core/data/datasource/auth_remote_datasource.dart
#	modules/auth/lib/src/core/data/datasource/auth_remote_datasource_impl.dart
#	modules/auth/lib/src/core/data/repositories/auth_repository_impl.dart
#	modules/auth/lib/src/core/domain/repositories/auth_repository.dart
#	modules/auth/lib/src/features/recover_password/presentation/new_password_screen.dart
#	modules/auth/lib/src/features/recover_password/presentation/restore_password_screen.dart
#	packages/design_system/lib/src/inputs/textfields.dart
#	packages/sf_localizations/assets/l10n/de.json
#	packages/sf_localizations/assets/l10n/en.json
#	packages/sf_localizations/assets/l10n/es.json
#	packages/sf_localizations/assets/l10n/fr.json
#	packages/sf_localizations/assets/l10n/it.json
#	packages/sf_localizations/assets/l10n/pt.json
#	packages/sf_localizations/lib/src/generated/i18n.dart
This commit is contained in:
2025-12-19 12:13:41 +01:00
32 changed files with 1585 additions and 815 deletions

View File

@@ -1,7 +1,7 @@
import 'package:flutter/material.dart';
class PrimaryButton extends StatelessWidget {
final VoidCallback onPressed;
final VoidCallback? onPressed;
final String text;
final Color color;
final double height;
@@ -9,24 +9,35 @@ class PrimaryButton extends StatelessWidget {
final double size;
final double radius;
final double padding;
final Widget? leading;
final double leadingGap;
const PrimaryButton({
super.key,
required this.onPressed,
required this.text,
required this.color,
this.onPressed,
this.height = 60,
this.width,
this.size = 18,
this.radius = 18,
this.padding = 0,
this.leading,
this.leadingGap = 10,
});
@override
Widget build(BuildContext context) {
final bgResolver = WidgetStateProperty.resolveWith<Color>((states) {
if (states.contains(WidgetState.disabled)) {
return color.withValues(alpha: 0.5);
}
return color;
});
return FilledButton(
style: ButtonStyle(
backgroundColor: WidgetStatePropertyAll<Color>(color),
backgroundColor: bgResolver,
padding: WidgetStatePropertyAll<EdgeInsetsGeometry>(
EdgeInsets.symmetric(horizontal: padding),
),
@@ -40,17 +51,29 @@ class PrimaryButton extends StatelessWidget {
child: SizedBox(
width: width,
height: height,
child: Center(
child: Text(
text,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: size,
fontWeight: FontWeight.w500,
letterSpacing: 0,
color: Colors.white, // theme.getColorFor(ThemeCode.textSecondary)
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
// mainAxisSize: MainAxisSize.min,
children: [
if (leading != null) ...[
IconTheme.merge(
data: const IconThemeData(color: Colors.white, size: 20),
child: leading!,
),
SizedBox(width: leadingGap),
],
Text(
text,
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: size,
fontWeight: FontWeight.w500,
letterSpacing: 0,
color: Colors.white,
),
),
),
],
),
),
);

View File

@@ -1,10 +1,11 @@
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
class CustomTextField extends StatelessWidget {
final bool? showPassword;
final TextInputType keyboardType;
final TextInputAction? textInputAction;
final ValueChanged<String>? onSubmitted;
final VoidCallback? onVisibilityChanged;
final bool numeric;
final String hint;
final String label;
final double labelSize;
@@ -18,8 +19,10 @@ class CustomTextField extends StatelessWidget {
const CustomTextField({
super.key,
this.showPassword,
this.keyboardType = TextInputType.text,
this.textInputAction,
this.onSubmitted,
this.onVisibilityChanged,
this.numeric = false,
this.hint = '',
this.label = '',
this.labelSize = 14,
@@ -45,17 +48,14 @@ class CustomTextField extends StatelessWidget {
),
),
TextFormField(
controller: controller,
keyboardType: numeric
? TextInputType.number
: TextInputType.text,
onFieldSubmitted: widget.onSubmitted,
textInputAction: widget.textInputAction,
controller: widget.controller,
keyboardType: widget.keyboardType,
obscureText: !(showPassword ?? true),
enableSuggestions: (showPassword ?? true),
autocorrect: !(showPassword ?? true),
style: const TextStyle(color: Color(0xFF4B4B4B)),
inputFormatters: numeric
? <TextInputFormatter>[FilteringTextInputFormatter.digitsOnly]
: const <TextInputFormatter>[],
decoration: InputDecoration(
counterText: "",
hintText: hint,

View File

@@ -93,7 +93,11 @@ void main() {
)
..addScenario(
'numeric',
SizedBox(height: 70, width: 250, child: CustomTextField(numeric: true)),
SizedBox(
height: 70,
width: 250,
child: CustomTextField(keyboardType: TextInputType.number),
),
)
..addScenario(
'password',