appinioGmbH / flutter_packages

Dart and Flutter plugins/packages used and maintained by @appinioGmbH
187 stars 214 forks source link

White trailing on top of the OnBoardingSlider to be generated for some reason and cannot be closed or sized #174

Open ARchitectsPYDC opened 11 months ago

ARchitectsPYDC commented 11 months ago

import 'package:flutter/material.dart'; import 'package:flutter_onboarding_slider/flutter_onboarding_slider.dart'; import 'package:tour_inn_app/Theme/themeColor.dart';

class BoardingPages extends StatelessWidget { BoardingPages({super.key}); @override Widget build(BuildContext context) { return OnBoardingSlider(

  pageBackgroundColor: ThemeProperty.button1,
  headerBackgroundColor: ThemeProperty.main,
  finishButtonText: 'Login',
  finishButtonStyle: const FinishButtonStyle(
    backgroundColor: Colors.black,
  ),
  trailing: Text('Login'),
  background: [
    Image.asset('assets/onboard1.png'),
    Image.asset('assets/onboard2.png'),
    Image.asset('assets/onboard3.png')
  ],
  totalPage: 3,
  speed: 1.8,
  pageBodies: [
    boardingContainer(context, <String>[
      'Find Your\nFavourite Place\nTo Stay',
      'Discover the World in Virtual Reality'
    ]),
    boardingContainer(context, <String>[
      'Immerse Yourself\nin Every\nDimension',
      'Explore, Book, Experience'
    ]),
    Container(
      padding: EdgeInsets.symmetric(horizontal: 40),
      child: Column(
        children: <Widget>[
          SizedBox(
            height: 400,
          ),
          Text('Description Text 2'),
        ],
      ),
    ),
  ],
);

}

Container boardingContainer( BuildContext context, List descriptionTexts) { return Container( padding: EdgeInsets.symmetric(horizontal: 40), child: Stack( children: [ Positioned( top: MediaQuery.of(context).size.height * 0.4, child: Column( children: [ Text( descriptionTexts[0], style: TextStyle( fontSize: ThemeProperty.xlarge, color: Colors.white, height: 1.2), ), Padding( padding: const EdgeInsets.only(top: 40), child: Text( descriptionTexts[1], style: TextStyle( fontSize: ThemeProperty.medium, color: const Color(0XFFC7C7C7)), ), ) ], ), ) ], )); } } I display this widget directly to my MaterialApp, still shows it regardless, I tried to wrap with Scaffold and without still the trailing exist, and the color inbetween

Seferi commented 8 months ago

I'm having the same problem, on the last slide I always get this white header on top. I tried everything and couldn't resolve the issue. I'd appreciate if someone could have a look. Thanks in advance.

I tested it on Android, on latest flutter 3.16.5 stable. It happens when the app is in dark mode.

EDIT: OnBoardingSlider was wrapped in CupertinoApp which was causing the problem. Removing that solved the problem.

Screenshot_20240106_175128