jaumard / flare_splash_screen

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

Alignment is not working #29

Open draskosaric opened 4 years ago

draskosaric commented 4 years ago

Hi, great library!

I set alignment to bottomCenter but it is aligned to the center of the screen. Here is the code:

  class MyApp extends StatelessWidget {
    // This widget is the root of your application.
    @override
    Widget build(BuildContext context) {
      return MaterialApp(
        title: 'Flutter Demo',
        home: WelcomeScreen(),
        theme: ThemeData(
          primarySwatch: Colors.blue,
          visualDensity: VisualDensity.adaptivePlatformDensity,
        ),
      );
    }
  }

  class WelcomeScreen extends StatefulWidget {
    @override
    _WelcomeScreenState createState() => _WelcomeScreenState();
  }

  class _WelcomeScreenState extends State<WelcomeScreen> {
    @override
    Widget build(BuildContext context) {
      var _size = MediaQuery.of(context).size;
      return SplashScreen.navigate(
        name: 'assets/intro.flr',
        next: (context) => MyHomePage(title: "Hey!"),
        startAnimation: 'intro',
        until: () => Future.delayed(Duration(seconds: 5)),
        alignment: Alignment.bottomCenter,
        width: _size.width,
        backgroundColor: Colors.black,
      );
    }
  }

This is the result: https://ibb.co/MsMRyYv

Am I doing something wrong here?

jaumard commented 3 years ago

This alignment is pass to the flare package, but I suppose it should apply to the container too, that might explain your result, I'll check more about this thanks for the report!