Skip to content

Commit c5a37b9

Browse files
committed
feat: minor improvements
1 parent af9178b commit c5a37b9

14 files changed

+496
-80
lines changed

lib/app_scaffolds/app.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ class _AppWidget extends StatelessWidget {
139139
locale: context.locale,
140140
routerConfig: generatedData?.routerConfig,
141141
scrollBehavior: NoThumbScrollBehavior().copyWith(scrollbars: false),
142-
title: buildTitle(context),
142+
onGenerateTitle: buildTitle,
143143
// showPerformanceOverlay: true,
144144
theme: buildTheme(context),
145145
)),

lib/architect/plans/info_box/default.content_placeholder.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class DefaultInfoBoxContentPlaceholder extends ArchBaseStatelessWidget<InfoBoxDa
3838
children: [
3939

4040
if (data.icon != null) Align(
41-
alignment: Alignment.topLeft,
41+
alignment: Alignment.topCenter,
4242
child: Padding(
4343
padding: context.paddingXS,
4444
child: Icon(data.icon!,

lib/blue_forms/models/elements/form_input_images.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,19 @@ class FormInputImagesFileSettings {
1212

1313
class FormInputImages extends FormInput {
1414

15+
final double imagePreviewAspectRatio;
1516
final int min;
1617
final int max;
1718
final FormInputImagesFileSettings fileSettings;
18-
final void Function(List<File> images)? onChange;
19+
final void Function(List<XFile> images)? onChange;
1920

2021
const FormInputImages({
2122
required super.id,
2223
super.initialValue,
2324
super.description,
2425
super.label,
2526
super.isActive,
27+
this.imagePreviewAspectRatio = 16 / 9,
2628
this.min = 1,
2729
this.max = 1,
2830
this.fileSettings = const FormInputImagesFileSettings(),

lib/blue_forms/util/common_form_inputs.dart

Lines changed: 56 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -116,40 +116,75 @@ abstract class CommonFormInputs {
116116
elementsPerRow: elementsPerRow,
117117
elements: [
118118

119-
FormInputText(
120-
id: '${idPrefix}givenName',
119+
CommonFormInputs.givenName(
120+
idPrefix: idPrefix,
121121
description: description,
122-
initialValue: initialGivenName,
123-
label: LibStrings.lib_blueForms_commonInputs_givenNameLabel.tr(),
124-
hint: LibStrings.lib_blueForms_commonInputs_givenNameHint.tr(),
125-
autocorrect: false,
126122
isOptional: isOptional,
127-
autofillHints: [
128-
AutofillHints.givenName,
129-
],
130-
validationType: kFormTextValidationType.trimNotEmpty,
123+
initialGivenName: initialGivenName,
131124
),
132125

133-
134-
FormInputText(
135-
id: '${idPrefix}familyName',
126+
CommonFormInputs.familyName(
127+
idPrefix: idPrefix,
136128
description: description,
137-
initialValue: initialFamilyName,
138-
label: LibStrings.lib_blueForms_commonInputs_familyNameLabel.tr(),
139-
hint: LibStrings.lib_blueForms_commonInputs_familyNameHint.tr(),
140-
autocorrect: false,
141129
isOptional: isOptional,
142-
autofillHints: [
143-
AutofillHints.familyName,
144-
],
145-
validationType: kFormTextValidationType.trimNotEmpty,
130+
initialFamilyName: initialFamilyName,
146131
),
147132

148133
],
149134
);
150135
}
151136

152137

138+
static FormInput givenName({
139+
String idPrefix = '',
140+
String? description,
141+
bool isOptional = false,
142+
bool isActive = true,
143+
String? initialGivenName,
144+
})
145+
{
146+
return FormInputText(
147+
id: '${idPrefix}givenName',
148+
isActive: isActive,
149+
description: description,
150+
initialValue: initialGivenName,
151+
label: LibStrings.lib_blueForms_commonInputs_givenNameLabel.tr(),
152+
hint: LibStrings.lib_blueForms_commonInputs_givenNameHint.tr(),
153+
autocorrect: false,
154+
isOptional: isOptional,
155+
autofillHints: [
156+
AutofillHints.givenName,
157+
],
158+
validationType: kFormTextValidationType.trimNotEmpty,
159+
);
160+
}
161+
162+
163+
static FormInput familyName({
164+
String idPrefix = '',
165+
String? description,
166+
bool isOptional = false,
167+
bool isActive = true,
168+
String? initialFamilyName,
169+
})
170+
{
171+
return FormInputText(
172+
id: '${idPrefix}familyName',
173+
isActive: isActive,
174+
description: description,
175+
initialValue: initialFamilyName,
176+
label: LibStrings.lib_blueForms_commonInputs_familyNameLabel.tr(),
177+
hint: LibStrings.lib_blueForms_commonInputs_familyNameHint.tr(),
178+
autocorrect: false,
179+
isOptional: isOptional,
180+
autofillHints: [
181+
AutofillHints.familyName,
182+
],
183+
validationType: kFormTextValidationType.trimNotEmpty,
184+
);
185+
}
186+
187+
153188

154189

155190

lib/blue_forms/widgets/form_input_container.dart

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,19 @@ class _FormInputContainerWidget extends StatelessWidget {
2424
mainAxisSize: MainAxisSize.min,
2525
children: [
2626

27+
28+
child,
29+
30+
2731
if (description != null) Padding(
28-
padding: context.paddingM_0.setBottom(context.dimensions.spaceXLValue),
32+
padding: context.paddingM_0.setTop(context.dimensions.spaceLValue),
2933
child: TextBody.medium(description!,
3034
textAlign: TextAlign.justify,
35+
italic: true,
36+
color: context.colors.onBackgroundLessFocus,
3137
),
3238
),
3339

34-
child
35-
3640
],
3741
);
3842
}

lib/blue_forms/widgets/form_input_group.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ class _FormInputGroup extends StatelessWidget {
9090

9191
groupChildren.add(
9292
Row(
93+
crossAxisAlignment: CrossAxisAlignment.start,
9394
children: rowChildren,
9495
)
9596
);
@@ -99,7 +100,7 @@ class _FormInputGroup extends StatelessWidget {
99100
if (i != definition.elements.length - 1)
100101
{
101102
groupChildren.add(
102-
context.spaceL
103+
context.spaceXL
103104
);
104105
}
105106

@@ -123,7 +124,7 @@ class _FormInputGroup extends StatelessWidget {
123124
if (i != definition.elements.length - 1)
124125
{
125126
groupChildren.add(
126-
context.spaceL
127+
context.spaceXL
127128
);
128129
}
129130
}

0 commit comments

Comments
 (0)