130 lines
3.8 KiB
Dart
130 lines
3.8 KiB
Dart
import 'package:chatting/app_page.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:chatting/discover_listview_cell.dart';
|
|
/**
|
|
* (1)修改整体的背景色为灰色;
|
|
* (2)去除导航栏阴影,将属性值 elevation 设置为0.0;
|
|
* (3)分组灰色使用Container;
|
|
* (4)分割线使用一个Row,放入两个Container,高度都为0.5,灰色的Container不需要给宽度;
|
|
*/
|
|
|
|
class DiscoverPage extends StatefulWidget {
|
|
@override
|
|
_DiscoverPageState createState() => _DiscoverPageState();
|
|
}
|
|
|
|
class _DiscoverPageState extends State<DiscoverPage> {
|
|
Color themColor = Color.fromRGBO(220, 220, 220, 1);
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
appBar: AppBar(
|
|
title: Text("发现"),
|
|
centerTitle: true,
|
|
elevation: 0.0, //导航栏阴影
|
|
),
|
|
body: Container(
|
|
color: themColor,
|
|
child: ListView(
|
|
children: <Widget>[
|
|
//*******************************************************
|
|
DiscoverListViewCellPage(
|
|
title: '朋友圈',
|
|
imageName: 'assets/images/ic_circle_of_friends.png',
|
|
),
|
|
Container(
|
|
//color: Colors.grey,
|
|
height: 10,
|
|
),
|
|
//*******************************************************
|
|
DiscoverListViewCellPage(
|
|
title: '扫一扫',
|
|
imageName: 'assets/images/ic_scan.png',
|
|
),
|
|
|
|
Row(
|
|
children: <Widget>[
|
|
Container(
|
|
height: 0.5,
|
|
width: 50,
|
|
color: Colors.white,
|
|
),
|
|
Container(
|
|
height: 0.5,
|
|
color: Colors.grey,
|
|
)
|
|
],
|
|
), //
|
|
DiscoverListViewCellPage(
|
|
title: '摇一摇',
|
|
imageName: 'assets/images/ic_shark_it_off.png',
|
|
),
|
|
|
|
Container(
|
|
height: 10,
|
|
),
|
|
|
|
DiscoverListViewCellPage(
|
|
title: '看一看',
|
|
imageName: 'assets/images/ic_look.png',
|
|
),
|
|
|
|
Row(
|
|
children: <Widget>[
|
|
Container(
|
|
height: 0.5,
|
|
width: 50,
|
|
color: Colors.white,
|
|
),
|
|
Container(
|
|
height: 0.5,
|
|
color: Colors.grey,
|
|
)
|
|
],
|
|
),
|
|
|
|
DiscoverListViewCellPage(
|
|
title: '搜一搜',
|
|
imageName: 'assets/images/ic_search.png',
|
|
),
|
|
Container(
|
|
height: 10,
|
|
), //灰色分组
|
|
|
|
DiscoverListViewCellPage(
|
|
title: '购物',
|
|
imageName: 'assets/images/ic_goods_cart.png',
|
|
subTitle: '618限时特惠',
|
|
subImagename: 'assets/images/ic_goods_cart.png',
|
|
),
|
|
Row(
|
|
children: <Widget>[
|
|
Container(
|
|
height: 0.5,
|
|
width: 50,
|
|
color: Colors.white,
|
|
),
|
|
Container(
|
|
height: 0.5,
|
|
color: Colors.grey,
|
|
)
|
|
],
|
|
),
|
|
DiscoverListViewCellPage(
|
|
title: '游戏',
|
|
imageName: 'assets/images/ic_game.png',
|
|
),
|
|
Container(
|
|
height: 10,
|
|
),
|
|
DiscoverListViewCellPage(
|
|
title: '小程序',
|
|
imageName: 'assets/images/ic_applet.png',
|
|
)
|
|
],
|
|
),
|
|
));
|
|
}
|
|
}
|