Skip to content

Commit

Permalink
Moved flutter code to github. There is now an AudYoFlo flutter pack (…
Browse files Browse the repository at this point in the history
…ayf_pack), a native pack (ayf_pack_native), an ffi host (ayf_ffihost) and a web host (ayf_webhost). You will find an example application project in the ayfstarter sub project
  • Loading branch information
hkbinaurics committed May 16, 2024
1 parent 9f83dcf commit d434de9
Show file tree
Hide file tree
Showing 293 changed files with 30,166 additions and 0 deletions.
32 changes: 32 additions & 0 deletions flutter/ayf_ffihost/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# 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
# Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock.
/pubspec.lock
**/doc/api/
.dart_tool/
.packages
build/

pubspec.yaml
Empty file.
10 changes: 10 additions & 0 deletions flutter/ayf_ffihost/.metadata
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# 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 and should not be manually edited.

version:
revision: fb57da5f945d02ef4f98dfd9409a72b7cce74268
channel: stable

project_type: package
Empty file.
3 changes: 3 additions & 0 deletions flutter/ayf_ffihost/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## 0.0.1

* TODO: Describe initial release.
17 changes: 17 additions & 0 deletions flutter/ayf_ffihost/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
if(JVX_RELEASE_SDK)

# Produce the right entries in the ffigen code lines
set(FFIGEN_HOST_HEADER_PATH "${CMAKE_INSTALL_PREFIX}/${INSTALL_PATH_INCLUDE_STATIC}/jvx-flutter-native-static/include/flutter_native_api.h")
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/pubspec.yaml.in ${CMAKE_CURRENT_SOURCE_DIR}/pubspec.yaml @ONLY)

# Configure for all tests
set(AYFBINRENDER_HOSTCONF_DLL "${CMAKE_INSTALL_PREFIX}/${INSTALL_PATH_BIN}/ayfbinrender-native-config_import.dll")
set(AYFBINRENDER_FFI_DLL "${CMAKE_INSTALL_PREFIX}/${INSTALL_PATH_BIN}/jvx-flutter-native-shared_import.dll")
set(AYFBINRENDER_FFI_PRELOAD_DLLS "${CMAKE_INSTALL_PREFIX}/${INSTALL_PATH_BIN}/zlib.dll,${CMAKE_INSTALL_PREFIX}/${INSTALL_PATH_BIN}/libfftw3-3.dll")
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/example/.ayf_ffihost_example.env.in ${CMAKE_CURRENT_SOURCE_DIR}/example/.ayf_ffihost_example.env @ONLY)

set(AYF_FLUTTER_WORKDIR ${CMAKE_INSTALL_PREFIX}/${INSTALL_PATH_RUNTIME})
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/launch.json.in ${CMAKE_CURRENT_SOURCE_DIR}/.vscode/launch.json @ONLY)
else()
message("Entering folder for runtime build - nothing to be done here!")
endif()
1 change: 1 addition & 0 deletions flutter/ayf_ffihost/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
TODO: Add your license here.
39 changes: 39 additions & 0 deletions flutter/ayf_ffihost/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<!--
This README describes the package. If you publish this package to pub.dev,
this README's contents appear on the landing page for your package.
For information about how to write a good package README, see the guide for
[writing package pages](https://dart.dev/guides/libraries/writing-package-pages).
For general information about developing packages, see the Dart guide for
[creating packages](https://dart.dev/guides/libraries/create-library-packages)
and the Flutter guide for
[developing packages and plugins](https://flutter.dev/developing-packages).
-->

TODO: Put a short description of the package here that helps potential users
know whether this package might be useful for them.

## Features

TODO: List what your package can do. Maybe include images, gifs, or videos.

## Getting started

TODO: List prerequisites and provide or point to information on how to
start using the package.

## Usage

TODO: Include short and useful examples for package users. Add longer examples
to `/example` folder.

```dart
const like = 'sample';
```

## Additional information

TODO: Tell users more about the package: where to find more information, how to
contribute to the package, how to file issues, what response they can expect
from the package authors, and more.
4 changes: 4 additions & 0 deletions flutter/ayf_ffihost/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
include: package:flutter_lints/flutter.yaml

# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options
3 changes: 3 additions & 0 deletions flutter/ayf_ffihost/example/.ayf_ffihost_example.env.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
AYF_BACKEND_FFI_SHARED_LIBRARY = '@AYFBINRENDER_FFI_DLL@'
AYF_BACKEND_PRELOAD_LIBRARIES = '@AYFBINRENDER_FFI_PRELOAD_DLLS@';
AYF_BACKEND_EXECUTABLE_IN_BINFOLDER = "yes";
47 changes: 47 additions & 0 deletions flutter/ayf_ffihost/example/.gitignore
Original file line number Diff line number Diff line change
@@ -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/

# Web related
lib/generated_plugin_registrant.dart

# 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
69 changes: 69 additions & 0 deletions flutter/ayf_ffihost/example/lib/main.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
/*
https://medium.com/nonstopio/flutter-best-practices-c3db1c3cd694
*/

import 'package:ayfcorepack/ayfcorepack.dart';
import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart';
import 'package:provider/provider.dart';
import '/models/ayf_ui_specific_widgets.dart';
import 'models/ayf_be_specific.dart';
import 'package:ayf_pack/ayf_pack.dart';

import 'package:ayf_ffihost/ayf_ffihost.dart'
if (dart.library.html) 'package:ayf_webhost/ayf_webhost.dart';

// import 'package:flutter_native_splash/flutter_native_splash.dart';

// Commando arguments:
// https://github.com/flutter/flutter/issues/32986

// TO DO: ADD GLOBAL VARIABLES TO LINK FROM STATIC CALLS TO WHATEVER
// https://stackoverflow.com/questions/29182581/global-variables-in-dart

void main(List<String> arguments) {
/*
if (Platform.isWindows || Platform.isLinux || Platform.isMacOS) {
setWindowTitle('App title');
setWindowMinSize(const Size(700, 500));
setWindowMaxSize(Size.infinite);
}
*/

// What is this good for in native windows?? It seems that native splash image
// does not work on platform windows!
//
// https://www.youtube.com/watch?v=dB0dOnc2k10
// WidgetsBinding widgetsBinding = WidgetsFlutterBinding.ensureInitialized();
// FlutterNativeSplash.preserve(widgetsBinding: widgetsBinding);
//

// Initialize the platform specific part here
AudYoFloPlatformSpecific platformSpec = allocatePlatformSpecific();
Map<String, dynamic> configArgs = {};
configArgs['corePack'] = ayfcore;
configArgs['host'] = ayfhost;
configArgs['cmdArgs'] = arguments;
platformSpec.configureSubSystem(configArgs);

// ***************************************************
runApp(MultiProvider(
providers: [
ChangeNotifierProvider<AudYoFloPeriodicNotifier>(
create: (_) => AudYoFloPeriodicNotifier()),
ChangeNotifierProvider<AudYoFloBackendCache>(
create: (_) => AudYoFloBackendCacheSpecific()),
ChangeNotifierProvider<AudYoFloUiModel>(
create: (_) => AudYoFloUiModelSpecificWithWidget()),
ChangeNotifierProvider<AudYoFloDebugModel>(
create: (_) => AudYoFloDebugModel()),
/*ChangeNotifierProvider<FernliveCacheModel>(
create: (_) => FernliveCacheModel()),*/
],

// Here, we enter the main widget. We pass the backend adapter (here: ffi bridge)
// and the core pack which holds the Ayf components precompiled plugin
child: AudYoFloMainWidget(
platformSpecific: platformSpec,
)));
}
5 changes: 5 additions & 0 deletions flutter/ayf_ffihost/example/lib/models/ayf_be_specific.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import 'package:ayf_pack/ayf_pack.dart';

class AudYoFloBackendCacheSpecific extends AudYoFloBackendCache {
AudYoFloBackendCacheSpecific() : super() {}
}
Loading

0 comments on commit d434de9

Please sign in to comment.