-
Notifications
You must be signed in to change notification settings - Fork 222
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Description
The following elements in "main" artboard are not displayed on iOS and Android.
- The sub artboard "icon-econ"
- The sub artboard "icon-igt"
Screen recording:
Steps To Reproduce
Steps to reproduce the behavior:
- Run the following code.
- As mentioned above, some elements aren't displayed.
code:
import 'package:flutter/cupertino.dart';
import 'package:flutter/services.dart';
import 'package:rive/rive.dart';
void main() {
runApp(CupertinoApp(home: MyHomePage()));
}
class MyHomePage extends StatefulWidget {
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
static const assetName = 'assets/currency-switcher_light-boolean.riv';
Artboard? artboard;
StateMachineController? controller;
SMIBool? boolInput;
@override
void initState() {
super.initState();
rootBundle.load(assetName).then((riveFileData) {
final artboard = RiveFile.import(riveFileData).mainArtboard;
final controller = StateMachineController.fromArtboard(artboard, 'State Machine')!;
artboard.addController(controller);
final boolInput = controller.findInput<bool>('check') as SMIBool;
setState(() {
this.artboard = artboard;
this.controller = controller;
this.boolInput = boolInput;
});
});
}
@override
Widget build(BuildContext context) {
return CupertinoPageScaffold(
navigationBar: const CupertinoNavigationBar(),
child: SafeArea(
child: Container(
color: const Color(0xFF000000),
alignment: Alignment.center,
child: GestureDetector(
onTap: () {
final boolInput = this.boolInput;
if (boolInput == null) return;
final oldValue = boolInput.value;
boolInput.value = !oldValue;
},
child: SizedBox(
width: 60,
height: 28,
child: artboard == null ? const SizedBox() : Rive(
fit: BoxFit.cover,
artboard: artboard!,
),
),
),
),
),
);
}
}
Source .riv/.rev file
Expected behavior
The sub artboard "icon-econ" and "icon-igt" are displayed as the following gif in Rive Preview(rive.rip).
In preview:
Device & Versions (please complete the following information)
- Device:
- iOS Simulator(iPhone 15)
- iPhone 3rd generation
- Galaxy A7
- OS:
- iOS 18.1
- iOS 18.1.1
- Android 10
- Flutter Version:
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.27.3, on macOS 14.6 23G80 darwin-arm64, locale ja-JP)
[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 15.4)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2024.1)
[✓] VS Code (version 1.97.0)
[✓] Connected device (5 available)
[✓] Network resources
// ...
dependencies:
flutter:
sdk: flutter
// ...
rive: ^0.13.20
// ...Thank you for reading.
devkaio
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working


