Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
4b178b6
cloning animation keys to reduce heap memory
gauchoj Aug 1, 2024
6e4f512
added some peformance improvements
gauchoj Aug 1, 2024
ca96c71
switch benchmark
gauchoj Aug 1, 2024
a857142
implementing club
gauchoj Aug 2, 2024
0434025
implementing world edit
gauchoj Aug 13, 2024
da72b6f
updated dependencies
gauchoj Sep 11, 2024
7b325c7
preparing overlay view to add pause, interval and post match
gauchoj Sep 17, 2024
41ab780
preparing for sync
gauchoj Oct 24, 2024
e2cdb71
Merge branch 'master' into master
gauchoj Oct 24, 2024
0804e51
after merge
gauchoj Oct 24, 2024
45ba276
Update .gitignore
gauchoj Dec 6, 2024
89a24c7
fixed problem with release-mode asset pre loading
gauchoj Dec 12, 2024
8de21eb
reviewing crashlytics
gauchoj Jan 11, 2025
6f992b4
Merge remote-tracking branch 'upstream/master'
gauchoj Jan 28, 2025
bb9d340
looking for performance opportunities in rive-flutter
gauchoj Jan 28, 2025
71eed6a
performance tweaks
gauchoj Jan 28, 2025
c991c0c
using HashSet, HashMap, moving from forEach to loops and avoiding unn…
gauchoj Jan 29, 2025
91997e2
fixed introduced bug (rive-flutter recover routine)
gauchoj Jan 29, 2025
482b70d
tweaking
gauchoj Feb 14, 2025
1b982b7
tweaking
gauchoj Feb 14, 2025
9b9519d
fixing ios startup
gauchoj Feb 14, 2025
e73022d
tweaking rive-flutter
gauchoj Feb 15, 2025
c8c2307
unique list
gauchoj Feb 15, 2025
74c0499
fixed UniqueList & removed KeyPropertyBase.propertyKeyChanged
gauchoj Feb 15, 2025
718f0a3
rive_core_context refactor (start)
gauchoj Feb 15, 2025
3a3bae5
rive_core_context refactor (2b continued)
gauchoj Feb 15, 2025
42e46ec
rive_core_context refactor done
gauchoj Feb 15, 2025
49463da
finding animation loop problem
gauchoj Feb 16, 2025
80540a4
small optimizations
gauchoj Feb 16, 2025
f902d0c
testing commit
gauchoj Feb 16, 2025
ee7cc74
detailed dump for iteration infinite loop
gauchoj Feb 17, 2025
1f4f7c7
logging infinite loop in the animation
gauchoj Feb 18, 2025
8f1db63
small edits
gauchoj Feb 18, 2025
1ddbedc
refactored match controllers lifecycle
gauchoj Feb 19, 2025
b0213b9
memory tuning & tweaking
gauchoj Feb 24, 2025
5bbd274
using a Core.id to store two int values
gauchoj Feb 25, 2025
cda2092
moving coreTypes to static initialization
gauchoj Feb 25, 2025
ca93e6b
testing match animations
gauchoj Feb 26, 2025
10843fb
implemented dynamic closestFrame exactsSecondsTolerance & optimizatio…
gauchoj Mar 5, 2025
01efd79
removing specific rive animations from interpolation interval
gauchoj Mar 6, 2025
c0b6236
UI optimization and setting player icons @ pre match
gauchoj Mar 6, 2025
037489b
for each -> for i
gauchoj Mar 6, 2025
b578f3e
cpu tweaks
gauchoj Mar 6, 2025
f7828ca
implementing rive_core_beans specific classes
gauchoj Mar 7, 2025
e82c265
all rive_core_beans migrated to specific implementation
gauchoj Mar 7, 2025
e7be7a4
investigating badge render problem
gauchoj Mar 8, 2025
6a1e6be
removing MoneySource from Dart export
gauchoj Mar 19, 2025
84696c7
preparing google play submission
gauchoj Mar 19, 2025
291e806
chore: git ref stokanal
devkaio Mar 27, 2025
bf65d38
Merge pull request #1 from kaypora-games/build/pubspec-setup
gauchoj Mar 28, 2025
e5781f6
_tooManyIterationsCollected set
gauchoj Mar 28, 2025
5489d17
Merge branch 'master' of https://github.com/kaypora-games/rive-flutter
gauchoj Mar 28, 2025
22f443f
stokanal can be imported from path
gauchoj Mar 28, 2025
c600982
running views after refactor
gauchoj Oct 9, 2025
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
16 changes: 16 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,19 @@ shared_lib/dependencies
shared_lib/bin
*.make
Makefile

# https://dart.dev/guides/libraries/private-files

.dart_tool/
build/

doc/api/

# IntelliJ
*.iml
*.ipr
*.iws
.idea/

# Mac
.DS_Store
6 changes: 4 additions & 2 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
analyzer:
errors:
unused_import: error
prefer_is_empty: ignore
exclude:
- ios
- macos
Expand Down Expand Up @@ -51,7 +52,8 @@ linter:
- join_return_with_assignment
- library_names
- library_prefixes
- lines_longer_than_80_chars
# STOKANAL-FORK-EDIT
# - lines_longer_than_80_chars
# - literal_only_boolean_expressions # too many false positives: https://github.com/dart-lang/sdk/issues/34181
- no_adjacent_strings_in_list
- no_duplicate_case_values
Expand All @@ -76,7 +78,7 @@ linter:
- prefer_contains
- prefer_final_fields
- prefer_final_in_for_each
- prefer_foreach
# - prefer_foreach
- prefer_function_declarations_over_variables
- prefer_initializing_formals
- prefer_is_empty
Expand Down
3 changes: 3 additions & 0 deletions devtools_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
description: This file stores settings for Dart & Flutter DevTools.
documentation: https://docs.flutter.dev/tools/devtools/extensions#configure-extension-enablement-states
extensions:
3 changes: 3 additions & 0 deletions example/devtools_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
description: This file stores settings for Dart & Flutter DevTools.
documentation: https://docs.flutter.dev/tools/devtools/extensions#configure-extension-enablement-states
extensions:
36 changes: 36 additions & 0 deletions example/macos/Flutter/GeneratedPluginRegistrant.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
//
// Generated file. Do not edit.
//

import FlutterMacOS
import Foundation

import audio_session
import connectivity_plus
import device_info_plus
import flutter_udid
import in_app_purchase_storekit
import in_app_review
import just_audio
import package_info_plus
import path_provider_foundation
import rive_common
import shared_preferences_foundation
import url_launcher_macos
import wakelock_plus

func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
AudioSessionPlugin.register(with: registry.registrar(forPlugin: "AudioSessionPlugin"))
ConnectivityPlusPlugin.register(with: registry.registrar(forPlugin: "ConnectivityPlusPlugin"))
DeviceInfoPlusMacosPlugin.register(with: registry.registrar(forPlugin: "DeviceInfoPlusMacosPlugin"))
FlutterUdidPlugin.register(with: registry.registrar(forPlugin: "FlutterUdidPlugin"))
InAppPurchasePlugin.register(with: registry.registrar(forPlugin: "InAppPurchasePlugin"))
InAppReviewPlugin.register(with: registry.registrar(forPlugin: "InAppReviewPlugin"))
JustAudioPlugin.register(with: registry.registrar(forPlugin: "JustAudioPlugin"))
FPPPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FPPPackageInfoPlusPlugin"))
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
RivePlugin.register(with: registry.registrar(forPlugin: "RivePlugin"))
SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))
UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin"))
WakelockPlusMacosPlugin.register(with: registry.registrar(forPlugin: "WakelockPlusMacosPlugin"))
}
23 changes: 23 additions & 0 deletions example/windows/flutter/generated_plugin_registrant.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
//
// Generated file. Do not edit.
//

// clang-format off

#include "generated_plugin_registrant.h"

#include <connectivity_plus/connectivity_plus_windows_plugin.h>
#include <flutter_udid/flutter_udid_plugin_c_api.h>
#include <rive_common/rive_plugin.h>
#include <url_launcher_windows/url_launcher_windows.h>

void RegisterPlugins(flutter::PluginRegistry* registry) {
ConnectivityPlusWindowsPluginRegisterWithRegistrar(
registry->GetRegistrarForPlugin("ConnectivityPlusWindowsPlugin"));
FlutterUdidPluginCApiRegisterWithRegistrar(
registry->GetRegistrarForPlugin("FlutterUdidPluginCApi"));
RivePluginRegisterWithRegistrar(
registry->GetRegistrarForPlugin("RivePlugin"));
UrlLauncherWindowsRegisterWithRegistrar(
registry->GetRegistrarForPlugin("UrlLauncherWindows"));
}
15 changes: 15 additions & 0 deletions example/windows/flutter/generated_plugin_registrant.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//
// Generated file. Do not edit.
//

// clang-format off

#ifndef GENERATED_PLUGIN_REGISTRANT_
#define GENERATED_PLUGIN_REGISTRANT_

#include <flutter/plugin_registry.h>

// Registers Flutter plugins.
void RegisterPlugins(flutter::PluginRegistry* registry);

#endif // GENERATED_PLUGIN_REGISTRANT_
27 changes: 27 additions & 0 deletions example/windows/flutter/generated_plugins.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#
# Generated file, do not edit.
#

list(APPEND FLUTTER_PLUGIN_LIST
connectivity_plus
flutter_udid
rive_common
url_launcher_windows
)

list(APPEND FLUTTER_FFI_PLUGIN_LIST
)

set(PLUGIN_BUNDLED_LIBRARIES)

foreach(plugin ${FLUTTER_PLUGIN_LIST})
add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin})
target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin)
list(APPEND PLUGIN_BUNDLED_LIBRARIES $<TARGET_FILE:${plugin}_plugin>)
list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries})
endforeach(plugin)

foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST})
add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin})
list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries})
endforeach(ffi_plugin)
14 changes: 9 additions & 5 deletions lib/src/controllers/linear_animation_controller.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import 'package:rive/src/core/core.dart';
import 'package:rive/src/generated/rive_core_beans.dart';
import 'package:rive/src/rive_core/animation/keyed_object.dart';
import 'package:rive/src/rive_core/animation/linear_animation_instance.dart'
as core;
import 'package:rive/src/rive_core/event.dart';
import 'package:rive/src/runtime_mounted_artboard.dart';

export 'package:rive/src/runtime_mounted_artboard.dart';

/// An AnimationController which controls a StateMachine and provides access to
Expand All @@ -27,19 +29,21 @@ class LinearAnimationInstance extends core.LinearAnimationInstance

@override
void reportEvent(Event event) {
_runtimeEventListeners.toList().forEach((callback) {
callback(event);
});
for (final t in _runtimeEventListeners) {
t(event);
}
// _runtimeEventListeners.toList().forEach((callback) {
// callback(event);
// });
}

@override
void reportKeyedCallback(
int objectId, int propertyKey, double elapsedSeconds) {
var coreObject = context?.resolve(objectId);
if (coreObject != null) {
RiveCoreContext.setCallback(
PropertyBeans.get(propertyKey).setCallback(
coreObject,
propertyKey,
CallbackData(this, delay: elapsedSeconds),
);
}
Expand Down
37 changes: 26 additions & 11 deletions lib/src/controllers/state_machine_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import 'package:rive/src/rive_core/animation/state_machine_trigger.dart';
import 'package:rive/src/rive_core/artboard.dart';
import 'package:rive/src/rive_core/state_machine_controller.dart' as core;
import 'package:rive/src/runtime_mounted_artboard.dart';

export 'package:rive/src/runtime_mounted_artboard.dart';

/// [StateMachine]s supports three input types. The StateMachine mostly
Expand Down Expand Up @@ -114,10 +115,13 @@ class SMITrigger extends SMIInput<bool> {
/// the inputs of the StateMachine.
class StateMachineController extends core.StateMachineController
with RuntimeEventReporter {
final List<SMIInput> _inputs = <SMIInput>[];

/// A list of inputs available in the StateMachine.
Iterable<SMIInput> get inputs => _inputs;
@nonVirtual
final List<SMIInput> inputs = <SMIInput>[];

// /// A list of inputs available in the StateMachine.
// Iterable<SMIInput> get inputs => _inputs;

final _runtimeEventListeners = <OnRuntimeEvent>{};

Expand All @@ -130,13 +134,13 @@ class StateMachineController extends core.StateMachineController
for (final input in stateMachine.inputs) {
switch (input.coreType) {
case StateMachineNumberBase.typeKey:
_inputs.add(SMINumber._(input as StateMachineNumber, this));
inputs.add(SMINumber._(input as StateMachineNumber, this));
break;
case StateMachineBoolBase.typeKey:
_inputs.add(SMIBool._(input as StateMachineBool, this));
inputs.add(SMIBool._(input as StateMachineBool, this));
break;
case StateMachineTriggerBase.typeKey:
_inputs.add(SMITrigger._(input as StateMachineTrigger, this));
inputs.add(SMITrigger._(input as StateMachineTrigger, this));
break;
}
}
Expand Down Expand Up @@ -168,7 +172,7 @@ class StateMachineController extends core.StateMachineController
/// For easier to use methods, see [getBoolInput], [getTriggerInput],
/// [getNumberInput].
SMIInput<T>? findInput<T>(String name) {
for (final input in _inputs) {
for (final input in inputs) {
if (input._is<T>() && input.name == name) {
return input as SMIInput<T>;
}
Expand All @@ -181,7 +185,7 @@ class StateMachineController extends core.StateMachineController
/// For easier to use methods, see [getBoolInput], [getTriggerInput],
/// [getNumberInput].
T? findSMI<T>(String name) {
for (final input in _inputs) {
for (final input in inputs) {
if (input is T && input.name == name) {
return input as T;
}
Expand Down Expand Up @@ -209,8 +213,11 @@ class StateMachineController extends core.StateMachineController

@override
void advanceInputs() {
for (final input in _inputs) {
input.advance();
final t = inputs.length;
for (var i = 0; i < t; i++) {
// for (final input in _inputs) {
inputs[i].advance();
// input.advance();
}
}

Expand All @@ -224,8 +231,16 @@ class StateMachineController extends core.StateMachineController

@override
void applyEvents() {
var events = reportedEvents.toList(growable: false);
super.applyEvents();
_runtimeEventListeners.toList().forEach(events.forEach);

for (final event in _runtimeEventListeners) {
// reportedEvents.forEach(event);

var list = reportedEvents;
var t = list.length;
for (var i = 0; i < t; i++) {
event(list[i]);
}
}
}
}
Loading