angel_flutter 1.0.0-alpha

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

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


$ pub get

with Flutter:


$ flutter packages get

Alternatively, your editor might support pub get or 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]
18
Health:
Code health derived from static analysis. [more]
--
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
--
Overall:
Weighted score of the above. [more]
9
Learn more about scoring.

The package version is not analyzed, because it does not support Dart 2. Until this is resolved, the package will receive a health and maintenance score of 0.

Analysis issues and suggestions

Fix dependencies in pubspec.yaml.

Running flutter packages pub upgrade failed with the following output:

ERR: The current Dart SDK version is 2.1.0-dev.9.4.flutter-f9ebf21297.
 
 Because angel_flutter depends on angel_client >=1.0.0-dev+1 <2.0.0-alpha which requires SDK version <2.0.0, version solving failed.

Maintenance issues and suggestions

Fix platform conflicts. (-20 points)

Error(s) prevent platform classification:

Fix dependencies in pubspec.yaml.

Running dartdoc failed. (-10 points)

Make sure dartdoc runs without any issues.

Package is pre-release. (-5 points)

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

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.19.0