Advertisement
leandropintor

Untitled

Jan 27th, 2020
468
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Dart 8.06 KB | None | 0 0
  1. import 'package:flutter/material.dart';
  2. import 'package:gestorpedidos/api/dadospedidorest.dart';
  3. import 'package:gestorpedidos/page/util.page.dart';
  4.  
  5. class DadosPedidosPage extends StatelessWidget {
  6.   final int codemp;
  7.   final int codfil;
  8.   final int numped;
  9.  
  10.   DadosPedidosPage({Key key, @required this.codemp, this.codfil, this.numped})
  11.       : super(key: key);
  12.  
  13.   @override
  14.   Widget build(BuildContext context) {
  15.     //carregarteste();
  16.     return Scaffold(
  17.       body: Container(
  18.         child: FutureBuilder(
  19.           future: DadosPedidosRest.listarDetalhesPedido(
  20.               this.codemp, this.codfil, this.numped),
  21.           builder: (BuildContext context, AsyncSnapshot snapshot) {
  22.             if (snapshot.data == null) {
  23.               return Container(
  24.                 child: Center(child: CircularProgressIndicator()),
  25.               );
  26.             } else {
  27.               return Scaffold(
  28.                 body: Container(
  29.                   padding: EdgeInsets.only(
  30.                     top: 10,
  31.                     left: 40,
  32.                     right: 40,
  33.                   ),
  34.                   color: Colors.white,
  35.                   child: ListView(
  36.                     children: <Widget>[
  37.                       Text(
  38.                         "Empresa:",
  39.                         style: TextStyle(fontWeight: FontWeight.bold),
  40.                       ),
  41.                       SizedBox(
  42.                         height: 1,
  43.                       ),
  44.                       TextField(
  45.                         readOnly: true,
  46.                         keyboardType: TextInputType.multiline,
  47.                         maxLines: null,
  48.                         controller: TextEditingController(
  49.                             text: snapshot.data[0].nomemp ?? ""),
  50.                       ),
  51.                       SizedBox(
  52.                         height: 3,
  53.                       ),
  54.                       Text("Cliente:",
  55.                           style: TextStyle(fontWeight: FontWeight.bold)),
  56.                       SizedBox(
  57.                         height: 1,
  58.                       ),
  59.                       TextField(
  60.                         readOnly: true,
  61.                         keyboardType: TextInputType.multiline,
  62.                         maxLines: null,
  63.                         controller: TextEditingController(
  64.                             text: snapshot.data[0].codcli.toString()+" - "+snapshot.data[0].nomcli ?? ""),
  65.                       ),
  66.                       SizedBox(
  67.                         height: 3,
  68.                       ),
  69.                       Text("Cond. Pagamento:",
  70.                           style: TextStyle(fontWeight: FontWeight.bold)),
  71.                       SizedBox(
  72.                         height: 1,
  73.                       ),
  74.                       TextField(
  75.                         readOnly: true,
  76.                         keyboardType: TextInputType.multiline,
  77.                         maxLines: null,
  78.                         controller: TextEditingController(
  79.                             text: snapshot.data[0].descpg ?? ""),
  80.                       ),
  81.                       SizedBox(
  82.                         height: 3,
  83.                       ),
  84.                       Text("Cond. Pagto:",
  85.                           style: TextStyle(fontWeight: FontWeight.bold)),
  86.                       SizedBox(
  87.                         height: 1,
  88.                       ),
  89.                       TextField(
  90.                         readOnly: true,
  91.                         keyboardType: TextInputType.multiline,
  92.                         maxLines: null,
  93.                         controller: TextEditingController(
  94.                             text: snapshot.data[0].descpg ?? ""),
  95.                       ),
  96.                       SizedBox(
  97.                         height: 3,
  98.                       ),
  99.                       Text("Preço de Pauta:",
  100.                           style: TextStyle(fontWeight: FontWeight.bold)),
  101.                       SizedBox(
  102.                         height: 1,
  103.                       ),
  104.                       TextField(
  105.                         readOnly: true,
  106.                         keyboardType: TextInputType.multiline,
  107.                         maxLines: null,
  108.                         controller: TextEditingController(
  109.                             text: snapshot.data[0].prepau == "N" ? "Não" : "Sim"),
  110.                       ),
  111.                       SizedBox(
  112.                         height: 3,
  113.                       ),
  114.                       Text("Representante:",
  115.                           style: TextStyle(fontWeight: FontWeight.bold)),
  116.                       SizedBox(
  117.                         height: 1,
  118.                       ),
  119.                       TextField(
  120.                         readOnly: true,
  121.                         keyboardType: TextInputType.multiline,
  122.                         maxLines: null,
  123.                         controller: TextEditingController(
  124.                             text: snapshot.data[0].nomrep ?? ""),
  125.                       ),
  126.                       SizedBox(
  127.                         height: 3,
  128.                       ),
  129.                       Text("Valor IPI:",
  130.                           style: TextStyle(fontWeight: FontWeight.bold)),
  131.                       SizedBox(
  132.                         height: 1,
  133.                       ),
  134.                       TextFormField(
  135.                         readOnly: true,
  136.                         controller: TextEditingController(
  137.                             text: "R\$ " +
  138.                                 Util.ConverteMascara(
  139.                                     snapshot.data[0].vlripi ?? 0.00,
  140.                                     "###,###,##0.00")),
  141.                       ),
  142.                       SizedBox(
  143.                         height: 5,
  144.                       ),
  145.                       Text("Valor ICMS:"),
  146.                       SizedBox(
  147.                         height: 1,
  148.                       ),
  149.                       TextFormField(
  150.                         readOnly: true,
  151.                         controller: TextEditingController(
  152.                             text: "R\$ " +
  153.                                 Util.ConverteMascara(
  154.                                     snapshot.data[0].vlricm ?? 0.00,
  155.                                     "###,###,##0.00")),
  156.                       ),
  157.                       SizedBox(
  158.                         height: 3,
  159.                       ),
  160.                       Text("Valor Total:",
  161.                           style: TextStyle(fontWeight: FontWeight.bold)),
  162.                       SizedBox(
  163.                         height: 1,
  164.                       ),
  165.                       TextFormField(
  166.                         readOnly: true,
  167.                         controller: TextEditingController(
  168.                             text: "R\$ " +
  169.                                 Util.ConverteMascara(
  170.                                     snapshot.data[0].vlrtot ?? 0.00,
  171.                                     "###,###,##0.00")),
  172.                         style: TextStyle(
  173.                             color: Colors.red, fontWeight: FontWeight.bold),
  174.                       ),
  175.                       SizedBox(
  176.                         height: 3,
  177.                       ),
  178.                       Text("Valor Vencido:",
  179.                           style: TextStyle(fontWeight: FontWeight.bold, fontSize: 18)),
  180.                       SizedBox(
  181.                         height: 1,
  182.                       ),
  183.                       TextFormField(
  184.                         readOnly: true,
  185.                         controller: TextEditingController(
  186.                             text: "R\$ " +
  187.                                 Util.ConverteMascara(
  188.                                     snapshot.data[0].vlrabe ?? 0.0,
  189.                                     "###,###,##0.00")),
  190.                         style: TextStyle(
  191.                             color: Colors.red, fontWeight: FontWeight.bold,fontSize: 18),
  192.                       ),
  193.                     ],
  194.                   ),
  195.                 ),
  196.               );
  197.             }
  198.           },
  199.         ),
  200.       ),
  201.     );
  202.   }
  203. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement