Skip to content

Commit

Permalink
Merge branch 'master' into fetch-versions
Browse files Browse the repository at this point in the history
  • Loading branch information
pavanpodila authored Feb 7, 2021
2 parents 36f3741 + 0404d63 commit 425b043
Show file tree
Hide file tree
Showing 35 changed files with 1,767 additions and 367 deletions.
47 changes: 47 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -424,9 +424,56 @@
"name": "Leonardo Custodio",
"avatar_url": "https://avatars0.githubusercontent.com/u/5619696?v=4",
"profile": "http://www.inovatso.com.br",
"contributions": [
"code",
"doc"
]
},
{
"login": "pr-1",
"name": "Prince Srivastava",
"avatar_url": "https://avatars3.githubusercontent.com/u/26018750?v=4",
"profile": "https://aboutprince.in/",
"contributions": [
"example",
"code"
]
},
{
"login": "muhajirdev",
"name": "Muhammad Muhajir",
"avatar_url": "https://avatars2.githubusercontent.com/u/12745166?v=4",
"profile": "http://muhajir.dev",
"contributions": [
"doc"
]
},
{
"login": "geweald",
"name": "D",
"avatar_url": "https://avatars1.githubusercontent.com/u/16155640?v=4",
"profile": "https://github.com/geweald",
"contributions": [
"doc"
]
},
{
"login": "davidmartos96",
"name": "David Martos",
"avatar_url": "https://avatars1.githubusercontent.com/u/22084723?v=4",
"profile": "https://github.com/davidmartos96",
"contributions": [
"code"
]
},
{
"login": "inimaga",
"name": "Issa Nimaga",
"avatar_url": "https://avatars3.githubusercontent.com/u/24917864?v=4",
"profile": "https://github.com/inimaga",
"contributions": [
"doc"
]
}
],
"contributorsPerLine": 7,
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ jobs:

- name: Install dependencies
working-directory: ${{ matrix.package }}
run: pub get
run: dart pub get

- name: Analyze
working-directory: ${{ matrix.package }}
run: dartanalyzer --fatal-infos --fatal-warnings .
run: dart analyze --fatal-infos --fatal-warnings .

- name: Run tests
working-directory: ${{ matrix.package }}
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ on:
- master

jobs:
build_dart_packages:
publish_dart_packages:
runs-on: ubuntu-latest

strategy:
matrix:
package: ["mobx", "mobx_codegen"]
package: [ "mobx", "mobx_codegen" ]

steps:
- uses: actions/checkout@v2
Expand All @@ -32,12 +32,12 @@ jobs:
TAG: ${{steps.publish.outputs.package}}-${{steps.publish.outputs.localVersion}}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

build_flutter_packages:
publish_flutter_packages:
runs-on: ubuntu-latest

strategy:
matrix:
package: ["flutter_mobx"]
package: [ "flutter_mobx" ]

steps:
- uses: actions/checkout@v2
Expand Down
98 changes: 52 additions & 46 deletions README.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/docs/examples/github/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ The first step is to define the reactive (aka _observable_) state of your UI. Th
In this case, we want a simple UI where we accept the _github-ID_ as input. We use that to fetch the user's repositories. This call will be made using the <PubBadge name="github" /> package, the results for which are stored as a `List<Repository>`. The `GithubStore` class so far looks like so:

```dart
import 'package:github/server.dart';
import 'package:github/github.dart';
import 'package:mobx/mobx.dart';
part 'github_store.g.dart';
class GithubStore = _GithubStore with _$GithubStore;
abstract class _GithubStore with Store {
final GitHub client = createGitHubClient();
final GitHub client = GitHub();
List<Repository> repositories = [];
Expand Down
24 changes: 4 additions & 20 deletions docs/docs/examples/todos/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Next comes the `TodoList`, which manages a list of `Todo`s. The core-state of `T

- [x] a list of `Todo`s
- [x] a `filter` that tracks the visibility-filter applied on the list of todos
- [x] the `currentDescription`, which tracks the description entered by the user for a new todo.


This can be seen with the `@observable` properties.

Expand All @@ -66,9 +66,6 @@ abstract class _TodoList with Store {
@observable
VisibilityFilter filter = VisibilityFilter.all;
@observable
String currentDescription = '';
}
```

Expand Down Expand Up @@ -149,17 +146,14 @@ abstract class _TodoList with Store {
void addTodo(String description) {
final todo = Todo(description);
todos.add(todo);
currentDescription = '';
}
@action
void removeTodo(Todo todo) {
todos.removeWhere((x) => x == todo);
}
@action
void changeDescription(String description) =>
currentDescription = description;
@action
void changeFilter(VisibilityFilter filter) => this.filter = filter;
Expand Down Expand Up @@ -194,9 +188,6 @@ abstract class _TodoList with Store {
@observable
VisibilityFilter filter = VisibilityFilter.all;
@observable
String currentDescription = '';
@computed
ObservableList<Todo> get pendingTodos =>
ObservableList.of(todos.where((todo) => todo.done != true));
Expand Down Expand Up @@ -245,18 +236,13 @@ abstract class _TodoList with Store {
void addTodo(String description) {
final todo = Todo(description);
todos.add(todo);
currentDescription = '';
}
@action
void removeTodo(Todo todo) {
todos.removeWhere((x) => x == todo);
}
@action
void changeDescription(String description) =>
currentDescription = description;
@action
void changeFilter(VisibilityFilter filter) => this.filter = filter;
Expand Down Expand Up @@ -380,7 +366,7 @@ class TodoListView extends StatelessWidget {

**AddTodo**

Similarly, here is the `AddTodo` widget that observes the `list.currentDescription` and also fires the `list.changeDescription` action.
Similarly, here is the `AddTodo` widget that fires the `list.addTodo` action.

```dart
class AddTodo extends StatelessWidget {
Expand All @@ -395,9 +381,7 @@ class AddTodo extends StatelessWidget {
decoration: const InputDecoration(
labelText: 'Add a Todo', contentPadding: EdgeInsets.all(8)),
controller: _textController,
onChanged: (String newValue) {
list.currentDescription = newValue;
},
textInputAction: TextInputAction.done,
onSubmitted: (String value) {
list.addTodo(value);
_textController.clear();
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/guides/cheat-sheet.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ abstract class _Contact with Store {
// highlight-next-line
@computed
String get fullName() => '$firstName, $lastName';
String get fullName => '$firstName, $lastName';
ObservableList<String> phoneNumbers = ObservableList.of([]);
Expand Down
4 changes: 2 additions & 2 deletions docs/docs/guides/json-serialization.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ The first step is to include the dependency on the <PubBadge name="dart_json_map

```yaml
dependencies:
dart_json_mapper: ^1.5.2
dart_json_mapper_mobx: ^1.2.0
dart_json_mapper: ^{{ plugins.dart_json_mapper }}
dart_json_mapper_mobx: ^{{ plugins.dart_json_mapper_mobx }}
```
## Configure `build.yaml`
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/guides/organizing-stores.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ class MyApp extends StatelessWidget {
Widget build(BuildContext context) {
return MultiProvider(
providers: [
Provider<MultiCounterStore>(builder: (_) => MultiCounterStore())
Provider<MultiCounterStore>(create: (_) => MultiCounterStore())
],
child: MaterialApp(
initialRoute: '/',
Expand Down
6 changes: 4 additions & 2 deletions docs/docs/versions.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,7 @@ export default {
flutter_mobx: PUB_FLUTTER_MOBX,
mobx_codegen: PUB_MOBX_CODEGEN,
build_runner: PUB_BUILD_RUNNER,
}
};
dart_json_mapper: PUB_DART_JSON_MAPPER,
dart_json_mapper_mobx: PUB_DART_JSON_MAPPER_MOBX,
},
};
12 changes: 6 additions & 6 deletions docs/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"@docusaurus/core": "2.0.0-alpha.65",
"@docusaurus/preset-classic": "2.0.0-alpha.65",
"@mdx-js/react": "^1.5.8",
"axios": "^0.20.0",
"axios": "^0.21.1",
"clsx": "^1.1.1",
"dotenv": "^8.2.0",
"lodash.get": "^4.4.2",
Expand Down
10 changes: 8 additions & 2 deletions docs/plugins/fetch-versions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,13 @@ const plugins = [
},
{
pub: 'build_runner',
}
},
{
pub: 'dart_json_mapper',
},
{
pub: 'dart_json_mapper_mobx',
},
];

// Fetch the plugins latest version from the pub API
Expand Down Expand Up @@ -78,4 +84,4 @@ module.exports = function sourceVersions() {
};
},
};
};
};
4 changes: 2 additions & 2 deletions docs/src/components/testimonials.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ MobX supports me on all of my projects.`,
title:
'Founded the Brazilian community Flutterando. Creator of bloc_pattern, Slidy and flutter_modular packages.',
photoUrl:
'https://pbs.twimg.com/profile_images/1245084668069924866/-DRI-sZi_400x400.jpg',
'https://pbs.twimg.com/profile_images/1350144832350597124/pZ5ykSgo_400x400.jpg',
message: `MobX feels so robust and leverages the Dart language very well.
Brazil's community was previously attached to BLoC. With MobX, they have found a great replacement.
Expand All @@ -75,7 +75,7 @@ Several people here in Brazil are building Flutter apps quickly, thanks to MobX.
title:
'Mobile app maker in ❤️ with Flutter & Figma & Firebase | @JintoApp co-founder | @FlutterRennes',
photoUrl:
'https://pbs.twimg.com/profile_images/1177279072810033152/R7NHj6M1_400x400.jpg',
'https://pbs.twimg.com/profile_images/1352225937065127936/HvZ47bKL_400x400.jpg',
message: `This framework is just awesome. I ported my Flutter
app to it and everything feels so much simpler now (even if the porting process has not been easy).
Expand Down
3 changes: 3 additions & 0 deletions flutter_mobx/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@ private: true

version: 1.0.0+1

environment:
sdk: '>=2.7.0 <3.0.0'

2 changes: 1 addition & 1 deletion flutter_mobx/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ environment:
sdk: ">=2.7.0 <3.0.0"

dependencies:
mobx: ^1.1.0
flutter:
sdk: flutter
mobx: ^1.1.0

dev_dependencies:
flutter_test:
Expand Down
3 changes: 2 additions & 1 deletion mobx/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## 1.2.1+2 - 1.2.1+3
## 1.2.1+2 - 1.2.1+4

- Reformatting for improving the pub.dev score
- Regenerated the example files

## 1.2.1 - 1.2.1+1

Expand Down
20 changes: 13 additions & 7 deletions mobx/example/lib/counter.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 425b043

Please sign in to comment.