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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 22 additions & 22 deletions client/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -245,10 +245,10 @@ packages:
dependency: transitive
description:
name: file_picker
sha256: ef7d2a085c1b1d69d17b6842d0734aad90156de08df6bd3c12496d0bd6ddf8e2
sha256: e7e16c9d15c36330b94ca0e2ad8cb61f93cd5282d0158c09805aed13b5452f22
url: "https://pub.dev"
source: hosted
version: "10.3.1"
version: "10.3.2"
fixnum:
dependency: transitive
description:
Expand Down Expand Up @@ -277,7 +277,7 @@ packages:
description:
path: "src/flutter/flet_ads"
ref: main
resolved-ref: e847a431388733d6bcd81748c617a3b962c5efa9
resolved-ref: aa05773138be06e69353e2a223bd23c51b36dd3f
url: "https://github.com/flet-dev/flet-ads.git"
source: git
version: "0.2.0"
Expand All @@ -286,7 +286,7 @@ packages:
description:
path: "src/flutter/flet_audio"
ref: main
resolved-ref: "5611fa1ef47c2faeeb6317671932cfd3ee2888c3"
resolved-ref: "06fb901f133fab54e603f8039bc9a1d707d19068"
url: "https://github.com/flet-dev/flet-audio.git"
source: git
version: "0.2.0"
Expand All @@ -295,7 +295,7 @@ packages:
description:
path: "src/flutter/flet_audio_recorder"
ref: main
resolved-ref: "10c9108060410c3c4e2435311c8e4ee70daf24bf"
resolved-ref: "62a1934a34514e92617f4e090b53828474f5969e"
url: "https://github.com/flet-dev/flet-audio-recorder.git"
source: git
version: "0.2.0"
Expand All @@ -313,7 +313,7 @@ packages:
description:
path: "src/flutter/flet_datatable2"
ref: main
resolved-ref: ebd7adc75486b276df382ae6401037c45a6df2a3
resolved-ref: bf6af9c7a9c1962c36512ff5ab48eec9f14ef81a
url: "https://github.com/flet-dev/flet-datatable2.git"
source: git
version: "0.1.0"
Expand All @@ -322,7 +322,7 @@ packages:
description:
path: "src/flutter/flet_flashlight"
ref: main
resolved-ref: "88fb80a6b4032956282a4be9c60f3c25f3cfccb5"
resolved-ref: def30504c3ed6786dc2a1fdb4f18b226a284a7d2
url: "https://github.com/flet-dev/flet-flashlight.git"
source: git
version: "0.2.0"
Expand All @@ -331,7 +331,7 @@ packages:
description:
path: "src/flutter/flet_geolocator"
ref: main
resolved-ref: "94ed74df1a8b791d0afaccc2f9caac3456698f78"
resolved-ref: "25efd0a9d15f23bf284912814a131388f8de9ec4"
url: "https://github.com/flet-dev/flet-geolocator.git"
source: git
version: "0.25.2"
Expand All @@ -340,7 +340,7 @@ packages:
description:
path: "src/flutter/flet_lottie"
ref: main
resolved-ref: "86eaa0b59f3cc54f9b2fb57abce9c0d22de253ca"
resolved-ref: "5187fcf6bcb37f4bfa59cad127f6444d40cdb48c"
url: "https://github.com/flet-dev/flet-lottie.git"
source: git
version: "0.2.0"
Expand All @@ -349,7 +349,7 @@ packages:
description:
path: "src/flutter/flet_map"
ref: main
resolved-ref: "8507cda6616f555974fbdcd3df05c3f2b02c043f"
resolved-ref: d79ebf24ebad208a543b73a7f7511cd4da1d7ea9
url: "https://github.com/flet-dev/flet-map.git"
source: git
version: "0.2.0"
Expand All @@ -358,7 +358,7 @@ packages:
description:
path: "src/flutter/flet_permission_handler"
ref: main
resolved-ref: "2a56423dd77d220a0067f4097f9e25659b2f9b36"
resolved-ref: dbd04f183b8452a5247f2807007cc40a2381a172
url: "https://github.com/flet-dev/flet-permission-handler.git"
source: git
version: "0.2.0"
Expand All @@ -367,7 +367,7 @@ packages:
description:
path: "src/flutter/flet_rive"
ref: main
resolved-ref: "67256e81ec7c906ae03790b0c180c9be018ed7a4"
resolved-ref: "6d78b068940afa5126fc38374ea326e710d43862"
url: "https://github.com/flet-dev/flet-rive.git"
source: git
version: "0.2.0"
Expand All @@ -376,7 +376,7 @@ packages:
description:
path: "src/flutter/flet_video"
ref: main
resolved-ref: a086b89d74f96e052a450d6c2a50c812a035ce45
resolved-ref: abeea4e9a3a2864299743726b26d5a245a4389d6
url: "https://github.com/flet-dev/flet-video.git"
source: git
version: "0.2.0"
Expand All @@ -385,7 +385,7 @@ packages:
description:
path: "src/flutter/flet_webview"
ref: main
resolved-ref: "9e2b64171f81cbe72a8a61ee9ba9d2af69587837"
resolved-ref: cb3d07bfb84ae1b51be25388ca04c03a9dafd7f3
url: "https://github.com/flet-dev/flet-webview.git"
source: git
version: "0.2.0"
Expand Down Expand Up @@ -1028,18 +1028,18 @@ packages:
dependency: transitive
description:
name: record_android
sha256: "8b170e33d9866f9b51e01a767d7e1ecb97b9ecd629950bd87a47c79359ec57f8"
sha256: "8361a791c9a3fa5c065f0b8b5adb10f12531f8538c86b19474cf7b56ea80d426"
url: "https://pub.dev"
source: hosted
version: "1.4.0"
version: "1.4.1"
record_ios:
dependency: transitive
description:
name: record_ios
sha256: ad97d0a75933c44bcf5aff648e86e32fc05eb61f8fbef190f14968c8eaf86692
sha256: "13e241ed9cbc220534a40ae6b66222e21288db364d96dd66fb762ebd3cb77c71"
url: "https://pub.dev"
source: hosted
version: "1.1.0"
version: "1.1.2"
record_linux:
dependency: transitive
description:
Expand All @@ -1052,10 +1052,10 @@ packages:
dependency: transitive
description:
name: record_macos
sha256: f1399bca76a1634da109e5b0cba764ed8332a2b4da49c704c66d2c553405ed81
sha256: "2849068bb59072f300ad63ed146e543d66afaef8263edba4de4834fc7c8d4d35"
url: "https://pub.dev"
source: hosted
version: "1.1.0"
version: "1.1.1"
record_platform_interface:
dependency: transitive
description:
Expand All @@ -1076,10 +1076,10 @@ packages:
dependency: transitive
description:
name: record_windows
sha256: "85a22fc97f6d73ecd67c8ba5f2f472b74ef1d906f795b7970f771a0914167e99"
sha256: "223258060a1d25c62bae18282c16783f28581ec19401d17e56b5205b9f039d78"
url: "https://pub.dev"
source: hosted
version: "1.0.6"
version: "1.0.7"
rive:
dependency: transitive
description:
Expand Down
16 changes: 16 additions & 0 deletions packages/flet/lib/src/controls/dropdown.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,27 @@ class DropdownControl extends StatefulWidget {

class _DropdownControlState extends State<DropdownControl> {
late final FocusNode _focusNode;
late final TextEditingController _controller;

@override
void initState() {
super.initState();
_focusNode = FocusNode();

_controller =
TextEditingController(text: widget.control.getString("value"));
_focusNode.addListener(_onFocusChange);
widget.control.addInvokeMethodListener(_invokeMethod);

_controller.addListener(_onTextChange);
}

void _onTextChange() {
debugPrint("Typed text: ${_controller.text}");
if (_controller.text != widget.control.getString("value")) {
widget.control.updateProperties({"value": _controller.text});
widget.control.triggerEvent("text_change", _controller.text);
}
}

void _onFocusChange() {
Expand All @@ -33,6 +47,7 @@ class _DropdownControlState extends State<DropdownControl> {
_focusNode.removeListener(_onFocusChange);
_focusNode.dispose();
widget.control.removeInvokeMethodListener(_invokeMethod);
_controller.dispose();
super.dispose();
}

Expand Down Expand Up @@ -182,6 +197,7 @@ class _DropdownControlState extends State<DropdownControl> {
Widget dropDown = DropdownMenu<String>(
enabled: !widget.control.disabled,
focusNode: _focusNode,
controller: _controller,
initialSelection: value,
enableFilter: widget.control.getBool("enable_filter", false)!,
enableSearch: widget.control.getBool("enable_search", true)!,
Expand Down
5 changes: 5 additions & 0 deletions packages/flet/lib/src/controls/search_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,9 @@ class _SearchBarControlState extends State<SearchBarControl> {
headerTextStyle:
widget.control.getTextStyle("view_header_text_style", theme),
viewSide: widget.control.getBorderSide("view_side", theme),
viewPadding: widget.control.getPadding("view_padding"),
viewBarPadding: widget.control.getPadding("view_bar_padding"),
shrinkWrap: widget.control.getBool("shrink_wrap"),
isFullScreen: widget.control.getBool("full_screen", false),
viewBackgroundColor: widget.control.getColor("view_bgcolor", context),
dividerColor: widget.control.getColor("divider_color", context),
Expand Down Expand Up @@ -208,6 +211,8 @@ class _SearchBarControlState extends State<SearchBarControl> {
shape:
widget.control.getWidgetStateOutlinedBorder("bar_shape", theme),
padding: widget.control.getWidgetStatePadding("bar_padding"),
constraints:
widget.control.getBoxConstraints("bar_size_constraints"),
textStyle:
widget.control.getWidgetStateTextStyle("bar_text_style", theme),
hintStyle: widget.control
Expand Down
2 changes: 1 addition & 1 deletion packages/flet/lib/src/controls/segmented_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class _SegmentedButtonControlState extends State<SegmentedButtonControl>
selected: selected,
showSelectedIcon: widget.control.getBool("show_selected_icon", true)!,
style: style,
selectedIcon: widget.control.buildWidget("selected_icon"),
selectedIcon: widget.control.buildIconOrWidget("selected_icon"),
onSelectionChanged: !widget.control.disabled
? (newSelection) => onChange(newSelection)
: null,
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
107 changes: 105 additions & 2 deletions sdk/python/packages/flet/integration_tests/controls/test_icon.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
import pytest
import pytest_asyncio

import flet as ft
import flet.testing as ftt


@pytest.mark.asyncio(loop_scope="module")
async def test_icon_basic(flet_app: ftt.FletTestApp, request):
# Create a new flet_app instance for each test method
@pytest_asyncio.fixture(scope="function", autouse=True)
def flet_app(flet_app_function):
return flet_app_function


@pytest.mark.asyncio(loop_scope="function")
async def test_basic(flet_app: ftt.FletTestApp, request):
await flet_app.assert_control_screenshot(
request.node.name,
ft.Column(
Expand Down Expand Up @@ -42,3 +49,99 @@ async def test_icon_basic(flet_app: ftt.FletTestApp, request):
]
),
)


@pytest.mark.asyncio(loop_scope="function")
async def test_theme(flet_app: ftt.FletTestApp):
flet_app.page.theme = ft.Theme(
icon_theme=ft.IconTheme(
color=ft.Colors.GREEN_900,
size=100,
apply_text_scaling=True, # doesn't show on screenshot
fill=0.5, # doesn't show on screenshow
opacity=0.5,
optical_size=48, # doesn't show pon screenshot
grade=-10, # doesn't show on screenshot
weight=10, # doesn't show on screenshot
shadows=ft.BoxShadow(color=ft.Colors.YELLOW, blur_radius=10),
)
)
flet_app.page.enable_screenshots = True
flet_app.page.window.width = 400
flet_app.page.window.height = 600

scr_1 = ft.Screenshot(
ft.Column(
[ # material
ft.Row(
controls=[
ft.Icon(
ft.Icons.ABC,
fill=0,
# color=ft.Colors.PINK,
apply_text_scaling=False,
opacity=0.1,
optical_size=200,
),
ft.Icon(
ft.Icons.AUDIOTRACK,
color=ft.Colors.GREEN_400,
size=30,
shadows=[
ft.BoxShadow(color=ft.Colors.YELLOW, blur_radius=10),
ft.BoxShadow(color=ft.Colors.RED, blur_radius=5),
],
),
ft.Icon(
ft.Icons.AC_UNIT,
color=ft.Colors.BLUE,
size=50,
),
ft.Icon(
ft.Icons.SETTINGS,
color="#c1c1c1",
),
ft.Icon(
ft.Icons.ALARM,
size=40,
),
]
),
# cupertino
ft.Row(
controls=[
ft.Icon(
ft.CupertinoIcons.AIRPLANE,
# color=ft.Colors.PINK,
),
ft.Icon(
icon=ft.CupertinoIcons.CUBE_BOX,
color=ft.Colors.GREEN_400,
size=30,
),
ft.Icon(
icon=ft.CupertinoIcons.ARCHIVEBOX,
color=ft.Colors.BLUE,
size=50,
),
ft.Icon(
icon=ft.CupertinoIcons.BAG,
color="#c1c1c1",
),
ft.Icon(
ft.CupertinoIcons.ALARM,
size=40,
),
]
),
]
),
)
flet_app.page.add(scr_1)
flet_app.page.update()
await flet_app.tester.pump_and_settle()

flet_app.assert_screenshot(
"theme_1",
await scr_1.capture(pixel_ratio=flet_app.screenshots_pixel_ratio),
)
Loading
Loading