Advertisement
Guest User

Untitled

a guest
Apr 7th, 2020
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.27 KB | None | 0 0
  1. Widget _category() {
  2.     return new FutureBuilder(
  3.       future: _fetchCategory(),
  4.       builder: (context, snapshot) {
  5.         if (snapshot.data != null) {
  6.           return Container(
  7.               height: 250,
  8.               child: GridView.builder(
  9.                 gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
  10.                     crossAxisCount: 3),
  11.                 itemCount: snapshot.data.length,
  12.                 itemBuilder: (context, index) {
  13.                   return Container(
  14.                       padding: EdgeInsets.only(top: 30),
  15.                       child: Column(children: <Widget>[
  16.                         Row(
  17.                             mainAxisAlignment: MainAxisAlignment.center,
  18.                             children: <Widget>[
  19.                               Column(
  20.                                 children: <Widget>[
  21.                                   Container(
  22.                                     padding: EdgeInsets.all(15),
  23.                                     child: Text(
  24.                                       snapshot.data[index].text,
  25.                                       style: TextStyle(color: Colors.black),
  26.                                     ),
  27.                                     decoration: BoxDecoration(
  28.                                       color: Colors.white,
  29.                                       borderRadius:
  30.                                           BorderRadius.all(Radius.circular(5)),
  31.                                       boxShadow: [
  32.                                         BoxShadow(
  33.                                           color: Colors.black54,
  34.                                           blurRadius: 5.0,
  35.                                           offset: Offset(
  36.                                             1.0,
  37.                                             2.0,
  38.                                           ),
  39.                                         )
  40.                                       ],
  41.                                     ),
  42.                                   ),
  43.                                 ],
  44.                               ),
  45.                             ])
  46.                       ]));
  47.                 },
  48.               ));
  49.         }
  50.         return new CircularProgressIndicator();
  51.       },
  52.     );
  53.   }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement