You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
431 B
20 lines
431 B
import 'package:retrofit/retrofit.dart';
|
|
import 'package:dio/dio.dart';
|
|
|
|
part 'api_service.g.dart';
|
|
|
|
@RestApi(baseUrl: 'https://api.example.com/')
|
|
abstract class ApiService {
|
|
factory ApiService(Dio dio) = _ApiService;
|
|
|
|
@GET("{path}")
|
|
Future<HttpResponse<dynamic>> get(
|
|
@Path("path") String path,
|
|
);
|
|
|
|
@POST("{path}")
|
|
Future<HttpResponse<dynamic>> post(
|
|
@Path("path") String path,
|
|
@Body() dynamic data,
|
|
);
|
|
}
|