Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import 'package:crud_flutter/model/barang.dart';
- import 'package:http/http.dart' show Client;
- class ApiService {
- final String baseUrl = "http://192.168.1.17/api_barang/index.php/Api/";
- Client client = Client();
- Future<List<Barang>> geBarang() async{
- final response = await client.get("$baseUrl/getBarang");
- if(response.statusCode == 200){
- return barangFromJson(response.body);
- }else{
- return null;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment