Flutter issues

Hello again
I send a private ticket this morning refering to my previous post here which was not fully solved, but I was instructed now to open again a post here..


Anyway here is the same thing I send you privately the morning , and will send also again now..


Hello .

Sorry to bother again, but still having issues with this one.

We managed to solve the scaling issue, but now the clients dev tell me the animation dont really work.
to quote him exactly: "interactivity sometimes working sometimes not working, its very random and most of time not working. I see its working status completely by luck."


I attach a video he send me, as well the .riv and .rev files for you to try to replicate the issue. Here is also the sharing link that works as it should , both dragging and tap to change the slider.:
https://rive.app/s/nM36MeX6HE_WRmy5ubQTAQ/?runtime=rive-renderer

Also here is the code the dev used to implement the .riv to flutter:

Hi Jannis, here is the our utilized AppRive class which handles common stuff:
dart
import 'package:flutter/material.dart';
import 'package:rive/rive.dart';
/// Minimal Rive wrapper to reproduce data binding issues without
/// any project-specific dependencies.
class AppRive extends StatefulWidget {
final String assetPath;
final void Function(AppRiveController controller)? onLoaded;
final Fit fit;
final Alignment alignment;
final double? width;
final double? height;
const AppRive({
super.key,
required this.assetPath,
this.onLoaded,
this.fit = Fit.contain,
this.alignment = Alignment.center,
this.width,
this.height,
});
@override
State createState() => AppRiveState();
}
class AppRiveState extends State {
late final FileLoader fileLoader;
AppRiveController? controller;
@override
void initState() {
super.initState();
_fileLoader = FileLoader.fromAsset(
widget.assetPath,
riveFactory: Factory.rive,
);
}
@override
void dispose() {
try {
_controller?.dispose();
} catch (_) {}
_fileLoader.dispose();
super.dispose();
}
void onLoaded(RiveLoaded state) {
controller = AppRiveController(state.controller);
widget.onLoaded?.call(_controller!);
setState(() {});
}
@override
Widget build(BuildContext context) {
final content = RiveWidgetBuilder(
fileLoader: fileLoader,
onLoaded: onLoaded,
builder:
(context, state) => switch (state) {
RiveLoading() => const Center(child: CircularProgressIndicator()),
RiveFailed() => const Center(
child: Text('Failed to load animation'),
),
RiveLoaded() => RiveWidget(
controller: state.controller,
fit: widget.fit,
alignment: widget.alignment,
),
},
);
if (widget.width != null || widget.height != null) {
return SizedBox(
width: widget.width,
height: widget.height,
child: content,
);
}
return content;
}
}
/// Minimal controller exposing only essential, typed data-binding access.
class AppRiveController {
final RiveWidgetController controller;
late final ViewModelInstance vm;
AppRiveController(this._controller) {
// Bind the view model automatically to reproduce data-binding behavior.
vm = controller.dataBind(DataBind.auto());
}
// Access to the bound view model in case deeper inspection is needed.
ViewModelInstance get vm => vm;
void dispose() {
try {
vm.dispose();
} catch (_) {}
try {
_controller.dispose();
} catch (_) {}
}
// Minimal, strongly-typed helpers commonly used in repros.
ViewModelInstanceBoolean boolean(String path) =>
require(path, vm.boolean(path), DataType.boolean);
ViewModelInstanceNumber number(String path) =>
require(path, vm.number(path), DataType.number);
ViewModelInstanceTrigger trigger(String path) =>
require(path, vm.trigger(path), DataType.trigger);
void fire(String path) => trigger(path).trigger();
T require(String name, T? value, DataType expected) {
if (value != null) return value;
// Throw a concise error that includes available properties for easier repros.
final available = vm.properties
.map((p) => '${p.name}:${p.type}')
.join(', ');
throw FlutterError(
'Property "$name" not found as $expected. Available: [$available]',
);
}
}

App uses rive: ^0.14.0-dev.5


Finally here is the link to the original post in the forum:
https://community.rive.app/c/support/flutter-scaling-issue

Please have a look at it and let me know if this is some sort of bug with Flutter or if there is something either the dev or me has been doing wrong.

Thanks!



­