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

Layout background not rendered #443

Open
apalala-dev opened this issue Dec 17, 2024 · 1 comment
Open

Layout background not rendered #443

apalala-dev opened this issue Dec 17, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@apalala-dev
Copy link

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

text_background.zip

Expected behavior

The Layout's background should be visible as on the Rive editor:
image

Screenshots

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

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 🙏

@apalala-dev apalala-dev added the bug Something isn't working label Dec 17, 2024
@HayesGordon
Copy link
Contributor

Layout is not yet supported on the Flutter runtime, this is part of a bigger rewrite for the Flutter runtime.

You can see this document for a list of runtime supported features: https://rive.app/community/doc/feature-support/dockjX9x72UM

The base for the new package is published as a dev release: https://pub.dev/packages/rive_native

The new Flutter runtime should be fully up to date early 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

2 participants