mock_of_context 1.0.0

  • Readme
  • Changelog
  • Example
  • Installing
  • new50

Mock of Context - Companion project for Out Of Context #

Travis CI Codecov Pub Dev Documentation

Please view the stable brunch for a production version.

Using mock_of_context #

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

  mock_of_context: ^1.0.0

Then, use any of the Mixins provided to mock a mixin from Out of Context.

import 'package:flutter_test/flutter_test.dart';
import 'package:mockito/mockito.dart';
import 'package:mock_of_context/mock_of_context.dart';

import 'package:out_of_context/out_of_context.dart';

class Fancy with RouterMixin {

  void back() => router.pop();


class StubFancy extends Fancy with MockRouterMixin {}

void main() {
  test('example', () {
    final fancy = StubFancy()..pop();


1.0.0 - Initial Launch! 🚀 #

  • Add MockRouterMixin
  • Add MockScaffoldMixin
  • Add MockScaffoldState


Please see the README.

Use this package as a library

1. Depend on it

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

  mock_of_context: ^1.0.0

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:mock_of_context/mock_of_context.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

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

  • Dart: 2.8.4
  • pana: 0.13.15
  • Flutter: 1.17.5

Analysis suggestions

Package not compatible with SDK dart


  • mock_of_context that is a package requiring null.

Health suggestions

Format lib/mock_of_context.dart.

Run flutter format to format lib/mock_of_context.dart.

Format lib/src/mock_mixins.dart.

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


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.2
mockito ^4.1.1 4.1.1
out_of_context ^1.0.1 1.0.1
Transitive dependencies
async 2.4.2
boolean_selector 2.0.0
charcode 1.1.3
collection 1.14.12 1.14.13
matcher 0.12.8
path 1.7.0
sky_engine 0.0.99
source_span 1.7.0
stack_trace 1.9.5
stream_channel 2.0.0
string_scanner 1.0.5
term_glyph 1.1.0
test_api 0.2.17
typed_data 1.1.6 1.2.0
vector_math 2.0.8 2.1.0-nullsafety
Dev dependencies
flint ^1.0.7