angel_flutter 1.0.0-alpha

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • 64

angel_flutter

Pub

Widgets and helpers for developing Flutter clients for Angel applications.

AngelAnimatedList

Found in package:angel_flutter/ui/angel_animated_list.dart.

AngelAnimatedList screenshot

Similar to the FirebaseAnimatedList widget in package:firebase_database, this widget is a ListView that updates itself in real-time, based on a Service or ServiceList instance. This plays nicely with WebSockets, REST, polling, and every transport provided by package:angel_client.

Example usage:

@override
Widget build(BuildContext context) {
    return new Scaffold(
    body: new RefreshIndicator(
        onRefresh: () => service.index().then((_) => null),
        child: new AngelAnimatedList(
            serviceList: todos,
            primary: true,
            defaultChild: (_) {
                return const Center(
                  child: const CircularProgressIndicator(),
                );
            },
            emptyState: (_) {
                return const Center(
                  child: const Text('No todos found.'),
                );
            },
            builder: (ctx, data, animation, index) {
                var todo = new Todo.fromJson(data);
                return new TodoItem(todo, service);
            },
          ),
        ),
    );
}

1.0.0-alpha

  • Created AngelAnimatedList.

example/main.dart

import 'package:angel_client/flutter.dart';
import 'package:angel_flutter/ui/angel_animated_list.dart';
import 'package:flutter/material.dart';

class MyHomePage extends StatefulWidget {
  @override
  State createState() {
    return new _MyHomePageState();
  }
}

class _MyHomePageState extends State<MyHomePage> {
  Angel app;
  Service service;
  ServiceList todos;
  TextEditingController todoText = new TextEditingController();

  @override
  void initState() {
    super.initState();
    app = new Rest('http://localhost:3000');
    service = app.service('api/todos');
    todos = new ServiceList(service);
    service.index();
  }

  @override
  Widget build(BuildContext context) {
    return new Scaffold(
      appBar: new AppBar(
        title: const Text('Todo List'),
      ),
      body: new RefreshIndicator(
        onRefresh: () => service.index().then((_) => null),
        child: new AngelAnimatedList(
          serviceList: todos,
          primary: true,
          defaultChild: (_) {
            return const Center(
              child: const CircularProgressIndicator(),
            );
          },
          emptyState: (_) {
            return const Center(
              child: const Text('No todos found.'),
            );
          },
          builder: (ctx, item, animation, index) {
            // Add item-builder code here!
          },
        ),
      ),
    );
  }
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  angel_flutter: ^1.0.0-alpha

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter packages get

Alternatively, your editor might support flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:angel_flutter/angel_flutter.dart';
  
Version Uploaded Documentation Archive
1.0.0-alpha Jan 7, 2018 Go to the documentation of angel_flutter 1.0.0-alpha Download angel_flutter 1.0.0-alpha archive
Popularity:
Describes how popular the package is relative to other packages. [more]
31
Health:
Code health derived from static analysis. [more]
97
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
98
Overall:
Weighted score of the above. [more]
64
Learn more about scoring.

We analyzed this package on Aug 10, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0
  • pana: 0.11.8
  • Flutter: 0.5.7

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Suggestions

Package is pre-release.

Pre-release versions should be used with caution, their API may change in breaking ways.

Format lib/angel_flutter.dart.

Run flutter format to format lib/angel_flutter.dart.

Format lib/ui/angel_animated_list.dart.

Run flutter format to format lib/ui/angel_animated_list.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.19.0
angel_client >=1.1.0 <2.0.0 1.2.0+1
flutter 0.0.0
meta ^1.0.0 1.1.5 1.1.6
Transitive dependencies
angel_http_exception 1.0.0+3
async 2.0.8
charcode 1.1.2
collection 1.14.6 1.14.11
dart2_constant 1.0.2+dart2
http 0.11.3+17
http_parser 3.1.3
json_god 2.0.0-beta+3
logging 0.11.3+2
merge_map 1.0.0
path 1.6.2
sky_engine 0.0.99
source_span 1.4.1
string_scanner 1.0.3
typed_data 1.1.5 1.1.6
vector_math 2.0.6 2.0.8
Dev dependencies
flutter_test
http_mock ^1.0.0