async_resource_flutter 0.1.1

  • Readme
  • Changelog
  • Example
  • Installing
  • 61

async_resource_flutter #

Flutter plugin for async_resource. Automatically cache network resources and use them when offline.

See https://pub.dartlang.org/packages/async_resource.

Examples #

SharedPrefsResource examples #

final stringRes = StringPrefsResource('string');
final boolRes = BoolPrefsResource('bool');
final intRes = IntPrefsResource('int');
final doubleRes = DoublePrefsResource('double');
final stringListRes = StringListPrefsResource('list');

Flutter examples #

This is taken from the working example.

import 'package:flutter/material.dart';
import 'package:async_resource_flutter/async_resource_flutter.dart';
// import 'package:async_resource_example/config.dart';
import 'src/resources.dart';


Color textColor = Colors.black;

void main() => runApp(MaterialApp(
    title: appName,
    home: FutureHandler(
      // This looks up the application documents directory so network requests
      // know where to cache results.
      future: MobileResources.init(),
      handler: (context, resources) => HomePage(),
    )));

class HomePage extends StatefulWidget {
  _HomePageState createState() => _HomePageState();
}

class _HomePageState extends State<HomePage> {
  static const lightBg = Color(0xFFfefefe);
  static const darkBg = Color(0xFF333333);

  int selectedPage = 0;
  Color bgColor = lightBg;

  @override
  void initState() {
    super.initState();
    resources.darkBackground.get().then((isDark) => setState(() {
          bgColor = isDark ? darkBg : lightBg;
          textColor = isDark ? Colors.white : Colors.black;
        }));
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: bgColor,
      appBar: AppBar(
        title: Text(appName),
        actions: <Widget>[
          Switch(value: bgColor == darkBg, onChanged: (_) => _toggleColor())
        ],
      ),
      body: _buildBody(context),
      bottomNavigationBar: BottomNavigationBar(
        type: BottomNavigationBarType.fixed,
        currentIndex: selectedPage,
        onTap: (index) {
          if (index != selectedPage) setState(() => selectedPage = index);
        },
        items: [
          BottomNavigationBarItem(
              icon: Icon(Icons.ac_unit), title: Text('Streamed\nHelpers')),
          BottomNavigationBarItem(
              icon: Icon(Icons.settings_remote),
              title: Text('Future\nHelpers')),
          BottomNavigationBarItem(
              icon: Icon(Icons.settings_input_antenna),
              title: Text('Streamed')),
          BottomNavigationBarItem(
              icon: Icon(Icons.shuffle), title: Text('Future')),
        ],
      ),
    );
  }

  Widget _buildBody(BuildContext context) {
    switch (selectedPage) {
      case 1:
        return PostsWithHelpers();
      case 2:
        return StreamedPostsWithoutHelpers();
      case 3:
        return PostsWithoutHelpers();
      case 0:
      default:
        return StreamedPostsWithHelpers();
    }
  }

  void _toggleColor() => setState(() {
        final turningDark = bgColor == lightBg;
        bgColor = turningDark ? darkBg : lightBg;
        textColor = turningDark ? Colors.white : Colors.black;
        resources.darkBackground.write(turningDark);
      });
}

//
// Different ways of building ListTiles from a `Post`.
//

Widget _buildPost(Post post) => ListTile(
      title: Text('${post?.title}', style: TextStyle(color: textColor)),
      subtitle: Text('${post?.body}', style: TextStyle(color: textColor)),
      leading: Text('${post?.id}', style: TextStyle(color: textColor)),
      trailing:
          Text('user ${post?.userId}', style: TextStyle(color: textColor)),
    );

/// Since [AsyncResource] uses [Future]s instead of [Stream]s, it only needs to
/// be created once. See [StreamedPostsWithHelpers] for this same example with
/// streams.
///
/// This class uses only the [FutureHandler] helper.
class PostsWithHelpers extends StatelessWidget {
  @override
  Widget build(BuildContext context) => RefreshIndicator(
        onRefresh: () => resources.posts.get(forceReload: true),
        child: FutureHandler<Iterable<Post>>(
          future: resources.posts.get(),
          initialData: resources.posts.data,
          handler: (context, posts) =>
              ListView(children: posts.map(_buildPost).toList()),
        ),
      );
}

/// Plain usage of [AsyncResource].
class PostsWithoutHelpers extends StatelessWidget {
  @override
  Widget build(BuildContext context) => RefreshIndicator(
        onRefresh: () => resources.posts.get(forceReload: true),
        child: FutureBuilder<Iterable<Post>>(
            future: resources.posts.get(),
            initialData: resources.posts.data,
            builder: (context, snapshot) {
              if (snapshot.hasData) {
                return ListView(
                    children: snapshot.data.map(_buildPost).toList());
              } else if (snapshot.hasError) {
                return Text('${snapshot.error}');
              } else {
                return Center(child: CircularProgressIndicator());
              }
            }),
      );
}

/// [StreamedResource] use streams that must be managed as part of widget state.
/// More specifically, they must be created and destroyed when the widget
/// changes.
///
/// In this example, state management is handled by [ResourceProviderRoot]. See
/// [StreamedPostsWithoutHelpers] for an example that only uses plain Flutter
/// widgets to manage the resource.
class StreamedPostsWithHelpers extends StatelessWidget {
  @override
  Widget build(BuildContext context) => ResourceProviderRoot<Iterable<Post>>(
        onInit: () => StreamedResource(resources.posts),
        // Builder introduces a new context so we can use the above provider.
        child: Builder(
          builder: (context) => RefreshIndicator(
                onRefresh: () async =>
                    ResourceProvider.of(context).sink.add(true),
                child: ResourceWidget<Iterable<Post>>(
                  (context, posts) => ListView(
                        children: posts.map(_buildPost).toList(),
                      ),
                ),
              ),
        ),
      );
}

/// Plain use of [StreamedResource]. This example manually implements
/// [ResourceProvider]. In practice you may have a class with multiple
/// resources, and in that case you would create your own provider class.
///
/// The name "provider" is likely going to fade as instead of extending
/// [InheritedWidget], new implementations will extend [InheritedModel], and
/// naming conventions will be to use "...Model" instead of "...Provider". Once
/// [InheritedModel] makes it to the beta channel (or 1.0 release), it will be
/// used in this package instead of InheritedWidget.
class StreamedPostsWithoutHelpers extends StatefulWidget {
  @override
  State<StatefulWidget> createState() => _StreamedPostsWithoutHelpersState();
}

class _StreamedPostsWithoutHelpersState
    extends State<StreamedPostsWithoutHelpers> {
  StreamedResource<Iterable<Post>> resource;

  @override
  Widget build(BuildContext context) => ResourceProvider<Iterable<Post>>(
        resource: resource,
        // Builder introduces a new context so we can use the above provider.
        child: Builder(
          builder: (context) => RefreshIndicator(
                onRefresh: () async =>
                    ResourceProvider.of(context).sink.add(true),
                child: StreamBuilder<Iterable<Post>>(
                    stream: resource.stream,
                    initialData: resources.posts.data,
                    builder: (context, snapshot) {
                      if (snapshot.hasData) {
                        return ListView(
                            children: snapshot.data.map(_buildPost).toList());
                      } else if (snapshot.hasError) {
                        return Text('${snapshot.error}');
                      } else {
                        return Center(child: CircularProgressIndicator());
                      }
                    }),
              ),
        ),
      );

  @override
  void initState() {
    super.initState();
    resource = StreamedResource(resources.posts);
    resource.sink.add(false);
  }

  @override
  void dispose() {
    resource.dispose();
    super.dispose();
  }

  @override
  void didUpdateWidget(StreamedPostsWithoutHelpers oldWidget) {
    super.didUpdateWidget(oldWidget);
    resource.dispose();
    resource = StreamedResource(resources.posts);
  }
}

[0.1.1] - November 25, 2018 #

  • Minor changes to the ResourceProvider helper class.
  • Upgrade dependencies

[0.1.0] - October 3, 2018 #

  • First release. Interchangeable with the now deprecated shared_prefs_resource.

example/main.dart

// See the working example at
// https://github.com/jifalops/async_resource/blob/master/example/packages/mobile/lib/main.dart
import 'package:flutter/material.dart';
import 'package:async_resource_flutter/async_resource_flutter.dart';
// import 'package:async_resource_example/config.dart';
import 'src/resources.dart';


Color textColor = Colors.black;

void main() => runApp(MaterialApp(
    title: appName,
    home: FutureHandler(
      // This looks up the application documents directory so network requests
      // know where to cache results.
      future: MobileResources.init(),
      handler: (context, resources) => HomePage(),
    )));

class HomePage extends StatefulWidget {
  _HomePageState createState() => _HomePageState();
}

class _HomePageState extends State<HomePage> {
  static const lightBg = Color(0xFFfefefe);
  static const darkBg = Color(0xFF333333);

  int selectedPage = 0;
  Color bgColor = lightBg;

  @override
  void initState() {
    super.initState();
    resources.darkBackground.get().then((isDark) => setState(() {
          bgColor = isDark ? darkBg : lightBg;
          textColor = isDark ? Colors.white : Colors.black;
        }));
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: bgColor,
      appBar: AppBar(
        title: Text(appName),
        actions: <Widget>[
          Switch(value: bgColor == darkBg, onChanged: (_) => _toggleColor())
        ],
      ),
      body: _buildBody(context),
      bottomNavigationBar: BottomNavigationBar(
        type: BottomNavigationBarType.fixed,
        currentIndex: selectedPage,
        onTap: (index) {
          if (index != selectedPage) setState(() => selectedPage = index);
        },
        items: [
          BottomNavigationBarItem(
              icon: Icon(Icons.ac_unit), title: Text('Streamed\nHelpers')),
          BottomNavigationBarItem(
              icon: Icon(Icons.settings_remote),
              title: Text('Future\nHelpers')),
          BottomNavigationBarItem(
              icon: Icon(Icons.settings_input_antenna),
              title: Text('Streamed')),
          BottomNavigationBarItem(
              icon: Icon(Icons.shuffle), title: Text('Future')),
        ],
      ),
    );
  }

  Widget _buildBody(BuildContext context) {
    switch (selectedPage) {
      case 1:
        return PostsWithHelpers();
      case 2:
        return StreamedPostsWithoutHelpers();
      case 3:
        return PostsWithoutHelpers();
      case 0:
      default:
        return StreamedPostsWithHelpers();
    }
  }

  void _toggleColor() => setState(() {
        final turningDark = bgColor == lightBg;
        bgColor = turningDark ? darkBg : lightBg;
        textColor = turningDark ? Colors.white : Colors.black;
        resources.darkBackground.write(turningDark);
      });
}

//
// Different ways of building ListTiles from a `Post`.
//

Widget _buildPost(Post post) => ListTile(
      title: Text('${post?.title}', style: TextStyle(color: textColor)),
      subtitle: Text('${post?.body}', style: TextStyle(color: textColor)),
      leading: Text('${post?.id}', style: TextStyle(color: textColor)),
      trailing:
          Text('user ${post?.userId}', style: TextStyle(color: textColor)),
    );

/// Since [AsyncResource] uses [Future]s instead of [Stream]s, it only needs to
/// be created once. See [StreamedPostsWithHelpers] for this same example with
/// streams.
///
/// This class uses only the [FutureHandler] helper.
class PostsWithHelpers extends StatelessWidget {
  @override
  Widget build(BuildContext context) => RefreshIndicator(
        onRefresh: () => resources.posts.get(forceReload: true),
        child: FutureHandler<Iterable<Post>>(
          future: resources.posts.get(),
          initialData: resources.posts.data,
          handler: (context, posts) =>
              ListView(children: posts.map(_buildPost).toList()),
        ),
      );
}

/// Plain usage of [AsyncResource].
class PostsWithoutHelpers extends StatelessWidget {
  @override
  Widget build(BuildContext context) => RefreshIndicator(
        onRefresh: () => resources.posts.get(forceReload: true),
        child: FutureBuilder<Iterable<Post>>(
            future: resources.posts.get(),
            initialData: resources.posts.data,
            builder: (context, snapshot) {
              if (snapshot.hasData) {
                return ListView(
                    children: snapshot.data.map(_buildPost).toList());
              } else if (snapshot.hasError) {
                return Text('${snapshot.error}');
              } else {
                return Center(child: CircularProgressIndicator());
              }
            }),
      );
}

/// [StreamedResource] use streams that must be managed as part of widget state.
/// More specifically, they must be created and destroyed when the widget
/// changes.
///
/// In this example, state management is handled by [ResourceProviderRoot]. See
/// [StreamedPostsWithoutHelpers] for an example that only uses plain Flutter
/// widgets to manage the resource.
class StreamedPostsWithHelpers extends StatelessWidget {
  @override
  Widget build(BuildContext context) => ResourceProviderRoot<Iterable<Post>>(
        onInit: () => StreamedResource(resources.posts),
        // Builder introduces a new context so we can use the above provider.
        child: Builder(
          builder: (context) => RefreshIndicator(
                onRefresh: () async =>
                    ResourceProvider.of(context).sink.add(true),
                child: ResourceWidget<Iterable<Post>>(
                  (context, posts) => ListView(
                        children: posts.map(_buildPost).toList(),
                      ),
                ),
              ),
        ),
      );
}

/// Plain use of [StreamedResource]. This example manually implements
/// [ResourceProvider]. In practice you may have a class with multiple
/// resources, and in that case you would create your own provider class.
///
/// The name "provider" is likely going to fade as instead of extending
/// [InheritedWidget], new implementations will extend [InheritedModel], and
/// naming conventions will be to use "...Model" instead of "...Provider". Once
/// [InheritedModel] makes it to the beta channel (or 1.0 release), it will be
/// used in this package instead of InheritedWidget.
class StreamedPostsWithoutHelpers extends StatefulWidget {
  @override
  State<StatefulWidget> createState() => _StreamedPostsWithoutHelpersState();
}

class _StreamedPostsWithoutHelpersState
    extends State<StreamedPostsWithoutHelpers> {
  StreamedResource<Iterable<Post>> resource;

  @override
  Widget build(BuildContext context) => ResourceProvider<Iterable<Post>>(
        resource: resource,
        // Builder introduces a new context so we can use the above provider.
        child: Builder(
          builder: (context) => RefreshIndicator(
                onRefresh: () async =>
                    ResourceProvider.of(context).sink.add(true),
                child: StreamBuilder<Iterable<Post>>(
                    stream: resource.stream,
                    initialData: resources.posts.data,
                    builder: (context, snapshot) {
                      if (snapshot.hasData) {
                        return ListView(
                            children: snapshot.data.map(_buildPost).toList());
                      } else if (snapshot.hasError) {
                        return Text('${snapshot.error}');
                      } else {
                        return Center(child: CircularProgressIndicator());
                      }
                    }),
              ),
        ),
      );

  @override
  void initState() {
    super.initState();
    resource = StreamedResource(resources.posts);
    resource.sink.add(false);
  }

  @override
  void dispose() {
    resource.dispose();
    super.dispose();
  }

  @override
  void didUpdateWidget(StreamedPostsWithoutHelpers oldWidget) {
    super.didUpdateWidget(oldWidget);
    resource.dispose();
    resource = StreamedResource(resources.posts);
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  async_resource_flutter: ^0.1.1

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

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

3. Import it

Now in your Dart code, you can use:


import 'package:async_resource_flutter/async_resource_flutter.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
45
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
44
Overall:
Weighted score of the above. [more]
61
Learn more about scoring.

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

  • Dart: 2.7.1
  • pana: 0.13.6
  • Flutter: 1.12.13+hotfix.8

Health suggestions

Fix lib/src/helpers/provider.dart. (-0.50 points)

Analysis of lib/src/helpers/provider.dart reported 1 hint:

line 18 col 16: 'inheritFromWidgetOfExactType' is deprecated and shouldn't be used. Use dependOnInheritedWidgetOfExactType instead. This feature was deprecated after v1.12.1..

Maintenance issues and suggestions

Make sure dartdoc successfully runs on your package's source files. (-10 points)

exitCode: 255 stdout: parsing /tmp/pub-dartlang-dartdocYRDMGQ/pkg/lib/async_resource_flutter.dart... parsing /flutter/bin/cache/pkg/sky_engine/lib/collection/collection.dart... parsing /flutter/bin/cache/pkg/sky_engine/lib/developer/developer.dart... parsing /flutter/bin/cache/pkg/sky_engine/lib/internal/internal.dart... parsing /flutter/bin/cache/pkg/sky_engine/lib/_interceptors/interceptors.dart... parsing /flutter/bin/cache/pkg/sky_engine/lib/io/io.dart... parsing /flutter/bin/cache/pkg/sky_engine/lib/isolate/isolate.dart... parsing /flutter/bin/cache/pkg/sky_engine/lib/convert/convert.dart... parsing /flutter/bin/cache/pkg/sky_engine/lib/async/async.dart... parsing /flutter/bin/cache/pkg/sky_engine/lib/typed_data/typed_data.dart... parsing /flutter/bin/cache/pkg/sky_engine/lib/_empty.dart... parsing /flutter/bin/cache/pkg/sky_engine/lib/js_util/js_util_dart2js.dart... parsing /flutter/bin/cache/pkg/sky_engine/lib/html/html_dart2js.dart... parsing /flutter/bin/cache/pkg/sky_engine/lib/math/math.dart... parsing /flutter/bin/cache/pkg/sky_engine/lib/core/core.dart... parsing /flutter/bin/cache/pkg/sky_engine/lib/_http/http.dart... parsing /flutter/bin/cache/pkg/sky_engine/lib/ui/ui.dart... parsing /flutter/bin/cache/pkg/sky_engine/lib/js/js_dart2js.dart... parsing /flutter/bin/cache/pkg/sky_engine/lib/ffi/ffi.dart... parsing /flutter/bin/cache/pkg/sky_engine/lib/wasm/wasm.dart... [...] parsing /tmp/pub-cache-dirVCUHUS/hosted/pub.dartlang.org/async-2.4.1/lib/src/result/future.dart... parsing /tmp/pub-cache-dirVCUHUS/hosted/pub.dartlang.org/async-2.4.1/lib/src/single_subscription_transformer.dart... parsing /tmp/pub-cache-dirVCUHUS/hosted/pub.dartlang.org/async-2.4.1/lib/src/stream_group.dart... parsing /tmp/pub-cache-dirVCUHUS/hosted/pub.dartlang.org/async-2.4.1/lib/src/stream_queue.dart... parsing /tmp/pub-cache-dirVCUHUS/hosted/pub.dartlang.org/async-2.4.1/lib/src/subscription_stream.dart... parsing /tmp/pub-cache-dirVCUHUS/hosted/pub.dartlang.org/async-2.4.1/lib/src/stream_splitter.dart... parsing /tmp/pub-cache-dirVCUHUS/hosted/pub.dartlang.org/async-2.4.1/lib/src/stream_sink_completer.dart... parsing /tmp/pub-cache-dirVCUHUS/hosted/pub.dartlang.org/async-2.4.1/lib/src/stream_subscription_transformer.dart... parsing /tmp/pub-cache-dirVCUHUS/hosted/pub.dartlang.org/async-2.4.1/lib/src/stream_zip.dart... parsing /tmp/pub-cache-dirVCUHUS/hosted/pub.dartlang.org/async-2.4.1/lib/src/typed_stream_transformer.dart... parsing /tmp/pub-cache-dirVCUHUS/hosted/pub.dartlang.org/http-0.12.0+4/lib/src/mock_client.dart... parsing /tmp/pub-cache-dirVCUHUS/hosted/pub.dartlang.org/http-0.12.0+4/lib/src/browser_client.dart... parsing /tmp/pub-cache-dirVCUHUS/hosted/pub.dartlang.org/pedantic-1.9.0/lib/pedantic.dart... parsing /tmp/pub-cache-dirVCUHUS/hosted/pub.dartlang.org/service_worker-0.2.4/lib/service_worker.dart... parsing /tmp/pub-cache-dirVCUHUS/hosted/pub.dartlang.org/service_worker-0.2.4/lib/window.dart... Initialized dartdoc with 694 libraries in 116.8 seconds documenting async_resource_flutter Generating docs for library async_resource_flutter from package:async_resource_flutter/async_resource_flutter.dart... Validating docs... Documented 1 public library in 10.4 seconds stderr: Documenting async_resource_flutter... error: unresolved export uri: "dart:html_common" from dart-html: (file:///flutter/bin/cache/pkg/sky_engine/lib/html/html_dart2js.dart:17:9) referred to by service_worker: (file:///tmp/pub-cache-dirVCUHUS/hosted/pub.dartlang.org/service_worker-0.2.4/lib/worker.dart:2:9) warning: private API of package:Dart is reexported by libraries in other packages: from E: (file:///flutter/bin/cache/pkg/sky_engine/lib/collection/collections.dart:13:28) referred to by collection: (file:///tmp/pub-cache-dirVCUHUS/hosted/pub.dartlang.org/collection-1.14.11/lib/collection.dart:1:1) referred to by dart.pkg.collection.wrappers: (file:///tmp/pub-cache-dirVCUHUS/hosted/pub.dartlang.org/collection-1.14.11/lib/wrappers.dart:7:9) warning: private API of package:Dart is reexported by libraries in other packages: from K: (file:///flutter/bin/cache/pkg/sky_engine/lib/collection/maps.dart:374:27) referred to by collection: (file:///tmp/pub-cache-dirVCUHUS/hosted/pub.dartlang.org/collection-1.14.11/lib/collection.dart:1:1) referred to by dart.pkg.collection.wrappers: (file:///tmp/pub-cache-dirVCUHUS/hosted/pub.dartlang.org/collection-1.14.11/lib/wrappers.dart:7:9) warning: private API of package:Dart is reexported by libraries in other packages: from V: (file:///flutter/bin/cache/pkg/sky_engine/lib/collection/maps.dart:374:30) referred to by collection: (file:///tmp/pub-cache-dirVCUHUS/hosted/pub.dartlang.org/collection-1.14.11/lib/collection.dart:1:1) referred to by dart.pkg.collection.wrappers: (file:///tmp/pub-cache-dirVCUHUS/hosted/pub.dartlang.org/collection-1.14.11/lib/wrappers.dart:7:9) warning: ambiguous reexport of dart-html.Event, canonicalization candidates: (service_worker, service_worker, service_worker.window) -> service_worker.window (confidence 0.01000) from dart-html.Event: (file:///flutter/bin/cache/pkg/sky_engine/lib/html/html_dart2js.dart:14761:7) service_worker: -0.9900 - is deprecated (-1.000), name is long (+0.01000) service_worker: 0.01000 - name is long (+0.01000) service_worker.window: 0.02000 - name is long (+0.02000) Use {@canonicalFor dart:html.Event} in the desired library's documentation to resolve the ambiguity and/or override dartdoc's decision, or structure your package so the reexport is less ambiguous. The symbol will still be referenced in all candidates -- this only controls the location where it will be written and which library will be displayed in navigation for the relevant pages. The flag --ambiguous-reexport-scorer-min-confidence allows you to set the threshold at which this warning will appear. warning: ambiguous reexport of dart-html.ErrorEvent, canonicalization candidates: (service_worker, service_worker, service_worker.window) -> service_worker.window (confidence 0.01000) from dart-html.ErrorEvent: (file:///flutter/bin/cache/pkg/sky_engine/lib/html/html_dart2js.dart:14725:7) service_worker: -0.9900 - is deprecated (-1.000), name is long (+0.01000) service_worker: 0.01000 - name is long (+0.01000) service_worker.window: 0.02000 - name is long (+0.02000) warning: ambiguous reexport of dart-html.MessageEvent, canonicalization candidates: (service_worker, service_worker, service_worker.window) -> service_worker.window (confidence 0.01000) from dart-html.MessageEvent: (file:///flutter/bin/cache/pkg/sky_engine/lib/html/html_dart2js.dart:20412:7) service_worker: -0.9900 - is deprecated (-1.000), name is long (+0.01000) service_worker: 0.01000 - name is long (+0.01000) service_worker.window: 0.02000 - name is long (+0.02000) warning: ambiguous reexport of dart-ui.hashList, canonicalization candidates: (cupertino, material, painting, rendering, widgets) -> widgets (confidence 0.000) from dart-ui.hashList: (file:///flutter/bin/cache/pkg/sky_engine/lib/ui/hash_codes.dart:114:5) cupertino: 1.010 - embeds package name (+1.000), name is long (+0.01000) material: 1.010 - embeds package name (+1.000), name is long (+0.01000) painting: 1.010 - embeds package name (+1.000), name is long (+0.01000) rendering: 1.010 - embeds package name (+1.000), name is long (+0.01000) widgets: 1.010 - embeds package name (+1.000), name is long (+0.01000) warning: ambiguous reexport of dart-ui.hashValues, canonicalization candidates: (cupertino, material, painting, rendering, widgets) -> widgets (confidence 0.000) from dart-ui.hashValues: (file:///flutter/bin/cache/pkg/sky_engine/lib/ui/hash_codes.dart:42:5) cupertino: 1.010 - embeds package name (+1.000), name is long (+0.01000) material: 1.010 - embeds package name (+1.000), name is long (+0.01000) painting: 1.010 - embeds package name (+1.000), name is long (+0.01000) rendering: 1.010 - embeds package name (+1.000), name is long (+0.01000) widgets: 1.010 - embeds package name (+1.000), name is long (+0.01000) warning: ambiguous reexport of dart-ui.VoidCallback, canonicalization candidates: (cupertino, foundation, material, painting, rendering, scheduler, widgets) -> widgets (confidence 0.000) from dart-ui.VoidCallback: (file:///flutter/bin/cache/pkg/sky_engine/lib/ui/window.dart:8:9) cupertino: 1.010 - embeds package name (+1.000), name is long (+0.01000) foundation: 1.010 - embeds package name (+1.000), name is long (+0.01000) material: 1.010 - embeds package name (+1.000), name is long (+0.01000) painting: 1.010 - embeds package name (+1.000), name is long (+0.01000) rendering: 1.010 - embeds package name (+1.000), name is long (+0.01000) scheduler: 1.010 - embeds package name (+1.000), name is long (+0.01000) widgets: 1.010 - embeds package name (+1.000), name is long (+0.01000) warning: ambiguous reexport of dart-ui.AccessibilityFeatures, canonicalization candidates: (rendering, semantics) -> semantics (confidence 0.000) from dart-ui.AccessibilityFeatures: (file:///flutter/bin/cache/pkg/sky_engine/lib/ui/window.dart:1208:7) rendering: 1.010 - embeds package name (+1.000), name is long (+0.01000) semantics: 1.010 - embeds package name (+1.000), name is long (+0.01000) warning: ambiguous reexport of dart-ui.FontWeight, canonicalization candidates: (cupertino, material, painting, rendering, widgets) -> widgets (confidence 0.000) from dart-ui.FontWeight: (file:///flutter/bin/cache/pkg/sky_engine/lib/ui/text.dart:17:7) cupertino: 1.010 - embeds package name (+1.000), name is long (+0.01000) material: 1.010 - embeds package name (+1.000), name is long (+0.01000) painting: 1.010 - embeds package name (+1.000), name is long (+0.01000) rendering: 1.010 - embeds package name (+1.000), name is long (+0.01000) widgets: 1.010 - embeds package name (+1.000), name is long (+0.01000) warning: ambiguous reexport of dart-ui.Locale, canonicalization candidates: (cupertino, material, painting, rendering, widgets) -> widgets (confidence 0.000) from dart-ui.Locale: (file:///flutter/bin/cache/pkg/sky_engine/lib/ui/window.dart:248:7) cupertino: 1.010 - embeds package name (+1.000), name is long (+0.01000) material: 1.010 - embeds package name (+1.000), name is long (+0.01000) painting: 1.010 - embeds package name (+1.000), name is long (+0.01000) rendering: 1.010 - embeds package name (+1.000), name is long (+0.01000) widgets: 1.010 - embeds package name (+1.000), name is long (+0.01000) warning: ambiguous reexport of dart-ui.Offset, canonicalization candidates: (cupertino, gestures, material, painting, rendering, widgets) -> widgets (confidence 0.000) from dart-ui.Offset: (file:///flutter/bin/cache/pkg/sky_engine/lib/ui/geometry.dart:119:7) cupertino: 1.010 - embeds package name (+1.000), name is long (+0.01000) gestures: 1.010 - embeds package name (+1.000), name is long (+0.01000) material: 1.010 - embeds package name (+1.000), name is long (+0.01000) painting: 1.010 - embeds package name (+1.000), name is long (+0.01000) rendering: 1.010 - embeds package name (+1.000), name is long (+0.01000) widgets: 1.010 - embeds package name (+1.000), name is long (+0.01000) warning: ambiguous reexport of dart-ui.Radius, canonicalization candidates: (cupertino, material, painting, rendering, widgets) -> widgets (confidence 0.000) from dart-ui.Radius: (file:///flutter/bin/cache/pkg/sky_engine/lib/ui/geometry.dart:895:7) cupertino: 1.010 - embeds package name (+1.000), name is long (+0.01000) material: 1.010 - embeds package name (+1.000), name is long (+0.01000) painting: 1.010 - embeds package name (+1.000), name is long (+0.01000) rendering: 1.010 - embeds package name (+1.000), name is long (+0.01000) widgets: 1.010 - embeds package name (+1.000), name is long (+0.01000) warning: ambiguous reexport of dart-ui.Rect, canonicalization candidates: (cupertino, material, painting, rendering, widgets) -> widgets (confidence 0.000) from dart-ui.Rect: (file:///flutter/bin/cache/pkg/sky_engine/lib/ui/geometry.dart:621:7) cupertino: 1.010 - embeds package name (+1.000), name is long (+0.01000) material: 1.010 - embeds package name (+1.000), name is long (+0.01000) painting: 1.010 - embeds package name (+1.000), name is long (+0.01000) rendering: 1.010 - embeds package name (+1.000), name is long (+0.01000) widgets: 1.010 - embeds package name (+1.000), name is long (+0.01000) warning: ambiguous reexport of dart-ui.RRect, canonicalization candidates: (cupertino, material, painting, rendering, widgets) -> widgets (confidence 0.000) from dart-ui.RRect: (file:///flutter/bin/cache/pkg/sky_engine/lib/ui/geometry.dart:1018:7) cupertino: 1.010 - embeds package name (+1.000), name is long (+0.01000) material: 1.010 - embeds package name (+1.000), name is long (+0.01000) painting: 1.010 - embeds package name (+1.000), name is long (+0.01000) rendering: 1.010 - embeds package name (+1.000), name is long (+0.01000) widgets: 1.010 - embeds package name (+1.000), name is long (+0.01000) warning: ambiguous reexport of dart-ui.RSTransform, canonicalization candidates: (cupertino, material, painting, rendering, widgets) -> widgets (confidence 0.000) from dart-ui.RSTransform: (file:///flutter/bin/cache/pkg/sky_engine/lib/ui/geometry.dart:1645:7) cupertino: 1.010 - embeds package name (+1.000), name is long (+0.01000) material: 1.010 - embeds package name (+1.000), name is long (+0.01000) painting: 1.010 - embeds package name (+1.000), name is long (+0.01000) rendering: 1.010 - embeds package name (+1.000), name is long (+0.01000) widgets: 1.010 - embeds package name (+1.000), name is long (+0.01000) warning: ambiguous reexport of dart-ui.Size, canonicalization candidates: (cupertino, material, painting, rendering, widgets) -> widgets (confidence 0.000) from dart-ui.Size: (file:///flutter/bin/cache/pkg/sky_engine/lib/ui/geometry.dart:347:7) cupertino: 1.010 - embeds package name (+1.000), name is long (+0.01000) material: 1.010 - embeds package name (+1.000), name is long (+0.01000) painting: 1.010 - embeds package name (+1.000), name is long (+0.01000) rendering: 1.010 - embeds package name (+1.000), name is long (+0.01000) widgets: 1.010 - embeds package name (+1.000), name is long (+0.01000) warning: ambiguous reexport of dart-ui.TextBox, canonicalization candidates: (cupertino, material, painting, rendering, widgets) -> widgets (confidence 0.000) from dart-ui.TextBox: (file:///flutter/bin/cache/pkg/sky_engine/lib/ui/text.dart:1220:7) cupertino: 1.010 - embeds package name (+1.000), name is long (+0.01000) material: 1.010 - embeds package name (+1.000), name is long (+0.01000) painting: 1.010 - embeds package name (+1.000), name is long (+0.01000) rendering: 1.010 - embeds package name (+1.000), name is long (+0.01000) widgets: 1.010 - embeds package name (+1.000), name is long (+0.01000) warning: ambiguous reexport of dart-ui.TextDecoration, canonicalization candidates: (cupertino, material, painting, rendering, widgets) -> widgets (confidence 0.000) from dart-ui.TextDecoration: (file:///flutter/bin/cache/pkg/sky_engine/lib/ui/text.dart:358:7) cupertino: 1.010 - embeds package name (+1.000), name is long (+0.01000) material: 1.010 - embeds package name (+1.000), name is long (+0.01000) painting: 1.010 - embeds package name (+1.000), name is long (+0.01000) rendering: 1.010 - embeds package name (+1.000), name is long (+0.01000) widgets: 1.010 - embeds package name (+1.000), name is long (+0.01000) warning: ambiguous reexport of dart-ui.TextPosition, canonicalization candidates: (cupertino, material, painting, rendering, services, widgets) -> widgets (confidence 0.000) from dart-ui.TextPosition: (file:///flutter/bin/cache/pkg/sky_engine/lib/ui/text.dart:1364:7) cupertino: 1.010 - embeds package name (+1.000), name is long (+0.01000) material: 1.010 - embeds package name (+1.000), name is long (+0.01000) painting: 1.010 - embeds package name (+1.000), name is long (+0.01000) rendering: 1.010 - embeds package name (+1.000), name is long (+0.01000) services: 1.010 - embeds package name (+1.000), name is long (+0.01000) widgets: 1.010 - embeds package name (+1.000), name is long (+0.01000) warning: ambiguous reexport of dart-ui.TextRange, canonicalization candidates: (cupertino, material, painting, rendering, services, widgets) -> widgets (confidence 0.000) from dart-ui.TextRange: (file:///flutter/bin/cache/pkg/sky_engine/lib/ui/text.dart:1410:7) cupertino: 1.010 - embeds package name (+1.000), name is long (+0.01000) material: 1.010 - embeds package name (+1.000), name is long (+0.01000) painting: 1.010 - embeds package name (+1.000), name is long (+0.01000) rendering: 1.010 - embeds package name (+1.000), name is long (+0.01000) services: 1.010 - embeds package name (+1.000), name is long (+0.01000) widgets: 1.010 - embeds package name (+1.000), name is long (+0.01000) warning: ambiguous reexport of dart-ui.AppLifecycleState, canonicalization candidates: (cupertino, material, scheduler, widgets) -> widgets (confidence 0.000) from dart-ui.AppLifecycleState: (file:///flutter/bin/cache/pkg/sky_engine/lib/ui/window.dart:154:6) cupertino: 1.010 - embeds package name (+1.000), name is long (+0.01000) material: 1.010 - embeds package name (+1.000), name is long (+0.01000) scheduler: 1.010 - embeds package name (+1.000), name is long (+0.01000) widgets: 1.010 - embeds package name (+1.000), name is long (+0.01000) warning: ambiguous reexport of dart-ui.Brightness, canonicalization candidates: (cupertino, material, services) -> services (confidence 0.000) from dart-ui.Brightness: (file:///flutter/bin/cache/pkg/sky_engine/lib/ui/window.dart:1272:6) cupertino: 1.010 - embeds package name (+1.000), name is long (+0.01000) material: 1.010 - embeds package name (+1.000), name is long (+0.01000) services: 1.010 - embeds package name (+1.000), name is long (+0.01000) warning: ambiguous reexport of dart-ui.FontStyle, canonicalization candidates: (cupertino, material, painting, rendering, widgets) -> widgets (confidence 0.000) from dart-ui.FontStyle: (file:///flutter/bin/cache/pkg/sky_engine/lib/ui/text.dart:8:6) cupertino: 1.010 - embeds package name (+1.000), name is long (+0.01000) material: 1.010 - embeds package name (+1.000), name is long (+0.01000) painting: 1.010 - embeds package name (+1.000), name is long (+0.01000) rendering: 1.010 - embeds package name (+1.000), name is long (+0.01000) widgets: 1.010 - embeds package name (+1.000), name is long (+0.01000) warning: ambiguous reexport of dart-ui.PlaceholderAlignment, canonicalization candidates: (cupertino, material, painting, rendering, widgets) -> widgets (confidence 0.000) from dart-ui.PlaceholderAlignment: (file:///flutter/bin/cache/pkg/sky_engine/lib/ui/text.dart:1619:6) cupertino: 1.010 - embeds package name (+1.000), name is long (+0.01000) material: 1.010 - embeds package name (+1.000), name is long (+0.01000) painting: 1.010 - embeds package name (+1.000), name is long (+0.01000) rendering: 1.010 - embeds package name (+1.000), name is long (+0.01000) widgets: 1.010 - embeds package name (+1.000), name is long (+0.01000) warning: ambiguous reexport of dart-ui.TextAffinity, canonicalization candidates: (cupertino, material, painting, rendering, services, widgets) -> widgets (confidence 0.000) from dart-ui.TextAffinity: (file:///flutter/bin/cache/pkg/sky_engine/lib/ui/text.dart:1322:6) cupertino: 1.010 - embeds package name (+1.000), name is long (+0.01000) material: 1.010 - embeds package name (+1.000), name is long (+0.01000) painting: 1.010 - embeds package name (+1.000), name is long (+0.01000) rendering: 1.010 - embeds package name (+1.000), name is long (+0.01000) services: 1.010 - embeds package name (+1.000), name is long (+0.01000) widgets: 1.010 - embeds package name (+1.000), name is long (+0.01000) warning: ambiguous reexport of dart-ui.TextAlign, canonicalization candidates: (cupertino, material, painting, rendering, widgets) -> widgets (confidence 0.000) from dart-ui.TextAlign: (file:///flutter/bin/cache/pkg/sky_engine/lib/ui/text.dart:317:6) cupertino: 1.010 - embeds package name (+1.000), name is long (+0.01000) material: 1.010 - embeds package name (+1.000), name is long (+0.01000) painting: 1.010 - embeds package name (+1.000), name is long (+0.01000) rendering: 1.010 - embeds package name (+1.000), name is long (+0.01000) widgets: 1.010 - embeds package name (+1.000), name is long (+0.01000) warning: ambiguous reexport of dart-ui.TextBaseline, canonicalization candidates: (cupertino, material, painting, rendering, widgets) -> widgets (confidence 0.000) from dart-ui.TextBaseline: (file:///flutter/bin/cache/pkg/sky_engine/lib/ui/text.dart:349:6) cupertino: 1.010 - embeds package name (+1.000), name is long (+0.01000) material: 1.010 - embeds package name (+1.000), name is long (+0.01000) painting: 1.010 - embeds package name (+1.000), name is long (+0.01000) rendering: 1.010 - embeds package name (+1.000), name is long (+0.01000) widgets: 1.010 - embeds package name (+1.000), name is long (+0.01000) warning: ambiguous reexport of dart-ui.TextDecorationStyle, canonicalization candidates: (cupertino, material, painting, rendering, widgets) -> widgets (confidence 0.000) from dart-ui.TextDecorationStyle: (file:///flutter/bin/cache/pkg/sky_engine/lib/ui/text.dart:417:6) cupertino: 1.010 - embeds package name (+1.000), name is long (+0.01000) material: 1.010 - embeds package name (+1.000), name is long (+0.01000) painting: 1.010 - embeds package name (+1.000), name is long (+0.01000) rendering: 1.010 - embeds package name (+1.000), name is long (+0.01000) widgets: 1.010 - embeds package name (+1.000), name is long (+0.01000) warning: ambiguous reexport of dart-ui.TextDirection, canonicalization candidates: (cupertino, material, painting, rendering, widgets) -> widgets (confidence 0.000) from dart-ui.TextDirection: (file:///flutter/bin/cache/pkg/sky_engine/lib/ui/text.dart:1208:6) cupertino: 1.010 - embeds package name (+1.000), name is long (+0.01000) material: 1.010 - embeds package name (+1.000), name is long (+0.01000) painting: 1.010 - embeds package name (+1.000), name is long (+0.01000) rendering: 1.010 - embeds package name (+1.000), name is long (+0.01000) widgets: 1.010 - embeds package name (+1.000), name is long (+0.01000) warning: no canonical library found for async_resource_flutter.BoolPrefsResource.basename, not linking, from async_resource_flutter.BoolPrefsResource.basename: (file:///tmp/pub-cache-dirVCUHUS/hosted/pub.dartlang.org/async_resource-0.1.4/lib/async_resource.dart:80:14) warning: no canonical library found for async_resource_flutter.BoolPrefsResource.data, not linking, from async_resource_flutter.BoolPrefsResource.data: (file:///tmp/pub-cache-dirVCUHUS/hosted/pub.dartlang.org/async_resource-0.1.4/lib/async_resource.dart:47:9) warning: no canonical library found for async_resource_flutter.BoolPrefsResource.hashCode, not linking, from async_resource_flutter.BoolPrefsResource.hashCode: (file:///flutter/bin/cache/pkg/sky_engine/lib/core/object.dart:94:20) warning: no canonical library found for async_resource_flutter.BoolPrefsResource.location, not linking, from async_resource_flutter.BoolPrefsResource.location: (file:///tmp/pub-cache-dirVCUHUS/hosted/pub.dartlang.org/async_resource-0.1.4/lib/async_resource.dart:20:16) warning: no canonical library found for async_resource_flutter.BoolPrefsResource.parser, not linking, from async_resource_flutter.BoolPrefsResource.parser: (file:///tmp/pub-cache-dirVCUHUS/hosted/pub.dartlang.org/async_resource-0.1.4/lib/async_resource.dart:50:19) warning: no canonical library found for async_resource_flutter.BoolPrefsResource.path, not linking, from async_resource_flutter.BoolPrefsResource.path: (file:///tmp/pub-cache-dirVCUHUS/hosted/pub.dartlang.org/async_resource-0.1.4/lib/async_resource.dart:77:14) warning: no canonical library found for async_resource_flutter.BoolPrefsResource.runtimeType, not linking, from async_resource_flutter.BoolPrefsResource.runtimeType: (file:///flutter/bin/cache/pkg/sky_engine/lib/core/object.dart:116:21) warning: unresolved doc reference [List

Support latest dependencies. (-10 points)

The version constraint in pubspec.yaml does not support the latest published versions for 1 dependency (shared_preferences).

Package is getting outdated. (-35.62 points)

The package was last published 70 weeks ago.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
async_resource ^0.1.0 0.1.4
flutter 0.0.0
shared_preferences ^0.4.0 0.4.3 0.5.6+3
Transitive dependencies
async 2.4.1
charcode 1.1.3
collection 1.14.11 1.14.12
http 0.12.0+4
http_parser 3.1.4
js 0.6.1+1
meta 1.1.8
path 1.6.4
pedantic 1.9.0
rxdart 0.18.1 0.23.1
service_worker 0.2.4
sky_engine 0.0.99
source_span 1.7.0
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test