Skip to content
Draft
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 .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ jobs:
asset_content_type: application/gzip
- os: ubuntu-latest
target: Android
build_target: apk
build_target: apk --dart-define=cronetHttpNoPlay=true
build_path: kitchenowl/build/app/outputs/flutter-apk
asset_extension: .apk
asset_content_type: application/vnd.android.package-archive
Expand Down
21 changes: 21 additions & 0 deletions kitchenowl/lib/services/api/api_service.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import 'dart:convert';
import 'dart:io';
import 'package:cronet_http/cronet_http.dart';
import 'package:cupertino_http/cupertino_http.dart';
import 'package:flutter/foundation.dart';
import 'package:http/http.dart' as http;
import 'package:http/io_client.dart';
Expand Down Expand Up @@ -72,6 +74,25 @@ class ApiService {
if (!kIsWeb) {
Config.packageInfo?.then((info) => headers["User-Agent"] =
"KitchenOwl-${Platform.operatingSystem}/${Config.packageInfoSync?.version}");
}

if (!kIsWeb && Platform.isAndroid) {
final engine = CronetEngine.build(
cacheMode: CacheMode.memory,
cacheMaxSize: 2 * 1024 * 1024,
userAgent:
"KitchenOwl-${Platform.operatingSystem}/${Config.packageInfoSync?.version}",
);
_client = CronetClient.fromCronetEngine(engine, closeEngine: true);
} else if (!kIsWeb && (Platform.isIOS || Platform.isMacOS)) {
final config = URLSessionConfiguration.ephemeralSessionConfiguration()
..cache = URLCache.withCapacity(memoryCapacity: 2 * 1024 * 1024)
..httpAdditionalHeaders = {
"User-Agent":
"KitchenOwl-${Platform.operatingSystem}/${Config.packageInfoSync?.version}"
};
_client = CupertinoClient.fromSessionConfiguration(config);
} else if (!kIsWeb) {
_client = IOClient(HttpClient()
..userAgent =
"KitchenOwl-${Platform.operatingSystem}/${Config.packageInfoSync?.version}");
Expand Down
1 change: 1 addition & 0 deletions kitchenowl/linux/flutter/generated_plugins.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ list(APPEND FLUTTER_PLUGIN_LIST
)

list(APPEND FLUTTER_FFI_PLUGIN_LIST
jni
)

set(PLUGIN_BUNDLED_LIBRARIES)
Expand Down
98 changes: 53 additions & 45 deletions kitchenowl/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.1.2"
code_assets:
dependency: transitive
description:
name: code_assets
sha256: "83ccdaa064c980b5596c35dd64a8d3ecc68620174ab9b90b6343b753aa721687"
url: "https://pub.dev"
source: hosted
version: "1.0.0"
collection:
dependency: "direct main"
description:
Expand All @@ -129,6 +121,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.19.1"
cronet_http:
dependency: "direct main"
description:
name: cronet_http
sha256: "8e77bc6f203e0bc9126e6a9092508a3435dbcb04da3b53ed1a358909385c5e0e"
url: "https://pub.dev"
source: hosted
version: "1.8.0"
cross_file:
dependency: transitive
description:
Expand All @@ -153,6 +153,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.0.2"
cupertino_http:
dependency: "direct main"
description:
name: cupertino_http
sha256: "3de09415040ad1def7a1b1d52cde3b07d6b29837bf0e4f7b822ca5c805e2d872"
url: "https://pub.dev"
source: hosted
version: "2.0.1"
cupertino_icons:
dependency: "direct main"
description:
Expand Down Expand Up @@ -503,14 +511,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.2.0"
glob:
dependency: transitive
description:
name: glob
sha256: c3f1ee72c96f8f78935e18aa8cecced9ab132419e8625dc187e1c2408efc20de
url: "https://pub.dev"
source: hosted
version: "2.1.3"
go_router:
dependency: "direct main"
description:
Expand All @@ -519,14 +519,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "17.2.0"
hooks:
dependency: transitive
description:
name: hooks
sha256: e79ed1e8e1929bc6ecb6ec85f0cb519c887aa5b423705ded0d0f2d9226def388
url: "https://pub.dev"
source: hosted
version: "1.0.2"
html:
dependency: transitive
description:
Expand All @@ -551,6 +543,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "4.1.2"
http_profile:
dependency: transitive
description:
name: http_profile
sha256: "7e679e355b09aaee2ab5010915c932cce3f2d1c11c3b2dc177891687014ffa78"
url: "https://pub.dev"
source: hosted
version: "0.1.0"
icons_launcher:
dependency: "direct dev"
description:
Expand Down Expand Up @@ -644,6 +644,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "0.20.2"
jni:
dependency: transitive
description:
name: jni
sha256: "8706a77e94c76fe9ec9315e18949cc9479cc03af97085ca9c1077b61323ea12d"
url: "https://pub.dev"
source: hosted
version: "0.15.2"
leak_tracker:
dependency: transitive
description:
Expand Down Expand Up @@ -724,14 +732,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.0.0"
native_toolchain_c:
dependency: transitive
description:
name: native_toolchain_c
sha256: "6ba77bb18063eebe9de401f5e6437e95e1438af0a87a3a39084fbd37c90df572"
url: "https://pub.dev"
source: hosted
version: "0.17.6"
nested:
dependency: transitive
description:
Expand All @@ -744,10 +744,10 @@ packages:
dependency: transitive
description:
name: objective_c
sha256: "100a1c87616ab6ed41ec263b083c0ef3261ee6cd1dc3b0f35f8ddfa4f996fe52"
sha256: c8467f3b067a3867c4876210b2fa65a57d117b5667ac158df5991804b0912673
url: "https://pub.dev"
source: hosted
version: "9.3.0"
version: "3.0.0"
octo_image:
dependency: transitive
description:
Expand All @@ -756,6 +756,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.1.0"
package_config:
dependency: transitive
description:
name: package_config
sha256: "1c5b77ccc91e4823a5af61ee74e6b972db1ef98c2ff5a18d3161c982a55448bd"
url: "https://pub.dev"
source: hosted
version: "2.1.0"
package_info_plus:
dependency: "direct main"
description:
Expand Down Expand Up @@ -808,10 +816,10 @@ packages:
dependency: transitive
description:
name: path_provider_foundation
sha256: "2a376b7d6392d80cd3705782d2caa734ca4727776db0b6ec36ef3f1855197699"
sha256: "6d13aece7b3f5c5a9731eaf553ff9dcbc2eff41087fd2df587fd0fed9a3eb0c4"
url: "https://pub.dev"
source: hosted
version: "2.6.0"
version: "2.5.1"
path_provider_linux:
dependency: transitive
description:
Expand Down Expand Up @@ -892,14 +900,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "6.1.5+1"
pub_semver:
dependency: transitive
description:
name: pub_semver
sha256: "5bfcf68ca79ef689f8990d1160781b4bad40a3bd5e5218ad4076ddb7f4081585"
url: "https://pub.dev"
source: hosted
version: "2.2.0"
reorderables:
dependency: "direct main"
description:
Expand Down Expand Up @@ -1377,6 +1377,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.1.1"
web_socket:
dependency: transitive
description:
name: web_socket
sha256: "3c12d96c0c9a4eec095246debcea7b86c0324f22df69893d538fcc6f1b8cce83"
url: "https://pub.dev"
source: hosted
version: "0.1.6"
webdriver:
dependency: transitive
description:
Expand Down Expand Up @@ -1426,5 +1434,5 @@ packages:
source: hosted
version: "3.1.3"
sdks:
dart: ">=3.10.3 <4.0.0"
dart: ">=3.10.0 <4.0.0"
flutter: ">=3.41.2"
2 changes: 2 additions & 0 deletions kitchenowl/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ dependencies:
package_info_plus: ^9.0.0
device_info_plus: ^12.1.0
http: ^1.1.2
cronet_http: ^1.3.2
cupertino_http: ^2.0.1
diffutil_dart: ^4.0.0
background_fetch: '^1.1.3'

Expand Down
1 change: 1 addition & 0 deletions kitchenowl/windows/flutter/generated_plugins.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ list(APPEND FLUTTER_PLUGIN_LIST
)

list(APPEND FLUTTER_FFI_PLUGIN_LIST
jni
)

set(PLUGIN_BUNDLED_LIBRARIES)
Expand Down
Loading