diff --git a/packages/app/.gitignore b/packages/app/.gitignore new file mode 100644 index 00000000..3db38235 --- /dev/null +++ b/packages/app/.gitignore @@ -0,0 +1,47 @@ +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.buildlog/ +.history +.svn/ +migrate_working_dir/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/ + +# The .vscode folder contains launch configuration and tasks you configure in +# VS Code which you may wish to be included in version control, so this line +# is commented out by default. +#.vscode/ + +# Flutter/Dart/Pub related +**/doc/api/ +**/ios/Flutter/.last_build_id +.dart_tool/ +.flutter-plugins +.flutter-plugins-dependencies +.packages +.pub-cache/ +.pub/ +/build/ + +# Symbolication related +app.*.symbols + +# Obfuscation related +app.*.map.json + +# Android Studio will place build artifacts here +/android/app/debug +/android/app/profile +/android/app/release + +# Aurora generated +/aurora/flutter diff --git a/packages/app/.metadata b/packages/app/.metadata index 72033a21..f1f62691 100644 --- a/packages/app/.metadata +++ b/packages/app/.metadata @@ -4,8 +4,8 @@ # This file should be version controlled and should not be manually edited. version: - revision: "ead455963c12b453cdb2358cad34969c76daf180" - channel: "stable" + revision: "2828ddd9a707d09af00b793a42faaa0f0e2b957f" + channel: "master" project_type: app @@ -13,14 +13,11 @@ project_type: app migration: platforms: - platform: root - create_revision: ead455963c12b453cdb2358cad34969c76daf180 - base_revision: ead455963c12b453cdb2358cad34969c76daf180 - - platform: android - create_revision: ead455963c12b453cdb2358cad34969c76daf180 - base_revision: ead455963c12b453cdb2358cad34969c76daf180 - - platform: linux - create_revision: ead455963c12b453cdb2358cad34969c76daf180 - base_revision: ead455963c12b453cdb2358cad34969c76daf180 + create_revision: 2828ddd9a707d09af00b793a42faaa0f0e2b957f + base_revision: 2828ddd9a707d09af00b793a42faaa0f0e2b957f + - platform: aurora + create_revision: 2828ddd9a707d09af00b793a42faaa0f0e2b957f + base_revision: 2828ddd9a707d09af00b793a42faaa0f0e2b957f # User provided section diff --git a/packages/app/aurora/.gitignore b/packages/app/aurora/.gitignore new file mode 100644 index 00000000..d3896c98 --- /dev/null +++ b/packages/app/aurora/.gitignore @@ -0,0 +1 @@ +flutter/ephemeral diff --git a/packages/app/aurora/CMakeLists.txt b/packages/app/aurora/CMakeLists.txt new file mode 100644 index 00000000..a0127f7e --- /dev/null +++ b/packages/app/aurora/CMakeLists.txt @@ -0,0 +1,47 @@ +cmake_minimum_required(VERSION 3.10) +project(su.markow.nextcloud-neon LANGUAGES CXX) + +include(GNUInstallDirs) + +set(BINARY_NAME ${CMAKE_PROJECT_NAME}) +set(FLUTTER_DIR ${CMAKE_CURRENT_SOURCE_DIR}/flutter) + +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +set(CMAKE_CXX_FLAGS "-Wall -Wextra") +set(CMAKE_CXX_FLAGS_RELEASE "-O3") + +set(CMAKE_SKIP_RPATH OFF) +set(CMAKE_INSTALL_RPATH "\$ORIGIN/../share/${BINARY_NAME}/lib") + +find_package(PkgConfig REQUIRED) +pkg_check_modules(FlutterEmbedder REQUIRED IMPORTED_TARGET flutter-embedder) + +add_executable(${BINARY_NAME} main.cpp ${FLUTTER_DIR}/generated_plugin_registrant.cpp) +target_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::FlutterEmbedder) +target_include_directories(${BINARY_NAME} PRIVATE ${FLUTTER_DIR}) + +include(flutter/generated_plugins.cmake) + +set(PACKAGE_INSTALL_DIR ${CMAKE_INSTALL_DATADIR}/${BINARY_NAME}) +set(DESKTOP_INSTALL_DIR ${CMAKE_INSTALL_DATADIR}/applications) +set(ICONS_INSTALL_ROOT_DIR ${CMAKE_INSTALL_DATADIR}/icons/hicolor) + +add_custom_command(TARGET ${BINARY_NAME} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy + ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/libflutter-embedder.so + ${PROJECT_BINARY_DIR}/bundle/lib/libflutter-embedder.so) + +install(FILES ${PROJECT_BINARY_DIR}/bundle/icudtl.dat DESTINATION ${PACKAGE_INSTALL_DIR}) +install(DIRECTORY ${PROJECT_BINARY_DIR}/bundle/flutter_assets DESTINATION ${PACKAGE_INSTALL_DIR}) +install(DIRECTORY ${PROJECT_BINARY_DIR}/bundle/lib DESTINATION ${PACKAGE_INSTALL_DIR}) + +install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) +install(FILES desktop/${BINARY_NAME}.desktop DESTINATION ${DESKTOP_INSTALL_DIR}) + +foreach(ICONS_SIZE 86x86 108x108 128x128 172x172) + install(FILES icons/${ICONS_SIZE}.png + RENAME ${BINARY_NAME}.png + DESTINATION ${ICONS_INSTALL_ROOT_DIR}/${ICONS_SIZE}/apps/) +endforeach(ICONS_SIZE) diff --git a/packages/app/aurora/desktop/su.markow.nextcloud-neon.desktop b/packages/app/aurora/desktop/su.markow.nextcloud-neon.desktop new file mode 100644 index 00000000..c31f3077 --- /dev/null +++ b/packages/app/aurora/desktop/su.markow.nextcloud-neon.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Application +Name=nextcloud-neon +Comment=A new Flutter project. +Icon=su.markow.nextcloud-neon +Exec=/usr/bin/su.markow.nextcloud-neon +X-Nemo-Application-Type=silica-qt5 + +[X-Application] +Permissions=UserDirs +OrganizationName=su.markow +ApplicationName=nextcloud-neon diff --git a/packages/app/aurora/icons/108x108.png b/packages/app/aurora/icons/108x108.png new file mode 100644 index 00000000..9f59ae2e Binary files /dev/null and b/packages/app/aurora/icons/108x108.png differ diff --git a/packages/app/aurora/icons/128x128.png b/packages/app/aurora/icons/128x128.png new file mode 100644 index 00000000..d8e57adb Binary files /dev/null and b/packages/app/aurora/icons/128x128.png differ diff --git a/packages/app/aurora/icons/172x172.png b/packages/app/aurora/icons/172x172.png new file mode 100644 index 00000000..bc3c7170 Binary files /dev/null and b/packages/app/aurora/icons/172x172.png differ diff --git a/packages/app/aurora/icons/86x86.png b/packages/app/aurora/icons/86x86.png new file mode 100644 index 00000000..a725e794 Binary files /dev/null and b/packages/app/aurora/icons/86x86.png differ diff --git a/packages/app/aurora/main.cpp b/packages/app/aurora/main.cpp new file mode 100644 index 00000000..331e26ef --- /dev/null +++ b/packages/app/aurora/main.cpp @@ -0,0 +1,9 @@ +#include +#include "generated_plugin_registrant.h" + +int main(int argc, char *argv[]) { + Application::Initialize(argc, argv); + RegisterPlugins(); + Application::Launch(); + return 0; +} diff --git a/packages/app/aurora/rpm/su.markow.nextcloud-neon.spec b/packages/app/aurora/rpm/su.markow.nextcloud-neon.spec new file mode 100644 index 00000000..4e85c667 --- /dev/null +++ b/packages/app/aurora/rpm/su.markow.nextcloud-neon.spec @@ -0,0 +1,33 @@ +%global __provides_exclude_from ^%{_datadir}/%{name}/lib/.*$ +%global __requires_exclude ^lib(dconf|flutter-embedder|maliit-glib|.+_platform_plugin)\\.so.*$ + +Name: su.markow.nextcloud-neon +Summary: A new Flutter project. +Version: 0.1.0 +Release: 1 +License: Proprietary +Source0: %{name}-%{version}.tar.zst + +BuildRequires: cmake +BuildRequires: pkgconfig(flutter-embedder) +BuildRequires: pkgconfig(sqlite3) +BuildRequires: pkgconfig(camera) + +%description +%{summary}. + +%prep +%autosetup + +%build +%cmake -DCMAKE_BUILD_TYPE=%{_flutter_build_type} +%make_build + +%install +%make_install + +%files +%{_bindir}/%{name} +%{_datadir}/%{name}/* +%{_datadir}/applications/%{name}.desktop +%{_datadir}/icons/hicolor/*/apps/%{name}.png diff --git a/packages/app/de.provokateurin.neon.yaml b/packages/app/de.provokateurin.neon.yaml index 909ad478..143166fa 100644 --- a/packages/app/de.provokateurin.neon.yaml +++ b/packages/app/de.provokateurin.neon.yaml @@ -9,7 +9,7 @@ finish-args: - --socket=wayland - --share=network - --device=dri - - --env=LD_LIBRARY_PATH=/app/lib/:/app/nextcloud-neon/lib/ + - --env=LD_LIBRARY_PATH=/app/lib/:/app/nextcloud-neon/lib/:/usr/lib modules: - ../../external/flathub-shared-modules/libappindicator/libappindicator-gtk3-12.10.json - name: aarch64-quirks diff --git a/packages/app/linux/CMakeLists.txt b/packages/app/linux/CMakeLists.txt index ae1721f3..42ca1c80 100644 --- a/packages/app/linux/CMakeLists.txt +++ b/packages/app/linux/CMakeLists.txt @@ -95,9 +95,9 @@ include(flutter/generated_plugins.cmake) # By default, "installing" just makes a relocatable bundle in the build # directory. set(BUILD_BUNDLE_DIR "${PROJECT_BINARY_DIR}/bundle") -if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) +#if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) -endif() +#endif() # Start with a clean build bundle directory every time. install(CODE " diff --git a/packages/app/pubspec.lock b/packages/app/pubspec.lock index e3dabeb8..5f81a88f 100644 --- a/packages/app/pubspec.lock +++ b/packages/app/pubspec.lock @@ -1,6 +1,14 @@ # Generated by pub # See https://dart.dev/tools/pub/glossary#lockfile packages: + ansicolor: + dependency: transitive + description: + name: ansicolor + sha256: "8bf17a8ff6ea17499e40a2d2542c2f481cd7615760c6d34065cb22bfd22e6880" + url: "https://pub.dev" + source: hosted + version: "2.0.2" archive: dependency: transitive description: @@ -61,10 +69,10 @@ packages: dependency: transitive description: name: built_value - sha256: "723b4021e903217dfc445ec4cf5b42e27975aece1fc4ebbc1ca6329c2d9fb54e" + sha256: "69acb7007eb2a31dc901512bfe0f7b767168be34cb734835d54c070bfa74c1b2" url: "https://pub.dev" source: hosted - version: "8.7.0" + version: "8.8.0" camera: dependency: transitive description: @@ -157,10 +165,10 @@ packages: dependency: transitive description: name: cross_file - sha256: "445db18de832dba8d851e287aff8ccf169bed30d2e94243cb54c7d2f1ed2142c" + sha256: "2f9d2cbccb76127ba28528cb3ae2c2326a122446a83de5a056aaa3880d3882c5" url: "https://pub.dev" source: hosted - version: "0.3.3+6" + version: "0.3.3+7" crypto: dependency: transitive description: @@ -197,10 +205,10 @@ packages: dependency: transitive description: name: dbus - sha256: "6f07cba3f7b3448d42d015bfd3d53fe12e5b36da2423f23838efc1d5fb31a263" + sha256: "365c771ac3b0e58845f39ec6deebc76e3276aa9922b0cc60840712094d9047ac" url: "https://pub.dev" source: hosted - version: "0.7.8" + version: "0.7.10" dependency_validator: dependency: transitive description: @@ -349,10 +357,10 @@ packages: dependency: transitive description: name: flutter_local_notifications - sha256: "6d11ea777496061e583623aaf31923f93a9409ef8fcaeeefdd6cd78bf4fe5bb3" + sha256: bb5cd63ff7c91d6efe452e41d0d0ae6348925c82eafd10ce170ef585ea04776e url: "https://pub.dev" source: hosted - version: "16.1.0" + version: "16.2.0" flutter_local_notifications_linux: dependency: transitive description: @@ -394,10 +402,10 @@ packages: dependency: transitive description: name: flutter_native_splash - sha256: d93394f22f73e810bda59e11ebe83329c5511d6460b6b7509c4e1f3c92d6d625 + sha256: c4d899312b36e7454bedfd0a4740275837b99e532d81c8477579d8183db1de6c url: "https://pub.dev" source: hosted - version: "2.3.5" + version: "2.3.6" flutter_plugin_android_lifecycle: dependency: transitive description: @@ -742,10 +750,19 @@ packages: dependency: transitive description: name: package_info_plus - sha256: "7e76fad405b3e4016cd39d08f455a4eb5199723cf594cd1b8916d47140d93017" + sha256: "6ff267fcd9d48cb61c8df74a82680e8b82e940231bb5f68356672fde0397334a" url: "https://pub.dev" source: hosted - version: "4.2.0" + version: "4.1.0" + package_info_plus_aurora: + dependency: transitive + description: + path: "packages/package_info_plus/package_info_plus_aurora" + ref: master + resolved-ref: "9c83303f10ec396bbb008e983659382ef69d4577" + url: "https://gitlab.com/omprussia/flutter/flutter-plugins.git" + source: git + version: "0.0.1" package_info_plus_platform_interface: dependency: transitive description: @@ -771,7 +788,7 @@ packages: source: hosted version: "1.0.1" path_provider: - dependency: transitive + dependency: "direct main" description: name: path_provider sha256: a1aa8aaa2542a6bc57e381f132af822420216c80d4781f7aa085ca3229208aaa @@ -786,6 +803,15 @@ packages: url: "https://pub.dev" source: hosted version: "2.2.1" + path_provider_aurora: + dependency: "direct main" + description: + path: "packages/path_provider/path_provider_aurora" + ref: master + resolved-ref: "9c83303f10ec396bbb008e983659382ef69d4577" + url: "https://gitlab.com/omprussia/flutter/flutter-plugins.git" + source: git + version: "0.0.1" path_provider_foundation: dependency: transitive description: @@ -878,10 +904,10 @@ packages: dependency: transitive description: name: plugin_platform_interface - sha256: da3fdfeccc4d4ff2da8f8c556704c08f912542c5fb3cf2233ed75372384a034d + sha256: f4f88d4a900933e7267e2b353594774fc0d07fb072b47eedcd5b54e1ea3269f8 url: "https://pub.dev" source: hosted - version: "2.1.6" + version: "2.1.7" pointycastle: dependency: transitive description: @@ -1026,6 +1052,15 @@ packages: url: "https://pub.dev" source: hosted version: "2.2.1" + shared_preferences_aurora: + dependency: transitive + description: + path: "packages/shared_preferences/shared_preferences_aurora" + ref: master + resolved-ref: "9c83303f10ec396bbb008e983659382ef69d4577" + url: "https://gitlab.com/omprussia/flutter/flutter-plugins.git" + source: git + version: "0.0.1" shared_preferences_foundation: dependency: transitive description: @@ -1103,29 +1138,38 @@ packages: source: hosted version: "7.0.0" sqflite: - dependency: transitive + dependency: "direct main" description: name: sqflite sha256: "591f1602816e9c31377d5f008c2d9ef7b8aca8941c3f89cc5fd9d84da0c38a9a" url: "https://pub.dev" source: hosted version: "2.3.0" + sqflite_aurora: + dependency: "direct main" + description: + path: "packages/sqflite/sqflite_aurora" + ref: master + resolved-ref: "9c83303f10ec396bbb008e983659382ef69d4577" + url: "https://gitlab.com/omprussia/flutter/flutter-plugins.git" + source: git + version: "2.2.6+aurora1" sqflite_common: dependency: transitive description: name: sqflite_common - sha256: "8ed044102f3135add97be8653662052838859f5400075ef227f8ad72ae320803" + sha256: bb4738f15b23352822f4c42a531677e5c6f522e079461fd240ead29d8d8a54a6 url: "https://pub.dev" source: hosted - version: "2.5.0+1" + version: "2.5.0+2" sqflite_common_ffi: dependency: transitive description: name: sqflite_common_ffi - sha256: "198b40b4a7ba58cca18d7837d0246859b7b4c8b007d2902634fc26dec57fa3f1" + sha256: "35d2fce1e971707c227cc4775cc017d5eafe06c2654c3435ebd5c3ad6c170f5f" url: "https://pub.dev" source: hosted - version: "2.3.0+3" + version: "2.3.0+4" sqlite3: dependency: transitive description: @@ -1274,10 +1318,10 @@ packages: dependency: transitive description: name: url_launcher_ios - sha256: "4ac97281cf60e2e8c5cc703b2b28528f9b50c8f7cebc71df6bdf0845f647268a" + sha256: bba3373219b7abb6b5e0d071b0fe66dfbe005d07517a68e38d4fc3638f35c6d3 url: "https://pub.dev" source: hosted - version: "6.2.0" + version: "6.2.1" url_launcher_linux: dependency: transitive description: @@ -1378,10 +1422,10 @@ packages: dependency: transitive description: name: wakelock_plus - sha256: f45a6c03aa3f8322e0a9d7f4a0482721c8789cb41d555407367650b8f9c26018 + sha256: f268ca2116db22e57577fb99d52515a24bdc1d570f12ac18bb762361d43b043d url: "https://pub.dev" source: hosted - version: "1.1.3" + version: "1.1.4" wakelock_plus_platform_interface: dependency: transitive description: @@ -1426,10 +1470,10 @@ packages: dependency: transitive description: name: webview_flutter_platform_interface - sha256: "6d9213c65f1060116757a7c473247c60f3f7f332cac33dc417c9e362a9a13e4f" + sha256: adb8c03c2be231bea5a8ed0e9039e9d18dbb049603376beaefa15393ede468a5 url: "https://pub.dev" source: hosted - version: "2.6.0" + version: "2.7.0" webview_flutter_wkwebview: dependency: transitive description: @@ -1442,10 +1486,10 @@ packages: dependency: transitive description: name: win32 - sha256: "350a11abd2d1d97e0cc7a28a81b781c08002aa2864d9e3f192ca0ffa18b06ed3" + sha256: "7c99c0e1e2fa190b48d25c81ca5e42036d5cac81430ef249027d97b0935c553f" url: "https://pub.dev" source: hosted - version: "5.0.9" + version: "5.1.0" window_manager: dependency: transitive description: @@ -1462,6 +1506,15 @@ packages: url: "https://pub.dev" source: hosted version: "1.0.3" + xdga_directories: + dependency: transitive + description: + path: "packages/xdga_directories" + ref: master + resolved-ref: "9c83303f10ec396bbb008e983659382ef69d4577" + url: "https://gitlab.com/omprussia/flutter/flutter-plugins.git" + source: git + version: "0.0.1" xml: dependency: transitive description: diff --git a/packages/app/pubspec.yaml b/packages/app/pubspec.yaml index 1275b13c..d67b8905 100644 --- a/packages/app/pubspec.yaml +++ b/packages/app/pubspec.yaml @@ -9,6 +9,18 @@ environment: dependencies: flutter: sdk: flutter + sqflite: ^2.3.0 + sqflite_aurora: + git: + url: https://gitlab.com/omprussia/flutter/flutter-plugins.git + ref: master + path: packages/sqflite/sqflite_aurora + path_provider: ^2.1.1 + path_provider_aurora: + git: + url: https://gitlab.com/omprussia/flutter/flutter-plugins.git + ref: master + path: packages/path_provider/path_provider_aurora neon: git: url: https://github.com/nextcloud/neon diff --git a/packages/neon/neon/lib/src/utils/adaptive.dart b/packages/neon/neon/lib/src/utils/adaptive.dart index f2c3a4de..928d3436 100644 --- a/packages/neon/neon/lib/src/utils/adaptive.dart +++ b/packages/neon/neon/lib/src/utils/adaptive.dart @@ -7,13 +7,14 @@ bool isCupertino(final BuildContext context) { final theme = Theme.of(context); switch (theme.platform) { + case TargetPlatform.iOS: + case TargetPlatform.macOS: + return true; case TargetPlatform.android: case TargetPlatform.fuchsia: case TargetPlatform.linux: case TargetPlatform.windows: + default: return false; - case TargetPlatform.iOS: - case TargetPlatform.macOS: - return true; } } diff --git a/packages/neon/neon/lib/src/utils/request_manager.dart b/packages/neon/neon/lib/src/utils/request_manager.dart index 5222f823..5a08b242 100644 --- a/packages/neon/neon/lib/src/utils/request_manager.dart +++ b/packages/neon/neon/lib/src/utils/request_manager.dart @@ -10,6 +10,7 @@ import 'package:path_provider/path_provider.dart'; import 'package:rxdart/rxdart.dart'; import 'package:sqflite/sqflite.dart'; import 'package:xml/xml.dart' as xml; +import 'package:sqflite/sqflite.dart'; typedef UnwrapCallback = T Function(R); typedef SerializeCallback = String Function(T); @@ -231,7 +232,7 @@ class Cache { return; } - final cacheDir = await getApplicationCacheDirectory(); + final cacheDir = await getTemporaryDirectory(); _database = await openDatabase( p.join(cacheDir.path, 'cache.db'), version: 1, diff --git a/packages/neon/neon/lib/src/widgets/adaptive_widgets/list_tile.dart b/packages/neon/neon/lib/src/widgets/adaptive_widgets/list_tile.dart index e0392fe7..ef6d1a27 100644 --- a/packages/neon/neon/lib/src/widgets/adaptive_widgets/list_tile.dart +++ b/packages/neon/neon/lib/src/widgets/adaptive_widgets/list_tile.dart @@ -88,18 +88,6 @@ class AdaptiveListTile extends StatelessWidget { final theme = Theme.of(context); switch (theme.platform) { - case TargetPlatform.android: - case TargetPlatform.fuchsia: - case TargetPlatform.linux: - case TargetPlatform.windows: - return ListTile( - title: title, - subtitle: subtitle, - leading: leading, - trailing: trailing, - onTap: onTap, - enabled: enabled, - ); case TargetPlatform.iOS: case TargetPlatform.macOS: final tile = CupertinoListTile( @@ -130,6 +118,20 @@ class AdaptiveListTile extends StatelessWidget { } return tile; + + case TargetPlatform.android: + case TargetPlatform.fuchsia: + case TargetPlatform.linux: + case TargetPlatform.windows: + default: + return ListTile( + title: title, + subtitle: subtitle, + leading: leading, + trailing: trailing, + onTap: onTap, + enabled: enabled, + ); } } } diff --git a/packages/neon/neon/pubspec.yaml b/packages/neon/neon/pubspec.yaml index a8ace978..ecb24451 100644 --- a/packages/neon/neon/pubspec.yaml +++ b/packages/neon/neon/pubspec.yaml @@ -44,6 +44,11 @@ dependencies: rxdart: ^0.27.4 scrollable_positioned_list: ^0.3.0 shared_preferences: ^2.2.1 + shared_preferences_aurora: + git: + url: https://gitlab.com/omprussia/flutter/flutter-plugins.git + ref: master + path: packages/shared_preferences/shared_preferences_aurora sort_box: git: url: https://github.com/nextcloud/neon