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
2 changes: 1 addition & 1 deletion packages/flet/lib/src/models/control.dart
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ class Control extends ChangeNotifier {
MapEntry(key, _transformIfControl(entryValue, parent, backend)),
);
}
if (value is List) {
if (value is List && value is! Uint8List) {
return value
.map((element) => _transformIfControl(element, parent, backend))
.toList(growable: true);
Expand Down
2 changes: 1 addition & 1 deletion sdk/python/examples/controls/charts/matplotlib_chart/3d.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import logging

import flet_charts
import matplotlib.pyplot as plt
import numpy as np

import flet as ft
import flet_charts

logging.basicConfig(level=logging.INFO)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import logging

import flet_charts
import matplotlib.pyplot as plt
import numpy as np

import flet as ft
import flet_charts

logging.basicConfig(level=logging.INFO)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import flet_charts as fch
import matplotlib
import matplotlib.pyplot as plt

import flet as ft
import flet_charts as fch


def main(page: ft.Page):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import flet_charts
import matplotlib.pyplot as plt
import numpy as np

import flet as ft
import flet_charts

state = {}

Expand Down Expand Up @@ -86,7 +86,7 @@ def update(self):
self.selected.set_visible(True)
self.selected.set_data([xs[dataind]], [ys[dataind]])

self.text.set_text("selected: %d" % dataind)
self.text.set_text(f"selected: {dataind:d}")
fig.canvas.draw()

browser = PointBrowser()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import flet_charts as fch
import matplotlib
import matplotlib.pyplot as plt
import numpy as np

import flet as ft
import flet_charts as fch


def main(page: ft.Page):
Expand Down
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.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import base64
import math

import pytest
Expand Down Expand Up @@ -682,6 +683,24 @@ async def test_draw_url_image(flet_app: ftt.FletTestApp, request):
)


base64_string = "iVBORw0KGgoAAAANSUhEUgAAABkAAAAgCAYAAADnnNMGAAAACXBIWXMAAAORAAADkQFnq8zdAAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAAA6dJREFUSImllltoHFUYx3/fzOzm0lt23ZrQ1AQbtBehNpvQohgkBYVo410RwQctNE3Sh0IfiiBoIAjqi6TYrKnFy4O3oiiRavDJFi3mXomIBmOxNZe63ay52GR3Zj4f2sTEzmx3m//TYf7/c35zvgPnO6KqrESXqpq3muocAikv6m+/zytj3ejik1VN21G31YA9CgJ6xC+bMyQZPVCuarciPAMYC99V6Vw5pLbFSibHmlVoRVj9P3cmPBM8tSJI/M6mzabpfoAQ9fIF7WK4bd5vvuFnLGgy2vi0abg94A0AcJGvMq3hDxGRyar9r4F+iLAm0yIiRk8m37tctS1WsrIhhrI30+Srmg+J87OXUf3lWGS1q89dC6ltsSanxk4Aj2QBABii96300g87P/rtlrWr8l+vyDMfdlXSyyEikqxsiOUAQJCBhfHdXRfCq1LSsSlcWG+KBAGStvvrMkgiuv8lUc2mREukPwLUfHG+uTQv8Eown7VL3XlbBxYhf1c17hbVF3MDwA9bts280TnaU1YYqPby07aeFlUlHt27wSQ4CLo+F8AvoTCvHmyKF+ZbEb/M77P2LgvAwmrTHAHflN3KZxVbMC2jMFNOpgPnrMSOhvvFkMezXdwV4ePbtvHtxnJAMQ0j4JtVnO+eLb5oiSlt5HDbv7t1O90lpYCCCKbhfzW5kAIwUAazR0BlfII8Ow0I6uoVmI9MyAMwbMs8CExmDbk4zgu931MyO4OI4KrYflkRjOoTI+uM9d1vjotwKPu9QMk/sxzuO8POiVFcdZ1M2YBVsMEAKOqLvaPIe7mACuw0z/80SMH58SMplxlfiDhVi7dw2pltRhjKBQTQdrSja2KKTfE551NHuaZ0QVPvWYQUn31/Vm2nDvgjF4grVJx6suSvrvrSJ/6cSW2Oz9mf264uNrB806xZ1k/CZ49dUKgDEtlCROX2hfHpx8pGuuo3PpqYulw8fjndOp1yhgtNKRevJ1FyR2Ola+jXAjdnwTkZ6o896GdWdxDw7IxFg+0DpmXchTKSBWQnIuJn9u4j7dt+13UfHXEkXQOcuQ4kMhVtqsgUyPiQiPQfHw1NB2sRjmXKuTg1NwwBYLhtPtQX26eqTwGXPDOqvmcC4Hnwfrrad94GrVsOYTqUTkQY+iTlNe/6O1miSP/x0VB/+wMIDwHn/vtV1iQC4Xv95uUEWVCoL9Y5Z+gdovoyMHUFJHv88jmVy0vTuw7cZNv2YaA61Bfb7ZX5F8SaUv2xwZevAAAAAElFTkSuQmCC" # noqa: E501


@pytest.mark.asyncio(loop_scope="module")
async def test_draw_bytes_image(flet_app: ftt.FletTestApp, request):
image_bytes = base64.b64decode(base64_string)
await flet_app.assert_control_screenshot(
request.node.name,
fc.Canvas(
[fc.Image(src_bytes=image_bytes, x=10, y=10)],
width=120,
height=120,
),
pump_times=1,
pump_duration=1000,
)


@pytest.mark.asyncio(loop_scope="module")
async def test_capture(flet_app: ftt.FletTestApp, request):
canvas = fc.Canvas(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ async def test_src_svg_string(flet_app: ftt.FletTestApp, request):


@pytest.mark.asyncio(loop_scope="module")
@pytest.mark.skip(reason="image is not rendered from src_bytes in CI environment")
async def test_src_bytes(flet_app: ftt.FletTestApp, request):
# Decode the Base64 string into bytes
image_bytes = base64.b64decode(base64_string)
Expand Down
Loading