Flutter学习 网格视图(类似iOS中CollectionView)

import 'package:flutter/material.dart';

class ThirdPage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    // TODO: implement build
   return MaterialApp(
     title: 'CollectionView',
     home: Scaffold(
       body: Center(
         child: GridView.count(
           padding: EdgeInsets.all(10),
           scrollDirection: Axis.vertical,
           crossAxisSpacing: 10,
           crossAxisCount: 3,
           mainAxisSpacing: 10,

           children: [
         new Image.network(
         "http://a3.att.hudong.com/14/75/01300000164186121366756803686.jpg",
             fit: BoxFit.cover

         ),
           new Image.network(
               "http://a3.att.hudong.com/14/75/01300000164186121366756803686.jpg",
               fit: BoxFit.cover
           ),
             new Image.network(
                 "http://a3.att.hudong.com/14/75/01300000164186121366756803686.jpg",
                 fit: BoxFit.cover
             ),
             new Image.network(
                 "http://a3.att.hudong.com/14/75/01300000164186121366756803686.jpg",
                 fit: BoxFit.cover
             ),
             new Image.network(
               "http://a3.att.hudong.com/14/75/01300000164186121366756803686.jpg",
               fit: BoxFit.cover
             ), new Image.network(
                 "http://a3.att.hudong.com/14/75/01300000164186121366756803686.jpg",
                 fit: BoxFit.cover
             ), new Image.network(
       "http://a3.att.hudong.com/14/75/01300000164186121366756803686.jpg",
       fit: BoxFit.cover
       ), new Image.network(
         "http://a3.att.hudong.com/14/75/01300000164186121366756803686.jpg",
         fit: BoxFit.cover
     ), new Image.network(
         "http://a3.att.hudong.com/14/75/01300000164186121366756803686.jpg",
         fit: BoxFit.cover
     ), new Image.network(
                 "http://a3.att.hudong.com/14/75/01300000164186121366756803686.jpg",
                 fit: BoxFit.cover
             ), new Image.network(
                 "http://a3.att.hudong.com/14/75/01300000164186121366756803686.jpg",
                 fit: BoxFit.cover
             ), new Image.network(
                 "http://a3.att.hudong.com/14/75/01300000164186121366756803686.jpg",
                 fit: BoxFit.cover
             ), new Image.network(
                 "http://a3.att.hudong.com/14/75/01300000164186121366756803686.jpg",
                 fit: BoxFit.cover
             ), new Image.network(
                 "http://a3.att.hudong.com/14/75/01300000164186121366756803686.jpg",
                 fit: BoxFit.cover
             ), new Image.network(
                 "http://a3.att.hudong.com/14/75/01300000164186121366756803686.jpg",
                 fit: BoxFit.cover
             ), new Image.network(
                 "http://a3.att.hudong.com/14/75/01300000164186121366756803686.jpg",
                 fit: BoxFit.cover
             ), new Image.network(
                 "http://a3.att.hudong.com/14/75/01300000164186121366756803686.jpg",
                 fit: BoxFit.cover
             ), new Image.network(
                 "http://a3.att.hudong.com/14/75/01300000164186121366756803686.jpg",
                 fit: BoxFit.cover
             ), new Image.network(
                 "http://a3.att.hudong.com/14/75/01300000164186121366756803686.jpg",
                 fit: BoxFit.cover
             ), new Image.network(
                 "http://a3.att.hudong.com/14/75/01300000164186121366756803686.jpg",
                 fit: BoxFit.cover
             ), new Image.network(
                 "http://a3.att.hudong.com/14/75/01300000164186121366756803686.jpg",
                 fit: BoxFit.cover
             ), new Image.network(
                 "http://a3.att.hudong.com/14/75/01300000164186121366756803686.jpg",
                 fit: BoxFit.cover
             ), new Image.network(
                 "http://a3.att.hudong.com/14/75/01300000164186121366756803686.jpg",
                 fit: BoxFit.cover
             ), new Image.network(
                 "http://a3.att.hudong.com/14/75/01300000164186121366756803686.jpg",
                 fit: BoxFit.cover
             ), new Image.network(
                 "http://a3.att.hudong.com/14/75/01300000164186121366756803686.jpg",
                 fit: BoxFit.cover
             ), new Image.network(
                 "http://a3.att.hudong.com/14/75/01300000164186121366756803686.jpg",
                 fit: BoxFit.cover
             )
           ],
         ),
       ),
     ),
   );
  }
}

你可能感兴趣的:(Flutter)