Fakultas Ilmu Komputer UI

Commit 91ff7a2d authored by Usman Sidiq's avatar Usman Sidiq
Browse files

[REFACTOR] Change minor update to code

parent bf4cca8e
Pipeline #41894 failed with stages
in 49 minutes and 2 seconds
import 'dart:convert';
class User {
String username;
String phonenumber;
String name;
String phone_number;
String email;
String password;
User({this.username, this.phonenumber, this.email, this.password});
User({this.name, this.phone_number, this.email, this.password});
factory User.fromJson(Map<String, dynamic> map) {
return User(
username: map["username"], phonenumber: map["phonenumber"], email: map["email"], password: map["password"]);
name: map["name"], phone_number: map["phone_number"], email: map["email"], password: map["password"]);
}
Map<String, dynamic> toJson() {
return {"username": username, "phonenumber": phonenumber, "email": email, "password": password};
return {"name": name, "phone_number": phone_number, "email": email, "password": password};
}
@override
String toString() {
return 'User{"username": $username, "phonenumber": $phonenumber, "email": $email, "password": $password}';
return 'User{"name": $name, "phone_number": $phone_number, "email": $email, "password": $password}';
}
}
......
......@@ -128,7 +128,7 @@ class LoginState extends State<Login> {
'password' : password
};
// var jsonData;
var response = await http.post('https://my.api.mockaroo.com/register.json?key=095ee610', body: data);
var response = await http.post('https://10.0.2.2:8000', body: data);
if(response.statusCode == 200) {
// jsonData = json.decode(response.body);
await Navigator.pushNamed(context, '/');
......
......@@ -3,7 +3,7 @@ import 'package:flutter/material.dart';
import 'package:ppl_disabilitas/config/styles.dart';
import 'package:ppl_disabilitas/utils/customButton.dart';
import 'package:ppl_disabilitas/utils/customTextField.dart';
//import 'package:ppl_disabilitas/network/network_interface.dart';g
//import 'package:ppl_disabilitas/network/network_interface.dart';
import 'package:ppl_disabilitas/utils/validator.dart';
import 'package:http/http.dart' as http;
......
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