vstate 0.0.4

SDKflutter
Platformandroidioswindowslinuxmacosweb

library that provides functionality for generating documentation for API requests.

vstate vstate is a Dart library that provides functionality for generating documentation for API requests. The library includes a generator that can parse annotated classes and functions and generate Markdown files that describe their associated API requests.

Usage To use vstate, import the library and use the RequestApi annotation to annotate functions that correspond to API requests:

add

dependencies:
  flutter:
    sdk: flutter
  vstate:
dev_dependencies:
  flutter_test:
    sdk: flutter
  build_runner:
import 'package:vstate/vstate.dart';
class XRepository {
  // ...
  @RequestApi(
  endpoint: '/api/v1/users',
  methodType: 'GET',
  requestType: '',
  responseType: 'List<User>',
)
 Future<void> FatchUsers(){
    // ...
 }
}
flutter pub run build_runner build

When you run the docGeneratorBuilder builder on your code, it will generate a Markdown file with information md

Class UserApiClient

EndpointMethod TypeRequest TypeResponse Type
/api/v1/usersGETList<User>

Request Body

FieldTypeRequired
String ('id')int✅
String ('name')String✅

Function incrementCounter

EndpointMethod TypeRequest TypeResponse Type
/func3GETfunc3func3