Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion packages/flet/lib/src/controls/animated_switcher.dart
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@ class AnimatedSwitcherControl extends StatelessWidget {
},
child: content,
);
return ConstrainedControl(control: control, child: animatedSwitcher);
return LayoutControl(control: control, child: animatedSwitcher);
}
}
13 changes: 11 additions & 2 deletions packages/flet/lib/src/controls/base_controls.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,20 @@ class BaseControl extends StatelessWidget {
}
}

class ConstrainedControl extends StatelessWidget {
// TODO - remove when extensions migrated to LayoutControl
class ConstrainedControl extends LayoutControl {
const ConstrainedControl({
super.key,
required super.control,
required super.child,
});
}

class LayoutControl extends StatelessWidget {
final Control control;
final Widget child;

const ConstrainedControl({
const LayoutControl({
super.key,
required this.control,
required this.child,
Expand Down
2 changes: 1 addition & 1 deletion packages/flet/lib/src/controls/bottom_app_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ class BottomAppBarControl extends StatelessWidget {
child: control.buildWidget("content"),
);

return ConstrainedControl(control: control, child: bottomAppBar);
return LayoutControl(control: control, child: bottomAppBar);
}
}
2 changes: 1 addition & 1 deletion packages/flet/lib/src/controls/button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,6 @@ class _ButtonControlState extends State<ButtonControl> with FletStoreMixin {
}
}

return ConstrainedControl(control: widget.control, child: button);
return LayoutControl(control: widget.control, child: button);
}
}
2 changes: 1 addition & 1 deletion packages/flet/lib/src/controls/canvas.dart
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ class _CanvasControlState extends State<CanvasControl> {
child: widget.control.buildWidget("content"),
);

return ConstrainedControl(control: widget.control, child: paint);
return LayoutControl(control: widget.control, child: paint);
}
}

Expand Down
2 changes: 1 addition & 1 deletion packages/flet/lib/src/controls/card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,6 @@ class CardControl extends StatelessWidget {
child: contentWidget);
}

return ConstrainedControl(control: control, child: card);
return LayoutControl(control: control, child: card);
}
}
2 changes: 1 addition & 1 deletion packages/flet/lib/src/controls/checkbox.dart
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,6 @@ class _CheckboxControlState extends State<CheckboxControl> {
child: FittedBox(fit: BoxFit.fill, child: result));
}

return ConstrainedControl(control: widget.control, child: result);
return LayoutControl(control: widget.control, child: result);
}
}
2 changes: 1 addition & 1 deletion packages/flet/lib/src/controls/chip.dart
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,6 @@ class _ChipControlState extends State<ChipControl> {
: null,
);

return ConstrainedControl(control: widget.control, child: chip);
return LayoutControl(control: widget.control, child: chip);
}
}
2 changes: 1 addition & 1 deletion packages/flet/lib/src/controls/circle_avatar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,6 @@ class CircleAvatarControl extends StatelessWidget {
: null,
child: content);

return ConstrainedControl(control: control, child: avatar);
return LayoutControl(control: control, child: avatar);
}
}
2 changes: 1 addition & 1 deletion packages/flet/lib/src/controls/column.dart
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,6 @@ class ColumnControl extends StatelessWidget {
child = ScrollNotificationControl(control: control, child: child);
}

return ConstrainedControl(control: control, child: child);
return LayoutControl(control: control, child: child);
}
}
2 changes: 1 addition & 1 deletion packages/flet/lib/src/controls/container.dart
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,6 @@ class ContainerControl extends StatelessWidget with FletStoreMixin {
container = IgnorePointer(child: container);
}

return ConstrainedControl(control: control, child: container);
return LayoutControl(control: control, child: container);
}
}
2 changes: 1 addition & 1 deletion packages/flet/lib/src/controls/cupertino_action_sheet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ class CupertinoActionSheetControl extends StatelessWidget {
actions: control.buildWidgets("actions"),
);

return ConstrainedControl(control: control, child: sheet);
return LayoutControl(control: control, child: sheet);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ class CupertinoActionSheetActionControl extends StatelessWidget {
child: content,
);

return ConstrainedControl(control: control, child: actionSheet);
return LayoutControl(control: control, child: actionSheet);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ class CupertinoActivityIndicatorControl extends StatelessWidget {
animating: control.getBool("animating", true)!,
color: control.getColor("color", context),
);
return ConstrainedControl(control: control, child: activityIndicator);
return LayoutControl(control: control, child: activityIndicator);
}
}
4 changes: 2 additions & 2 deletions packages/flet/lib/src/controls/cupertino_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class _CupertinoButtonControlState extends State<CupertinoButtonControl> {
if (icon != null) {
if (content != null) {
child = Row(
mainAxisSize: MainAxisSize.min,
mainAxisSize: MainAxisSize.min,
children: [icon, const SizedBox(width: 8), content]);
} else {
child = icon;
Expand Down Expand Up @@ -208,6 +208,6 @@ class _CupertinoButtonControlState extends State<CupertinoButtonControl> {
);
}

return ConstrainedControl(control: widget.control, child: button);
return LayoutControl(control: widget.control, child: button);
}
}
2 changes: 1 addition & 1 deletion packages/flet/lib/src/controls/cupertino_checkbox.dart
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,6 @@ class _CheckboxControlState extends State<CupertinoCheckboxControl> {
child: FittedBox(fit: BoxFit.fill, child: result));
}

return ConstrainedControl(control: widget.control, child: result);
return LayoutControl(control: widget.control, child: result);
}
}
2 changes: 1 addition & 1 deletion packages/flet/lib/src/controls/cupertino_date_picker.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,6 @@ class _CupertinoDatePickerControlState
return ErrorControl("CupertinoDatePicker Error: ${e.toString()}");
}

return ConstrainedControl(control: widget.control, child: dialog);
return LayoutControl(control: widget.control, child: dialog);
}
}
2 changes: 1 addition & 1 deletion packages/flet/lib/src/controls/cupertino_list_tile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,6 @@ class CupertinoListTileControl extends StatelessWidget {
tile = ListTileClicks(notifier: _clickNotifier, child: tile);
}

return ConstrainedControl(control: control, child: tile);
return LayoutControl(control: control, child: tile);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,6 @@ class _CupertinoNavigationBarControlState
label: dest.getString("label", "")!);
}).toList());

return ConstrainedControl(control: widget.control, child: navBar);
return LayoutControl(control: widget.control, child: navBar);
}
}
2 changes: 1 addition & 1 deletion packages/flet/lib/src/controls/cupertino_picker.dart
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,6 @@ class _CupertinoPickerControlState extends State<CupertinoPickerControl> {
}).toList(),
);

return ConstrainedControl(control: widget.control, child: picker);
return LayoutControl(control: widget.control, child: picker);
}
}
2 changes: 1 addition & 1 deletion packages/flet/lib/src/controls/cupertino_radio.dart
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,6 @@ class _CupertinoRadioControlState extends State<CupertinoRadioControl>
: Row(children: [labelWidget, cupertinoRadio])));
}

return ConstrainedControl(control: widget.control, child: result);
return LayoutControl(control: widget.control, child: result);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,6 @@ class _CupertinoSegmentedButtonControlState
},
);

return ConstrainedControl(control: widget.control, child: segmnetedButton);
return LayoutControl(control: widget.control, child: segmnetedButton);
}
}
2 changes: 1 addition & 1 deletion packages/flet/lib/src/controls/cupertino_slider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,6 @@ class _CupertinoSliderControlState extends State<CupertinoSliderControl> {
}
: null);

return ConstrainedControl(control: widget.control, child: cupertinoSlider);
return LayoutControl(control: widget.control, child: cupertinoSlider);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,6 @@ class CupertinoSlidingSegmentedButtonControl extends StatelessWidget {
},
);

return ConstrainedControl(control: control, child: button);
return LayoutControl(control: control, child: button);
}
}
2 changes: 1 addition & 1 deletion packages/flet/lib/src/controls/cupertino_switch.dart
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ class _CupertinoSwitchControlState extends State<CupertinoSwitchControl> {
: Row(children: [labelWidget, swtch])));
}

return ConstrainedControl(control: widget.control, child: result);
return LayoutControl(control: widget.control, child: result);
//});
}
}
4 changes: 2 additions & 2 deletions packages/flet/lib/src/controls/cupertino_textfield.dart
Original file line number Diff line number Diff line change
Expand Up @@ -314,11 +314,11 @@ class _CupertinoTextFieldControlState extends State<CupertinoTextFieldControl> {
}

if (widget.control.getExpand("expand", 0)! > 0) {
return ConstrainedControl(control: widget.control, child: textField);
return LayoutControl(control: widget.control, child: textField);
} else {
double? width = widget.control.getDouble("width");

return ConstrainedControl(
return LayoutControl(
control: widget.control,
child: width == null
? ConstrainedBox(
Expand Down
2 changes: 1 addition & 1 deletion packages/flet/lib/src/controls/cupertino_timer_picker.dart
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@ class _CupertinoTimerPickerControlState
},
);

return ConstrainedControl(control: widget.control, child: picker);
return LayoutControl(control: widget.control, child: picker);
}
}
2 changes: 1 addition & 1 deletion packages/flet/lib/src/controls/datatable.dart
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,6 @@ class DataTableControl extends StatelessWidget {
}).toList(),
);

return ConstrainedControl(control: control, child: datatable);
return LayoutControl(control: control, child: datatable);
}
}
2 changes: 1 addition & 1 deletion packages/flet/lib/src/controls/dismissible.dart
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ class _DismissibleControlState extends State<DismissibleControl> {
.getDismissThresholds("dismiss_thresholds", const {})!,
child: content);

return ConstrainedControl(control: widget.control, child: dismissible);
return LayoutControl(control: widget.control, child: dismissible);
}
}

Expand Down
2 changes: 1 addition & 1 deletion packages/flet/lib/src/controls/dropdown.dart
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,6 @@ class _DropdownControlState extends State<DropdownControl> {
});
}

return ConstrainedControl(control: widget.control, child: dropDown);
return LayoutControl(control: widget.control, child: dropDown);
}
}
4 changes: 2 additions & 2 deletions packages/flet/lib/src/controls/dropdownm2.dart
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ class _DropdownM2ControlState extends State<DropdownM2Control> {
);

if (widget.control.getExpand("expand", 0)! > 0) {
return ConstrainedControl(control: widget.control, child: dropDown);
return LayoutControl(control: widget.control, child: dropDown);
} else {
return LayoutBuilder(
builder: (BuildContext context, BoxConstraints constraints) {
Expand All @@ -159,7 +159,7 @@ class _DropdownM2ControlState extends State<DropdownM2Control> {
child: dropDown);
}

return ConstrainedControl(control: widget.control, child: dropDown);
return LayoutControl(control: widget.control, child: dropDown);
},
);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/flet/lib/src/controls/expansion_panel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,6 @@ class ExpansionPanelListControl extends StatelessWidget {
);
}).toList());

return ConstrainedControl(control: control, child: panelList);
return LayoutControl(control: control, child: panelList);
}
}
2 changes: 1 addition & 1 deletion packages/flet/lib/src/controls/expansion_tile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,6 @@ class ExpansionTileControl extends StatelessWidget {
children: controls,
);

return ConstrainedControl(control: control, child: tile);
return LayoutControl(control: control, child: tile);
}
}
2 changes: 1 addition & 1 deletion packages/flet/lib/src/controls/flet_app_control.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class _FletAppControlState extends State<FletAppControl> {
var appStartupScreenMessage =
widget.control.getString("app_startup_screen_message");

return ConstrainedControl(
return LayoutControl(
control: widget.control,
child: FletApp(
controlId: widget.control.id,
Expand Down
2 changes: 1 addition & 1 deletion packages/flet/lib/src/controls/floating_action_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,6 @@ class FloatingActionButtonControl extends StatelessWidget {
"FloatingActionButton has nothing to display. Provide at minimum icon or content.");
}

return ConstrainedControl(control: control, child: button);
return LayoutControl(control: control, child: button);
}
}
2 changes: 1 addition & 1 deletion packages/flet/lib/src/controls/gesture_detector.dart
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,6 @@ class _GestureDetectorControlState extends State<GestureDetectorControl> {
"GestureDetector should have at least one event handler defined");
}

return ConstrainedControl(control: widget.control, child: result);
return LayoutControl(control: widget.control, child: result);
}
}
2 changes: 1 addition & 1 deletion packages/flet/lib/src/controls/grid_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,6 @@ class _GridViewControlState extends State<GridViewControl> {
},
);

return ConstrainedControl(control: widget.control, child: gridView);
return LayoutControl(control: widget.control, child: gridView);
}
}
2 changes: 1 addition & 1 deletion packages/flet/lib/src/controls/icon.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class IconControl extends StatelessWidget {
Widget build(BuildContext context) {
debugPrint("Icon build: ${control.id}");

return ConstrainedControl(
return LayoutControl(
control: control,
child: Icon(
control.getIconData("icon"),
Expand Down
2 changes: 1 addition & 1 deletion packages/flet/lib/src/controls/icon_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ class _IconButtonControlState extends State<IconButtonControl>
onPressed: onPressed);
}

return ConstrainedControl(control: widget.control, child: button);
return LayoutControl(control: widget.control, child: button);
});
}
}
2 changes: 1 addition & 1 deletion packages/flet/lib/src/controls/image.dart
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class ImageControl extends StatelessWidget {
disabled: control.disabled,
errorCtrl: errorContent,
);
return ConstrainedControl(
return LayoutControl(
control: control,
child: _clipCorners(image, control.getBorderRadius("border_radius")));
}
Expand Down
3 changes: 1 addition & 2 deletions packages/flet/lib/src/controls/interactive_viewer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@ class _InteractiveViewerControlState extends State<InteractiveViewerControl>
"InteractiveViewer.content must be provided and visible"),
);

return ConstrainedControl(
control: widget.control, child: interactiveViewer);
return LayoutControl(control: widget.control, child: interactiveViewer);
}
}
2 changes: 1 addition & 1 deletion packages/flet/lib/src/controls/list_tile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ class ListTileControl extends StatelessWidget with FletStoreMixin {

tile = Material(type: MaterialType.transparency, child: tile);

return ConstrainedControl(control: control, child: tile);
return LayoutControl(control: control, child: tile);
}
}

Expand Down
2 changes: 1 addition & 1 deletion packages/flet/lib/src/controls/list_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,6 @@ class _ListViewControlState extends State<ListViewControl> {
},
);

return ConstrainedControl(control: widget.control, child: listView);
return LayoutControl(control: widget.control, child: listView);
}
}
Loading