session 0.1.1
session: ^0.1.1 copied to clipboard
Network request result
session #
Network request result
json to dart https://javiercbk.github.io/json_to_dart/
Getting Started #
Add dependency #
dependencies:
session: ^0.1.1 #latest version
Example #
import 'package:session/session.dart';
Session session = Session(
config: Config(
baseUrl: 'https://api.tuchong.com/',
// proxy: 'PROXY localhost:8888',
connectTimeout: 5,
receiveTimeout: 5,
code: 'result',
list: 'feedList',
validCode: 'SUCCESS',
),
);
void example() async {
Result result = await session.request('feed-app', data: {'page': _counter});
if (result.valid) {
result.fillList(result.list.map((json) => Model.fromJson(json)).toList());
print(result.models.length);
}
}