Advertisement
Guest User

Untitled

a guest
Oct 21st, 2019
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Dart 25.21 KB | None | 0 0
  1. import 'dart:async';
  2. import 'package:app_esdudez/models/ciclo_model.dart';
  3. import 'package:flutter/material.dart';
  4. import 'package:scoped_model/scoped_model.dart';
  5. import 'home_estudarFinal.dart';
  6. import 'package:flutter_datetime_picker/flutter_datetime_picker.dart';
  7. import 'package:intl/intl.dart';
  8. import 'package:app_esdudez/widgets/bordaContainer.dart';
  9.  
  10. class HomeEstudar extends StatefulWidget {
  11.   @override
  12.   _HomeEstudar createState() => _HomeEstudar();
  13. }
  14.  
  15. class _HomeEstudar extends State<HomeEstudar>
  16.     with SingleTickerProviderStateMixin {
  17.   @override
  18.   void initState() {
  19.     super.initState();
  20.     _animationController =
  21.         AnimationController(vsync: this, duration: Duration(milliseconds: 300));
  22.     DateTime now = DateTime.now();
  23.     _date = DateFormat('dd-MM-yyyy').format(now);
  24.   }
  25.  
  26.   @override
  27.   void dispose() {
  28.     super.dispose();
  29.     _animationController.dispose();
  30.   }
  31.  
  32.   List<String> materia = [
  33.     // lista de materias
  34.     "Ingles",
  35.     "Portugues",
  36.     "Matematica",
  37.     "Direito Processual Penal"
  38.   ];
  39.  
  40.   final _scaffoldKey = GlobalKey<ScaffoldState>();
  41.   final _assuntoController = TextEditingController();
  42.   final _formKey = GlobalKey<FormState>();
  43.   AnimationController _animationController;
  44.   Stopwatch watch = new Stopwatch();
  45.   Timer timer;
  46.   String _date = "Data"; // Dia do estudo
  47.   String _time = "Tempo";
  48.   String elapsedTime = '00:00:00'; // tempo de estudo
  49.   String tempoManual;
  50.   String dropdownValue = 'Ingles'; //materia escolhida
  51.   String newValue;
  52.   String textoMenu = "Selecione a matéria";
  53.   String assunto = ''; // assunto que está estudando
  54.   String textoBotaoPlay = "Iniciar";
  55.   String hoursStr = "00";
  56.   String minutesStr = "00";
  57.   String secondsStr = "00";
  58.   bool assuntoControle = true;
  59.   bool tempoIniciado = false;
  60.   bool isPlaying = false;
  61.   bool _isButtonLembreteDisabled = false;
  62.   bool _isButtonTempoManualDisabled = false;
  63.   bool _isButtonDataDisabled = false;
  64.   int dropdownbuttonControle = 2;
  65.   int buttonControle = 2;
  66.   int timeSoFar;
  67.   int timeSoFarHoras;
  68.   int timeSoFarMinutos;
  69.   int timeSoFarSegundos;
  70.   int valorWidget = 0;
  71.   int valorPadrao = 0;
  72.   double cardControle = 3;
  73.   var _height = 300.0;
  74.   var _heightPadrao = 90.0;
  75.   var _widthPadrao = 90.0;
  76.  
  77.   @override
  78.   Widget build(BuildContext context) {
  79.     // usar model,
  80.     // criar variavel no ciclo by user, para a materia do ciclo
  81.     // cirar uma funçao no model, par varrer as materias e pegar a primeira que nao foi estudada
  82.     // puxar a materia que nao foi estudada para essa tela, (função retorna materia)
  83.     // usar materia, ou pegar id dela, para adicionar as os topicos, com o id dela..
  84.     final List<Widget> myWidget = [
  85.       teste(),
  86.       teste2(),
  87.     ];
  88.  
  89.     final List<Widget> myPadrao = [
  90.       padrao(),
  91.       padrao2(),
  92.     ];
  93.     print('Tela Estudar.');
  94.     return ScopedModelDescendant<CicloModel>(builder: (context, child, model) {
  95.       model
  96.           .getMateriaParaEstudo(); // chama função para buscar proxima materia para estudar...
  97.  
  98.       if (model.isLoading) {
  99.         print("entrou no if model loading..");
  100.         // CHAMA FUNÇAO DEDICADA A ESSA TELA
  101.  
  102.         return Center(
  103.           child: CircularProgressIndicator(
  104.               valueColor: new AlwaysStoppedAnimation<Color>(Colors.white)),
  105.         );
  106.       } else {
  107.         print("entrou no ELSE");
  108.         print(model.materiaParaEstudo.nome);
  109.         print(model.materiaParaEstudo.index);
  110.  
  111.         return Scaffold(
  112.             backgroundColor: Colors.white,
  113.             resizeToAvoidBottomPadding: false,
  114.             key: _scaffoldKey,
  115.             body: Container(
  116.                 color: Colors.blue,
  117.                 child: Container(
  118.                     decoration: bordaContainer(), // Borda do body do Scafold
  119.                     child: SingleChildScrollView(
  120.                         child: Padding(
  121.                       padding: EdgeInsets.only(
  122.                           top: 5, left: 15, right: 15, bottom: 15),
  123.                       child: Column(
  124.                         children: <Widget>[
  125.                           AnimatedContainer(
  126.                             height: _height,
  127.                             duration: Duration(seconds: 1),
  128.                             child: myWidget[valorWidget],
  129.                           ),
  130.                           Padding(
  131.                             padding: EdgeInsets.only(bottom: 20),
  132.                           ),
  133.                           GestureDetector(
  134.                             child: Card(
  135.                               elevation: 8,
  136.                               color: Colors.blue,
  137.                               shape: RoundedRectangleBorder(
  138.                                   borderRadius: BorderRadius.circular(500)),
  139.                               child: AnimatedContainer(
  140.                                 duration: Duration(seconds: 1),
  141.                                 height: _heightPadrao,
  142.                                 width: _widthPadrao,
  143.                                 child: AnimatedSwitcher(
  144.                                   duration: Duration(seconds: 5),
  145.                                   child: myPadrao[valorPadrao],
  146.                                 ),
  147.                               ),
  148.                             ),
  149.                             onTap: onpressedIniciar(),
  150.                           ),
  151.                           Text(
  152.                             "Iniciar",
  153.                             style: TextStyle(fontSize: 15),
  154.                           ),
  155.                           Container(
  156.                               child: Row(
  157.                             mainAxisAlignment: MainAxisAlignment.spaceEvenly,
  158.                             children: <Widget>[
  159.                               botaoParar(), // Botao que para de contar o tempo
  160.                               SizedBox(width: 50.0),
  161.                               botaoReiniciar(),
  162.                             ],
  163.                           ))
  164.                         ],
  165.                       ),
  166.                     )))),
  167.             floatingActionButton: FloatingActionButton.extended(
  168.               ///BOTAO FINALIZAR
  169.               heroTag: 'teste5',
  170.               onPressed:
  171.                   onpressedAvancar(), // Ações realizadas quando o botao avançar é pressionado
  172.               label: Text(
  173.                 "Avançar",
  174.                 style: TextStyle(fontSize: 15),
  175.               ),
  176.               backgroundColor: Colors.blue,
  177.             ),
  178.             floatingActionButtonLocation:
  179.                 FloatingActionButtonLocation.endFloat);
  180.       }
  181.     });
  182.   }
  183.  
  184.   updateTime(Timer timer) {
  185.     if (watch.isRunning) {
  186.       setState(() {
  187.         elapsedTime = transformMilliSeconds(watch.elapsedMilliseconds);
  188.       });
  189.     }
  190.   }
  191.  
  192.   startWatch() {
  193.     watch.start();
  194.     timer = new Timer.periodic(new Duration(milliseconds: 100), updateTime);
  195.   }
  196.  
  197.   stopWatch() {
  198.     watch.stop();
  199.     setTime();
  200.   }
  201.  
  202.   resetWatch() {
  203.     watch.reset();
  204.     setTime();
  205.   }
  206.  
  207.   setTime() {
  208.     timeSoFar = watch.elapsedMilliseconds;
  209.     setState(() {
  210.       elapsedTime = transformMilliSeconds(timeSoFar);
  211.     });
  212.   }
  213.  
  214.   transformMilliSeconds(int milliseconds) {
  215.     int hundreds = (milliseconds / 10).truncate();
  216.     int seconds = (hundreds / 100).truncate();
  217.     int minutes = (seconds / 60).truncate();
  218.     int hours = (minutes / 60).truncate();
  219.  
  220.     setState(() {
  221.       hoursStr = (hours % 60).toString().padLeft(2, '0');
  222.       minutesStr = (minutes % 60).toString().padLeft(2, '0');
  223.       secondsStr = (seconds % 60).toString().padLeft(2, '0');
  224.     });
  225.  
  226.     return "$hoursStr:$minutesStr:$secondsStr";
  227.   }
  228.  
  229.   void _handleOnPressed() {
  230.     setState(() {
  231.       isPlaying = !isPlaying;
  232.       isPlaying
  233.           ? _animationController.forward()
  234.           : _animationController.reverse();
  235.     });
  236.   }
  237.  
  238.   Function onpressedLembrete() {
  239.     if (_isButtonLembreteDisabled) {
  240.       return null;
  241.     } else {
  242.       return () {
  243.         // do anything else you may want to here
  244.       };
  245.     }
  246.   }
  247.  
  248.   Function onpressedTempoManual() {
  249.     if (_isButtonTempoManualDisabled) {
  250.       return null;
  251.     } else {
  252.       return () {
  253.         if (_formKey.currentState.validate()) {
  254.           if (dropdownValue != null) {
  255.             DatePicker.showTimePicker(context,
  256.                 theme: DatePickerTheme(
  257.                   containerHeight: 210.0,
  258.                 ),
  259.                 showTitleActions: true, onConfirm: (time) {
  260.               print('confirm $time');
  261.               _time = '${time.hour}:${time.minute}:${time.second}';
  262.               setState(() {
  263.                 //startWatch();
  264.                 //stopWatch();
  265.               });
  266.             }, currentTime: DateTime.now(), locale: LocaleType.en);
  267.             setState(() {});
  268.           }
  269.         } else {
  270.           _scaffoldKey.currentState.showSnackBar(
  271.               SnackBar(content: Text("Voce nao selecionou a materia")));
  272.         }
  273.       };
  274.     }
  275.   }
  276.  
  277.   Function onpressedData() {
  278.     if (_isButtonDataDisabled) {
  279.       return null;
  280.     } else {
  281.       return () {
  282.         DatePicker.showDatePicker(context,
  283.             theme: DatePickerTheme(
  284.               containerHeight: 210.0,
  285.             ),
  286.             showTitleActions: true,
  287.             minTime: DateTime(2000, 1, 1),
  288.             maxTime: DateTime(2050, 12, 31), onConfirm: (date) {
  289.           print('confirm $date');
  290.           _date = '${date.day}-${date.month}-${date.year}';
  291.           setState(() {});
  292.         }, currentTime: DateTime.now(), locale: LocaleType.en);
  293.       };
  294.     }
  295.   }
  296.  
  297.   Function onpressedIniciar() {
  298.     return () {
  299.       if (_formKey.currentState.validate()) {
  300.         if (dropdownValue != null) {
  301.           if (tempoIniciado == false) {
  302.             setState(() {
  303.               _heightPadrao = 230.0;
  304.               _widthPadrao = 230.0;
  305.               _height = 140.0;
  306.               valorWidget = 1;
  307.               valorPadrao = 1;
  308.               assuntoControle = false;
  309.               _isButtonLembreteDisabled = true;
  310.               _isButtonTempoManualDisabled = true;
  311.               _isButtonDataDisabled = true;
  312.               textoMenu = dropdownValue;
  313.               dropdownbuttonControle = 0;
  314.               cardControle = 1;
  315.               tempoIniciado = true;
  316.               textoBotaoPlay = "Pausar";
  317.             });
  318.             startWatch();
  319.  
  320.             _handleOnPressed();
  321.           } else {
  322.             setState(() {
  323.               textoBotaoPlay = "Iniciar";
  324.               tempoIniciado = false;
  325.             });
  326.             _handleOnPressed();
  327.             stopWatch();
  328.           }
  329.         } else {
  330.           Scaffold.of(context).showSnackBar(
  331.               SnackBar(content: Text("Voce nao selecionou a materia")));
  332.         }
  333.       }
  334.     };
  335.   }
  336.  
  337.   Function onpressedParar() {
  338.     return () {
  339.       if (tempoIniciado != false) {
  340.         setState(() {
  341.           textoBotaoPlay = "Iniciar";
  342.           tempoIniciado = false;
  343.         });
  344.         _handleOnPressed();
  345.         stopWatch();
  346.       }
  347.     };
  348.   }
  349.  
  350.   Function onpressedReiniciar() {
  351.     return () {
  352.       showDialog<String>(
  353.         context: context,
  354.         barrierDismissible:
  355.             true, // dialog is dismissible with a tap on the barrier
  356.         builder: (BuildContext context) {
  357.           return AlertDialog(
  358.             // CONCLUIR.....
  359.             title: Text(
  360.               'Tem certeza que quer reiniciar o tempo?',
  361.               style: TextStyle(fontSize: 15),
  362.             ),
  363.             actions: <Widget>[
  364.               FlatButton(
  365.                 child: Text(
  366.                   'Não',
  367.                   style: TextStyle(fontSize: 15),
  368.                 ),
  369.                 onPressed: () {
  370.                   Navigator.of(context).pop();
  371.                 },
  372.               ),
  373.               FlatButton(
  374.                 child: Text(
  375.                   'Sim',
  376.                   style: TextStyle(fontSize: 15),
  377.                 ),
  378.                 onPressed: () {
  379.                   resetWatch();
  380.                   if (tempoIniciado == true) {
  381.                     stopWatch();
  382.                     setState(() {
  383.                       textoBotaoPlay = "Iniciar";
  384.                       tempoIniciado = false;
  385.                     });
  386.                     _handleOnPressed();
  387.                   }
  388.                   Navigator.of(context).pop();
  389.                 },
  390.               ),
  391.             ],
  392.           );
  393.         },
  394.       );
  395.     };
  396.   }
  397.  
  398.   Widget espaco() {
  399.     return Padding(
  400.       padding: EdgeInsets.only(bottom: 10),
  401.     );
  402.   }
  403.  
  404.   Function onpressedAvancar() {
  405.     return () {
  406.       //if (_formKey.currentState.validate()) {
  407.       if (dropdownValue != null) {
  408.         if (cardControle == 1) {
  409.           if (tempoIniciado == true) {
  410.             stopWatch();
  411.             setState(() {
  412.               textoBotaoPlay = "Iniciar";
  413.               tempoIniciado = false;
  414.             });
  415.             _handleOnPressed();
  416.           }
  417.           Navigator.of(context).push(
  418.               MaterialPageRoute(builder: (context) => HomeEstudarFinal()));
  419.         } else {
  420.           _scaffoldKey.currentState.showSnackBar(
  421.               SnackBar(content: Text("Voce nao iniciou seu tempo")));
  422.         }
  423.       } else {
  424.         _scaffoldKey.currentState.showSnackBar(
  425.             SnackBar(content: Text("Voce nao selecionou a materia")));
  426.       }
  427.       //}
  428.     };
  429.   }
  430.  
  431.   Widget selecionaMateria() {
  432.     return Container(
  433.       decoration: BoxDecoration(
  434.         border: Border.all(width: 0.1),
  435.         color: Colors.white,
  436.       ),
  437.       child: DropdownButtonHideUnderline(
  438.           child: ButtonTheme(
  439.         alignedDropdown: true,
  440.         child: DropdownButton<String>(
  441.           isExpanded: true,
  442.           hint: new Text(
  443.             textoMenu,
  444.             style: TextStyle(color: Colors.black, fontSize: 15.0),
  445.           ),
  446.           value: dropdownValue,
  447.           onChanged: dropdownbuttonControle > 1
  448.               ? (newValue) {
  449.                   setState(() {
  450.                     dropdownValue = newValue;
  451.                   });
  452.                 }
  453.               : null,
  454.           items: materia.map<DropdownMenuItem<String>>((String value) {
  455.             return DropdownMenuItem<String>(
  456.               value: value,
  457.               child: Text(
  458.                 value,
  459.                 style: TextStyle(color: Colors.black, fontSize: 15.0),
  460.               ),
  461.             );
  462.           }).toList(),
  463.         ),
  464.       )),
  465.     );
  466.   }
  467.  
  468.   Widget digitaAssunto() {
  469.     return Form(
  470.       key: _formKey,
  471.       child: Column(
  472.         crossAxisAlignment: CrossAxisAlignment.start,
  473.         children: <Widget>[
  474.           Text(
  475.             "Digite o assunto que está estudando",
  476.             style: TextStyle(fontSize: 15),
  477.           ),
  478.           TextFormField(
  479.             controller: _assuntoController,
  480.             maxLength: 70,
  481.             enabled: assuntoControle,
  482.             key: Key('Assunto'),
  483.             style: TextStyle(color: Colors.black, fontSize: 15.0),
  484.             validator: (value) {
  485.               // verificar alerta de erro
  486.               if (value.isEmpty) {
  487.                 return 'Por favor digite o assunto';
  488.               } else {
  489.                 setState(() {
  490.                   assunto = value;
  491.                 });
  492.               }
  493.             },
  494.             onSaved: (value) {
  495.               setState(() {
  496.                 assunto = value;
  497.               });
  498.             },
  499.           ),
  500.         ],
  501.       ),
  502.     );
  503.   }
  504.  
  505.   Widget diaEstudo() {
  506.     return GestureDetector(
  507.       onTap: onpressedData(),
  508.       child: Container(
  509.         alignment: Alignment.center,
  510.         //height: 50.0,
  511.         child: Row(
  512.           mainAxisAlignment: MainAxisAlignment.spaceBetween,
  513.           children: <Widget>[
  514.             Row(
  515.               children: <Widget>[
  516.                 Container(
  517.                   child: Row(
  518.                     children: <Widget>[
  519.                       Icon(
  520.                         Icons.date_range,
  521.                         size: 15.0,
  522.                         color: Colors.black,
  523.                       ),
  524.                       Text(
  525.                         " Dia: $_date",
  526.                         style: TextStyle(color: Colors.black, fontSize: 15.0),
  527.                       ),
  528.                     ],
  529.                   ),
  530.                 )
  531.               ],
  532.             ),
  533.             Text(
  534.               "  Trocar",
  535.               style: TextStyle(color: Colors.black, fontSize: 15.0),
  536.             ),
  537.           ],
  538.         ),
  539.       ),
  540.     );
  541.   }
  542.  
  543.   Widget botaoParar() {
  544.     return Column(
  545.       //BOTAO PARAR
  546.       children: <Widget>[
  547.         SizedBox(
  548.           width: 40,
  549.           height: 40,
  550.           child: new FloatingActionButton(
  551.               heroTag: 'teste1',
  552.               elevation: 5,
  553.               backgroundColor: Colors.white,
  554.               onPressed: onpressedParar(),
  555.               child: new Icon(
  556.                 Icons.stop,
  557.                 color: Colors.black,
  558.                 size: 20,
  559.               )),
  560.         ),
  561.         Padding(
  562.           padding: EdgeInsets.only(bottom: 3),
  563.         ),
  564.         Text(
  565.           "Parar",
  566.           style: TextStyle(fontSize: 12, color: Colors.black),
  567.         ),
  568.       ],
  569.     );
  570.   }
  571.  
  572.   Widget botaoIniciar() {
  573.     return Column(
  574.       //BOTAO INICIAR
  575.       children: <Widget>[
  576.         SizedBox(
  577.           height: 60,
  578.           width: 60,
  579.           child: FloatingActionButton(
  580.             heroTag: 'teste2',
  581.             elevation: 5,
  582.             backgroundColor: Colors.white,
  583.             child: AnimatedIcon(
  584.               icon: AnimatedIcons.play_pause,
  585.               progress: _animationController,
  586.               size: 35,
  587.               color: Colors.black,
  588.             ),
  589.             onPressed: onpressedIniciar(),
  590.           ),
  591.         ),
  592.         Padding(
  593.           padding: EdgeInsets.only(bottom: 3),
  594.         ),
  595.         Text(
  596.           textoBotaoPlay,
  597.           style: TextStyle(fontSize: 14, color: Colors.black),
  598.         ),
  599.       ],
  600.     );
  601.   }
  602.  
  603.   Widget botaoReiniciar() {
  604.     return Column(
  605.       //BOTAO REINICIAR
  606.       children: <Widget>[
  607.         SizedBox(
  608.           width: 40,
  609.           height: 40,
  610.           child: new FloatingActionButton(
  611.               heroTag: 'teste3',
  612.               elevation: 5,
  613.               backgroundColor: Colors.white,
  614.               onPressed: onpressedReiniciar(),
  615.               child: new Icon(
  616.                 Icons.refresh,
  617.                 color: Colors.black,
  618.                 size: 20,
  619.               )),
  620.         ),
  621.         Padding(
  622.           padding: EdgeInsets.only(bottom: 3),
  623.         ),
  624.         Text(
  625.           "Reiniciar",
  626.           style: TextStyle(fontSize: 12, color: Colors.black),
  627.         ),
  628.       ],
  629.     );
  630.   }
  631.  
  632.   Widget botaoLembrete() {
  633.     return RaisedButton(
  634.       color: Colors.white,
  635.       child: Text("Definir Lembrete",
  636.           style: TextStyle(fontSize: 15, color: Colors.black87)),
  637.       onPressed: onpressedLembrete(),
  638.     );
  639.   }
  640.  
  641.   Widget botaoTempoManual() {
  642.     return RaisedButton(
  643.         color: Colors.white,
  644.         child: Text("Tempo Manual",
  645.             style: TextStyle(fontSize: 15, color: Colors.black87)),
  646.         onPressed: onpressedTempoManual());
  647.   }
  648.  
  649.   Widget teste() {
  650.     return Card(
  651.         elevation: cardControle,
  652.         child: Padding(
  653.             padding: EdgeInsets.only(left: 20, right: 20, top: 10, bottom: 10),
  654.             child: Column(
  655.               // coluna dentro do card
  656.               crossAxisAlignment: CrossAxisAlignment.start,
  657.               children: <Widget>[
  658.                 Text(
  659.                   "Selecione a materia que irá estudar",
  660.                   style: TextStyle(fontSize: 15),
  661.                 ),
  662.                 espaco(), // Espaço entre os componentes
  663.                 selecionaMateria(), // Dropbutton, para selecionar a materia que ira estudar
  664.                 espaco(), // Espaço entre os componentes
  665.                 digitaAssunto(), // Espaço para digitar o assunto que sera estudado
  666.                 espaco(), // Espaço entre os componentes
  667.                 diaEstudo(), // Dia de estudo - por padrao é o dia atual, é possivel alterar
  668.                 espaco(), // Espaço entre os componentes
  669.                 Row(
  670.                   mainAxisAlignment: MainAxisAlignment.spaceBetween,
  671.                   children: <Widget>[
  672.                     botaoLembrete(), // Defini um alarme para o tempo de estudo
  673.                     botaoTempoManual(), // Inseri um tempo manual, é possivel continuar a partir desse tempo
  674.                     // ainde precisa de ajustes
  675.                   ],
  676.                 )
  677.               ],
  678.             )));
  679.   }
  680.  
  681.   Widget teste2() {
  682.     return Card(
  683.         elevation: 5,
  684.         child: Padding(
  685.             padding: EdgeInsets.only(left: 20, right: 20, top: 10, bottom: 10),
  686.             child: Row(
  687.               children: <Widget>[
  688.                 Column(
  689.                   // coluna dentro do card
  690.                   crossAxisAlignment: CrossAxisAlignment.start,
  691.                   children: <Widget>[
  692.                     Text(
  693.                       "Direito Penal:",
  694.                       style: TextStyle(fontSize: 15),
  695.                     ),
  696.                     espaco(), // Espaço entre os componentes
  697.                     Text(
  698.                       "Principios Direito Penal",
  699.                       style: TextStyle(fontSize: 15),
  700.                     ),
  701.                     espaco(), // Espaço entre os componentes
  702.                     Row(
  703.                       children: <Widget>[
  704.                         Icon(
  705.                           Icons.date_range,
  706.                           size: 15.0,
  707.                           color: Colors.black,
  708.                         ),
  709.                         Padding(
  710.                           padding: EdgeInsets.only(left: 5),
  711.                         ),
  712.                         Text(
  713.                           "Dia: 10/12/2019",
  714.                           style: TextStyle(fontSize: 15),
  715.                         ),
  716.                       ],
  717.                     ),
  718.                     espaco(), // Espaço entre os componentes
  719.                     Row(
  720.                       children: <Widget>[
  721.                         Icon(
  722.                           Icons.access_alarm,
  723.                           size: 15.0,
  724.                           color: Colors.black,
  725.                         ),
  726.                         Padding(
  727.                           padding: EdgeInsets.only(left: 5),
  728.                         ),
  729.                         Text(
  730.                           "Alarme",
  731.                           style: TextStyle(fontSize: 15),
  732.                         ),
  733.                       ],
  734.                     ),
  735.  
  736.                   ],
  737.                 )
  738.               ],
  739.             )));
  740.   }
  741.  
  742.   Widget padrao() {
  743.     return Padding(
  744.       padding: EdgeInsets.all(3),
  745.       child: Card(
  746.         elevation: 5,
  747.         color: Colors.white,
  748.         shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(500)),
  749.         child: Container(
  750.           alignment: AlignmentDirectional.center,
  751.           child: AnimatedIcon(
  752.             icon: AnimatedIcons.play_pause,
  753.             progress: _animationController,
  754.             size: 35,
  755.             color: Colors.black,
  756.           ),
  757.         ),
  758.       ),
  759.     );
  760.   }
  761.  
  762.   Widget padrao2() {
  763.     return Padding(
  764.       padding: EdgeInsets.all(3),
  765.       child: Card(
  766.         elevation: 5,
  767.         color: Colors.white,
  768.         shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(500)),
  769.         child: Container(
  770.           alignment: AlignmentDirectional.center,
  771.           child: Column(
  772.             mainAxisAlignment: MainAxisAlignment.center,
  773.             crossAxisAlignment: CrossAxisAlignment.center,
  774.             children: <Widget>[
  775.               Padding(
  776.                 padding: EdgeInsets.only(top: 70),
  777.               ),
  778.               Row(
  779.                 crossAxisAlignment: CrossAxisAlignment.center,
  780.                 mainAxisAlignment: MainAxisAlignment.center,
  781.                 children: <Widget>[
  782.                   Text(
  783.                     hoursStr,
  784.                     style: TextStyle(fontSize: 45),
  785.                   ),
  786.                   Text(
  787.                     "h",
  788.                     style: TextStyle(fontSize: 15),
  789.                   ),
  790.                   Text(
  791.                     minutesStr,
  792.                     style: TextStyle(
  793.                       fontSize: 45,
  794.                     ),
  795.                   ),
  796.                   Text(
  797.                     "m",
  798.                     style: TextStyle(fontSize: 15),
  799.                   ),
  800.                   Text(
  801.                     secondsStr,
  802.                     style: TextStyle(fontSize: 45),
  803.                   ),
  804.                   Text(
  805.                     "s",
  806.                     style: TextStyle(fontSize: 15),
  807.                   ),
  808.                 ],
  809.               ),
  810.               Spacer(),
  811.               AnimatedIcon(
  812.                 icon: AnimatedIcons.play_pause,
  813.                 progress: _animationController,
  814.                 size: 35,
  815.                 color: Colors.black,
  816.               ),
  817.               Padding(
  818.                 padding: EdgeInsets.only(bottom: 10),
  819.               )
  820.             ],
  821.           ),
  822.         ),
  823.       ),
  824.     );
  825.   }
  826. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement