Skip to content

bug: Example of locally hosted Lottie file doesnt work #6386

@Snak3Doc

Description

@Snak3Doc

Duplicate Check

Describe the bug

The example for locally hosted Lottie files produces this error Error loading Lottie: Unable to load asset:, the web-hosted one works fine.

It's not a malformed Lottie JSON, as I've tried with verified working Lottie files and get the same error.

Code sample

Code
import flet as ft
import flet_lottie as ftl


def main(page: ft.Page):
    page.add(
        ft.SafeArea(
            content=ft.Column(
                controls=[
                    ftl.Lottie(
                        src="https://raw.githubusercontent.com/xvrh/lottie-flutter/master/example/assets/Mobilo/A.json",
                        reverse=False,
                        animate=True,
                        error_content=ft.Placeholder(ft.Text("Error loading Lottie")),
                        on_error=lambda e: print(f"Error loading Lottie: {e.data}"),
                    ),
                    ftl.Lottie(
                        src="sample.json",
                        reverse=False,
                        animate=True,
                        enable_merge_paths=True,
                        enable_layers_opacity=True,
                        error_content=ft.Placeholder(ft.Text("Error loading Lottie")),
                        on_error=lambda e: print(f"Error loading Lottie: {e.data}"),

                    ),
                ],
            ),
        )
    )


if __name__ == "__main__":
    ft.run(main)

To reproduce

  1. Copy the example python code from GitHub.
  2. Copy the sample.json from GitHub.
  3. flet run

Expected behavior

No response

Screenshots / Videos

Captures

[Upload media here]

Operating System

Windows

Operating system details

10

Flet version

0.82.2

Regression

I'm not sure / I don't know

Suggestions

No response

Logs

Logs
[Paste your logs here]

Additional details

No response

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

👀 In review

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions