dart – Flutter – 屏幕不滚动

前端之家收集整理的这篇文章主要介绍了dart – Flutter – 屏幕不滚动前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我插入了6张卡,但是无法滚动屏幕.

根据下图,页脚中出现红色条纹,屏幕不滚动.

有什么可以滚动屏幕?

main.dart

import 'package:flutter/material.dart';

void main() {
  runApp(new MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
      title: "Myapp",home: new HomePage(),);
  }
}

class HomePage extends StatelessWidget {
  @override
  Widget build(BuildContext context) => new Scaffold(
    appBar: new AppBar(
      backgroundColor: new Color(0xFF26C6DA),),body: new Column(
      children: <Widget>[
        new Card(
          child: new Column(
            mainAxisSize: MainAxisSize.min,children: <Widget>[
              const ListTile(
                leading: const Icon(Icons.album),title: const Text('The Enchanted Nightingale'),subtitle: const Text('Music by Julie Gable. Lyrics by Sidney Stein.'),],...
        ...
        ...
      ],)    
  );
}

enter image description here

解决方法

列不滚动.尝试使用ListView替换外部列.你可能需要把shrinkWrap:true放在上面.

猜你在找的Flutter相关文章