jaumard / flare_splash_screen

Facilitator for having a Splash Screen with a Flare animation
MIT License
95 stars 20 forks source link

Black screen while displaying animation #8

Closed maxouille closed 5 years ago

maxouille commented 5 years ago

Hi,

Your plugin seems pretty cool but I can't make it work prperly. While the data is loading, the flare animation that I created is not displayed and I got a black screen with the "debug" banner. For info, my animation is working as I tried to display it with a FlareActor and it's working.

I've done like your example :

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'TestApp',
      home: SplashScreen.navigate(
        name: 'intro.flr',
        next: HomeScreen(),
        until: () => loadData(context),
        startAnimation: '1',
      ),
    );
  }
}

And put the anim.flr into assets and add it to the pubspec.yaml :

When my code is running, I got no error and the next screen is displayed after the data is loaded.

Here is my flutter doctor output:

[√] Flutter (Channel stable, v1.7.8+hotfix.4, on Microsoft Windows [version 10.0.17763.615], locale fr-FR) • Flutter version 1.7.8+hotfix.4 at C:\Users\Maxence\flutter • Framework revision 20e59316b8 (8 days ago), 2019-07-18 20:04:33 -0700 • Engine revision fee001c93f • Dart version 2.4.0

[√] Android toolchain - develop for Android devices (Android SDK version 28.0.3) • Android SDK at C:\Users\Maxence\AppData\Local\Android\sdk • Android NDK location not configured (optional; useful for native profiling support) • Platform android-28, build-tools 28.0.3 • Java binary at: C:\Program Files (x86)\Android\Android Studio\jre\bin\java • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01) • All Android licenses accepted.

[√] Android Studio (version 3.4) • Android Studio at C:\Program Files (x86)\Android\Android Studio • Flutter plugin version 37.1.1 • Dart plugin version 183.6270 • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)

Thanks for your help, I really want to make your plugin work :)

danielrf121 commented 5 years ago

Hi, try this:

import 'package:flare_splash_screen/flare_splash_screen.dart';
.
.
.
return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: SplashScreen(
        'assets/splash.flr',
        HomeView(),
        startAnimation: 'fail',
        backgroundColor: Color(0xff181818)
      )
    );
maxouille commented 5 years ago

Hi, try this:

import 'package:flare_splash_screen/flare_splash_screen.dart';
.
.
.
return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: SplashScreen(
        'assets/splash.flr',
        HomeView(),
        startAnimation: 'fail',
        backgroundColor: Color(0xff181818)
      )
    );

It's working thx, I thought Android and Flutter had a default background color ^^

I have another problem. When the method loadData() is running, it loads data from json to a database. This freezes the animation. Do you know why and how to solve this ?

Thx !

jaumard commented 5 years ago

If it freezes you have two possibility:

In any case nothing related to this package :) closing the issue