From 0f413b6f7538d9cf1a1cefbf9a7c79e1aa75b197 Mon Sep 17 00:00:00 2001 From: Robert Powell Date: Sun, 29 Oct 2023 13:48:29 +0800 Subject: [PATCH] Update document. --- .gitignore | 1 + README.md | 20 +++++++++++++++++--- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 3038b5c..7a5fdb4 100644 --- a/.gitignore +++ b/.gitignore @@ -33,3 +33,4 @@ windows/ android/ ios/ +.metadata \ No newline at end of file diff --git a/README.md b/README.md index d57f12f..05e83f8 100644 --- a/README.md +++ b/README.md @@ -142,16 +142,29 @@ Flutter mediator is a state management package base on the [InheritedModel][] wi
-## Setting up +## Getting started -Add the following dependency to pubspec.yaml of your flutter project: +Run this command: + +With Flutter: + +``` + $ flutter pub add flutter_mediator +``` + +This will add a line like this to your package's pubspec.yaml (and run an implicit flutter pub get): ```yaml dependencies: flutter_mediator: "^2.2.5" ``` -Import flutter_mediator in files that will be used: +Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more. + + +### Import it + +Now in your Dart code, you can use: ```dart import 'package:flutter_mediator/mediator.dart'; @@ -159,6 +172,7 @@ import 'package:flutter_mediator/mediator.dart'; For help getting started with Flutter, view the online [documentation](https://flutter.dev/docs). +   [Table of Contents] # Global Mode