本文介绍了处理水平步进器的溢出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我用几个步骤实现了一个非常简单的水平步进器.但是,我得到了溢出横幅,指出我的步骤不适合该视图.
I implemented a very simple horizontal stepper with a few steps. However i get the overflow banner stating that my steps does not fit the view.
如何使带有步骤的栏变为可滚动状态?
import 'package:flutter/material.dart';
class SetupPage extends StatefulWidget {
@override
_SetupPageState createState() => _SetupPageState();
}
class _SetupPageState extends State<SetupPage> {
List<Step> steps = [
new Step(title: Text('Step 1'), content: new Container()),
new Step(title: Text('Step 2'), content: new Container()),
new Step(title: Text('Step 3'), content: new Container()),
new Step(title: Text('Step 4'), content: new Container()),
new Step(title: Text('Step 5'), content: new Container()),
new Step(title: Text('Step 6'), content: new Container()),
new Step(title: Text('Step 7'), content: new Container()),
];
@override
Widget build(BuildContext context) {
return new Scaffold(
appBar: AppBar(title: Text('Setup'),),
body: new Stepper(steps: steps, type: StepperType.horizontal, currentStep: 0,),
);
}
}
推荐答案
@Jens: please try to use this package to custom horizontal stepper, with this example
这篇关于处理水平步进器的溢出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!