在抖动中创建自定义简介屏幕滑块

问题描述 投票:0回答:1

我需要创建这样的内容intro slider like this

我正在使用来自flutter的介绍性滑块插件,但不支持2张图片我已经尝试过

 slides.add(
      new Slide(
        pathImage: 'assets/logo_1.png',
        description:
            "Find trusted help for everything on your to-do-list.",
        styleDescription: TextStyle(
          color: Colors.black,
          fontSize: 18.0,
        ),
        marginDescription: EdgeInsets.only(top: 10.0),
        backgroundImage: "assets/ss4.jpg",
        backgroundOpacity: 0.0,
      ),
    );

 IntroSlider(
              slides: this.slides,
              colorActiveDot: Color(0xFF17b01b),
              sizeDot: 10.0,
              isShowSkipBtn: false,
              styleNameDoneBtn: TextStyle(
                color: Color(0xFF17b01b),
                fontSize: 15.0,
                fontWeight: FontWeight.bold,
              ),
              nameDoneBtn: 'Got it >',
              nameNextBtn: 'Got it >',
                  onDonePress:this.onDonePress ,
            )),

简介滑杆支持两幅图像,但是第二幅用于背景图像,因此我的图像在简介滑杆中占据了整个屏幕的背景,如何像在已附加的图像中那样将第二幅图像设置在中央?或如何在简介滑块中为背景图像赋予高度宽度?

flutter flutter-layout
1个回答
0
投票
如插件文档https://pub.dev/packages/intro_slider中所述,您可以像这样设置图像的高度和宽度:

new Slide( pathImage: 'assets/logo_1.png', // Added the next 3 lines heightImage: 500, widthImage: 300, foregroundImageFit: BoxFit.contain, description: "Find trusted help for everything on your to-do-list.", styleDescription: TextStyle( color: Colors.black, fontSize: 18.0, ), marginDescription: EdgeInsets.only(top: 10.0), backgroundImage: "assets/ss4.jpg", backgroundOpacity: 0.0, ),

© www.soinside.com 2019 - 2024. All rights reserved.