Compare commits

...

37 Commits
main ... 0.23.0

Author SHA1 Message Date
Feodor Fitsner 0eac4d4c5b
Merge pull request #11 from flet-dev/0.23.0-fix1
Fix dependencies
2024-06-19 10:07:55 -07:00
Feodor Fitsner 4447012691 Override wakelock_plus and package_info_plus deps 2024-06-19 10:04:03 -07:00
Feodor Fitsner 3c41d5cb1c kotlin_version = '1.7.22' 2024-06-19 09:48:44 -07:00
Feodor Fitsner 03d7a63609 Flet 0.23 2024-06-19 09:44:43 -07:00
Feodor Fitsner f1c45f90b4
Merge pull request #10 from flet-dev/impeller
Enable impeller on macOS and Android
2024-06-14 10:18:50 -07:00
TheEthicalBoy 1d28e0fbdb
Merge branch '0.22.1' into impeller 2024-06-14 12:18:14 +02:00
ndonkoHenri b69b87efb3 enable impeller 2024-06-14 12:14:14 +02:00
Feodor Fitsner 1cc0c49f29 minSdkVersion 23 for Android app 2024-06-13 11:52:50 -07:00
Feodor Fitsner 326209fdbf Use Flet 0.22.1 2024-04-30 12:05:58 -07:00
Feodor Fitsner a88b3b8e48 Squashed commit of the following:
commit cb9af5b9a64396835120754eb085a62fcc0b558b
Author: Feodor Fitsner <feodor@appveyor.com>
Date:   Mon Apr 29 11:32:15 2024 -0700

    Add NSMicrophoneUsageDescription to Info.plist
2024-04-29 11:36:46 -07:00
Feodor Fitsner 14a925be08 Fix for apps with numpy on macOS
https://github.com/flet-dev/serious-python/issues/85#issuecomment-2065000974
2024-04-18 12:17:32 -07:00
Feodor Fitsner 9496a9b3de Use Flet 0.22.0 2024-04-12 10:13:59 -07:00
Feodor Fitsner 7bc5081b00 Squashed commit of the following:
commit e8217a057a
Author: Feodor Fitsner <feodor@appveyor.com>
Date:   Mon Mar 11 11:11:48 2024 -0700

    Squashed commit of the following:

    commit 7660adc12c
    Author: Feodor Fitsner <feodor@appveyor.com>
    Date:   Mon Mar 11 11:11:30 2024 -0700

        minSdkVersion 21
2024-03-11 11:12:05 -07:00
Feodor Fitsner e2ab18efdd Use Flet 0.21.2 2024-03-07 08:57:54 -08:00
Feodor Fitsner 0b83309df0 Use Flet 0.21.1 2024-03-06 13:24:17 -08:00
Feodor Fitsner 27a2ec266e Use Flet 0.21.0 2024-03-06 11:04:10 -08:00
Feodor Fitsner 4ffc1adf42 android:label="{{ cookiecutter.product_name }}" 2024-02-20 14:12:50 -08:00
Feodor Fitsner 52d86b3bd3 flet: ^0.20.2 2024-02-17 14:47:05 -08:00
Feodor Fitsner 50c7144fca cupertino_icons: ^1.0.6 2024-02-17 09:47:56 -08:00
Feodor Fitsner 26b3c9a244
Merge pull request #7 from flet-dev/0.20.0-fix1
0.20.1 fixes
2024-02-16 17:39:15 -08:00
Feodor Fitsner d96ce5a571 Use Flet 0.20.1 2024-02-16 17:38:57 -08:00
Feodor Fitsner d48614191d Fix settings.gradle 2024-02-16 12:19:14 -08:00
Feodor Fitsner 5e1d40c94c Remove minSdkVersion 21 2024-02-16 12:16:41 -08:00
Feodor Fitsner a233de7547 Fix type of `createControlFactories` 2024-02-15 10:59:07 -08:00
Feodor Fitsner c25fa1db79 Fix `createControlFactories` 2024-02-14 18:51:11 -08:00
Feodor Fitsner b6b6f3426f
Merge pull request #6 from flet-dev/0.20.0-dev
Flet 0.20.0
2024-02-14 18:07:12 -08:00
Feodor Fitsner bd9285b831 Use Flet 0.20.0 2024-02-14 18:06:36 -08:00
Feodor Fitsner 6c78ea8471 Move ensureInitialized 2024-02-09 12:53:58 -08:00
Feodor Fitsner 2546c20766 {{ dep }}.ensureInitialized() 2024-02-09 12:47:09 -08:00
Feodor Fitsner 5a1fc38804 Pyodide v0.25.0 2024-02-04 09:44:50 -08:00
Feodor Fitsner 52ebf16507 var createControlFactories 2024-01-23 11:19:11 -08:00
Feodor Fitsner 4fa29e6f5d flutter_dependencies didn't work 2024-01-23 10:59:23 -08:00
Feodor Fitsner aadcfb3baa Back flutter_dependencies 2024-01-23 10:57:49 -08:00
Feodor Fitsner 31dca2b5e5 "flutter": null 2024-01-23 10:54:27 -08:00
Feodor Fitsner 417ae1c0c7 Remove from cookiecutter.json 2024-01-23 10:52:58 -08:00
Feodor Fitsner 3d3a54c486 Fix cookiecutter.flutter.dependencies 2024-01-23 10:51:54 -08:00
Feodor Fitsner 438daea208 Add flutter_dependencies 2024-01-23 10:47:34 -08:00
12 changed files with 146 additions and 113 deletions

View File

@ -7,6 +7,7 @@
"org_name": "com.flet", "org_name": "com.flet",
"company_name": "Your Company", "company_name": "Your Company",
"copyright": "Copyright (c) 2023 Your Company", "copyright": "Copyright (c) 2023 Your Company",
"flutter": null,
"sep": "/", "sep": "/",
"kotlin_dir": "{{ cookiecutter.org_name.replace('.', cookiecutter.sep) }}{{ cookiecutter.sep }}{{ cookiecutter.project_name }}{{ cookiecutter.sep }}", "kotlin_dir": "{{ cookiecutter.org_name.replace('.', cookiecutter.sep) }}{{ cookiecutter.sep }}{{ cookiecutter.project_name }}{{ cookiecutter.sep }}",
"hide_loading_animation": true, "hide_loading_animation": true,

View File

@ -41,11 +41,8 @@ android {
} }
defaultConfig { defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "{{ cookiecutter.org_name }}.{{ cookiecutter.project_name }}" applicationId "{{ cookiecutter.org_name }}.{{ cookiecutter.project_name }}"
// You can update the following values to match your application needs. minSdkVersion 23
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
minSdkVersion flutter.minSdkVersion
targetSdkVersion flutter.targetSdkVersion targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger() versionCode flutterVersionCode.toInteger()
versionName flutterVersionName versionName flutterVersionName
@ -57,8 +54,6 @@ android {
buildTypes { buildTypes {
release { release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug signingConfig signingConfigs.debug
} }
} }
@ -68,4 +63,4 @@ flutter {
source '../..' source '../..'
} }
dependencies {} dependencies {}

View File

@ -3,5 +3,6 @@
the Flutter tool needs it to communicate with the running application the Flutter tool needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc. to allow setting breakpoints, to provide hot reload, etc.
--> -->
<uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.INTERNET" />
</manifest> <uses-permission android:name="android.permission.RECORD_AUDIO" />
</manifest>

View File

@ -1,9 +1,13 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"> <manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<application <application
android:label="{{ cookiecutter.project_name }}" android:label="{{ cookiecutter.product_name }}"
android:name="${applicationName}" android:name="${applicationName}"
android:icon="@mipmap/ic_launcher"> android:icon="@mipmap/ic_launcher">
<meta-data
android:name="io.flutter.embedding.android.EnableImpeller"
android:value="true"/>
<activity <activity
android:name=".MainActivity" android:name=".MainActivity"
android:exported="true" android:exported="true"
@ -17,12 +21,12 @@
while the Flutter UI initializes. After that, this theme continues while the Flutter UI initializes. After that, this theme continues
to determine the Window background behind the Flutter UI. --> to determine the Window background behind the Flutter UI. -->
<meta-data <meta-data
android:name="io.flutter.embedding.android.NormalTheme" android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme" android:resource="@style/NormalTheme"
/> />
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN"/> <action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER"/> <category android:name="android.intent.category.LAUNCHER" />
</intent-filter> </intent-filter>
</activity> </activity>
<!-- Don't delete the meta-data below. <!-- Don't delete the meta-data below.
@ -31,4 +35,4 @@
android:name="flutterEmbedding" android:name="flutterEmbedding"
android:value="2" /> android:value="2" />
</application> </application>
</manifest> </manifest>

View File

@ -3,5 +3,6 @@
the Flutter tool needs it to communicate with the running application the Flutter tool needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc. to allow setting breakpoints, to provide hot reload, etc.
--> -->
<uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.INTERNET" />
</manifest> <uses-permission android:name="android.permission.RECORD_AUDIO" />
</manifest>

View File

@ -1,12 +1,11 @@
buildscript { buildscript {
ext.kotlin_version = '1.7.10' ext.kotlin_version = '1.7.22'
repositories { repositories {
google() google()
mavenCentral() mavenCentral()
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:7.4.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
} }
} }
@ -28,4 +27,4 @@ subprojects {
tasks.register("clean", Delete) { tasks.register("clean", Delete) {
delete rootProject.buildDir delete rootProject.buildDir
} }

View File

@ -10,11 +10,20 @@ pluginManagement {
includeBuild("${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle") includeBuild("${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle")
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
plugins { plugins {
id "dev.flutter.flutter-gradle-plugin" version "1.0.0" apply false id "dev.flutter.flutter-gradle-plugin" version "1.0.0" apply false
} }
} }
include ":app" plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version "7.3.0" apply false
}
apply from: "${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle/app_plugin_loader.gradle" include ":app"

View File

@ -1,49 +1,56 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0"> <plist version="1.0">
<dict> <dict>
<key>CFBundleDevelopmentRegion</key> <key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string> <string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key> <key>CFBundleDisplayName</key>
<string>{{ cookiecutter.product_name }}</string> <string>{{ cookiecutter.product_name }}</string>
<key>CFBundleExecutable</key> <key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string> <string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key> <key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string> <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key> <key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string> <string>6.0</string>
<key>CFBundleName</key> <key>CFBundleName</key>
<string>{{ cookiecutter.project_name }}</string> <string>{{ cookiecutter.project_name }}</string>
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>APPL</string> <string>APPL</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>$(FLUTTER_BUILD_NAME)</string> <string>$(FLUTTER_BUILD_NAME)</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>????</string> <string>????</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>$(FLUTTER_BUILD_NUMBER)</string> <string>$(FLUTTER_BUILD_NUMBER)</string>
<key>LSRequiresIPhoneOS</key> <key>LSRequiresIPhoneOS</key>
<true/> <true />
<key>UILaunchStoryboardName</key> <key>UILaunchStoryboardName</key>
<string>LaunchScreen</string> <string>LaunchScreen</string>
<key>UIMainStoryboardFile</key> <key>UIMainStoryboardFile</key>
<string>Main</string> <string>Main</string>
<key>UISupportedInterfaceOrientations</key> <key>UISupportedInterfaceOrientations</key>
<array> <array>
<string>UIInterfaceOrientationPortrait</string> <string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string> <string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string> <string>UIInterfaceOrientationLandscapeRight</string>
</array> </array>
<key>UISupportedInterfaceOrientations~ipad</key> <key>UISupportedInterfaceOrientations~ipad</key>
<array> <array>
<string>UIInterfaceOrientationPortrait</string> <string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string> <string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string> <string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string> <string>UIInterfaceOrientationLandscapeRight</string>
</array> </array>
<key>CADisableMinimumFrameDurationOnPhone</key> <key>CADisableMinimumFrameDurationOnPhone</key>
<true/> <true />
<key>UIApplicationSupportsIndirectInputEvents</key> <key>UIApplicationSupportsIndirectInputEvents</key>
<true/> <true />
</dict> <key>NSAppTransportSecurity</key>
</plist> <dict>
<key>NSAllowsArbitraryLoads</key>
<true />
</dict>
<key>NSMicrophoneUsageDescription</key>
<string>Audio Recording</string>
</dict>
</plist>

View File

@ -9,6 +9,10 @@ import 'package:path/path.dart' as path;
import 'package:serious_python/serious_python.dart'; import 'package:serious_python/serious_python.dart';
import 'package:url_strategy/url_strategy.dart'; import 'package:url_strategy/url_strategy.dart';
{% for dep in cookiecutter.flutter.dependencies %}
import 'package:{{ dep }}/{{ dep }}.dart' as {{ dep }};
{% endfor %}
const bool isProduction = bool.fromEnvironment('dart.vm.product'); const bool isProduction = bool.fromEnvironment('dart.vm.product');
const assetPath = "app/app.zip"; const assetPath = "app/app.zip";
@ -19,12 +23,21 @@ final hideLoadingPage =
const outLogFilename = "out.log"; const outLogFilename = "out.log";
const errorExitCode = 100; const errorExitCode = 100;
List<CreateControlFactory> createControlFactories = [
{% for dep in cookiecutter.flutter.dependencies %}
{{ dep }}.createControl,
{% endfor %}
];
const pythonScript = """ const pythonScript = """
import certifi, os, runpy, socket, sys, traceback import certifi, os, runpy, socket, sys, traceback
os.environ["REQUESTS_CA_BUNDLE"] = certifi.where() os.environ["REQUESTS_CA_BUNDLE"] = certifi.where()
os.environ["SSL_CERT_FILE"] = certifi.where() os.environ["SSL_CERT_FILE"] = certifi.where()
# fix for: https://github.com/flet-dev/serious-python/issues/85#issuecomment-2065000974
os.environ["OPENBLAS_NUM_THREADS"] = "1"
if os.getenv("FLET_PLATFORM") == "android": if os.getenv("FLET_PLATFORM") == "android":
import ssl import ssl
@ -79,6 +92,10 @@ void main() async {
debugPrint = (String? message, {int? wrapWidth}) => null; debugPrint = (String? message, {int? wrapWidth}) => null;
} }
{% for dep in cookiecutter.flutter.dependencies %}
{{ dep }}.ensureInitialized();
{% endfor %}
runApp(FutureBuilder( runApp(FutureBuilder(
future: prepareApp(), future: prepareApp(),
builder: (BuildContext context, AsyncSnapshot snapshot) { builder: (BuildContext context, AsyncSnapshot snapshot) {
@ -89,6 +106,7 @@ void main() async {
pageUrl: pageUrl, pageUrl: pageUrl,
assetsDir: assetsDir, assetsDir: assetsDir,
hideLoadingPage: hideLoadingPage, hideLoadingPage: hideLoadingPage,
createControlFactories: createControlFactories
) )
: FutureBuilder( : FutureBuilder(
future: runPythonApp(), future: runPythonApp(),
@ -107,6 +125,7 @@ void main() async {
pageUrl: pageUrl, pageUrl: pageUrl,
assetsDir: assetsDir, assetsDir: assetsDir,
hideLoadingPage: hideLoadingPage, hideLoadingPage: hideLoadingPage,
createControlFactories: createControlFactories
); );
} }
}); });

View File

@ -1,32 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0"> <plist version="1.0">
<dict> <dict>
<key>CFBundleDevelopmentRegion</key> <key>FLTEnableImpeller</key>
<string>$(DEVELOPMENT_LANGUAGE)</string> <true />
<key>CFBundleExecutable</key> <key>CFBundleDevelopmentRegion</key>
<string>$(EXECUTABLE_NAME)</string> <string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleIconFile</key> <key>CFBundleExecutable</key>
<string></string> <string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key> <key>CFBundleIconFile</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string> <string></string>
<key>CFBundleInfoDictionaryVersion</key> <key>CFBundleIdentifier</key>
<string>6.0</string> <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleName</key> <key>CFBundleInfoDictionaryVersion</key>
<string>$(PRODUCT_NAME)</string> <string>6.0</string>
<key>CFBundlePackageType</key> <key>CFBundleName</key>
<string>APPL</string> <string>$(PRODUCT_NAME)</string>
<key>CFBundleShortVersionString</key> <key>CFBundlePackageType</key>
<string>$(FLUTTER_BUILD_NAME)</string> <string>APPL</string>
<key>CFBundleVersion</key> <key>CFBundleShortVersionString</key>
<string>$(FLUTTER_BUILD_NUMBER)</string> <string>$(FLUTTER_BUILD_NAME)</string>
<key>LSMinimumSystemVersion</key> <key>CFBundleVersion</key>
<string>$(MACOSX_DEPLOYMENT_TARGET)</string> <string>$(FLUTTER_BUILD_NUMBER)</string>
<key>NSHumanReadableCopyright</key> <key>LSMinimumSystemVersion</key>
<string>$(PRODUCT_COPYRIGHT)</string> <string>$(MACOSX_DEPLOYMENT_TARGET)</string>
<key>NSMainNibFile</key> <key>NSHumanReadableCopyright</key>
<string>MainMenu</string> <string>$(PRODUCT_COPYRIGHT)</string>
<key>NSPrincipalClass</key> <key>NSMainNibFile</key>
<string>NSApplication</string> <string>MainMenu</string>
</dict> <key>NSPrincipalClass</key>
</plist> <string>NSApplication</string>
<key>NSMicrophoneUsageDescription</key>
<string>Audio Recording</string>
</dict>
</plist>

View File

@ -12,22 +12,15 @@ dependencies:
sdk: flutter sdk: flutter
serious_python: ^0.7.0 serious_python: ^0.7.0
# serious_python: flet: ^0.23.0
# git:
# url: https://github.com/flet-dev/serious-python
# path: src/serious_python
# ref: 'd059aef'
flet: ^0.19.0
# flet:
# git:
# url: https://github.com/flet-dev/flet.git
# path: package
# ref: '37b9581'
path: ^1.8.3 path: ^1.8.3
url_strategy: ^0.2.0 url_strategy: ^0.2.0
cupertino_icons: ^1.0.2 cupertino_icons: ^1.0.6
dependency_overrides:
wakelock_plus: ^1.2.5
package_info_plus: ^8.0.0
dev_dependencies: dev_dependencies:
flutter_test: flutter_test:

View File

@ -1,4 +1,4 @@
importScripts("https://cdn.jsdelivr.net/pyodide/v0.24.1/full/pyodide.js"); importScripts("https://cdn.jsdelivr.net/pyodide/v0.25.0/full/pyodide.js");
self.pythonModuleName = null; self.pythonModuleName = null;
self.initialized = false; self.initialized = false;