-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* create models for Artikel and create get-post method * refactor method get and post * create myartikel.dart for artikel page * create artikel_by_id.dart * create floating action button for tambah artikel * create form_tambah_artikel.dart for form tambah artikel page * delete keyboard type in form tambah artikel * Implement auth: done (#3) * Init authentication page * Add bottom navbar * Implement login and signup UI * Authentication: done * edit _bacabund.dart * add conditional for floating action button in myartikel.dart * changed widget name into MyArtikel * add BacaBundPage to routes_factory.dart, but still got an error * fixed bug string got null * fixed bug in models and method get artikel * change button color into red * fixed overflow in login page * fixed overflow in signup page * use the postArtikel method in form page * change the login and signup url & changed models attribute variable names * trash #1 * create new post method using request.post, but still got an error * fixed bugs in post artikel * fixed bugs in button simpan form artikel * delete unnecessary comments * add configuration for deployment * use circular progress indicator while fetching artikel * add state while fetching data * Periksabund ui * Create Home, Onboarding, and TanyaBund Page (#4) * Feat: TanyaBund Post Question and Answer (#5) * Create Home, Onboarding, and TanyaBund Page * Feat: Implement Functionality to Add Question and Answer * new branch * Temporary commit * get post * Commit * Add Functionality to Delete Question and Answer (#6) * Create Home, Onboarding, and TanyaBund Page * Feat: Implement Functionality to Add Question and Answer * Add Functionality to Delete Question and Answer * Fix: Conflict * Finishing TanyaBund * PeriksaBund Get, Post #1 * Pubspec commit * change appbar color * merge development * delete codes for debugging * Commit pubspec * Change Api to Railway * add if else for faskes * railway * scrollview * PeriksaBund Delete Feature #1 * scrollview * Implementing Logout * Commit Co-authored-by: iqbalpa <[email protected]> Co-authored-by: shafanjw <[email protected]> Co-authored-by: dionavarastika <[email protected]>
- Loading branch information
1 parent
b1ab5ab
commit 8070135
Showing
78 changed files
with
4,223 additions
and
169 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import 'dart:convert'; | ||
|
||
List<Artikel> artikelFromJson(String str) => List<Artikel>.from( | ||
json.decode(str).map((artikel) => Artikel.fromJson(artikel))); | ||
|
||
String artikelToJson(List<Artikel> data) => | ||
json.encode(List<dynamic>.from(data.map((artikel) => artikel.toJson()))); | ||
|
||
class Artikel { | ||
Artikel({ | ||
required this.id, | ||
required this.judul, | ||
required this.isi, | ||
required this.author, | ||
required this.tanggal, | ||
}); | ||
|
||
int id; | ||
String judul; | ||
String isi; | ||
String author; | ||
String tanggal; | ||
|
||
factory Artikel.fromJson(Map<String, dynamic> json) => Artikel( | ||
id: json['pk'], | ||
judul: json['fields']['judul'], | ||
isi: json['fields']['isi'], | ||
tanggal: json['fields']['tanggal'], | ||
author: json['fields']['author'], | ||
); | ||
|
||
Map<String, dynamic> toJson() => { | ||
'id': id, | ||
'judul': judul, | ||
'isi': isi, | ||
'author': author, | ||
'tanggal': tanggal, | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// To parse this JSON data, do | ||
// | ||
// final catat = catatFromJson(jsonString); | ||
|
||
import 'dart:convert'; | ||
|
||
Catat catatFromJson(String str) => Catat.fromJson(json.decode(str)); | ||
|
||
String catatToJson(Catat data) => json.encode(data.toJson()); | ||
|
||
class Catat { | ||
Catat({ | ||
required this.user, | ||
required this.date, | ||
required this.weight, | ||
required this.height, | ||
required this.bmi, | ||
}); | ||
|
||
int user; | ||
String date; | ||
double weight; | ||
double height; | ||
double bmi; | ||
|
||
factory Catat.fromJson(Map<String, dynamic> json) => Catat( | ||
user: json["user"], | ||
date: json["date"], | ||
weight: json["weight"].toDouble(), | ||
height: json["height"].toDouble(), | ||
bmi: json["bmi"].toDouble(), | ||
); | ||
|
||
Map<String, dynamic> toJson() => { | ||
"user": user, | ||
"date": date, | ||
"weight": weight, | ||
"height": height, | ||
"bmi": bmi, | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import 'dart:convert'; | ||
|
||
List<Note> informasiFromJson(String str) => List<Note>.from( | ||
json.decode(str).map((informasi) => Note.fromJson(informasi))); | ||
|
||
String informasiToJson(List<Note> data) => | ||
json.encode(List<dynamic>.from(data.map((informasi) => informasi.toJson()))); | ||
|
||
class Note { | ||
Note({ | ||
required this.id, | ||
required this.user, | ||
required this.lokasi, | ||
required this.tanggal, | ||
required this.waktu, | ||
required this.kapasitas_balita, | ||
}); | ||
|
||
int id; | ||
int user; | ||
String lokasi; | ||
String tanggal; | ||
String waktu; | ||
int kapasitas_balita; | ||
|
||
|
||
factory Note.fromJson(Map<String, dynamic> json) => Note( | ||
id: json['id'], | ||
user: json['user_id'], | ||
lokasi: json['lokasi'], | ||
tanggal: json['tanggal'], | ||
waktu: json['waktu'], | ||
kapasitas_balita: json['kapasitas_balita'], | ||
); | ||
|
||
Map<String, dynamic> toJson() => { | ||
'id':id, | ||
'user': user, | ||
'lokasi': lokasi, | ||
'tanggal': tanggal, | ||
'waktu': waktu, | ||
'kapasitas_balita': kapasitas_balita, | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
import 'dart:convert'; | ||
|
||
List<AnswerModel> answerModelFromJson(String str) => List<AnswerModel>.from(json.decode(str).map((x) => AnswerModel.fromJson(x))); | ||
|
||
String answerModelToJson(List<AnswerModel> data) => json.encode(List<dynamic>.from(data.map((x) => x.toJson()))); | ||
|
||
class AnswerModel { | ||
AnswerModel({ | ||
required this.model, | ||
required this.pk, | ||
required this.user, | ||
required this.text, | ||
required this.date, | ||
required this.questionPk, | ||
required this.roleUser, | ||
}); | ||
|
||
String model; | ||
int pk; | ||
String user; | ||
String text; | ||
DateTime date; | ||
int questionPk; | ||
String roleUser; | ||
|
||
factory AnswerModel.fromJson(Map<String, dynamic> json) => AnswerModel( | ||
model: json['model'], | ||
pk: json['pk'], | ||
user: List<String>.from(json['fields']['user'].map((x) => x)).first, | ||
text: json['fields']['text'], | ||
date: DateTime.parse(json['fields']['date']), | ||
questionPk: json['fields']['question'], | ||
roleUser: json['fields']['role_user'], | ||
); | ||
|
||
Map<String, dynamic> toJson() => { | ||
'model': model, | ||
'pk': pk, | ||
'user': user, | ||
'text': text, | ||
'date': "${date.year.toString().padLeft(4, '0')}-${date.month.toString().padLeft(2, '0')}-${date.day.toString().padLeft(2, '0')}", | ||
'question': questionPk, | ||
'role_user': roleUser, | ||
}; | ||
} | ||
|
||
// class Fields { | ||
// Fields({ | ||
// this.user, | ||
// this.text, | ||
// this.date, | ||
// this.question, | ||
// this.roleUser, | ||
// }); | ||
|
||
// List<String> user; | ||
// String text; | ||
// DateTime date; | ||
// int question; | ||
// String roleUser; | ||
|
||
// factory Fields.fromJson(Map<String, dynamic> json) => Fields( | ||
// user: List<String>.from(json['user'].map((x) => x)), | ||
// text: json['text'], | ||
// date: DateTime.parse(json['date']), | ||
// question: json['question'], | ||
// roleUser: json['role_user'], | ||
// ); | ||
|
||
// Map<String, dynamic> toJson() => { | ||
// 'user': List<dynamic>.from(user.map((x) => x)), | ||
// 'text': text, | ||
// 'date': "${date.year.toString().padLeft(4, '0')}-${date.month.toString().padLeft(2, '0')}-${date.day.toString().padLeft(2, '0')}", | ||
// 'question': question, | ||
// 'role_user': roleUser, | ||
// }; | ||
// } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import 'dart:convert'; | ||
|
||
List<QuestionModel> questionModelFromJson(String str) => | ||
List<QuestionModel>.from( | ||
json.decode(str).map((x) => QuestionModel.fromJson(x))); | ||
|
||
String questionModelToJson(List<QuestionModel> data) => | ||
json.encode(List<dynamic>.from(data.map((x) => x.toJson()))); | ||
|
||
class QuestionModel { | ||
QuestionModel({ | ||
required this.model, | ||
required this.pk, | ||
required this.user, | ||
required this.text, | ||
required this.isAnswered, | ||
required this.date, | ||
required this.totalLike, | ||
required this.totalAnswer, | ||
required this.roleUser, | ||
}); | ||
|
||
String model; | ||
int pk; | ||
String user; | ||
String text; | ||
bool isAnswered; | ||
DateTime date; | ||
int totalLike; | ||
int totalAnswer; | ||
String roleUser; | ||
|
||
factory QuestionModel.fromJson(Map<String, dynamic> json) => QuestionModel( | ||
model: json['model'], | ||
pk: json['pk'], | ||
user: List<String>.from(json['fields']['user'].map((x) => x)).first, | ||
text: json['fields']['text'], | ||
isAnswered: json['fields']['is_answered'], | ||
date: DateTime.parse(json['fields']['date']), | ||
totalLike: json['fields']['total_like'], | ||
totalAnswer: json['fields']['total_answer'], | ||
roleUser: json['fields']['role_user'], | ||
); | ||
|
||
Map<String, dynamic> toJson() => { | ||
'model': model, | ||
'pk': pk, | ||
'user': user, | ||
'text': text, | ||
'is_answered': isAnswered, | ||
'date': | ||
"${date.year.toString().padLeft(4, '0')}-${date.month.toString().padLeft(2, '0')}-${date.day.toString().padLeft(2, '0')}", | ||
'total_like': totalLike, | ||
'total_answer': totalAnswer, | ||
'role_user': roleUser, | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.