Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some elements are not displayed on iOS and Android #454

Open
yukimatsus opened this issue Feb 12, 2025 · 0 comments
Open

Some elements are not displayed on iOS and Android #454

yukimatsus opened this issue Feb 12, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@yukimatsus
Copy link

yukimatsus commented Feb 12, 2025

Description

The following elements in "main" artboard are not displayed on iOS and Android.

  • The sub artboard "icon-econ"
  • The sub artboard "icon-igt"

In rive editor:
Image

Screen recording:

Image

Steps To Reproduce

Steps to reproduce the behavior:

  1. Run the following code.
  2. 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

riv_and_rev.zip

Expected behavior

The sub artboard "icon-econ" and "icon-igt" are displayed as the following gif in Rive Preview(rive.rip).

In preview:

Image

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.

@yukimatsus yukimatsus added the bug Something isn't working label Feb 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant