Skip to content
Merged
8 changes: 5 additions & 3 deletions client/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,11 @@ packages:
flutter_svg:
dependency: transitive
description:
name: flutter_svg
url: "https://pub.dartlang.org"
source: hosted
path: "."
ref: flet-fixes
resolved-ref: "71166dc07d39b686f117319a04479d26e44c2a24"
url: "https://github.com/flet-dev/flutter_svg.git"
source: git
version: "1.1.5"
flutter_test:
dependency: "direct dev"
Expand Down
29 changes: 22 additions & 7 deletions package/lib/src/controls/create_control.dart
Original file line number Diff line number Diff line change
Expand Up @@ -326,15 +326,20 @@ Widget constrainedControl(
return _expandable(
_positionedControl(
context,
_offsetControl(
context,
_scaledControl(
_aspectRatio(
_offsetControl(
context,
_rotatedControl(
_scaledControl(
context,
_sizedControl(
_tooltip(_opacity(context, widget, parent, control),
parent, control),
_rotatedControl(
context,
_sizedControl(
_tooltip(
_opacity(context, widget, parent, control),
parent,
control),
parent,
control),
parent,
control),
parent,
Expand Down Expand Up @@ -391,6 +396,16 @@ Widget _tooltip(Widget widget, Control? parent, Control control) {
: widget;
}

Widget _aspectRatio(Widget widget, Control? parent, Control control) {
var aspectRatio = control.attrDouble("aspectRatio");
return aspectRatio != null
? AspectRatio(
aspectRatio: aspectRatio,
child: widget,
)
: widget;
}

Widget _rotatedControl(
BuildContext context, Widget widget, Control? parent, Control control) {
var rotationDetails = parseRotate(control, "rotate");
Expand Down
5 changes: 4 additions & 1 deletion package/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ dependencies:
markdown: ^6.0.1
file_picker: ^5.0.1
shared_preferences: ^2.0.15
flutter_svg: ^1.1.5
flutter_svg:
git:
url: https://github.com/flet-dev/flutter_svg.git
ref: flet-fixes
window_to_front: ^0.0.3
audioplayers: ^1.1.0

Expand Down
2 changes: 2 additions & 0 deletions sdk/python/flet/animated_switcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ def __init__(
rotate: RotateValue = None,
scale: ScaleValue = None,
offset: OffsetValue = None,
aspect_ratio: OptionalNumber = None,
animate_opacity: AnimationValue = None,
animate_size: AnimationValue = None,
animate_position: AnimationValue = None,
Expand Down Expand Up @@ -59,6 +60,7 @@ def __init__(
rotate=rotate,
scale=scale,
offset=offset,
aspect_ratio=aspect_ratio,
animate_opacity=animate_opacity,
animate_size=animate_size,
animate_position=animate_position,
Expand Down
2 changes: 2 additions & 0 deletions sdk/python/flet/card.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def __init__(
rotate: RotateValue = None,
scale: ScaleValue = None,
offset: OffsetValue = None,
aspect_ratio: OptionalNumber = None,
animate_opacity: AnimationValue = None,
animate_size: AnimationValue = None,
animate_position: AnimationValue = None,
Expand Down Expand Up @@ -55,6 +56,7 @@ def __init__(
rotate=rotate,
scale=scale,
offset=offset,
aspect_ratio=aspect_ratio,
animate_opacity=animate_opacity,
animate_size=animate_size,
animate_position=animate_position,
Expand Down
2 changes: 2 additions & 0 deletions sdk/python/flet/checkbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ def __init__(
rotate: RotateValue = None,
scale: ScaleValue = None,
offset: OffsetValue = None,
aspect_ratio: OptionalNumber = None,
animate_opacity: AnimationValue = None,
animate_size: AnimationValue = None,
animate_position: AnimationValue = None,
Expand Down Expand Up @@ -72,6 +73,7 @@ def __init__(
rotate=rotate,
scale=scale,
offset=offset,
aspect_ratio=aspect_ratio,
animate_opacity=animate_opacity,
animate_size=animate_size,
animate_position=animate_position,
Expand Down
2 changes: 2 additions & 0 deletions sdk/python/flet/circle_avatar.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def __init__(
rotate: RotateValue = None,
scale: ScaleValue = None,
offset: OffsetValue = None,
aspect_ratio: OptionalNumber = None,
animate_opacity: AnimationValue = None,
animate_size: AnimationValue = None,
animate_position: AnimationValue = None,
Expand Down Expand Up @@ -61,6 +62,7 @@ def __init__(
rotate=rotate,
scale=scale,
offset=offset,
aspect_ratio=aspect_ratio,
animate_opacity=animate_opacity,
animate_size=animate_size,
animate_position=animate_position,
Expand Down
2 changes: 2 additions & 0 deletions sdk/python/flet/column.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ def __init__(
rotate: RotateValue = None,
scale: ScaleValue = None,
offset: OffsetValue = None,
aspect_ratio: OptionalNumber = None,
animate_opacity: AnimationValue = None,
animate_size: AnimationValue = None,
animate_position: AnimationValue = None,
Expand Down Expand Up @@ -66,6 +67,7 @@ def __init__(
rotate=rotate,
scale=scale,
offset=offset,
aspect_ratio=aspect_ratio,
animate_opacity=animate_opacity,
animate_size=animate_size,
animate_position=animate_position,
Expand Down
12 changes: 12 additions & 0 deletions sdk/python/flet/constrained_control.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ def __init__(
rotate: RotateValue = None,
scale: ScaleValue = None,
offset: OffsetValue = None,
aspect_ratio: OptionalNumber = None,
animate_opacity: AnimationValue = None,
animate_size: AnimationValue = None,
animate_position: AnimationValue = None,
Expand Down Expand Up @@ -57,6 +58,7 @@ def __init__(
self.scale = scale
self.rotate = rotate
self.offset = offset
self.aspect_ratio = aspect_ratio
self.animate_opacity = animate_opacity
self.animate_size = animate_size
self.animate_position = animate_position
Expand Down Expand Up @@ -169,6 +171,16 @@ def offset(self) -> OffsetValue:
def offset(self, value: OffsetValue):
self.__offset = value

# aspect_ratio
@property
def aspect_ratio(self) -> OptionalNumber:
return self._get_attr("aspectRatio")

@aspect_ratio.setter
@beartype
def aspect_ratio(self, value: OptionalNumber):
self._set_attr("aspectRatio", value)

# animate_opacity
@property
def animate_opacity(self) -> AnimationValue:
Expand Down
2 changes: 2 additions & 0 deletions sdk/python/flet/container.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ def __init__(
rotate: RotateValue = None,
scale: ScaleValue = None,
offset: OffsetValue = None,
aspect_ratio: OptionalNumber = None,
animate_opacity: AnimationValue = None,
animate_size: AnimationValue = None,
animate_position: AnimationValue = None,
Expand Down Expand Up @@ -104,6 +105,7 @@ def __init__(
rotate=rotate,
scale=scale,
offset=offset,
aspect_ratio=aspect_ratio,
animate_opacity=animate_opacity,
animate_size=animate_size,
animate_position=animate_position,
Expand Down
2 changes: 2 additions & 0 deletions sdk/python/flet/dropdown.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ def __init__(
rotate: RotateValue = None,
scale: ScaleValue = None,
offset: OffsetValue = None,
aspect_ratio: OptionalNumber = None,
animate_opacity: AnimationValue = None,
animate_size: AnimationValue = None,
animate_position: AnimationValue = None,
Expand Down Expand Up @@ -94,6 +95,7 @@ def __init__(
rotate=rotate,
scale=scale,
offset=offset,
aspect_ratio=aspect_ratio,
animate_opacity=animate_opacity,
animate_size=animate_size,
animate_position=animate_position,
Expand Down
2 changes: 2 additions & 0 deletions sdk/python/flet/elevated_button.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ def __init__(
rotate: RotateValue = None,
scale: ScaleValue = None,
offset: OffsetValue = None,
aspect_ratio: OptionalNumber = None,
animate_opacity: AnimationValue = None,
animate_size: AnimationValue = None,
animate_position: AnimationValue = None,
Expand Down Expand Up @@ -65,6 +66,7 @@ def __init__(
rotate=rotate,
scale=scale,
offset=offset,
aspect_ratio=aspect_ratio,
animate_opacity=animate_opacity,
animate_size=animate_size,
animate_position=animate_position,
Expand Down
2 changes: 2 additions & 0 deletions sdk/python/flet/floating_action_button.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def __init__(
rotate: RotateValue = None,
scale: ScaleValue = None,
offset: OffsetValue = None,
aspect_ratio: OptionalNumber = None,
animate_opacity: AnimationValue = None,
animate_size: AnimationValue = None,
animate_position: AnimationValue = None,
Expand Down Expand Up @@ -58,6 +59,7 @@ def __init__(
rotate=rotate,
scale=scale,
offset=offset,
aspect_ratio=aspect_ratio,
animate_opacity=animate_opacity,
animate_size=animate_size,
animate_position=animate_position,
Expand Down
2 changes: 2 additions & 0 deletions sdk/python/flet/form_field_control.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ def __init__(
rotate: RotateValue = None,
scale: ScaleValue = None,
offset: OffsetValue = None,
aspect_ratio: OptionalNumber = None,
animate_opacity: AnimationValue = None,
animate_size: AnimationValue = None,
animate_position: AnimationValue = None,
Expand Down Expand Up @@ -92,6 +93,7 @@ def __init__(
rotate=rotate,
scale=scale,
offset=offset,
aspect_ratio=aspect_ratio,
animate_opacity=animate_opacity,
animate_size=animate_size,
animate_position=animate_position,
Expand Down
2 changes: 2 additions & 0 deletions sdk/python/flet/gesture_detector.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ def __init__(
rotate: RotateValue = None,
scale: ScaleValue = None,
offset: OffsetValue = None,
aspect_ratio: OptionalNumber = None,
animate_opacity: AnimationValue = None,
animate_size: AnimationValue = None,
animate_position: AnimationValue = None,
Expand Down Expand Up @@ -126,6 +127,7 @@ def __init__(
rotate=rotate,
scale=scale,
offset=offset,
aspect_ratio=aspect_ratio,
animate_opacity=animate_opacity,
animate_size=animate_size,
animate_position=animate_position,
Expand Down
2 changes: 2 additions & 0 deletions sdk/python/flet/grid_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ def __init__(
rotate: RotateValue = None,
scale: ScaleValue = None,
offset: OffsetValue = None,
aspect_ratio: OptionalNumber = None,
animate_opacity: AnimationValue = None,
animate_size: AnimationValue = None,
animate_position: AnimationValue = None,
Expand Down Expand Up @@ -65,6 +66,7 @@ def __init__(
rotate=rotate,
scale=scale,
offset=offset,
aspect_ratio=aspect_ratio,
animate_opacity=animate_opacity,
animate_size=animate_size,
animate_position=animate_position,
Expand Down
2 changes: 2 additions & 0 deletions sdk/python/flet/icon.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ def __init__(
rotate: RotateValue = None,
scale: ScaleValue = None,
offset: OffsetValue = None,
aspect_ratio: OptionalNumber = None,
animate_opacity: AnimationValue = None,
animate_size: AnimationValue = None,
animate_position: AnimationValue = None,
Expand All @@ -44,6 +45,7 @@ def __init__(
rotate=rotate,
scale=scale,
offset=offset,
aspect_ratio=aspect_ratio,
animate_opacity=animate_opacity,
animate_size=animate_size,
animate_position=animate_position,
Expand Down
2 changes: 2 additions & 0 deletions sdk/python/flet/icon_button.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ def __init__(
rotate: RotateValue = None,
scale: ScaleValue = None,
offset: OffsetValue = None,
aspect_ratio: OptionalNumber = None,
animate_opacity: AnimationValue = None,
animate_size: AnimationValue = None,
animate_position: AnimationValue = None,
Expand Down Expand Up @@ -64,6 +65,7 @@ def __init__(
rotate=rotate,
scale=scale,
offset=offset,
aspect_ratio=aspect_ratio,
animate_opacity=animate_opacity,
animate_size=animate_size,
animate_position=animate_position,
Expand Down
2 changes: 2 additions & 0 deletions sdk/python/flet/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ def __init__(
rotate: RotateValue = None,
scale: ScaleValue = None,
offset: OffsetValue = None,
aspect_ratio: OptionalNumber = None,
animate_opacity: AnimationValue = None,
animate_size: AnimationValue = None,
animate_position: AnimationValue = None,
Expand Down Expand Up @@ -80,6 +81,7 @@ def __init__(
rotate=rotate,
scale=scale,
offset=offset,
aspect_ratio=aspect_ratio,
animate_opacity=animate_opacity,
animate_size=animate_size,
animate_position=animate_position,
Expand Down
2 changes: 2 additions & 0 deletions sdk/python/flet/list_tile.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ def __init__(
rotate: RotateValue = None,
scale: ScaleValue = None,
offset: OffsetValue = None,
aspect_ratio: OptionalNumber = None,
animate_opacity: AnimationValue = None,
animate_size: AnimationValue = None,
animate_position: AnimationValue = None,
Expand Down Expand Up @@ -69,6 +70,7 @@ def __init__(
rotate=rotate,
scale=scale,
offset=offset,
aspect_ratio=aspect_ratio,
animate_opacity=animate_opacity,
animate_size=animate_size,
animate_position=animate_position,
Expand Down
2 changes: 2 additions & 0 deletions sdk/python/flet/list_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ def __init__(
rotate: RotateValue = None,
scale: ScaleValue = None,
offset: OffsetValue = None,
aspect_ratio: OptionalNumber = None,
animate_opacity: AnimationValue = None,
animate_size: AnimationValue = None,
animate_position: AnimationValue = None,
Expand Down Expand Up @@ -65,6 +66,7 @@ def __init__(
rotate=rotate,
scale=scale,
offset=offset,
aspect_ratio=aspect_ratio,
animate_opacity=animate_opacity,
animate_size=animate_size,
animate_position=animate_position,
Expand Down
2 changes: 2 additions & 0 deletions sdk/python/flet/markdown.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ def __init__(
rotate: RotateValue = None,
scale: ScaleValue = None,
offset: OffsetValue = None,
aspect_ratio: OptionalNumber = None,
animate_opacity: AnimationValue = None,
animate_size: AnimationValue = None,
animate_position: AnimationValue = None,
Expand Down Expand Up @@ -65,6 +66,7 @@ def __init__(
rotate=rotate,
scale=scale,
offset=offset,
aspect_ratio=aspect_ratio,
animate_opacity=animate_opacity,
animate_size=animate_size,
animate_position=animate_position,
Expand Down
Loading