angel_flutter 1.0.0-alpha

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

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!
          },
        ),
      ),
    );
  }
}

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 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

Analysis

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

  • Dart: 2.0.0-dev.49.0
  • pana: 0.10.6
  • Flutter: 0.3.2

Scores

Popularity:
Describes how popular the package is relative to other packages. [more]
15 / 100
Health:
Code health derived from static analysis. [more]
97 / 100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
98 / 100
Overall score:
Weighted score of the above. [more]
56
Learn more about scoring.

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.

  • Fix analysis and formatting issues.

    Analysis or formatting checks reported 2 hints.

    Run flutter format to format lib/angel_flutter.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.2
Transitive dependencies
angel_http_exception 1.0.0
async 2.0.6
charcode 1.1.1
collection 1.14.6 1.14.9
http 0.11.3+16
http_parser 3.1.1
json_god 2.0.0-beta+1
merge_map 1.0.0
path 1.5.1
sky_engine 0.0.99
source_span 1.4.0
string_scanner 1.0.2
typed_data 1.1.5
vector_math 2.0.6
Dev dependencies
flutter_test
http_mock ^1.0.0