dartive 0.0.2 copy "dartive: ^0.0.2" to clipboard
dartive: ^0.0.2 copied to clipboard

outdated

Retain your existing Flutter code, and use Dartive to make it faster.

Features #

A fast and easy server architecture for Dart. Seamlessly integrate with your existing codebase. Models can be used as a data layer for your application, or as a server for your Flutter app.

Getting started #

TODO: List prerequisites and provide or point to information on how to start using the package.

Usage #

In order to run a RESTFUL server all you have to do is create a model and extend it with the Model class. and follow the following code and your server would be running on port 8080.

void main(List<String> arguments) async{
  Dartive.get('/', () {
    print("This is running");
    return 'return new';
  });
  

  Dartive.post('/some.json', (Dartive api) async {
    var  body = api.request;
    // you have to change the way that the request is parsed. this can be done by using models
    // or by using the request.body property
    var x = json
        .decode(body)
        .map((data) => Root.fromJson(data))
        .toList();
    List<Root> streetsList = List<Root>.from(x);
    print(streetsList);

    return    streetsList[0];;
  });
  await Dartive.listen(host: '0.0.0.0', port: 8080);
}

To add ORM support for post requests. #

4
likes
0
points
14
downloads

Publisher

verified publisherrach.codes

Weekly Downloads

Retain your existing Flutter code, and use Dartive to make it faster.

Homepage
Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

convert, crypto, flutter, mime

More

Packages that depend on dartive