ServiceGenerator class

Generates a service class.

Constructors

ServiceGenerator.new({required String name, String output = 'output/services'})
Creates a new instance of ServiceGenerator.

Properties

hashCode int
The hash code for this object.
no setterinherited
name String
The name of the service.
getter/setter pair
output String
The output directory for the service file.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

generate(List<Map<String, String>> functionList) → void
getFunctionCode({required String name, String method = 'get', String url = 'ApiConstants.fetch(id)', bool isAuth = false}) StringBuffer
Generates a function for the service.
getServiceCode(List<Map<String, String>> functions) String
Generates the code for the service class.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited