Support developer mode with custom URL
This commit is contained in:
parent
45c4485f6b
commit
7174430e6f
|
|
@ -124,6 +124,7 @@ Future prepareApp() async {
|
||||||
|
|
||||||
await setupDesktop();
|
await setupDesktop();
|
||||||
|
|
||||||
|
var devPageUrl = const String.fromEnvironment("FLET_PAGE_URL");
|
||||||
if (kIsWeb) {
|
if (kIsWeb) {
|
||||||
// web mode - connect via HTTP
|
// web mode - connect via HTTP
|
||||||
pageUrl = Uri.base.toString();
|
pageUrl = Uri.base.toString();
|
||||||
|
|
@ -131,10 +132,13 @@ Future prepareApp() async {
|
||||||
if (routeUrlStrategy == "path") {
|
if (routeUrlStrategy == "path") {
|
||||||
setPathUrlStrategy();
|
setPathUrlStrategy();
|
||||||
}
|
}
|
||||||
} else if (_args.isNotEmpty && isDesktopPlatform()) {
|
} else if ((_args.isNotEmpty || devPageUrl != "") && isDesktopPlatform()) {
|
||||||
// developer mode
|
// developer mode
|
||||||
debugPrint("Flet app is running in Developer mode");
|
debugPrint("Flet app is running in Developer mode");
|
||||||
|
pageUrl = devPageUrl;
|
||||||
|
if (_args.isNotEmpty && pageUrl == "") {
|
||||||
pageUrl = _args[0];
|
pageUrl = _args[0];
|
||||||
|
}
|
||||||
if (_args.length > 1) {
|
if (_args.length > 1) {
|
||||||
var pidFilePath = _args[1];
|
var pidFilePath = _args[1];
|
||||||
debugPrint("Args contain a path to PID file: $pidFilePath}");
|
debugPrint("Args contain a path to PID file: $pidFilePath}");
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue