restui 0.2.0 copy "restui: ^0.2.0" to clipboard
restui: ^0.2.0 copied to clipboard

discontinuedreplaced by: http_api
outdated

A simple yet powerful HTTP API client library that main target is to remove separation between HTTP API and app state management

example/lib/main.dart

import 'package:example/screens/home_screen.dart';
import 'package:example/screens/state_management/photo_store.dart';
import 'package:flutter/material.dart';

import 'package:restui/restui.dart';

import 'example_api.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return RestuiProvider<ExampleApi>(
      apiBuilder: (BuildContext context) => ExampleApi(
        stores: <ApiStore>[
          PhotoStore(),
        ],
        uri: Uri.parse("https://picsum.photos"),
        link: HeadersMapperLink(['connection'], debug: true)
          ..chain(DebugLink(printResponseBody: true)),
      ),
      child: MaterialApp(
        title: 'Flutter RestUI example app',
        theme: ThemeData(
          primarySwatch: Colors.blue,
        ),
        home: HomeScreen(),
      ),
    );
  }
}
4
likes
0
pub points
0%
popularity

Publisher

verified publisherklyta.it

A simple yet powerful HTTP API client library that main target is to remove separation between HTTP API and app state management

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter, http, http_parser, meta

More

Packages that depend on restui