Advertisement
sebuahhobi

rendered flex, rendered box was not laid

Jun 13th, 2022
1,279
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Dart 4.15 KB | None | 0 0
  1. return Material(
  2.       child: Scaffold(
  3.         resizeToAvoidBottomInset: false,
  4.         appBar: AppBar(
  5.           leading: const Icon(
  6.             Icons.arrow_back,
  7.             color: Colors.white,
  8.           ),
  9.           elevation: 5,
  10.           title: const Text(
  11.             "GPS",
  12.           ),
  13.         ),
  14.         body: Container(
  15.           width: 130,
  16.           margin: const EdgeInsets.all(10),
  17.           child: SingleChildScrollView(
  18.             child: Column(
  19.               children: [
  20.                 SizedBox(
  21.                   height: 10,
  22.                   child: TextFormField(
  23.                     controller: latT,
  24.                     decoration: InputDecoration(
  25.                       labelText: "Latitude",
  26.                       border: OutlineInputBorder(
  27.                         borderRadius: BorderRadius.circular(10),
  28.                       ),
  29.                     ),
  30.                   ),
  31.                 ),
  32.                 Flexible(
  33.                   child: TextFormField(
  34.                     controller: longT,
  35.                     decoration: InputDecoration(
  36.                       labelText: "Longitude",
  37.                       border: OutlineInputBorder(
  38.                         borderRadius: BorderRadius.circular(10),
  39.                       ),
  40.                     ),
  41.                   ),
  42.                 ),
  43.                 Flexible(
  44.                   child: TextFormField(
  45.                     controller: ketT,
  46.                     decoration: InputDecoration(
  47.                       labelText: "Keterangan",
  48.                       border: OutlineInputBorder(
  49.                         borderRadius: BorderRadius.circular(10),
  50.                       ),
  51.                     ),
  52.                   ),
  53.                 ),
  54.                 Flexible(
  55.                   child: Row(
  56.                     mainAxisAlignment: MainAxisAlignment.spaceAround,
  57.                     children: [
  58.                       ElevatedButton(
  59.                         style: ButtonStyle(
  60.                           backgroundColor:
  61.                               MaterialStateProperty.all(Colors.greenAccent),
  62.                         ),
  63.                         onPressed: () async {
  64.                           saveData();
  65.                         },
  66.                         child: const Text("Simpan Data"),
  67.                       ),
  68.                       ElevatedButton(
  69.                         onPressed: () {
  70.                           checkGps();
  71.                         },
  72.                         child: const Text("Get GPS"),
  73.                       ),
  74.                     ],
  75.                   ),
  76.                 ),
  77.                 /*ListView.builder(
  78.                   scrollDirection: Axis.vertical,
  79.                   shrinkWrap: true,
  80.                   itemCount: _journals.length,
  81.                   itemBuilder: (context, index) => Card(
  82.                     color: Colors.orange[200],
  83.                     margin: const EdgeInsets.all(15),
  84.                     child: ListTile(
  85.                       title: Text(
  86.                         _journals[index]['id'],
  87.                       ),
  88.                       subtitle: Text(
  89.                         _journals[index]['lat'],
  90.                       ),
  91.                       trailing: SizedBox(
  92.                         width: 100,
  93.                         child: Row(
  94.                           children: [
  95.                             IconButton(
  96.                               icon: const Icon(Icons.edit),
  97.                               onPressed: () {},
  98.                             ),
  99.                             IconButton(
  100.                               icon: const Icon(Icons.delete),
  101.                               onPressed: () =>
  102.                                   _deleteItem(_journals[index]['id']),
  103.                             ),
  104.                           ],
  105.                         ),
  106.                       ),
  107.                     ),
  108.                   ),
  109.                 ),*/
  110.               ],
  111.             ),
  112.             /*Text(servicestatus ? "GPS is Enabled" : "GPS is disabled."),
  113.                   Text(haspermission ? "GPS is Enabled" : "GPS is disabled."),*/
  114.           ),
  115.         ),
  116.       ),
  117.     );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement