[text] flutttt

Viewer

  1. import 'package:flutter/material.dart';
  2. import 'package:slide_countdown_clock/slide_countdown_clock.dart';
  3.  
  4.  
  5. class deepQuestions extends StatefulWidget {
  6.   @override
  7.   _deepQuestionsState createState() => _deepQuestionsState();
  8. }
  9.  
  10. class _deepQuestionsState extends State<deepQuestions>
  11.     with TickerProviderStateMixin {
  12.  
  13.   /*int endTime = DateTime.now().millisecondsSinceEpoch + 60000;*/
  14.   int _counter = 0;
  15.   AnimationController _controller;
  16.   int levelClock = 180;
  17.  
  18.   @override
  19.   void dispose() {
  20.     _controller.dispose();
  21.     super.dispose();
  22.   }
  23.  
  24.   void _incrementCounter() {
  25.     setState(() {
  26.       _counter++;
  27.     });
  28.   }
  29.  
  30.   @override
  31.   void initState() {
  32.     super.initState();
  33.     _controller = AnimationController(
  34.         vsync: this,
  35.         duration: Duration(
  36.             seconds:
  37.                 levelClock) // gameData.levelClock is a user entered number elsewhere in the applciation
  38.         );
  39.  
  40.     _controller.forward();
  41.   }
  42.   int _groupValue = -1;
  43.  
  44.   @override
  45.   Widget build(BuildContext context) {
  46.     return Scaffold(
  47.       appBar: AppBar(
  48.         backgroundColor: Colors.white,
  49.         centerTitle: false,
  50.         leading: IconButton(
  51.           icon: Icon(
  52.             Icons.arrow_back,
  53.             color: Colors.orange,
  54.           ),
  55.           onPressed: () => Navigator.pop(context),
  56.         ),
  57.         title: new Text(
  58.           'Deep 46',
  59.           style: TextStyle(color: Colors.teal),
  60.         ),
  61.       ),
  62.       body: Column(
  63.         children: [
  64.                   Row(
  65.                     children: [
  66.                       Container(
  67.                         color: Colors.deepOrange,
  68.                         width: MediaQuery.of(context).size.width / 1.4,
  69.                         height: 30,
  70.                         child: Padding(
  71.                           padding: EdgeInsets.only(left: 100),
  72.                           child: SlideCountdownClock(
  73.                           duration: Duration(minutes: 5),
  74.                           slideDirection: SlideDirection.Up,
  75.                           separator: ":",
  76.                           textStyle: TextStyle(
  77.                             fontSize: 25,
  78.                             fontWeight: FontWeight.bold,
  79.                             color: Colors.white,
  80.                           ),
  81.                           onDone: () {
  82.                             /*_scaffoldKey.currentState.showSnackBar(SnackBar(content: Text('Clock 1 finished')));*/
  83.                           },
  84.                         ),
  85.                         )
  86.                       ),
  87.                       SizedBox(
  88.                         width: 140, // <-- match_parent
  89.                         child: ElevatedButton(
  90.                           style:
  91.                           ElevatedButton.styleFrom(
  92.                             primary: Colors.teal,
  93.                           ),
  94.                           onPressed: () {
  95.                             showModalBottomSheet<void>(
  96.                               context: context,
  97.                               builder: (BuildContext context) {
  98.                                 return Container(
  99.                                   height: 400,
  100.                                   color: Colors.white,
  101.                                   child: Center(
  102.                                     child: Column(
  103.                                       mainAxisAlignment:MainAxisAlignment.start,
  104.                                       mainAxisSize: MainAxisSize.min,
  105.                                       children: <Widget>[
  106.                                         Row(
  107.                                           children: [
  108.                                             IconButton(
  109.                                               icon: Icon(
  110.                                                 Icons.arrow_back,
  111.                                                 color: Colors.orange,
  112.                                               ),
  113.                                               onPressed: () =>
  114.                                                   Navigator.pop(context),
  115.                                             ),
  116.                                             Text(
  117.                                               'Deep 46 Materi',
  118.                                               style: TextStyle(
  119.                                                 fontSize: 18,
  120.                                                 color: Colors.teal,
  121.                                                 fontWeight:
  122.                                                 FontWeight.bold,
  123.                                               ),
  124.                                             )
  125.                                           ],
  126.                                         ),
  127.                                         Image.asset('Assets/tb.PNG'),
  128.                                       ],
  129.                                     ),
  130.                                   ),
  131.                                 );
  132.                               },
  133.                             );
  134.                           },
  135.                           child:
  136.                           Row(
  137.                             children: [
  138.                              Icon( Icons.image),
  139.                               Text('Lihat Materi'),
  140.                             ],
  141.                           )
  142.                         ),
  143.                       ),
  144.  
  145.                     ],
  146.  
  147.               ),
  148.           SizedBox(height: 30),
  149.           Container(
  150.             color: Colors.white,
  151.             height: 600,
  152.             child: Column(
  153.               children: [
  154.                 Padding(padding: EdgeInsets.only(left: 10, right: 10),
  155.                   child:Text('1. Berikut Adalah Bentuk untuk melakukan Kerjasama antar bank untuk memaksimalkan keuntungan', style: TextStyle(
  156.                       fontSize: 18
  157.                   ),
  158.                   ),),
  159.  
  160.                 _myRadioButton(
  161.                   title: "Bank Garansi",
  162.                   value: 0,
  163.                   onChanged: (newValue) => setState(() => _groupValue = newValue),
  164.                 ),
  165.  
  166.                 _myRadioButton(
  167.                   title: "Pengembangan OTR Mobile remittance",
  168.                   value: 1,
  169.                   onChanged: (newValue) => setState(() => _groupValue = newValue),
  170.                 ),
  171.                 _myRadioButton(
  172.                   title: "Pinjaman Sindikasi untuk Perusahaan Besar",
  173.                   value: 2,
  174.                   onChanged: (newValue) => setState(() => _groupValue = newValue),
  175.                 ),
  176.                 _myRadioButton(
  177.                   title: "Transaksi ekspor impor",
  178.                   value: 3,
  179.                   onChanged: (newValue) => setState(() => _groupValue = newValue),
  180.                 ),
  181.                 SizedBox(height:20),
  182.                 SizedBox(
  183.                   width: MediaQuery.of(context).size.width / 1.1, // <-- match_parent
  184.                   child: ElevatedButton(
  185.                     style:
  186.                     ElevatedButton.styleFrom(
  187.                       primary: Colors.deepOrange,
  188.                     ),
  189.                     onPressed: () {
  190.                       Navigator.push(
  191.                         context,
  192.                         MaterialPageRoute(
  193.                           builder: (context) => deepQuestions(),
  194.                         ),
  195.                       );
  196.                     },
  197.                     child:
  198.                     const Text('Submit'),
  199.                   ),
  200.                 ),
  201.               ],
  202.             ),
  203.           )
  204.         ],
  205.         /*Text('Deep46 Questions Page'),*/
  206.       ),
  207.     );
  208.   }
  209. }
  210.  
  211.  
  212. Widget _myRadioButton({String title, int value, Function onChanged}) {
  213.   var _groupValue=-1;
  214.   return RadioListTile(
  215.     value: value,
  216.     groupValue: _groupValue,
  217.     onChanged: onChanged,
  218.     title: Text(title),
  219.   );
  220. }

Editor

You can edit this paste and save as new:


File Description
  • flutttt
  • Paste Code
  • 14 Jun-2021
  • 7.81 Kb
You can Share it: