Initial commit: Penyerahan final Source code Tugas Akhir
This commit is contained in:
17
lib/base_service.dart
Normal file
17
lib/base_service.dart
Normal file
@ -0,0 +1,17 @@
|
||||
import 'package:flutter_dotenv/flutter_dotenv.dart';
|
||||
|
||||
// Ganti baseUrl jadi ngambil dari file .env
|
||||
String? baseUrl = dotenv.env['BASE_URL_API'];
|
||||
|
||||
const Map<String, String> baseHeader = {
|
||||
'Content-Type': 'application/json',
|
||||
'Accept': 'application/json',
|
||||
};
|
||||
|
||||
Map<String, String> headerWithToken(String? token) {
|
||||
return {
|
||||
'Content-Type': 'application/json',
|
||||
'Accept': 'application/json',
|
||||
'Authorization': 'Bearer $token',
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user