Fakultas Ilmu Komputer UI

Commit 7066591b authored by Usman Sidiq's avatar Usman Sidiq
Browse files

[GREEN] Fix linter issue and implement create fasilitas

parent 3c0a7702
......@@ -3,7 +3,6 @@ import 'dart:io';
import 'package:http/http.dart' as http;
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:ppl_disabilitas/page/filter_fasilitas/fasilitas.dart';
import 'package:ppl_disabilitas/utils/customDeskripsiField.dart';
import 'package:ppl_disabilitas/utils/customButton.dart';
import 'package:ppl_disabilitas/utils/validator.dart';
......@@ -112,13 +111,13 @@ class AddInformasiState extends State<AddInformasi> {
GestureDetector(
onTap: _getImage,
child: Container(
padding: const EdgeInsets.symmetric(horizontal: 20.0, vertical: 2.0),
decoration: const BoxDecoration(
padding: EdgeInsets.symmetric(horizontal: 20.0, vertical: 2.0),
decoration: BoxDecoration(
borderRadius: BorderRadius.only(
topLeft: const Radius.circular(20.0),
topRight: const Radius.circular(20.0),
bottomLeft: const Radius.circular(20.0),
bottomRight: const Radius.circular(20.0),
topLeft: Radius.circular(20.0),
topRight: Radius.circular(20.0),
bottomLeft: Radius.circular(20.0),
bottomRight: Radius.circular(20.0),
),
color: Colors.black12,
),
......@@ -142,7 +141,7 @@ class AddInformasiState extends State<AddInformasi> {
shrinkWrap: true,
key: Key('Checkbox Fasilitas'),
children: fasilitas.keys.map((String key) {
return new CheckboxListTile(
return CheckboxListTile(
title: Text(key),
value: fasilitas[key],
onChanged: (bool value) {
......@@ -191,7 +190,7 @@ class AddInformasiState extends State<AddInformasi> {
elevation: 0.0,
color: Colors.white70,
shape: RoundedRectangleBorder(
borderRadius: new BorderRadius.all(Radius.circular(10)),
borderRadius: BorderRadius.all(Radius.circular(10)),
side: BorderSide(color: Color(0xff3A903A))
),
......@@ -239,8 +238,9 @@ class AddInformasiState extends State<AddInformasi> {
}
addInfo(String tag, String deskripsi, String rating) async {
for(MapEntry<String, bool> me in fasilitas.entries)
for(MapEntry<String, bool> me in fasilitas.entries) {
if(me.value == true) tag = tag + tags[me.key] + ' ';
}
Map data = {
'tag': tag,
'deskripsi': deskripsi,
......@@ -295,8 +295,8 @@ class AddInformasiState extends State<AddInformasi> {
void _resetInput() async{
deskripsiController.clear();
rating = 0.0;
_clearImage();
_clearCheckBox();
await _clearImage();
await _clearCheckBox();
}
......
......@@ -43,8 +43,10 @@ class FieldValidator {
}
static String validateInfo(String value) {
if (value.isEmpty) return '*Wajib diisi';
else
if (value.isEmpty) {
return '*Wajib diisi';
} else {
return null;
}
}
}
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment