Browse Source

[flutter_example_packages] Add app, start home page

merge-requests/21/head
Vitaliy Zarubin 2 years ago
parent
commit
7b1b60270c
  1. 47
      example/.gitignore
  2. 30
      example/.metadata
  3. 16
      example/README.md
  4. 1
      example/analysis_options.yaml
  5. BIN
      example/assets/images/logo-head.png
  6. 1
      example/aurora/.gitignore
  7. 47
      example/aurora/CMakeLists.txt
  8. 12
      example/aurora/desktop/ru.auroraos.flutter_example_packages.desktop
  9. BIN
      example/aurora/icons/108x108.png
  10. BIN
      example/aurora/icons/128x128.png
  11. BIN
      example/aurora/icons/172x172.png
  12. BIN
      example/aurora/icons/86x86.png
  13. 9
      example/aurora/main.cpp
  14. 31
      example/aurora/rpm/ru.auroraos.flutter_example_packages.spec
  15. 1
      example/data/raw/flutter.svg
  16. BIN
      example/data/raw/icon.png
  17. 2
      example/data/raw/links
  18. 1
      example/data/raw/logo-head.svg
  19. 1
      example/data/raw/package.svg
  20. 3
      example/l10n.yaml
  21. 33
      example/lib/app.dart
  22. 3
      example/lib/base/build/build.config.dart
  23. 6
      example/lib/base/build/build.debug.dart
  24. 6
      example/lib/base/build/build.release.dart
  25. 38
      example/lib/base/di/app_di.dart
  26. 18
      example/lib/extensions/keys_ext.dart
  27. 3
      example/lib/l10n/app_en.arb
  28. 3
      example/lib/l10n/app_ru.arb
  29. 9
      example/lib/main.dart
  30. 9
      example/lib/main.release.dart
  31. 8
      example/lib/model.dart
  32. 8
      example/lib/pages/battery_plus/model.dart
  33. 31
      example/lib/pages/battery_plus/page.dart
  34. 8
      example/lib/pages/device_info_plus/model.dart
  35. 31
      example/lib/pages/device_info_plus/page.dart
  36. 8
      example/lib/pages/flutter_local_notifications/model.dart
  37. 31
      example/lib/pages/flutter_local_notifications/page.dart
  38. 8
      example/lib/pages/flutter_secure_storage/model.dart
  39. 31
      example/lib/pages/flutter_secure_storage/page.dart
  40. 8
      example/lib/pages/home/model.dart
  41. 237
      example/lib/pages/home/page.dart
  42. 8
      example/lib/pages/package_info_plus/model.dart
  43. 31
      example/lib/pages/package_info_plus/page.dart
  44. 8
      example/lib/pages/path_provider/model.dart
  45. 31
      example/lib/pages/path_provider/page.dart
  46. 8
      example/lib/pages/shared_preferences/model.dart
  47. 31
      example/lib/pages/shared_preferences/page.dart
  48. 8
      example/lib/pages/wakelock/model.dart
  49. 31
      example/lib/pages/wakelock/page.dart
  50. 8
      example/lib/pages/xdga_directories/model.dart
  51. 31
      example/lib/pages/xdga_directories/page.dart
  52. 7
      example/lib/theme/colors.dart
  53. 7
      example/lib/theme/radius.dart
  54. 54
      example/lib/theme/theme.dart
  55. 38
      example/lib/widgets/layouts/page_layout.dart
  56. 614
      example/pubspec.lock
  57. 45
      example/pubspec.yaml
  58. 94
      example/run.sh
  59. BIN
      example/web/favicon.png
  60. BIN
      example/web/icons/Icon-192.png
  61. BIN
      example/web/icons/Icon-512.png
  62. BIN
      example/web/icons/Icon-maskable-192.png
  63. BIN
      example/web/icons/Icon-maskable-512.png
  64. 58
      example/web/index.html
  65. 35
      example/web/manifest.json

47
example/.gitignore vendored

@ -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

30
example/.metadata

@ -0,0 +1,30 @@
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled.
version:
revision: 135454af32477f815a7525073027a3ff9eff1bfd
channel: aurora
project_type: app
# Tracks metadata for the flutter migrate command
migration:
platforms:
- platform: root
create_revision: 135454af32477f815a7525073027a3ff9eff1bfd
base_revision: 135454af32477f815a7525073027a3ff9eff1bfd
- platform: aurora
create_revision: 135454af32477f815a7525073027a3ff9eff1bfd
base_revision: 135454af32477f815a7525073027a3ff9eff1bfd
# User provided section
# List of Local paths (relative to this file) that should be
# ignored by the migrate tool.
#
# Files that are not part of the templates will be ignored by default.
unmanaged_files:
- 'lib/main.dart'
- 'ios/Runner.xcodeproj/project.pbxproj'

16
example/README.md

@ -0,0 +1,16 @@
# flutter_example_packages
A new Flutter project.
## Getting Started
This project is a starting point for a Flutter application.
A few resources to get you started if this is your first Flutter project:
- [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab)
- [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook)
For help getting started with Flutter development, view the
[online documentation](https://docs.flutter.dev/), which offers tutorials,
samples, guidance on mobile development, and a full API reference.

1
example/analysis_options.yaml

@ -0,0 +1 @@
include: package:flutter_lints/flutter.yaml

BIN
example/assets/images/logo-head.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

1
example/aurora/.gitignore vendored

@ -0,0 +1 @@
flutter/ephemeral

47
example/aurora/CMakeLists.txt

@ -0,0 +1,47 @@
cmake_minimum_required(VERSION 3.10)
project(ru.auroraos.flutter_example_packages 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)

12
example/aurora/desktop/ru.auroraos.flutter_example_packages.desktop

@ -0,0 +1,12 @@
[Desktop Entry]
Type=Application
Name=Flutter example packages
Comment=Application demonstrating the work of plugins.
Icon=ru.auroraos.flutter_example_packages
Exec=/usr/bin/ru.auroraos.flutter_example_packages
X-Nemo-Application-Type=silica-qt5
[X-Application]
Permissions=
OrganizationName=ru.auroraos
ApplicationName=flutter_example_packages

BIN
example/aurora/icons/108x108.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

BIN
example/aurora/icons/128x128.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

BIN
example/aurora/icons/172x172.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

BIN
example/aurora/icons/86x86.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

9
example/aurora/main.cpp

@ -0,0 +1,9 @@
#include <flutter/application.h>
#include "generated_plugin_registrant.h"
int main(int argc, char *argv[]) {
Application::Initialize(argc, argv);
RegisterPlugins();
Application::Launch();
return 0;
}

31
example/aurora/rpm/ru.auroraos.flutter_example_packages.spec

@ -0,0 +1,31 @@
%global __provides_exclude_from ^%{_datadir}/%{name}/lib/.*$
%global __requires_exclude ^lib(dconf|flutter-embedder|maliit-glib|appmanifest-.+|.+_platform_plugin)\\.so.*$
Name: ru.auroraos.flutter_example_packages
Summary: A new Flutter project.
Version: 0.1.0
Release: 1
License: Proprietary
Source0: %{name}-%{version}.tar.zst
BuildRequires: cmake
BuildRequires: pkgconfig(flutter-embedder)
%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

1
example/data/raw/flutter.svg

@ -0,0 +1 @@
<svg height="317" preserveAspectRatio="xMidYMid" viewBox="0 0 256 317" width="256" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><linearGradient id="a" x1="3.951709%" x2="75.897073%" y1="26.993029%" y2="52.919266%"><stop offset="0"/><stop offset="1" stop-opacity="0"/></linearGradient><path d="m157.665785.00054936-157.66523564 157.66523564 48.80041204 48.800412 206.4667466-206.46564764z" fill="#47c5fb"/><path d="m156.567183 145.396793-84.4184723 84.418472 48.9838973 49.71564 48.710317-48.710318 85.424893-85.423794z" fill="#47c5fb"/><path d="m121.133047 279.531124 37.081545 37.081546h97.052567l-85.424893-85.791863z" fill="#00569e"/><path d="m71.5995742 230.364072 48.8015108-48.801511 49.440961 49.258575-48.709219 48.710318z" fill="#00b5f8"/><path d="m121.132827 279.531454 40.560069-13.459227 4.028979-31.130919z" fill="url(#a)" fill-opacity=".8"/></svg>

After

Width:  |  Height:  |  Size: 894 B

BIN
example/data/raw/icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

2
example/data/raw/links

@ -0,0 +1,2 @@
https://iconduck.com/icons/94312/flutter
https://iconduck.com/icons/54169/package

1
example/data/raw/logo-head.svg

@ -0,0 +1 @@
<?xml version="1.0" encoding="UTF-8"?> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 318.64 385.84"> <defs> <style>.cls-1{fill:#c2a5e8;}</style> </defs> <g id="Layer_2" data-name="Layer 2"> <g id="ref"> <path class="cls-1" d="M300.85,245.26H290.1a1.71,1.71,0,0,1-1.48-2.57l3.73-6.46a5.69,5.69,0,0,0,0-5.7l-16.15-28-24.7,42.72h-8.19a1.71,1.71,0,0,1-1.48-2.57l27.15-47a5.69,5.69,0,0,0,0-5.7l-16.15-28L159.06,324.23l-4.26-7.37a4.53,4.53,0,0,1,0-4.56l90.81-157.07a5.69,5.69,0,0,0,0-5.7l-16.15-28-93.8,162.23-4.25-7.37a4.53,4.53,0,0,1,0-4.56l90.83-157.11a5.69,5.69,0,0,0,0-5.7L206.08,81,111.14,245.26H103a1.71,1.71,0,0,1-1.48-2.57L198.86,74.23a5.72,5.72,0,0,0,0-5.7l-16.16-28L64.35,245.26H56.16a1.71,1.71,0,0,1-1.48-2.57l120.81-209a5.69,5.69,0,0,0,0-5.7L159.32,0,0,276.08H95.61l63.46,109.75,63.47-109.75h96.1Z"></path> </g> </g> </svg>

After

Width:  |  Height:  |  Size: 838 B

1
example/data/raw/package.svg

@ -0,0 +1 @@
<svg enable-background="new 0 0 48 48" viewBox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"><path d="m38 42h-28c-2.2 0-4-1.8-4-4v-28c0-2.2 1.8-4 4-4h28c2.2 0 4 1.8 4 4v28c0 2.2-1.8 4-4 4z" fill="#ff9800"/><path d="m29.5 16h-11c-.8 0-1.5-.7-1.5-1.5 0-.8.7-1.5 1.5-1.5h11c.8 0 1.5.7 1.5 1.5 0 .8-.7 1.5-1.5 1.5z" fill="#8a5100"/></svg>

After

Width:  |  Height:  |  Size: 335 B

3
example/l10n.yaml

@ -0,0 +1,3 @@
arb-dir: lib/l10n
template-arb-file: app_en.arb
output-localization-file: app_localizations.dart

33
example/lib/app.dart

@ -0,0 +1,33 @@
import 'package:flutter/material.dart';
import 'package:flutter_example_packages/base/di/app_di.dart';
import 'package:flutter_example_packages/model.dart';
import 'package:flutter_example_packages/pages/home/page.dart';
import 'package:flutter_example_packages/pages/xdga_directories/page.dart';
import 'package:flutter_example_packages/theme/theme.dart';
import 'package:scoped_model/scoped_model.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
/// Main app class
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return ScopedModel<AppModel>(
model: getIt<AppModel>(),
child: ScopedModelDescendant<AppModel>(
builder: (context, child, model) => MaterialApp(
localizationsDelegates: AppLocalizations.localizationsDelegates,
supportedLocales: AppLocalizations.supportedLocales,
title: 'Flutter Aurora OS',
theme: appTheme,
initialRoute: '/',
routes: {
'/': (context) => const HomePage(),
'/xdga_directories': (context) => const XdgaDirectoriesPage(),
},
),
),
);
}
}

3
example/lib/base/build/build.config.dart

@ -0,0 +1,3 @@
abstract class BuildConfig {
bool get isDebug;
}

6
example/lib/base/build/build.debug.dart

@ -0,0 +1,6 @@
import 'build.config.dart';
class BuildDebugConfig implements BuildConfig {
@override
bool get isDebug => true;
}

6
example/lib/base/build/build.release.dart

@ -0,0 +1,6 @@
import 'build.config.dart';
class BuildReleaseConfig implements BuildConfig {
@override
bool get isDebug => false;
}

38
example/lib/base/di/app_di.dart

@ -1,25 +1,35 @@
import 'package:flutter_example_packages/base/build/build.config.dart';
import 'package:flutter_example_packages/model.dart';
import 'package:flutter_example_packages/pages/battery_plus/model.dart';
import 'package:flutter_example_packages/pages/device_info_plus/model.dart';
import 'package:flutter_example_packages/pages/flutter_local_notifications/model.dart';
import 'package:flutter_example_packages/pages/flutter_secure_storage/model.dart';
import 'package:flutter_example_packages/pages/home/model.dart';
import 'package:flutter_example_packages/pages/package_info_plus/model.dart';
import 'package:flutter_example_packages/pages/path_provider/model.dart';
import 'package:flutter_example_packages/pages/shared_preferences/model.dart';
import 'package:flutter_example_packages/pages/wakelock/model.dart';
import 'package:flutter_example_packages/pages/xdga_directories/model.dart';
import 'package:get_it/get_it.dart';
final getIt = GetIt.instance;
/// Initialization application DI
void setupDI(BuildConfig config) {
final dio = configureDio(url: config.baseUrl);
getIt
// build info
// build info
..registerSingleton<BuildConfig>(config)
// services
..registerSingleton<AuthService>(AuthService(dio))
..registerSingleton<UsersService>(UsersService(dio))
..registerSingleton<CardsService>(CardsService(dio))
// pages models
// pages models
..registerFactory<HomeModel>(() => HomeModel())
..registerFactory<SignInModel>(() => SignInModel())
..registerFactory<SignUpModel>(() => SignUpModel())
..registerFactory<CardModel>(() => CardModel())
..registerFactory<CardsModel>(() => CardsModel())
..registerFactory<StatsModel>(() => StatsModel())
..registerFactory<FriendsModel>(() => FriendsModel())
// other
..registerFactory<BatteryPlusModel>(() => BatteryPlusModel())
..registerFactory<DeviceInfoPlusModel>(() => DeviceInfoPlusModel())
..registerFactory<FlutterLocalNotificationsModel>(() => FlutterLocalNotificationsModel())
..registerFactory<FlutterSecureStorageModel>(() => FlutterSecureStorageModel())
..registerFactory<PackageInfoPlusModel>(() => PackageInfoPlusModel())
..registerFactory<PathProviderModel>(() => PathProviderModel())
..registerFactory<SharedPreferencesModel>(() => SharedPreferencesModel())
..registerFactory<WakelockModel>(() => WakelockModel())
..registerFactory<XdgaDirectoriesModel>(() => XdgaDirectoriesModel())
// other
..registerSingleton<AppModel>(AppModel());
}

18
example/lib/extensions/keys_ext.dart

@ -0,0 +1,18 @@
import 'package:flutter/material.dart';
/// Extensions for [GlobalKey]
extension ExtGlobalKey on GlobalKey {
/// Get height by key
double? getHeight() {
if (currentContext == null) {
return null;
}
try {
final renderBoxRed = currentContext!.findRenderObject() as RenderBox;
final sizeRed = renderBoxRed.size;
return sizeRed.height;
} catch (e) {
return 0;
}
}
}

3
example/lib/l10n/app_en.arb

@ -0,0 +1,3 @@
{
"helloPageTitle": "Flutter Aurora OS"
}

3
example/lib/l10n/app_ru.arb

@ -0,0 +1,3 @@
{
"helloPageTitle": "Flutter ОС Аврора"
}

9
example/lib/main.dart

@ -0,0 +1,9 @@
import 'package:flutter/material.dart';
import 'package:flutter_example_packages/app.dart';
import 'package:flutter_example_packages/base/build/build.release.dart';
import 'package:flutter_example_packages/base/di/app_di.dart';
void main() {
setupDI(BuildReleaseConfig());
runApp(const MyApp());
}

9
example/lib/main.release.dart

@ -0,0 +1,9 @@
import 'package:flutter/material.dart';
import 'package:flutter_example_packages/app.dart';
import 'package:flutter_example_packages/base/build/build.debug.dart';
import 'package:flutter_example_packages/base/di/app_di.dart';
void main() {
setupDI(BuildDebugConfig());
runApp(const MyApp());
}

8
example/lib/model.dart

@ -0,0 +1,8 @@
import 'package:flutter/widgets.dart';
import 'package:scoped_model/scoped_model.dart';
/// Global model for app
class AppModel extends Model {
/// Get [ScopedModel]
static AppModel of(BuildContext context) => ScopedModel.of<AppModel>(context);
}

8
example/lib/pages/battery_plus/model.dart

@ -0,0 +1,8 @@
import 'package:flutter/widgets.dart';
import 'package:scoped_model/scoped_model.dart';
/// Model for [BatteryPlusPage]
class BatteryPlusModel extends Model {
/// Get [ScopedModel]
static BatteryPlusModel of(BuildContext context) => ScopedModel.of<BatteryPlusModel>(context);
}

31
example/lib/pages/battery_plus/page.dart

@ -0,0 +1,31 @@
import 'package:flutter/material.dart';
import 'package:flutter_example_packages/base/di/app_di.dart';
import 'package:flutter_example_packages/pages/battery_plus/model.dart';
import 'package:scoped_model/scoped_model.dart';
class BatteryPlusPage extends StatefulWidget {
const BatteryPlusPage({
super.key,
});
@override
State<BatteryPlusPage> createState() => _BatteryPlusPageState();
}
class _BatteryPlusPageState extends State<BatteryPlusPage> {
@override
Widget build(BuildContext context) {
return ScopedModel<BatteryPlusModel>(
model: getIt<BatteryPlusModel>(),
child: ScopedModelDescendant<BatteryPlusModel>(builder: (context, child, model) {
return Wrap(
spacing: 20,
runSpacing: 20,
children: const [
Text("data"),
],
);
}),
);
}
}

8
example/lib/pages/device_info_plus/model.dart

@ -0,0 +1,8 @@
import 'package:flutter/widgets.dart';
import 'package:scoped_model/scoped_model.dart';
/// Model for [DeviceInfoPlusPage]
class DeviceInfoPlusModel extends Model {
/// Get [ScopedModel]
static DeviceInfoPlusModel of(BuildContext context) => ScopedModel.of<DeviceInfoPlusModel>(context);
}

31
example/lib/pages/device_info_plus/page.dart

@ -0,0 +1,31 @@
import 'package:flutter/material.dart';
import 'package:flutter_example_packages/base/di/app_di.dart';
import 'package:flutter_example_packages/pages/device_info_plus/model.dart';
import 'package:scoped_model/scoped_model.dart';
class DeviceInfoPlusPage extends StatefulWidget {
const DeviceInfoPlusPage({
super.key,
});
@override
State<DeviceInfoPlusPage> createState() => _DeviceInfoPlusPageState();
}
class _DeviceInfoPlusPageState extends State<DeviceInfoPlusPage> {
@override
Widget build(BuildContext context) {
return ScopedModel<DeviceInfoPlusModel>(
model: getIt<DeviceInfoPlusModel>(),
child: ScopedModelDescendant<DeviceInfoPlusModel>(builder: (context, child, model) {
return Wrap(
spacing: 20,
runSpacing: 20,
children: const [
Text("data"),
],
);
}),
);
}
}

8
example/lib/pages/flutter_local_notifications/model.dart

@ -0,0 +1,8 @@
import 'package:flutter/widgets.dart';
import 'package:scoped_model/scoped_model.dart';
/// Model for [FlutterLocalNotificationsPage]
class FlutterLocalNotificationsModel extends Model {
/// Get [ScopedModel]
static FlutterLocalNotificationsModel of(BuildContext context) => ScopedModel.of<FlutterLocalNotificationsModel>(context);
}

31
example/lib/pages/flutter_local_notifications/page.dart

@ -0,0 +1,31 @@
import 'package:flutter/material.dart';
import 'package:flutter_example_packages/base/di/app_di.dart';
import 'package:flutter_example_packages/pages/flutter_local_notifications/model.dart';
import 'package:scoped_model/scoped_model.dart';
class FlutterLocalNotificationsPage extends StatefulWidget {
const FlutterLocalNotificationsPage({
super.key,
});
@override
State<FlutterLocalNotificationsPage> createState() => _FlutterLocalNotificationsPageState();
}
class _FlutterLocalNotificationsPageState extends State<FlutterLocalNotificationsPage> {
@override
Widget build(BuildContext context) {
return ScopedModel<FlutterLocalNotificationsModel>(
model: getIt<FlutterLocalNotificationsModel>(),
child: ScopedModelDescendant<FlutterLocalNotificationsModel>(builder: (context, child, model) {
return Wrap(
spacing: 20,
runSpacing: 20,
children: const [
Text("data"),
],
);
}),
);
}
}

8
example/lib/pages/flutter_secure_storage/model.dart

@ -0,0 +1,8 @@
import 'package:flutter/widgets.dart';
import 'package:scoped_model/scoped_model.dart';
/// Model for [FlutterSecureStoragePage]
class FlutterSecureStorageModel extends Model {
/// Get [ScopedModel]
static FlutterSecureStorageModel of(BuildContext context) => ScopedModel.of<FlutterSecureStorageModel>(context);
}

31
example/lib/pages/flutter_secure_storage/page.dart

@ -0,0 +1,31 @@
import 'package:flutter/material.dart';
import 'package:flutter_example_packages/base/di/app_di.dart';
import 'package:flutter_example_packages/pages/flutter_secure_storage/model.dart';
import 'package:scoped_model/scoped_model.dart';
class FlutterSecureStoragePage extends StatefulWidget {
const FlutterSecureStoragePage({
super.key,
});
@override
State<FlutterSecureStoragePage> createState() => _FlutterSecureStoragePageState();
}
class _FlutterSecureStoragePageState extends State<FlutterSecureStoragePage> {
@override
Widget build(BuildContext context) {
return ScopedModel<FlutterSecureStorageModel>(
model: getIt<FlutterSecureStorageModel>(),
child: ScopedModelDescendant<FlutterSecureStorageModel>(builder: (context, child, model) {
return Wrap(
spacing: 20,
runSpacing: 20,
children: const [
Text("data"),
],
);
}),
);
}
}

8
example/lib/pages/home/model.dart

@ -0,0 +1,8 @@
import 'package:flutter/widgets.dart';
import 'package:scoped_model/scoped_model.dart';
/// Model for [HomePage]
class HomeModel extends Model {
/// Get [ScopedModel]
static HomeModel of(BuildContext context) => ScopedModel.of<HomeModel>(context);
}

237
example/lib/pages/home/page.dart

@ -0,0 +1,237 @@
import 'package:flutter/material.dart';
import 'package:flutter_example_packages/base/di/app_di.dart';
import 'package:flutter_example_packages/extensions/keys_ext.dart';
import 'package:flutter_example_packages/pages/home/model.dart';
import 'package:flutter_example_packages/theme/colors.dart';
import 'package:flutter_example_packages/theme/radius.dart';
import 'package:flutter_example_packages/widgets/layouts/page_layout.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:scoped_model/scoped_model.dart';
class HomePage extends StatefulWidget {
const HomePage({
super.key,
});
@override
State<HomePage> createState() => _HomePageState();
}
class _HomePageState extends State<HomePage> {
double _hH = 0;
final _header = GlobalKey();
@override
void initState() {
super.initState();
WidgetsBinding.instance.addPostFrameCallback((_) => setState(() {
_hH = _header.getHeight() ?? 0;
Future.delayed(const Duration(milliseconds: 100), () {
setState(() {
_hH = _header.getHeight() ?? 0;
});
});
Future.delayed(const Duration(milliseconds: 200), () {
setState(() {
_hH = _header.getHeight() ?? 0;
});
});
}));
}
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
final localizations = AppLocalizations.of(context)!;
return PageLayout(
child: ScopedModel<HomeModel>(
model: getIt<HomeModel>(),
child: ScopedModelDescendant<HomeModel>(
builder: (context, child, model) {
return Stack(
children: [
Container(
height: _hH > 0 ? _hH : 0,
color: AppColors.primary,
width: double.infinity,
child: Center(
child: Align(
alignment: FractionalOffset.bottomRight,
child: Padding(
padding: const EdgeInsets.only(
left: 20, right: 20, top: 0, bottom: 40),
child: Opacity(
opacity: 0.3,
child: Image.asset(
'images/logo-head.png',
width: 250,
),
),
),
),
),
),
Container(
key: _header,
width: double.infinity,
padding: const EdgeInsets.only(
left: 20, right: 20, top: 30, bottom: 120),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"Welcome!",
textAlign: TextAlign.left,
style: theme.textTheme.titleLarge?.copyWith(
color: const Color(0xFF3c67b5),
),
),
const SizedBox(height: 50),
Text(
"In this application you can find 100500 plugins supporting Aurors OS. If it happens that something is missing for you, you can write to us or add it yourself.",
textAlign: TextAlign.left,
style: theme.textTheme.bodyLarge?.copyWith(
color: const Color(0xFF3c67b5),
height: 1.5,
),
),
],
),
),
ListView.builder(
padding: EdgeInsets.only(top: _hH > 0 ? _hH - 16 : 0),
itemCount: 20,
itemBuilder: (context, index) {
final i = index;
return Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: i == 0
? const BorderRadius.only(
topLeft: Radius.circular(20),
topRight: Radius.circular(20),
)
: null,
),
child: Padding(
padding: i == 0
? const EdgeInsets.only(
left: 20, right: 20, top: 20, bottom: 0)
: const EdgeInsets.symmetric(horizontal: 20),
child: Column(
children: [
Stack(
children: [
Padding(
padding: const EdgeInsets.only(top: 10),
child: Stack(
children: [
SizedBox(
width: double.infinity,
child: Card(
child: Padding(
padding: const EdgeInsets.all(20),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
'battery_plus',
textAlign: TextAlign.left,
style: theme
.textTheme.titleSmall,
),
const SizedBox(height: 10),
Text(
'A Flutter plugin to access various information about the battery of the device the app is running on.',
textAlign: TextAlign.left,
style: theme
.textTheme.bodyMedium
?.copyWith(
color: Colors.black
.withOpacity(
0.6)),
),
const SizedBox(height: 12),
Divider(
height: 1,
color:
const Color(0xFF3c67b5)
.withOpacity(0.2)),
const SizedBox(height: 12),
Text(
'Version: 4.0.1',
textAlign: TextAlign.left,
style: theme.textTheme.caption
?.copyWith(
color: const Color(
0xFF3c67b5)
.withOpacity(
0.7)),
),
],
),
),
),
),
Positioned.fill(
child: Material(
color: Colors.transparent,
child: InkWell(
customBorder:
RoundedRectangleBorder(
borderRadius: AppRadius.small,
),
hoverColor: Colors.transparent,
onTap: () => debugPrint("click"),
),
),
),
],
),
),
Align(
alignment: FractionalOffset.topRight,
child: Container(
margin: const EdgeInsets.only(right: 16),
decoration: BoxDecoration(
color: i % 2 == 0
? Colors.orange
: Colors.blueAccent,
borderRadius: AppRadius.small,
),
child: Padding(
padding: const EdgeInsets.all(6),
child: Text(
i % 2 == 0
? 'platform dependent'
: 'platform independent',
textAlign: TextAlign.left,
style:
theme.textTheme.caption?.copyWith(
color: Colors.white,
fontWeight: FontWeight.w100,
),
),
),
),
),
],
),
const SizedBox(height: 20),
],
),
),
);
},
),
],
);
},
),
),
);
}
}

8
example/lib/pages/package_info_plus/model.dart

@ -0,0 +1,8 @@
import 'package:flutter/widgets.dart';
import 'package:scoped_model/scoped_model.dart';
/// Model for [PackageInfoPlusPage]
class PackageInfoPlusModel extends Model {
/// Get [ScopedModel]
static PackageInfoPlusModel of(BuildContext context) => ScopedModel.of<PackageInfoPlusModel>(context);
}

31
example/lib/pages/package_info_plus/page.dart

@ -0,0 +1,31 @@
import 'package:flutter/material.dart';
import 'package:flutter_example_packages/base/di/app_di.dart';
import 'package:flutter_example_packages/pages/package_info_plus/model.dart';
import 'package:scoped_model/scoped_model.dart';
class PackageInfoPlusPage extends StatefulWidget {
const PackageInfoPlusPage({
super.key,
});
@override
State<PackageInfoPlusPage> createState() => _PackageInfoPlusPageState();
}
class _PackageInfoPlusPageState extends State<PackageInfoPlusPage> {
@override
Widget build(BuildContext context) {
return ScopedModel<PackageInfoPlusModel>(
model: getIt<PackageInfoPlusModel>(),
child: ScopedModelDescendant<PackageInfoPlusModel>(builder: (context, child, model) {
return Wrap(
spacing: 20,
runSpacing: 20,
children: const [
Text("data"),
],
);
}),
);
}
}

8
example/lib/pages/path_provider/model.dart

@ -0,0 +1,8 @@
import 'package:flutter/widgets.dart';
import 'package:scoped_model/scoped_model.dart';
/// Model for [PathProviderPage]
class PathProviderModel extends Model {
/// Get [ScopedModel]
static PathProviderModel of(BuildContext context) => ScopedModel.of<PathProviderModel>(context);
}

31
example/lib/pages/path_provider/page.dart

@ -0,0 +1,31 @@
import 'package:flutter/material.dart';
import 'package:flutter_example_packages/base/di/app_di.dart';
import 'package:flutter_example_packages/pages/path_provider/model.dart';
import 'package:scoped_model/scoped_model.dart';
class PathProviderPage extends StatefulWidget {
const PathProviderPage({
super.key,
});
@override
State<PathProviderPage> createState() => _PathProviderPageState();
}
class _PathProviderPageState extends State<PathProviderPage> {
@override
Widget build(BuildContext context) {
return ScopedModel<PathProviderModel>(
model: getIt<PathProviderModel>(),
child: ScopedModelDescendant<PathProviderModel>(builder: (context, child, model) {
return Wrap(
spacing: 20,
runSpacing: 20,
children: const [
Text("data"),
],
);
}),
);
}
}

8
example/lib/pages/shared_preferences/model.dart

@ -0,0 +1,8 @@
import 'package:flutter/widgets.dart';
import 'package:scoped_model/scoped_model.dart';
/// Model for [SharedPreferencesPage]
class SharedPreferencesModel extends Model {
/// Get [ScopedModel]
static SharedPreferencesModel of(BuildContext context) => ScopedModel.of<SharedPreferencesModel>(context);
}

31
example/lib/pages/shared_preferences/page.dart

@ -0,0 +1,31 @@
import 'package:flutter/material.dart';
import 'package:flutter_example_packages/base/di/app_di.dart';
import 'package:flutter_example_packages/pages/shared_preferences/model.dart';
import 'package:scoped_model/scoped_model.dart';
class SharedPreferencesPage extends StatefulWidget {
const SharedPreferencesPage({
super.key,
});
@override
State<SharedPreferencesPage> createState() => _SharedPreferencesPageState();
}
class _SharedPreferencesPageState extends State<SharedPreferencesPage> {
@override
Widget build(BuildContext context) {
return ScopedModel<SharedPreferencesModel>(
model: getIt<SharedPreferencesModel>(),
child: ScopedModelDescendant<SharedPreferencesModel>(builder: (context, child, model) {
return Wrap(
spacing: 20,
runSpacing: 20,
children: const [
Text("data"),
],
);
}),
);
}
}

8
example/lib/pages/wakelock/model.dart

@ -0,0 +1,8 @@
import 'package:flutter/widgets.dart';
import 'package:scoped_model/scoped_model.dart';
/// Model for [WakelockPage]
class WakelockModel extends Model {
/// Get [ScopedModel]
static WakelockModel of(BuildContext context) => ScopedModel.of<WakelockModel>(context);
}

31
example/lib/pages/wakelock/page.dart

@ -0,0 +1,31 @@
import 'package:flutter/material.dart';
import 'package:flutter_example_packages/base/di/app_di.dart';
import 'package:flutter_example_packages/pages/wakelock/model.dart';
import 'package:scoped_model/scoped_model.dart';
class WakelockPage extends StatefulWidget {
const WakelockPage({
super.key,
});
@override
State<WakelockPage> createState() => _WakelockPageState();
}
class _WakelockPageState extends State<WakelockPage> {
@override
Widget build(BuildContext context) {
return ScopedModel<WakelockModel>(
model: getIt<WakelockModel>(),
child: ScopedModelDescendant<WakelockModel>(builder: (context, child, model) {
return Wrap(
spacing: 20,
runSpacing: 20,
children: const [
Text("data"),
],
);
}),
);
}
}

8
example/lib/pages/xdga_directories/model.dart

@ -0,0 +1,8 @@
import 'package:flutter/widgets.dart';
import 'package:scoped_model/scoped_model.dart';
/// Model for [XdgaDirectoriesPage]
class XdgaDirectoriesModel extends Model {
/// Get [ScopedModel]
static XdgaDirectoriesModel of(BuildContext context) => ScopedModel.of<XdgaDirectoriesModel>(context);
}

31
example/lib/pages/xdga_directories/page.dart

@ -0,0 +1,31 @@
import 'package:flutter/material.dart';
import 'package:flutter_example_packages/base/di/app_di.dart';
import 'package:flutter_example_packages/pages/xdga_directories/model.dart';
import 'package:scoped_model/scoped_model.dart';
class XdgaDirectoriesPage extends StatefulWidget {
const XdgaDirectoriesPage({
super.key,
});
@override
State<XdgaDirectoriesPage> createState() => _XdgaDirectoriesPageState();
}
class _XdgaDirectoriesPageState extends State<XdgaDirectoriesPage> {
@override
Widget build(BuildContext context) {
return ScopedModel<XdgaDirectoriesModel>(
model: getIt<XdgaDirectoriesModel>(),
child: ScopedModelDescendant<XdgaDirectoriesModel>(builder: (context, child, model) {
return Wrap(
spacing: 20,
runSpacing: 20,
children: const [
Text("data"),
],
);
}),
);
}
}

7
example/lib/theme/colors.dart

@ -0,0 +1,7 @@
import 'dart:ui';
class AppColors {
static const Color primary = Color(0xFFCBDCF8);
static const Color secondary = Color(0xFF00b3ad);
static const Color warning = Color(0xFFfb7d4a);
}

7
example/lib/theme/radius.dart

@ -0,0 +1,7 @@
import 'package:flutter/material.dart';
class AppRadius {
static final large = BorderRadius.circular(24.0);
static final medium = BorderRadius.circular(16.0);
static final small = BorderRadius.circular(8.0);
}

54
example/lib/theme/theme.dart

@ -0,0 +1,54 @@
import 'package:flutter/material.dart';
import 'package:flutter_example_packages/theme/colors.dart';
import 'package:flutter_example_packages/theme/radius.dart';
import 'package:google_fonts/google_fonts.dart';
final appTheme = ThemeData(
colorScheme: ThemeData().colorScheme.copyWith(
primary: AppColors.primary,
secondary: AppColors.secondary,
),
cardTheme: CardTheme(
clipBehavior: Clip.antiAlias,
margin: const EdgeInsets.all(0),
color: AppColors.primary.withOpacity(0.4),
elevation: 0,
shape: RoundedRectangleBorder(
borderRadius: AppRadius.small,
),
),
/// [Text]
textTheme: TextTheme(
headlineLarge: GoogleFonts.ubuntu(
fontSize: 60,
fontWeight: FontWeight.bold,
),
headlineMedium: GoogleFonts.ubuntu(
fontSize: 40,
fontWeight: FontWeight.bold,
),
headlineSmall: GoogleFonts.ubuntu(
fontSize: 24,
fontWeight: FontWeight.bold,
),
titleLarge: GoogleFonts.ubuntu(
fontSize: 60,
),
titleMedium: GoogleFonts.ubuntu(
fontSize: 40,
),
titleSmall: GoogleFonts.ubuntu(
fontSize: 24,
),
bodyLarge: GoogleFonts.ubuntu(
fontSize: 18,
),
bodyMedium: GoogleFonts.ubuntu(
fontSize: 16,
),
bodySmall: GoogleFonts.ubuntu(
fontSize: 12,
),
),
);

38
example/lib/widgets/layouts/page_layout.dart

@ -0,0 +1,38 @@
import 'package:flutter/material.dart';
import 'package:flutter_example_packages/model.dart';
import 'package:scoped_model/scoped_model.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
class PageLayout extends StatefulWidget {
const PageLayout({
super.key,
required this.child,
});
final Widget child;
@override
State<PageLayout> createState() => _PageLayoutState();
}
class _PageLayoutState extends State<PageLayout> {
@override
Widget build(BuildContext context) {
final localizations = AppLocalizations.of(context)!;
return ScopedModelDescendant<AppModel>(builder: (context, child, model) {
return Localizations.override(
context: context,
child: Builder(
builder: (context) {
return Scaffold(
appBar: AppBar(
elevation: 0,
),
body: widget.child,
);
},
),
);
});
}
}

614
example/pubspec.lock

@ -0,0 +1,614 @@
# Generated by pub
# See https://dart.dev/tools/pub/glossary#lockfile
packages:
_fe_analyzer_shared:
dependency: transitive
description:
name: _fe_analyzer_shared
url: "https://pub.dartlang.org"
source: hosted
version: "50.0.0"
analyzer:
dependency: transitive
description:
name: analyzer
url: "https://pub.dartlang.org"
source: hosted
version: "5.2.0"
args:
dependency: transitive
description:
name: args
url: "https://pub.dartlang.org"
source: hosted
version: "2.4.1"
async:
dependency: transitive
description:
name: async
url: "https://pub.dartlang.org"
source: hosted
version: "2.9.0"
boolean_selector:
dependency: transitive
description:
name: boolean_selector
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0"
build:
dependency: transitive
description:
name: build
url: "https://pub.dartlang.org"
source: hosted
version: "2.3.1"
build_config:
dependency: transitive
description:
name: build_config
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.1"
build_daemon:
dependency: transitive
description:
name: build_daemon
url: "https://pub.dartlang.org"
source: hosted
version: "3.1.1"
build_resolvers:
dependency: transitive
description:
name: build_resolvers
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0"
build_runner:
dependency: "direct dev"
description:
name: build_runner
url: "https://pub.dartlang.org"
source: hosted
version: "2.3.3"
build_runner_core:
dependency: transitive
description:
name: build_runner_core
url: "https://pub.dartlang.org"
source: hosted
version: "7.2.7"
built_collection:
dependency: transitive
description:
name: built_collection
url: "https://pub.dartlang.org"
source: hosted
version: "5.1.1"
built_value:
dependency: transitive
description:
name: built_value
url: "https://pub.dartlang.org"
source: hosted
version: "8.6.1"
characters:
dependency: transitive
description:
name: characters
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.1"
checked_yaml:
dependency: transitive
description:
name: checked_yaml
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.2"
cli_util:
dependency: transitive
description:
name: cli_util
url: "https://pub.dartlang.org"
source: hosted
version: "0.3.5"
clock:
dependency: transitive
description:
name: clock
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.1"
code_builder:
dependency: transitive
description:
name: code_builder
url: "https://pub.dartlang.org"
source: hosted
version: "4.4.0"
collection:
dependency: transitive
description:
name: collection
url: "https://pub.dartlang.org"
source: hosted
version: "1.16.0"
convert:
dependency: transitive
description:
name: convert
url: "https://pub.dartlang.org"
source: hosted
version: "3.1.1"
crypto:
dependency: transitive
description:
name: crypto
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.2"
cupertino_icons:
dependency: "direct main"
description:
name: cupertino_icons
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.5"
dart_style:
dependency: transitive
description:
name: dart_style
url: "https://pub.dartlang.org"
source: hosted
version: "2.2.5"
fake_async:
dependency: transitive
description:
name: fake_async
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.1"
ffi:
dependency: "direct main"
description:
name: ffi
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.2"
ffigen:
dependency: "direct dev"
description:
name: ffigen
url: "https://pub.dartlang.org"
source: hosted
version: "7.2.7"
file:
dependency: transitive
description:
name: file
url: "https://pub.dartlang.org"
source: hosted
version: "6.1.4"
fixnum:
dependency: transitive
description:
name: fixnum
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.1"
flutter:
dependency: "direct main"
description: flutter
source: sdk
version: "0.0.0"
flutter_lints:
dependency: "direct dev"
description:
name: flutter_lints
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.1"
flutter_localizations:
dependency: "direct main"
description: flutter
source: sdk
version: "0.0.0"
flutter_test:
dependency: "direct dev"
description: flutter
source: sdk
version: "0.0.0"
frontend_server_client:
dependency: transitive
description:
name: frontend_server_client
url: "https://pub.dartlang.org"
source: hosted
version: "3.2.0"
get_it:
dependency: "direct main"
description:
name: get_it
url: "https://pub.dartlang.org"
source: hosted
version: "7.6.0"
glob:
dependency: transitive
description:
name: glob
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.1"
google_fonts:
dependency: "direct main"
description:
name: google_fonts
url: "https://pub.dartlang.org"
source: hosted
version: "4.0.4"
graphs:
dependency: transitive
description:
name: graphs
url: "https://pub.dartlang.org"
source: hosted
version: "2.3.1"
http:
dependency: transitive
description:
name: http
url: "https://pub.dartlang.org"
source: hosted
version: "0.13.5"
http_multi_server:
dependency: transitive
description:
name: http_multi_server
url: "https://pub.dartlang.org"
source: hosted
version: "3.2.1"
http_parser:
dependency: transitive
description:
name: http_parser
url: "https://pub.dartlang.org"
source: hosted
version: "4.0.2"
intl:
dependency: "direct main"
description:
name: intl
url: "https://pub.dartlang.org"
source: hosted
version: "0.17.0"
io:
dependency: transitive
description:
name: io
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.4"
js:
dependency: transitive
description:
name: js
url: "https://pub.dartlang.org"
source: hosted
version: "0.6.5"
json_annotation:
dependency: "direct main"
description:
name: json_annotation
url: "https://pub.dartlang.org"
source: hosted
version: "4.8.0"
json_serializable:
dependency: "direct dev"
description:
name: json_serializable
url: "https://pub.dartlang.org"
source: hosted
version: "6.6.1"
lints:
dependency: transitive
description:
name: lints
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.1"
logging:
dependency: transitive
description:
name: logging
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.1"
matcher:
dependency: transitive
description:
name: matcher
url: "https://pub.dartlang.org"
source: hosted
version: "0.12.12"
material_color_utilities:
dependency: transitive
description:
name: material_color_utilities
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.5"
meta:
dependency: transitive
description:
name: meta
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.0"
mime:
dependency: transitive
description:
name: mime
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.4"
package_config:
dependency: transitive
description:
name: package_config
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0"
path:
dependency: transitive
description:
name: path
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.2"
path_provider:
dependency: transitive
description:
name: path_provider
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.15"
path_provider_android:
dependency: transitive
description:
name: path_provider_android
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.27"
path_provider_foundation:
dependency: transitive
description:
name: path_provider_foundation
url: "https://pub.dartlang.org"
source: hosted
version: "2.2.3"
path_provider_linux:
dependency: transitive
description:
name: path_provider_linux
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.11"
path_provider_platform_interface:
dependency: transitive
description:
name: path_provider_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.6"
path_provider_windows:
dependency: transitive
description:
name: path_provider_windows
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.7"
platform:
dependency: transitive
description:
name: platform
url: "https://pub.dartlang.org"
source: hosted
version: "3.1.0"
plugin_platform_interface:
dependency: transitive
description:
name: plugin_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.4"
pool:
dependency: transitive
description:
name: pool
url: "https://pub.dartlang.org"
source: hosted
version: "1.5.1"
process:
dependency: transitive
description:
name: process
url: "https://pub.dartlang.org"
source: hosted
version: "4.2.4"
pub_semver:
dependency: transitive
description:
name: pub_semver
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.4"
pubspec_parse:
dependency: transitive
description:
name: pubspec_parse
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.3"
quiver:
dependency: transitive
description:
name: quiver
url: "https://pub.dartlang.org"
source: hosted
version: "3.2.1"
scoped_model:
dependency: "direct main"
description:
name: scoped_model
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0"
shelf:
dependency: transitive
description:
name: shelf
url: "https://pub.dartlang.org"
source: hosted
version: "1.4.1"
shelf_web_socket:
dependency: transitive
description:
name: shelf_web_socket
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.4"
sky_engine:
dependency: transitive
description: flutter
source: sdk
version: "0.0.99"
source_gen:
dependency: transitive
description:
name: source_gen
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.2"
source_helper:
dependency: transitive
description:
name: source_helper
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.3"
source_span:
dependency: transitive
description:
name: source_span
url: "https://pub.dartlang.org"
source: hosted
version: "1.9.0"
stack_trace:
dependency: transitive
description:
name: stack_trace
url: "https://pub.dartlang.org"
source: hosted
version: "1.10.0"
stream_channel:
dependency: transitive
description:
name: stream_channel
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0"
stream_transform:
dependency: transitive
description:
name: stream_transform
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0"
string_scanner:
dependency: transitive
description:
name: string_scanner
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.1"
term_glyph:
dependency: transitive
description:
name: term_glyph
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.1"
test_api:
dependency: transitive
description:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.4.12"
timing:
dependency: transitive
description:
name: timing
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.1"
typed_data:
dependency: transitive
description:
name: typed_data
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.2"
vector_math:
dependency: transitive
description:
name: vector_math
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.2"
watcher:
dependency: transitive
description:
name: watcher
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.2"
web_socket_channel:
dependency: transitive
description:
name: web_socket_channel
url: "https://pub.dartlang.org"
source: hosted
version: "2.4.0"
win32:
dependency: transitive
description:
name: win32
url: "https://pub.dartlang.org"
source: hosted
version: "4.1.4"
xdg_directories:
dependency: transitive
description:
name: xdg_directories
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.0"
yaml:
dependency: transitive
description:
name: yaml
url: "https://pub.dartlang.org"
source: hosted
version: "3.1.1"
yaml_edit:
dependency: transitive
description:
name: yaml_edit
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0"
sdks:
dart: ">=2.18.6 <3.0.0"
flutter: ">=3.3.0"

45
example/pubspec.yaml

@ -0,0 +1,45 @@
name: flutter_example_packages
description: An application demonstrating the operation of Flutter plugins on the Aurora OS.
publish_to: "none"
version: 1.0.0+1
environment:
sdk: ">=2.18.6 <3.0.0"
dependencies:
flutter:
sdk: flutter
flutter_localizations:
sdk: flutter
####################################
## Platform dependent plugins Aurora OS
####################################
## Package verified
cupertino_icons: ^1.0.2
google_fonts: ^4.0.3
scoped_model: ^2.0.0
get_it: ^7.2.0
json_annotation: ^4.8.0
ffi: ^2.0.2
intl: ^0.17.0
dev_dependencies:
flutter_test:
sdk:
flutter
####################################
## Package verified
flutter_lints: ^2.0.0
build_runner: ^2.3.3
json_serializable: ^6.6.1
ffigen: ^7.2.7
flutter:
generate: true
uses-material-design: true
assets:
- assets/
- assets/images/

94
example/run.sh

@ -0,0 +1,94 @@
#!/bin/bash
# Copyright (c) 2023. Open Mobile Platform LLC.
# License: Proprietary.
## Build example, sign rpm, upload/install/run rpm to device
## Usage
##
## chmod +x ./run.sh
##
## ./run.sh \
## -d <ip>:<password> \
## -s /home/user/sign/folder
## Flutter path
FLUTTER="$HOME/.local/opt/flutter-sdk/bin/flutter"
## https://developer.auroraos.ru/doc/software_development/psdk/setup
## Install Platform SDK path
## You may not have set the PSDK_DIR environment variable.
## export PSDK_DIR=$HOME/AuroraPlatformSDK/sdks/aurora_psdk
while getopts d:s: flag; do
case "${flag}" in
d) device=${OPTARG} ;;
s) sign=${OPTARG} ;;
*)
echo "usage: $0 [-d] [-s]" >&2
exit 1
;;
esac
done
## Update dependency
$FLUTTER pub get
## Generate internationalizing
$FLUTTER gen-l10n
## Run ffigen
# $FLUTTER pub run ffigen
## Build aurora example app
{
$FLUTTER build aurora --release
} || {
exit 1;
}
if [ -n "$sign" ]; then
key=$(ls "$sign"/*key.pem)
if [ -z "$key" ]; then
echo "Key *key.pem not found."
exit
fi
cert=$(ls "$sign"/*cert.pem)
if [ -z "$cert" ]; then
echo "Key *cert.pem not found."
exit
fi
## Sign rpm system key
"$PSDK_DIR"/sdk-chroot rpmsign-external sign \
--key "$key" \
--cert "$cert" \
build/aurora/arm/release/RPMS/*.rpm
fi
if [ -n "$device" ]; then
PACKAGE="ru.auroraos.flutter_example_packages"
IFS=':' read -ra ADDR <<< "$device"
D_IP="${ADDR[0]}"
D_PASS="${ADDR[1]}"
# shellcheck disable=SC2012
rpm=$(ls "$PWD"/build/aurora/arm/release/RPMS/*.rpm | sort -r | head -n 1)
# upload rpm
scp "$rpm" defaultuser@"$D_IP:/home/defaultuser/Downloads"
# install rpm
ssh -t defaultuser@"$D_IP" "echo $D_PASS | devel-su pkcon -y install-local /home/defaultuser/Downloads/$PACKAGE*.rpm"
# run application
ssh -t defaultuser@"$D_IP" "/usr/bin/$PACKAGE"
fi

BIN
example/web/favicon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 917 B

BIN
example/web/icons/Icon-192.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

BIN
example/web/icons/Icon-512.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

BIN
example/web/icons/Icon-maskable-192.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

BIN
example/web/icons/Icon-maskable-512.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

58
example/web/index.html

@ -0,0 +1,58 @@
<!DOCTYPE html>
<html>
<head>
<!--
If you are serving your web app in a path other than the root, change the
href value below to reflect the base path you are serving from.
The path provided below has to start and end with a slash "/" in order for
it to work correctly.
For more details:
* https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base
This is a placeholder for base href that will be replaced by the value of
the `--base-href` argument provided to `flutter build`.
-->
<base href="$FLUTTER_BASE_HREF">
<meta charset="UTF-8">
<meta content="IE=Edge" http-equiv="X-UA-Compatible">
<meta name="description" content="A new Flutter project.">
<!-- iOS meta tags & icons -->
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-mobile-web-app-title" content="flutter_example_packages">
<link rel="apple-touch-icon" href="icons/Icon-192.png">
<!-- Favicon -->
<link rel="icon" type="image/png" href="favicon.png"/>
<title>flutter_example_packages</title>
<link rel="manifest" href="manifest.json">
<script>
// The value below is injected by flutter build, do not touch.
var serviceWorkerVersion = null;
</script>
<!-- This script adds the flutter initialization JS code -->
<script src="flutter.js" defer></script>
</head>
<body>
<script>
window.addEventListener('load', function(ev) {
// Download main.dart.js
_flutter.loader.loadEntrypoint({
serviceWorker: {
serviceWorkerVersion: serviceWorkerVersion,
}
}).then(function(engineInitializer) {
return engineInitializer.initializeEngine();
}).then(function(appRunner) {
return appRunner.runApp();
});
});
</script>
</body>
</html>

35
example/web/manifest.json

@ -0,0 +1,35 @@
{
"name": "flutter_example_packages",
"short_name": "flutter_example_packages",
"start_url": ".",
"display": "standalone",
"background_color": "#0175C2",
"theme_color": "#0175C2",
"description": "A new Flutter project.",
"orientation": "portrait-primary",
"prefer_related_applications": false,
"icons": [
{
"src": "icons/Icon-192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "icons/Icon-512.png",
"sizes": "512x512",
"type": "image/png"
},
{
"src": "icons/Icon-maskable-192.png",
"sizes": "192x192",
"type": "image/png",
"purpose": "maskable"
},
{
"src": "icons/Icon-maskable-512.png",
"sizes": "512x512",
"type": "image/png",
"purpose": "maskable"
}
]
}
Loading…
Cancel
Save