Advertisement
Guest User

Untitled

a guest
Sep 11th, 2019
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Dart 39.07 KB | None | 0 0
  1. import 'package:flutter/material.dart';
  2. import 'package:geolocator/geolocator.dart';
  3. import 'package:gogiver/Config/UiData.dart';
  4. import 'package:gogiver/DAL/ParceiraDao.dart';
  5. import 'package:gogiver/DAL/ParceiraPorCategoriaDao.dart';
  6. import 'package:gogiver/Telas/MarcaSingle.dart';
  7. import 'package:gogiver/Telas/Marcas.dart';
  8. import 'package:gogiver/Telas/Parceira.dart';
  9. import 'package:http/http.dart' as http;
  10.  
  11. class Destaque extends StatefulWidget {
  12.   @override
  13.   _DestaqueState createState() => _DestaqueState();
  14. }
  15.  
  16. class _DestaqueState extends State<Destaque> {Container myArticles(String imageVal, String heading, String subHeading) {
  17.     return Container(
  18.       width: 250.0,
  19.       child: Card(
  20.         child: Wrap(
  21.           children: <Widget>[
  22.             Stack(
  23.               children: <Widget>[
  24.                 Positioned(
  25.                   child: Image.network(imageVal),
  26.                 ),
  27.                 Positioned(
  28.                   top: 15,
  29.                   left: 15,
  30.                   child: Container(
  31.                     alignment: Alignment.center,
  32.                     height: 55,
  33.                     width: 55,
  34.                     decoration: BoxDecoration(
  35.                       shape: BoxShape.circle,
  36.                       border: Border.all(
  37.                         width: 2,
  38.                         color: Colors.white,
  39.                       ),
  40.                     ),
  41.                     child: Column(
  42.                       mainAxisAlignment: MainAxisAlignment.center,
  43.                       crossAxisAlignment: CrossAxisAlignment.center,
  44.                       children: <Widget>[
  45.                         Text(
  46.                           "20%",
  47.                           style: TextStyle(
  48.                             color: Colors.white,
  49.                           ),
  50.                         ),
  51.                         Text(
  52.                           'Off',
  53.                           style: TextStyle(
  54.                             color: Colors.white,
  55.                           ),
  56.                         )
  57.                       ],
  58.                     ),
  59.                   ),
  60.                 ),
  61.               ],
  62.             ),
  63.             Row(
  64.               mainAxisAlignment: MainAxisAlignment.spaceBetween,
  65.               children: <Widget>[
  66.                 Padding(
  67.                     padding: EdgeInsets.all(10),
  68.                     child: Text(
  69.                       "Wanna Class",
  70.                       style: TextStyle(
  71.                           fontSize: 20,
  72.                           color: Color(0xff322F36),
  73.                           fontWeight: FontWeight.bold),
  74.                     )),
  75.                 Padding(
  76.                     padding: EdgeInsets.all(10),
  77.                     child: Row(
  78.                       children: <Widget>[
  79.                         Icon(
  80.                           Icons.place,
  81.                         ),
  82.                         Text("500 m"),
  83.                       ],
  84.                     )),
  85.               ],
  86.             ),
  87.             Padding(
  88.               padding: EdgeInsets.only(left: 5, bottom: 5),
  89.               child: Row(
  90.                 children: <Widget>[
  91.                   Icon(
  92.                     Icons.dashboard,
  93.                     color: Color(0xff3E3840),
  94.                   ),
  95.                   Text(
  96.                     "Curso",
  97.                     style: TextStyle(
  98.                       color: Color(0xff3E3840),
  99.                     ),
  100.                   )
  101.                 ],
  102.               ),
  103.             ),
  104.             Padding(
  105.               padding: EdgeInsets.only(left: 5),
  106.               child: Row(
  107.                 children: <Widget>[
  108.                   Container(
  109.                     padding: EdgeInsets.all(3),
  110.                     decoration: BoxDecoration(
  111.                         color: Color(0xff362F2F),
  112.                         borderRadius: BorderRadius.all(Radius.circular(5.0))),
  113.                     child: Text(
  114.                       "4.7",
  115.                       style: TextStyle(color: Colors.white, fontSize: 20),
  116.                     ),
  117.                   ),
  118.                   Padding(
  119.                     padding: EdgeInsets.only(left: 5),
  120.                     child: Text(
  121.                       "200 avaliaçôes |",
  122.                       style: TextStyle(color: Colors.black.withOpacity(0.3)),
  123.                     ),
  124.                   ),
  125.                   Padding(
  126.                     padding: EdgeInsets.only(left: 5),
  127.                     child: Text(
  128.                       "Aberto",
  129.                       style: TextStyle(
  130.                         color: Colors.lightGreen,
  131.                       ),
  132.                     ),
  133.                   ),
  134.                 ],
  135.               ),
  136.             ),
  137.             Center(
  138.               child: Padding(
  139.                 padding: EdgeInsets.all(10),
  140.                 child: Text(
  141.                   "Ofertas Online",
  142.                   style: TextStyle(color: Colors.black.withOpacity(0.7)),
  143.                 ),
  144.               ),
  145.             ),
  146.             Center(
  147.               child: Container(
  148.                 padding: EdgeInsets.all(10),
  149.                 width: 200,
  150.                 decoration: BoxDecoration(
  151.                     color: Color(0xff362F2F),
  152.                     borderRadius: BorderRadius.all(Radius.circular(5.0))),
  153.                 child: Padding(
  154.                   padding: EdgeInsets.all(0),
  155.                   child: Row(
  156.                     mainAxisAlignment: MainAxisAlignment.center,
  157.                     children: <Widget>[
  158.                       Text(
  159.                         "PEGAR CUPON",
  160.                         style: TextStyle(color: Colors.white),
  161.                       ),
  162.                       Icon(
  163.                         Icons.local_offer,
  164.                         color: Colors.white,
  165.                       )
  166.                     ],
  167.                   ),
  168.                 ),
  169.               ),
  170.             )
  171.           ],
  172.         ),
  173.       ),
  174.     );
  175.   }
  176.  
  177.   Container mySingleArticles(String imageVal, String heading, String subHeading) {
  178.     return Container(
  179.       height: 450,
  180.       child: Card(
  181.         child: Wrap(
  182.           children: <Widget>[
  183.             Stack(
  184.               children: <Widget>[
  185.                 Positioned(
  186.                   child: GestureDetector(
  187.                     onTap: () {
  188.                       Navigator.push(context,
  189.                           MaterialPageRoute(builder: (context) => Parceira(1)));
  190.                     },
  191.                     child: Image.network(imageVal),
  192.                   ),
  193.                 ),
  194.                 Positioned(
  195.                   top: 15,
  196.                   left: 15,
  197.                   child: Container(
  198.                     alignment: Alignment.center,
  199.                     height: 55,
  200.                     width: 55,
  201.                     decoration: BoxDecoration(
  202.                       shape: BoxShape.circle,
  203.                       border: Border.all(
  204.                         width: 2,
  205.                         color: Colors.white,
  206.                       ),
  207.                     ),
  208.                     child: Column(
  209.                       mainAxisAlignment: MainAxisAlignment.center,
  210.                       crossAxisAlignment: CrossAxisAlignment.center,
  211.                       children: <Widget>[
  212.                         Text(
  213.                           "20%",
  214.                           style: TextStyle(
  215.                             color: Colors.white,
  216.                           ),
  217.                         ),
  218.                         Text(
  219.                           'Off',
  220.                           style: TextStyle(
  221.                             color: Colors.white,
  222.                           ),
  223.                         )
  224.                       ],
  225.                     ),
  226.                   ),
  227.                 ),
  228.               ],
  229.             ),
  230.             Row(
  231.               mainAxisAlignment: MainAxisAlignment.spaceBetween,
  232.               children: <Widget>[
  233.                 Padding(
  234.                     padding: EdgeInsets.all(10),
  235.                     child: Text(
  236.                       "Wanna Class",
  237.                       style: TextStyle(
  238.                           fontSize: 20,
  239.                           color: Color(0xff322F36),
  240.                           fontWeight: FontWeight.bold),
  241.                     )),
  242.                 Padding(
  243.                     padding: EdgeInsets.all(10),
  244.                     child: Row(
  245.                       children: <Widget>[
  246.                         Icon(
  247.                           Icons.place,
  248.                         ),
  249.                         Text("500 m"),
  250.                       ],
  251.                     )),
  252.               ],
  253.             ),
  254.             Padding(
  255.               padding: EdgeInsets.only(left: 5, bottom: 5),
  256.               child: Row(
  257.                 children: <Widget>[
  258.                   Icon(
  259.                     Icons.dashboard,
  260.                     color: Color(0xff3E3840),
  261.                   ),
  262.                   Text(
  263.                     "Curso",
  264.                     style: TextStyle(
  265.                       color: Color(0xff3E3840),
  266.                     ),
  267.                   )
  268.                 ],
  269.               ),
  270.             ),
  271.             Padding(
  272.               padding: EdgeInsets.only(left: 5),
  273.               child: Row(
  274.                 children: <Widget>[
  275.                   Container(
  276.                     padding: EdgeInsets.all(3),
  277.                     decoration: BoxDecoration(
  278.                         color: Color(0xff362F2F),
  279.                         borderRadius: BorderRadius.all(Radius.circular(5.0))),
  280.                     child: Text(
  281.                       "4.7",
  282.                       style: TextStyle(color: Colors.white, fontSize: 20),
  283.                     ),
  284.                   ),
  285.                   Padding(
  286.                     padding: EdgeInsets.only(left: 5),
  287.                     child: Text(
  288.                       "200 avaliaçôes |",
  289.                       style: TextStyle(color: Colors.black.withOpacity(0.3)),
  290.                     ),
  291.                   ),
  292.                   Padding(
  293.                     padding: EdgeInsets.only(left: 5),
  294.                     child: Text(
  295.                       "Aberto",
  296.                       style: TextStyle(
  297.                         color: Colors.lightGreen,
  298.                       ),
  299.                     ),
  300.                   ),
  301.                 ],
  302.               ),
  303.             ),
  304.             Center(
  305.               child: Padding(
  306.                 padding: EdgeInsets.all(10),
  307.                 child: Text(
  308.                   "Ofertas Online",
  309.                   style: TextStyle(color: Colors.black.withOpacity(0.7)),
  310.                 ),
  311.               ),
  312.             ),
  313.             Center(
  314.               child: Container(
  315.                 padding: EdgeInsets.all(10),
  316.                 width: 200,
  317.                 decoration: BoxDecoration(
  318.                     color: Color(0xff362F2F),
  319.                     borderRadius: BorderRadius.all(Radius.circular(5.0))),
  320.                 child: Padding(
  321.                   padding: EdgeInsets.all(0),
  322.                   child: Row(
  323.                     mainAxisAlignment: MainAxisAlignment.center,
  324.                     children: <Widget>[
  325.                       Text(
  326.                         "PEGAR CUPON",
  327.                         style: TextStyle(color: Colors.white),
  328.                       ),
  329.                       Icon(
  330.                         Icons.local_offer,
  331.                         color: Colors.white,
  332.                       )
  333.                     ],
  334.                   ),
  335.                 ),
  336.               ),
  337.             )
  338.           ],
  339.         ),
  340.       ),
  341.     );
  342.   }
  343.  
  344.   _coordernadasDistancia() async {
  345.     //-22.744061, -42.862394
  346.     //-22.745119, -42.859079
  347.     double distanceInMeters = await Geolocator()
  348.         .distanceBetween(-22.744061, -42.862394, -22.745119, -42.859079);
  349.     return distanceInMeters.toStringAsPrecision(3);
  350.   }
  351.  
  352.   _listarMatrizPageSize() {
  353.     ParceiraPorCategoriaDao listarMatrizPage = ParceiraPorCategoriaDao();
  354.     return listarMatrizPage.listarMatrizesPageSize(http.Client());
  355.   }
  356.  
  357.   _listarParceirasDestaque() {
  358.     ParceiraDao pDestaque = ParceiraDao();
  359.     return pDestaque.destaque(http.Client());
  360.   }
  361.     _listarTopXUltimosCadastrados() {
  362.       ParceiraPorCategoriaDao topUltimos = ParceiraPorCategoriaDao();
  363.   return topUltimos.listarTopXUltimosCadastrados(http.Client());
  364. }
  365.  
  366.   @override
  367.   Widget build(BuildContext context) {
  368.     return ListView(
  369.       children: <Widget>[
  370.         Padding(
  371.           padding: EdgeInsets.only(left: 5, top: 15, bottom: 20),
  372.           child: Text(UiData.cardMarca),
  373.         ),
  374.         _listarPorPatrocinadora(),
  375.         Padding(
  376.           padding: EdgeInsets.only(left: 5, top: 15),
  377.           child: Text(UiData.cardPerto),
  378.         ),
  379.         Container(
  380.           height: 450,
  381.           color: Colors.white,
  382.           child: Container(
  383.             margin: EdgeInsets.symmetric(vertical: 10.0),
  384.             child: FutureBuilder(
  385.                 future: _listarParceirasDestaque(),
  386.                 builder: (context, snapshot) {
  387.                   switch (snapshot.connectionState) {
  388.                     case ConnectionState.none:
  389.                     case ConnectionState.waiting:
  390.                       return Center(
  391.                         child: CircularProgressIndicator(),
  392.                       );
  393.                       break;
  394.                     case ConnectionState.active:
  395.                     case ConnectionState.done:
  396.                       if (snapshot.data == null) {
  397.                         return Center(
  398.                           child: Text("Nenhum resultado encontrado"),
  399.                         );
  400.                       }
  401.                       if (snapshot.hasError) {
  402.                         return Center(
  403.                           child: Text("Nenhum resultado encontrado"),
  404.                         );
  405.                       }
  406.                       return ListView.builder(
  407.                           scrollDirection: Axis.horizontal,
  408.                           itemCount: snapshot.data.length,
  409.                           itemBuilder: (context, index) {
  410.                             return Container(
  411.                               height: 90,
  412.                               width: 260,
  413.                               child: Card(
  414.                                 child: Wrap(
  415.                                   children: <Widget>[
  416.                                     Stack(
  417.                                       children: <Widget>[
  418.                                         Positioned(
  419.                                           child: GestureDetector(
  420.                                             onTap: () {
  421.                                               Navigator.push(
  422.                                                   context,
  423.                                                   MaterialPageRoute(
  424.                                                       builder: (context) =>
  425.                                                           Parceira(snapshot
  426.                                                               .data[index]
  427.                                                               .id)));
  428.                                             },
  429.                                             child: Image.network(
  430.                                                 snapshot.data[index].logo),
  431.                                           ),
  432.                                         ),
  433.                                         Positioned(
  434.                                           top: 15,
  435.                                           left: 15,
  436.                                           child: Container(
  437.                                             alignment: Alignment.center,
  438.                                             height: 55,
  439.                                             width: 55,
  440.                                             decoration: BoxDecoration(
  441.                                               shape: BoxShape.circle,
  442.                                               border: Border.all(
  443.                                                 width: 2,
  444.                                                 color: Colors.white,
  445.                                               ),
  446.                                             ),
  447.                                             child: Column(
  448.                                               mainAxisAlignment:
  449.                                               MainAxisAlignment.center,
  450.                                               crossAxisAlignment:
  451.                                               CrossAxisAlignment.center,
  452.                                               children: <Widget>[
  453.                                                 Text(
  454.                                                   "20%",
  455.                                                   style: TextStyle(
  456.                                                     color: Colors.white,
  457.                                                   ),
  458.                                                 ),
  459.                                                 Text(
  460.                                                   'Off',
  461.                                                   style: TextStyle(
  462.                                                     color: Colors.white,
  463.                                                   ),
  464.                                                 )
  465.                                               ],
  466.                                             ),
  467.                                           ),
  468.                                         ),
  469.                                       ],
  470.                                     ),
  471.                                     Row(
  472.                                       mainAxisAlignment:
  473.                                       MainAxisAlignment.spaceBetween,
  474.                                       children: <Widget>[
  475.                                         new Flexible(
  476.                                           child: new Container(
  477.                                             padding: new EdgeInsets.only(
  478.                                                 right: 13.0),
  479.                                             child: Padding(
  480.                                               padding: EdgeInsets.only(
  481.                                                   top: 10,
  482.                                                   left: 10,
  483.                                                   bottom: 10),
  484.                                               child: new Text(
  485.                                                 snapshot.data[index].nome,
  486.                                                 maxLines: 1,
  487.                                                 softWrap: false,
  488.                                                 overflow: TextOverflow.ellipsis,
  489.                                                 style: new TextStyle(
  490.                                                   fontSize: 16.0,
  491.                                                   fontFamily: 'Roboto',
  492.                                                   color: new Color(0xFF212121),
  493.                                                   fontWeight: FontWeight.bold,
  494.                                                 ),
  495.                                               ),
  496.                                             ),
  497.                                           ),
  498.                                         ),
  499.                                         Padding(
  500.                                             padding: EdgeInsets.all(10),
  501.                                             child: Row(
  502.                                               children: <Widget>[
  503.                                                 Icon(
  504.                                                   Icons.place,
  505.                                                 ),
  506.                                                 Text("500 m"),
  507.                                               ],
  508.                                             )),
  509.                                       ],
  510.                                     ),
  511.                                     Padding(
  512.                                       padding:
  513.                                       EdgeInsets.only(left: 5, bottom: 5),
  514.                                       child: Row(
  515.                                         children: <Widget>[
  516.                                           Icon(
  517.                                             Icons.dashboard,
  518.                                             color: Color(0xff3E3840),
  519.                                           ),
  520.                                           Text(
  521.                                             "Curso",
  522.                                             style: TextStyle(
  523.                                               color: Color(0xff3E3840),
  524.                                             ),
  525.                                           )
  526.                                         ],
  527.                                       ),
  528.                                     ),
  529.                                     Center(
  530.                                       child: Padding(
  531.                                         padding: EdgeInsets.all(10),
  532.                                         child: Text(
  533.                                           "Ofertas Online",
  534.                                           style: TextStyle(
  535.                                               color: Colors.black
  536.                                                   .withOpacity(0.7)),
  537.                                         ),
  538.                                       ),
  539.                                     ),
  540.                                     Center(
  541.                                       child: Container(
  542.                                         padding: EdgeInsets.all(10),
  543.                                         width: 200,
  544.                                         decoration: BoxDecoration(
  545.                                             color: Color(0xff362F2F),
  546.                                             borderRadius: BorderRadius.all(
  547.                                                 Radius.circular(5.0))),
  548.                                         child: Padding(
  549.                                           padding: EdgeInsets.all(0),
  550.                                           child: Row(
  551.                                             mainAxisAlignment:
  552.                                             MainAxisAlignment.center,
  553.                                             children: <Widget>[
  554.                                               Text(
  555.                                                 "PEGAR CUPON",
  556.                                                 style: TextStyle(
  557.                                                     color: Colors.white),
  558.                                               ),
  559.                                               Icon(
  560.                                                 Icons.local_offer,
  561.                                                 color: Colors.white,
  562.                                               )
  563.                                             ],
  564.                                           ),
  565.                                         ),
  566.                                       ),
  567.                                     )
  568.                                   ],
  569.                                 ),
  570.                               ),
  571.                             );
  572.                           });
  573.  
  574.                       break;
  575.                   }
  576.                 }),
  577.           ),
  578.         ),
  579.         Padding(
  580.           padding: EdgeInsets.only(left: 5, top: 15),
  581.           child: Text(UiData.cardnew),
  582.         ),
  583.         Container(
  584.           height: 410,
  585.           child: Container(
  586.             margin: EdgeInsets.symmetric(vertical: 20.0),
  587.             height: 300,
  588.             child:
  589.                 ListView(scrollDirection: Axis.horizontal, children: <Widget>[
  590.               myArticles(
  591.                   "https://picsum.photos/id/30/300/200", "teste", "SubTitle"),
  592.               myArticles(
  593.                   "https://picsum.photos/id/10/300/200", "teste", "SubTitle"),
  594.               myArticles(
  595.                   "https://picsum.photos/id/60/300/200", "teste", "SubTitle"),
  596.               myArticles(
  597.                   "https://picsum.photos/id/40/300/200", "teste", "SubTitle"),
  598.             ]),
  599.           ),
  600.         ),
  601.         _listarTopXMaisVisitados(),
  602.       ],
  603.     );
  604.   }
  605.  
  606.   //CHAMADA DAS FETURE NOS ENDPOINTS
  607.  
  608.   Widget _listarPorPatrocinadora() {
  609.     return Container(
  610.         height: 90,
  611.         color: Colors.white,
  612.         child: Row(
  613.           children: <Widget>[
  614.             Expanded(
  615.               child: Container(
  616.                   margin: EdgeInsets.symmetric(vertical: 10.0),
  617.                   child: FutureBuilder(
  618.                     future: _listarMatrizPageSize(),
  619.                     builder: (context, snapshot) {
  620.                       switch (snapshot.connectionState) {
  621.                         case ConnectionState.none:
  622.                         case ConnectionState.waiting:
  623.                           return Center(
  624.                             child: CircularProgressIndicator(),
  625.                           );
  626.                           break;
  627.                         case ConnectionState.active:
  628.                         case ConnectionState.done:
  629.                           if (snapshot.data == null) {
  630.                             return Center(
  631.                               child: Text("Nenhuma Empresa encontrada"),
  632.                             );
  633.                           }
  634.  
  635.                           return ListView.builder(
  636.                               scrollDirection: Axis.horizontal,
  637.                               itemCount: snapshot.data.length,
  638.                               itemBuilder: (BuildContext context, int index) {
  639.                                 return _empresas(snapshot.data[index].logo);
  640.                               });
  641.                           break;
  642.                       }
  643.                     },
  644.                   )),
  645.             ),
  646.             _verLista()
  647.           ],
  648.         ));
  649.   }
  650.  
  651.   Widget _listarTopXMaisVisitados() {
  652.     return Column(
  653.         children: <Widget>[
  654.           Container(
  655.             height: 1500,
  656.             child: FutureBuilder(
  657.                 future: _listarTopXUltimosCadastrados(),
  658.                 builder: (context, snapshot){
  659.                   switch(snapshot.connectionState){
  660.                     case ConnectionState.none:
  661.                     case ConnectionState.waiting:
  662.                       return Center(
  663.                         child: CircularProgressIndicator(),
  664.                       );
  665.                       break;
  666.                     case ConnectionState.active:
  667.                     case ConnectionState.done:
  668.                       if (snapshot.data == null) {
  669.                         return Center(
  670.                           child: Text("Nenhuma Empresa encontrada"),
  671.                         );
  672.                       }
  673.  
  674.                       return Column(
  675.                         children: <Widget>[
  676.                           Expanded(
  677.  
  678.                             child: ListView.builder(
  679.                               physics: NeverScrollableScrollPhysics(),
  680.                               itemCount: snapshot.data.length,
  681.                               itemBuilder:(BuildContext context, int index){
  682.  
  683.                                 return Container(
  684.                                   height: 450,
  685.                                   child: Card(
  686.                                     child: Wrap(
  687.                                       children: <Widget>[
  688.                                         Stack(
  689.                                           children: <Widget>[
  690.                                             Positioned(
  691.                                               child: GestureDetector(
  692.                                                 onTap: () {
  693.                                                   Navigator.push(
  694.                                                       context,
  695.                                                       MaterialPageRoute(
  696.                                                           builder: (context) => Parceira(1)));
  697.                                                 },
  698.                                                 child: Image.network("https://picsum.photos/id/30/350/234"),
  699.                                               ),
  700.                                             ),
  701.                                             Positioned(
  702.                                               top: 15,
  703.                                               left: 15,
  704.                                               child: Container(
  705.                                                 alignment: Alignment.center,
  706.                                                 height: 55,
  707.                                                 width: 55,
  708.                                                 decoration: BoxDecoration(
  709.                                                   shape: BoxShape.circle,
  710.                                                   border: Border.all(
  711.                                                     width: 2,
  712.                                                     color: Colors.white,
  713.                                                   ),
  714.                                                 ),
  715.                                                 child: Column(
  716.                                                   mainAxisAlignment: MainAxisAlignment.center,
  717.                                                   crossAxisAlignment: CrossAxisAlignment.center,
  718.                                                   children: <Widget>[
  719.                                                     Text(
  720.                                                       "20%",
  721.                                                       style: TextStyle(
  722.                                                         color: Colors.white,
  723.                                                       ),
  724.                                                     ),
  725.                                                     Text(
  726.                                                       'Off',
  727.                                                       style: TextStyle(
  728.                                                         color: Colors.white,
  729.                                                       ),
  730.                                                     )
  731.                                                   ],
  732.                                                 ),
  733.                                               ),
  734.                                             ),
  735.                                           ],
  736.                                         ),
  737.                                         Row(
  738.                                           mainAxisAlignment: MainAxisAlignment.spaceBetween,
  739.                                           children: <Widget>[
  740.                                             Padding(
  741.                                                 padding: EdgeInsets.all(10),
  742.                                                 child: Text(
  743.                                                   "Wanna Class",
  744.                                                   style: TextStyle(
  745.                                                       fontSize: 20,
  746.                                                       color: Color(0xff322F36),
  747.                                                       fontWeight: FontWeight.bold),
  748.                                                 )),
  749.                                             Padding(
  750.                                                 padding: EdgeInsets.all(10),
  751.                                                 child: Row(
  752.                                                   children: <Widget>[
  753.                                                     Icon(
  754.                                                       Icons.place,
  755.                                                     ),
  756.                                                     Text("500 m"),
  757.                                                   ],
  758.                                                 )),
  759.                                           ],
  760.                                         ),
  761.                                         Padding(
  762.                                           padding: EdgeInsets.only(left: 5, bottom: 5),
  763.                                           child: Row(
  764.                                             children: <Widget>[
  765.                                               Icon(
  766.                                                 Icons.dashboard,
  767.                                                 color: Color(0xff3E3840),
  768.                                               ),
  769.                                               Text(
  770.                                                 "Curso",
  771.                                                 style: TextStyle(
  772.                                                   color: Color(0xff3E3840),
  773.                                                 ),
  774.                                               )
  775.                                             ],
  776.                                           ),
  777.                                         ),
  778.                                         Padding(
  779.                                           padding: EdgeInsets.only(left: 5),
  780.                                           child: Row(
  781.                                             children: <Widget>[
  782.                                               Container(
  783.                                                 padding: EdgeInsets.all(3),
  784.                                                 decoration: BoxDecoration(
  785.                                                     color: Color(0xff362F2F),
  786.                                                     borderRadius:
  787.                                                     BorderRadius.all(Radius.circular(5.0))),
  788.                                                 child: Text(
  789.                                                   "4.7",
  790.                                                   style: TextStyle(color: Colors.white, fontSize: 20),
  791.                                                 ),
  792.                                               ),
  793.                                               Padding(
  794.                                                 padding: EdgeInsets.only(left: 5),
  795.                                                 child: Text(
  796.                                                   "200 avaliaçôes |",
  797.                                                   style:
  798.                                                   TextStyle(color: Colors.black.withOpacity(0.3)),
  799.                                                 ),
  800.                                               ),
  801.                                               Padding(
  802.                                                 padding: EdgeInsets.only(left: 5),
  803.                                                 child: Text(
  804.                                                   "Aberto",
  805.                                                   style: TextStyle(
  806.                                                     color: Colors.lightGreen,
  807.                                                   ),
  808.                                                 ),
  809.                                               ),
  810.                                             ],
  811.                                           ),
  812.                                         ),
  813.                                         Center(
  814.                                           child: Padding(
  815.                                             padding: EdgeInsets.all(10),
  816.                                             child: Text(
  817.                                               "Ofertas Online",
  818.                                               style: TextStyle(color: Colors.black.withOpacity(0.7)),
  819.                                             ),
  820.                                           ),
  821.                                         ),
  822.                                         Center(
  823.                                           child: Container(
  824.                                             padding: EdgeInsets.all(10),
  825.                                             width: 200,
  826.                                             decoration: BoxDecoration(
  827.                                                 color: Color(0xff362F2F),
  828.                                                 borderRadius: BorderRadius.all(Radius.circular(5.0))),
  829.                                             child: Padding(
  830.                                               padding: EdgeInsets.all(0),
  831.                                               child: Row(
  832.                                                 mainAxisAlignment: MainAxisAlignment.center,
  833.                                                 children: <Widget>[
  834.                                                   Text(
  835.                                                     "PEGAR CUPON",
  836.                                                     style: TextStyle(color: Colors.white),
  837.                                                   ),
  838.                                                   Icon(
  839.                                                     Icons.local_offer,
  840.                                                     color: Colors.white,
  841.                                                   )
  842.                                                 ],
  843.                                               ),
  844.                                             ),
  845.                                           ),
  846.                                         )
  847.                                       ],
  848.                                     ),
  849.                                   ),
  850.                                 );
  851.  
  852.                               },
  853.  
  854.                             ),
  855.                           )
  856.                         ],
  857.                       );
  858.                       break;
  859.                   }
  860.  
  861.  
  862.                 }
  863.             ),
  864.           )
  865.         ],
  866.  
  867.     );
  868.   }
  869.  
  870.   Widget _empresas(img) {
  871.     return Builder(builder: (BuildContext context) {
  872.       return Stack(
  873.         children: <Widget>[
  874.           Positioned(
  875.             child: GestureDetector(
  876.               onTap: () {
  877.                 Navigator.push(context,
  878.                     MaterialPageRoute(builder: (context) => MarcaSingle()));
  879.               },
  880.               child: Padding(
  881.                 padding: EdgeInsets.only(left: 10, right: 5),
  882.                 child: Image.network(
  883.                   img,
  884.                   fit: BoxFit.contain,
  885.                   width: 70,
  886.                 ),
  887.               ),
  888.             ),
  889.           ),
  890.         ],
  891.       );
  892.     });
  893.   }
  894.  
  895.   Widget _verLista() {
  896.     return Builder(
  897.       builder: (BuildContext context) {
  898.         return GestureDetector(
  899.           onTap: () {
  900.             Navigator.push(
  901.                 context, MaterialPageRoute(builder: (context) => Marcas()));
  902.           },
  903.           child: Column(
  904.             children: <Widget>[
  905.               Padding(
  906.                 padding: EdgeInsets.all(20),
  907.                 child: Text(
  908.                   "Ver Todas",
  909.                   style: TextStyle(
  910.                     color: Colors.blue,
  911.                   ),
  912.                 ),
  913.               )
  914.             ],
  915.           ),
  916.         );
  917.       },
  918.     );
  919.   }
  920.  
  921. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement