GithubHelp home page GithubHelp logo

reflutter's Introduction

Reflutter

Status
CI Build Travis
Release Travis
Package Pub

Reflutter is a simple Dart library for automatically generating HTTP clients from simple metadata. It borrows heavily from the jaguar_http project and the Refit project for .NET.

Usage

See the example folder for a simple usage example.

Features and bugs

Please file bugs and feature requests on GitHub.

reflutter's People

Contributors

ctartamella avatar

Stargazers

Glenn Versweyveld avatar  avatar dev avatar  avatar Valerio Ferreira avatar Martijn van Dijk avatar

Watchers

 avatar

Forkers

adiltola

reflutter's Issues

Remove dependency on Jaguar serializer.

It would be better to use a more standard serializer. This will ease package requirements especially for Flutter users at the expense of users having to change the serialization code for their backing models.

Clean up generated code.

There are a few clean up tasks that could be taken on with the code generated for each API method. It would be better if it were more typesafe and refactor safe in the library. (No strings of code as much as possible) Also there are places where it fails some code analysis as well. Ideally, our generated code should pass analysis.

Unit testing.

This library is in bad need of proper testing. Right now all we really have is the ability to code generate the example.

how to get data from ReflutterResponse?

the field _body of ReflutterResponse is private, how to access it?

/// Defines the default wrapper for responses from the Reflutter generated API.
/// This should be used for all API calls and should wrap whatver object type [T]
/// that you expect from the call.
class ReflutterResponse<T> {
  final T _body;
  final http.Response _rawResponse;

  /// Generate a response for the given body and raw HTTP response.
  ReflutterResponse(this._body, this._rawResponse);

  /// Generates a response indicating an error condition
  /// with the given response.
  ReflutterResponse.error(this._rawResponse) : _body = null;

  /// Defines whether the response indicates success.
  bool isSuccessful() =>
      _rawResponse.statusCode >= 200 && _rawResponse.statusCode < 300;

  @override
  String toString() => 'RefitResponse($_body)';
}

GUi code

GUi using the existing code generated classes.

It would be nice to see a Flutter GUI using these classes.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.