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
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Flet changelog

## 0.7.2

* Fix: Route change by url is not working if `page.theme` specified ([#1406](https://github.com/flet-dev/flet/issues/1406)).
* Rollback flutter_svg to 1.1.6 to fix regressions in Plotly charts ([#1402](https://github.com/flet-dev/flet/issues/1402)).
* Force web server in desktop mode with `ft.app(view=ft.FLET_APP_WEB)`.

## 0.7.1

* `ButtonStyle` with `shape` or `side` params failed in flet 0.7.0 ([#1390](https://github.com/flet-dev/flet/issues/1390)).
Expand Down
8 changes: 4 additions & 4 deletions client/macos/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ DEPENDENCIES:
- FlutterMacOS (from `Flutter/ephemeral`)
- path_provider_foundation (from `Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin`)
- screen_retriever (from `Flutter/ephemeral/.symlinks/plugins/screen_retriever/macos`)
- shared_preferences_foundation (from `Flutter/ephemeral/.symlinks/plugins/shared_preferences_foundation/darwin`)
- shared_preferences_foundation (from `Flutter/ephemeral/.symlinks/plugins/shared_preferences_foundation/macos`)
- url_launcher_macos (from `Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos`)
- window_manager (from `Flutter/ephemeral/.symlinks/plugins/window_manager/macos`)
- window_to_front (from `Flutter/ephemeral/.symlinks/plugins/window_to_front/macos`)
Expand All @@ -37,7 +37,7 @@ EXTERNAL SOURCES:
screen_retriever:
:path: Flutter/ephemeral/.symlinks/plugins/screen_retriever/macos
shared_preferences_foundation:
:path: Flutter/ephemeral/.symlinks/plugins/shared_preferences_foundation/darwin
:path: Flutter/ephemeral/.symlinks/plugins/shared_preferences_foundation/macos
url_launcher_macos:
:path: Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos
window_manager:
Expand All @@ -50,8 +50,8 @@ SPEC CHECKSUMS:
FlutterMacOS: 8f6f14fa908a6fb3fba0cd85dbd81ec4b251fb24
path_provider_foundation: eaf5b3e458fc0e5fbb9940fb09980e853fe058b8
screen_retriever: 59634572a57080243dd1bf715e55b6c54f241a38
shared_preferences_foundation: e2dae3258e06f44cc55f49d42024fd8dd03c590c
url_launcher_macos: 5335912b679c073563f29d89d33d10d459f95451
shared_preferences_foundation: 297b3ebca31b34ec92be11acd7fb0ba932c822ca
url_launcher_macos: c04e4fa86382d4f94f6b38f14625708be3ae52e2
window_manager: 3a1844359a6295ab1e47659b1a777e36773cd6e8
window_to_front: 4cdc24ddd8461ad1a55fa06286d6a79d8b29e8d8

Expand Down
2 changes: 1 addition & 1 deletion client/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ packages:
path: "../package"
relative: true
source: path
version: "0.7.1"
version: "0.7.2"
flutter:
dependency: "direct main"
description: flutter
Expand Down
9 changes: 7 additions & 2 deletions client/web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,12 @@
<title>Flet</title>
<link rel="manifest" href="manifest.json">

<!-- flutterWebRenderer -->
<script>
var webRenderer = "auto";
var useColorEmoji = false;
</script>

<!-- webRenderer -->
<!-- useColorEmoji -->

<!-- pyodideCode -->
Expand Down Expand Up @@ -105,7 +110,7 @@
}).then(function (engineInitializer) {
loading.classList.add('main_done');
return engineInitializer.initializeEngine({
renderer: flutterWebRenderer,
renderer: webRenderer,
useColorEmoji: useColorEmoji,
});
}).then(function (appRunner) {
Expand Down
6 changes: 6 additions & 0 deletions package/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 0.7.2

* Fix: Route change by url is not working if `page.theme` specified ([#1406](https://github.com/flet-dev/flet/issues/1406)).
* Rollback flutter_svg to 1.1.6 to fix regressions in Plotly charts ([#1402](https://github.com/flet-dev/flet/issues/1402)).
* Force web server in desktop mode with `ft.app(view=ft.FLET_APP_WEB)`.

## 0.7.1

* `ButtonStyle` with `shape` or `side` params failed in flet 0.7.0 ([#1390](https://github.com/flet-dev/flet/issues/1390)).
Expand Down
2 changes: 1 addition & 1 deletion package/lib/src/controls/create_control.dart
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ Widget createControl(Control? parent, String id, bool parentDisabled,
globalKey, controlView, parent, parentDisabled, nextChild);

// no theme defined? return widget!
if (controlView.control.attrString("theme") == null) {
if (id == "page" || controlView.control.attrString("theme") == null) {
return widget;
}

Expand Down
2 changes: 1 addition & 1 deletion package/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: flet
description: Write entire Flutter app in Python or add server-driven UI experience into existing Flutter app.
homepage: https://flet.dev
repository: https://github.com/flet-dev/flet
version: 0.7.1
version: 0.7.2

# This package supports all platforms listed below.
platforms:
Expand Down
9 changes: 8 additions & 1 deletion sdk/python/packages/flet-pyodide/src/flet/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
from flet.flet import FLET_APP, FLET_APP_HIDDEN, WEB_BROWSER, app, app_async
from flet.flet import (
FLET_APP,
FLET_APP_HIDDEN,
FLET_APP_WEB,
WEB_BROWSER,
app,
app_async,
)
from flet_core import *
9 changes: 8 additions & 1 deletion sdk/python/packages/flet/src/flet/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
from flet import utils
from flet.flet import FLET_APP, FLET_APP_HIDDEN, WEB_BROWSER, app, app_async
from flet.flet import (
FLET_APP,
FLET_APP_HIDDEN,
FLET_APP_WEB,
WEB_BROWSER,
app,
app_async,
)
from flet.pubsub import PubSub
from flet_core import *
6 changes: 3 additions & 3 deletions sdk/python/packages/flet/src/flet/cli/commands/publish.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,12 +218,12 @@ def filter_tar(tarinfo: tarfile.TarInfo):
index = index.replace("%FLET_WEB_PYODIDE%", "true")
index = index.replace("<!-- pyodideCode -->", pyodideCode)
index = index.replace(
"<!-- flutterWebRenderer -->",
f'<script>var flutterWebRenderer="{options.web_renderer}";</script>',
"<!-- webRenderer -->",
f'<script>webRenderer="{options.web_renderer}";</script>',
)
index = index.replace(
"<!-- useColorEmoji -->",
f"<script>var useColorEmoji={str(options.use_color_emoji).lower()};</script>",
f"<script>useColorEmoji={str(options.use_color_emoji).lower()};</script>",
)
index = index.replace("%FLET_ROUTE_URL_STRATEGY%", options.route_url_strategy)

Expand Down
19 changes: 10 additions & 9 deletions sdk/python/packages/flet/src/flet/flet.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,10 @@

WEB_BROWSER = "web_browser"
FLET_APP = "flet_app"
FLET_APP_WEB = "flet_app_web"
FLET_APP_HIDDEN = "flet_app_hidden"

AppViewer = Literal[None, "web_browser", "flet_app", "flet_app_hidden"]
AppViewer = Literal[None, "web_browser", "flet_app", "flet_app_web", "flet_app_hidden"]

WebRenderer = Literal[None, "auto", "html", "canvaskit"]

Expand Down Expand Up @@ -150,7 +151,7 @@ def exit_gracefully(signum, frame):
pid_file = None

if (
(view == FLET_APP or view == FLET_APP_HIDDEN)
(view == FLET_APP or view == FLET_APP_HIDDEN or view == FLET_APP_WEB)
and not is_linux_server()
and url_prefix is None
):
Expand Down Expand Up @@ -226,7 +227,7 @@ def exit_gracefully(signum, frame):
pid_file = None

if (
(view == FLET_APP or view == FLET_APP_HIDDEN)
(view == FLET_APP or view == FLET_APP_HIDDEN or view == FLET_APP_WEB)
and not is_linux_server()
and url_prefix is None
):
Expand Down Expand Up @@ -282,8 +283,8 @@ def __connect_internal_sync(

uds_path = os.getenv("FLET_SERVER_UDS_PATH")

is_desktop = view == FLET_APP or view == FLET_APP_HIDDEN
if server is None and not is_desktop:
is_socket_server = server is None and (view == FLET_APP or view == FLET_APP_HIDDEN)
if not is_socket_server:
server = __start_flet_server(
host,
port,
Expand Down Expand Up @@ -320,7 +321,7 @@ def on_session_created(conn, session_data):
)
page.error(f"There was an error while processing your request: {e}")

if is_desktop:
if is_socket_server:
conn = SyncLocalSocketConnection(
port,
uds_path,
Expand Down Expand Up @@ -360,8 +361,8 @@ async def __connect_internal_async(

uds_path = os.getenv("FLET_SERVER_UDS_PATH")

is_desktop = view == FLET_APP or view == FLET_APP_HIDDEN
if server is None and not is_desktop:
is_socket_server = server is None and (view == FLET_APP or view == FLET_APP_HIDDEN)
if not is_socket_server:
server = __start_flet_server(
host,
port,
Expand Down Expand Up @@ -400,7 +401,7 @@ async def on_session_created(session_data):
f"There was an error while processing your request: {e}"
)

if is_desktop:
if is_socket_server:
conn = AsyncLocalSocketConnection(
port,
uds_path,
Expand Down
6 changes: 3 additions & 3 deletions server/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,14 +137,14 @@ func Start(ctx context.Context, wg *sync.WaitGroup, serverPort int, contentDir s
// web renderer
if config.WebRenderer() != "" {
indexData = bytes.Replace(indexData,
[]byte("<!-- flutterWebRenderer -->"),
[]byte(fmt.Sprintf("<script>var flutterWebRenderer=\"%s\";</script>", config.WebRenderer())), 1)
[]byte("<!-- webRenderer -->"),
[]byte(fmt.Sprintf("<script>webRenderer=\"%s\";</script>", config.WebRenderer())), 1)
}

// color emoji
indexData = bytes.Replace(indexData,
[]byte("<!-- useColorEmoji -->"),
[]byte(fmt.Sprintf("<script>var useColorEmoji=%v;</script>", config.UseColorEmoji())), 1)
[]byte(fmt.Sprintf("<script>useColorEmoji=%v;</script>", config.UseColorEmoji())), 1)

c.Data(http.StatusOK, "text/html", indexData)
} else {
Expand Down
2 changes: 1 addition & 1 deletion studio/client/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ packages:
path: "../../package"
relative: true
source: path
version: "0.7.1"
version: "0.7.2"
flutter:
dependency: "direct main"
description: flutter
Expand Down