Skip to content

Commit

Permalink
Merge branch 'main' into cookie0x45
Browse files Browse the repository at this point in the history
  • Loading branch information
TheNoumanDev authored Sep 26, 2024
2 parents 491cf16 + 6d57b24 commit e9fe3e9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
4 changes: 1 addition & 3 deletions modules/ensemble/lib/widget/helpers/form_helper.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ class FormFieldController extends WidgetController {
bool? enabled;
bool required = false;
IconModel? icon;
int? fontSize;
int? maxWidth;

InputVariant? variant;
Expand Down Expand Up @@ -65,7 +64,6 @@ class FormFieldController extends WidgetController {
floatLabel = Utils.getBool(value, fallback: false),
'required': (value) => required = Utils.getBool(value, fallback: false),
'icon': (value) => icon = Utils.getIcon(value),
'fontSize': (value) => fontSize = Utils.optionalInt(value),
'maxWidth': (value) =>
maxWidth = Utils.optionalInt(value, min: 0, max: 5000),
'variant': (type) => variant = InputVariant.values.from(type),
Expand Down Expand Up @@ -292,7 +290,7 @@ abstract class FormFieldWidgetState<W extends HasController>
if (widget.controller is FormFieldController) {
final formController = (widget.controller as FormFieldController);
return textStyle.copyWith(
fontSize: formController.fontSize?.toDouble(),
fontSize: formController.labelStyle?.fontSize,
overflow: formController.labelStyle?.overflow ?? TextOverflow.ellipsis,
color: formController.labelStyle?.color,
fontWeight: formController.labelStyle?.fontWeight,
Expand Down
6 changes: 3 additions & 3 deletions modules/ensemble/lib/widget/input/form_time.dart
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,12 @@ class TimeController extends FormFieldController with HasTextPlaceholder {
IOSTimePickerStyle? iOSStyles;
AndroidTimePickerStyle? androidStyles;

Text prettyValue(BuildContext context) {
Text prettyValue(BuildContext context, TextStyle formFieldTextStyle) {
if (value != null) {
return Text(
MaterialLocalizations.of(context)
.formatTimeOfDay(value!, alwaysUse24HourFormat: use24hFormat),
style: TextStyle(fontSize: fontSize?.toDouble()),
style: formFieldTextStyle,
);
} else {
return Text(
Expand Down Expand Up @@ -335,7 +335,7 @@ class TimeState extends FormFieldWidgetState<Time> {
children: [
const Icon(Icons.alarm, color: Colors.black54),
const SizedBox(width: 5),
widget._controller.prettyValue(context),
widget._controller.prettyValue(context, formFieldTextStyle)
],
);
if (!isEnabled()) {
Expand Down

0 comments on commit e9fe3e9

Please sign in to comment.