Skip to content

Commit

Permalink
feat: update component dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
freekvandeven committed Jun 27, 2024
1 parent cffb71f commit 8455800
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 23 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 4.1.0

- Update to flutter_registration 2.1.0
- Update flutter_form_wizard to 6.3.2
- Update flutter_profile to 1.5.0

## 4.0.1

- Fix registrationRepository not being passed to the registration screen.
Expand Down
10 changes: 5 additions & 5 deletions lib/src/user_stories/flutter_user_userstory_go_router.dart
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ List<GoRoute> getAuthStoryRoutes(
SnackBar(
backgroundColor:
configuration.loginErrorSnackbarBackgroundColor ??
theme.colorScheme.onBackground,
theme.colorScheme.onSurface,
content: Column(
mainAxisSize: MainAxisSize.min,
children: [
Expand All @@ -74,7 +74,7 @@ List<GoRoute> getAuthStoryRoutes(
style: configuration
.loginErrorSnackbarTitleTextStyle ??
theme.textTheme.titleSmall?.copyWith(
color: theme.colorScheme.background,
color: theme.colorScheme.surface,
),
),
const SizedBox(height: 8),
Expand All @@ -83,7 +83,7 @@ List<GoRoute> getAuthStoryRoutes(
style: configuration
.loginErrorSnackbarMessageTextStyle ??
theme.textTheme.bodySmall?.copyWith(
color: theme.colorScheme.background,
color: theme.colorScheme.surface,
height: 1.3,
),
textAlign: TextAlign.center,
Expand Down Expand Up @@ -230,13 +230,13 @@ List<GoRoute> getAuthStoryRoutes(
Text(
result.requestPasswordError!.title,
style: theme.textTheme.titleSmall?.copyWith(
color: theme.colorScheme.onBackground,
color: theme.colorScheme.onSurface,
),
),
Text(
result.requestPasswordError!.message,
style: theme.textTheme.bodySmall?.copyWith(
color: theme.colorScheme.onBackground,
color: theme.colorScheme.onSurface,
height: 1.3,
),
textAlign: TextAlign.center,
Expand Down
10 changes: 5 additions & 5 deletions lib/src/user_stories/flutter_user_userstory_navigator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,15 @@ Widget _loginScreen(
SnackBar(
backgroundColor:
configuration.loginErrorSnackbarBackgroundColor ??
theme.colorScheme.onBackground,
theme.colorScheme.onSurface,
content: Column(
mainAxisSize: MainAxisSize.min,
children: [
Text(
result.loginError!.title,
style: configuration.loginErrorSnackbarTitleTextStyle ??
theme.textTheme.titleSmall?.copyWith(
color: theme.colorScheme.background,
color: theme.colorScheme.surface,
),
),
const SizedBox(height: 8),
Expand All @@ -67,7 +67,7 @@ Widget _loginScreen(
style:
configuration.loginErrorSnackbarMessageTextStyle ??
theme.textTheme.bodySmall?.copyWith(
color: theme.colorScheme.background,
color: theme.colorScheme.surface,
height: 1.3,
),
textAlign: TextAlign.center,
Expand Down Expand Up @@ -224,13 +224,13 @@ Widget _forgotPasswordScreen(
Text(
result.requestPasswordError!.title,
style: theme.textTheme.titleSmall?.copyWith(
color: theme.colorScheme.onBackground,
color: theme.colorScheme.onSurface,
),
),
Text(
result.requestPasswordError!.message,
style: theme.textTheme.bodySmall?.copyWith(
color: theme.colorScheme.onBackground,
color: theme.colorScheme.onSurface,
height: 1.3,
),
textAlign: TextAlign.center,
Expand Down
21 changes: 13 additions & 8 deletions lib/src/widgets/image_picker_input.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ class FlutterFormInputImage extends FlutterFormInputWidget<Uint8List> {
const FlutterFormInputImage({
required super.controller,
required this.imagePickerConfig,
required this.validationMessage,
super.key,
super.label,
this.firstName,
Expand All @@ -16,16 +17,16 @@ class FlutterFormInputImage extends FlutterFormInputWidget<Uint8List> {

final String? firstName;
final String? lastName;
final String validationMessage;
final ImagePickerConfig imagePickerConfig;

@override
Widget build(BuildContext context) {
super.registerController(context);

var _ = getTranslator(context);
return ImageFormField(
onSaved: controller.onSaved,
validator: (value) => controller.onValidate(value, _),
validator: (value) => controller.onValidate(value, validationMessage),
initialValue: controller.value,
imagePickerConfig: imagePickerConfig,
);
Expand Down Expand Up @@ -168,12 +169,16 @@ class FlutterFormInputImageController
}

@override
String? onValidate(
Uint8List? value,
String Function(String, {List<String>? params}) translator,
) =>
null;
void Function(Uint8List? value)? onSubmit;

@override
void Function(Uint8List? value)? onSubmit;
String? onValidate(Uint8List? value, String validationMessage) {
if (mandatory) {
if (value == null || value.isEmpty) {
return validationMessage;
}
}

return null;
}
}
3 changes: 3 additions & 0 deletions lib/src/widgets/onboarding.dart
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ class _OnboardingState extends State<Onboarding> {
FlutterFormInputImage(
firstName: 'mike',
lastName: 'van der velden',
validationMessage: 'Please select an image',
controller: imageController,
imagePickerConfig: getImagePickerConfig(),
),
Expand All @@ -85,6 +86,7 @@ class _OnboardingState extends State<Onboarding> {
border: OutlineInputBorder(),
contentPadding: EdgeInsets.symmetric(horizontal: 8),
),
validationMessage: 'Please enter your first name',
),
const SizedBox(
height: 20,
Expand All @@ -102,6 +104,7 @@ class _OnboardingState extends State<Onboarding> {
border: OutlineInputBorder(),
contentPadding: EdgeInsets.symmetric(horizontal: 8),
),
validationMessage: 'Please enter your bio',
),
),
],
Expand Down
9 changes: 4 additions & 5 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: flutter_user
description: "Flutter Userstory for onboarding, login, and registration."
publish_to: "none"
version: 4.0.1
version: 4.1.0

environment:
sdk: ">=3.2.5 <4.0.0"
Expand All @@ -22,19 +22,19 @@ dependencies:
flutter_registration:
git:
url: https://github.com/Iconica-Development/flutter_registration
ref: 2.0.4
ref: 2.1.0
flutter_form_wizard:
git:
url: https://github.com/Iconica-Development/flutter_form_wizard
ref: 6.2.5
ref: 6.3.2
flutter_stepper:
git:
url: https://github.com/Iconica-Development/stepper
ref: 2.2.0
flutter_profile:
git:
url: https://github.com/Iconica-Development/flutter_profile
ref: 1.3.0
ref: 1.5.0
flutter_image_picker:
git:
url: https://github.com/Iconica-Development/flutter_image_picker
Expand All @@ -47,6 +47,5 @@ dev_dependencies:
git:
url: https://github.com/Iconica-Development/flutter_iconica_analysis
ref: 6.0.0

flutter:
uses-material-design: true

0 comments on commit 8455800

Please sign in to comment.