当前位置:网站首页>Shutter style

Shutter style

2022-06-23 06:23:00 Susceptible to cold

//   Service page item
Widget _buildGridService() {
  return Scaffold(
      appBar: AppBar(
        elevation: 8.0, // Height of shadow 
        title: Text(' Convenience services '),
        backgroundColor: MyColors.color_red,
        centerTitle: true, // Is the title centered , The default is false
      ),
      body: Center(
          child: GridView.extent(
        // No rolling 
        physics: new NeverScrollableScrollPhysics(),
        // The maximum length of the horizontal axis 
        maxCrossAxisExtent: 150.0,
        padding: const EdgeInsets.all(5.0),
        // Spindle spacing   The vertical axis 
        mainAxisSpacing: 1.0,
        // Horizontal axis interval   Secondary axis 
        crossAxisSpacing: 4.0,
        semanticChildCount: 3,
        children: _buildGridTileList(serviceList),
      )));
}
List<Container> _buildGridTileList(List<MyService> list) {
  return new List.generate(
      list.length,
      (int index) => new Container(
            child: new GestureDetector(
              onTap: () {
                print("--- Click. :" + serviceList[index].text);
                Navigator.push(
                    context,
                    new MaterialPageRoute(
                        builder: (context) => new ServiceWebPage(
                            from: serviceList[index].text)));
              },
              child: Column(
                mainAxisAlignment: MainAxisAlignment.spaceEvenly,
                children: <Widget>[
                  Image.asset(
                    list[index].iconImage,
                    width: 50.0,
                    height: 50.0,
                    fit: BoxFit.fill,
                  ),
                  new Container(
                    padding: EdgeInsets.only(top: 5.0),
                    child: new Text(
                      list[index].text,
                      style: new TextStyle(
                        fontSize: 14.0,
                      ),
                    ),
                  )
                ],
              ),
            ),
          ));
}
原网站

版权声明
本文为[Susceptible to cold]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/01/202201132054151497.html