-
Notifications
You must be signed in to change notification settings - Fork 222
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Description
The fills and strokes of texts wrapped in Layout are not shown.
Steps To Reproduce
This is my sample class for the reproducible example :
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:rive/rive.dart';
class BackgroundLayoutTextTest extends StatefulWidget {
const BackgroundLayoutTextTest({super.key, required this.assetPath});
final String assetPath;
@override
State<BackgroundLayoutTextTest> createState() =>
_BackgroundLayoutTextTestState();
}
class _BackgroundLayoutTextTestState extends State<BackgroundLayoutTextTest> {
RiveFile? _riveData;
@override
void initState() {
super.initState();
_loadRiveAsset();
}
@override
Widget build(BuildContext context) {
if (_riveData == null) {
return Placeholder();
} else {
return RiveAnimation.direct(
_riveData!,
artboard: 'test',
alignment: Alignment.topCenter,
fit: BoxFit.fitWidth,
);
}
}
Future<void> _loadRiveAsset() async {
final data = await rootBundle.load(widget.assetPath);
_riveData = RiveFile.import(data);
setState(() {});
}
}Source .riv/.rev file
Expected behavior
The Layout's background should be visible as on the Rive editor:

Screenshots
Backgrounds are not visibles, the blue is the fill color of the artboard:

Device & Versions (please complete the following information)
- Device: Redmi 9C
- OS: Android 11
- Flutter Version: Copy-paste the output of
flutter --version
Flutter 3.24.3 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 2663184aa7 (3 months ago) • 2024-09-11 16:27:48 -0500
Engine • revision 36335019a8
Tools • Dart 3.5.3 • DevTools 2.37.3
Additional context
The attached rive files are just a reproducible example but the production animation is a bit more complex.
Any workaround appreciated 🙏
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working