out_of_context 1.0.1

  • Readme
  • Changelog
  • Example
  • Installing
  • new58

Out of Context - Context-free navigation & scaffolds #

Travis CI Codecov Pub Dev Documentation

Navigation in Flutter involves a great deal of ceremony as a BuilderContext must always be passed to a Navigator. A BuilContext must be passed down from a Widget to the calling method, which is needlessly verbose. It also makes testing hard as the navigation methods are static and cannot be mocked.

Out of Context provides (over-glorified) wrappers for context-free navigation and scaffolds.

Please view the stable brunch for a production version.


Using out_of_context #

To import the library, add the following dependency to your project.

dependencies:
  out_of_context: ^1.0.1

Then, use any of the Mixins provided.

import 'package:out_of_context/out_of_context.dart';

class Fancy with RouterMixin {

  // router is provided by the RouterMixin
  // Look Ma, no BuildContexts!
  void back() => router.pop();

}

Mock of Context #

Mock of Context is a companion project that provides mocks to simplify testing.

Please see the project here.

1.0.1 - No context is best context (13/06/2020) #

  • Fix missing example/pubspec.yaml
  • Fix relative path for Flint

1.0.0 - How can mirrors be real if our eyes aren't real? (13/06/2020) #

  • Add Keyed
  • Add Router
  • Add RouterMixin
  • Add ScaffoldMixin

example/README.md

Please refer to the README

Use this package as a library

1. Depend on it

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


dependencies:
  out_of_context: ^1.0.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:out_of_context/out_of_context.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
15
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
58
Learn more about scoring.

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

  • Dart: 2.8.4
  • pana: 0.13.13
  • Flutter: 1.17.5

Analysis suggestions

Package not compatible with SDK dart

because of import path [out_of_context] that is in a package requiring null.

Health suggestions

Format lib/out_of_context.dart.

Run flutter format to format lib/out_of_context.dart.

Format lib/src/keyed.dart.

Run flutter format to format lib/src/keyed.dart.

Format lib/src/router.dart.

Run flutter format to format lib/src/router.dart.

Format lib/src/scaffolding.dart.

Run flutter format to format lib/src/scaffolding.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.8.4 <3.0.0
flutter 0.0.0
meta ^1.1.8 1.1.8 1.2.1
Transitive dependencies
collection 1.14.12 1.14.13
sky_engine 0.0.99
typed_data 1.1.6 1.2.0
vector_math 2.0.8
Dev dependencies
flint ^1.0.7
flutter_test
mockito ^4.1.1