angel_client 2.0.2 copy "angel_client: ^2.0.2" to clipboard
angel_client: ^2.0.2 copied to clipboard

Support for querying Angel servers in the browser, Flutter, and command-line.

example/main.dart

import 'dart:async';
import 'package:angel_client/angel_client.dart';

Future doSomething(Angel app) async {
  var userService = app
      .service<String, Map<String, dynamic>>('api/users')
      .map(User.fromMap, User.toMap);

  var users = await userService.index();
  print('Name: ${users.first.name}');
}

class User {
  final String name;

  User({this.name});

  static User fromMap(Map data) => User(name: data['name'] as String);

  static Map<String, String> toMap(User user) => {'name': user.name};
}
1
likes
40
pub points
5%
popularity

Publisher

verified publisherangel-dart.dev

Support for querying Angel servers in the browser, Flutter, and command-line.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

angel_http_exception, collection, http, json_god, meta, path

More

Packages that depend on angel_client