Skip to content

Commit

Permalink
Rename provider_sample to change_notifier_provider_sample to clarify …
Browse files Browse the repository at this point in the history
…this particular usage of Provider
  • Loading branch information
brianegan committed Jan 10, 2020
1 parent 2254a48 commit 9454959
Show file tree
Hide file tree
Showing 80 changed files with 53 additions and 43 deletions.
4 changes: 2 additions & 2 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ task:
app_arch: mvc
app_arch: mvi_flutter
app_arch: mvu
app_arch: provider
app_arch: change_notifier_provider
app_arch: redux
app_arch: scoped_model
app_arch: simple_bloc_flutter
Expand Down Expand Up @@ -74,7 +74,7 @@ task:
app_arch: mvc
app_arch: mvi_flutter
app_arch: mvu
app_arch: provider
app_arch: change_notifier_provider
app_arch: redux
app_arch: scoped_model
app_arch: simple_bloc_flutter
Expand Down
8 changes: 4 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -283,14 +283,14 @@ jobs:
script: travis_retry ./scripts/ci.sh ./redux
- <<: *integration-test
os: linux
env: provider_android
script: travis_retry ./scripts/ci.sh ./provider
env: change_notifier_provider_android
script: travis_retry ./scripts/ci.sh ./change_notifier_provider
- <<: *integration-test
os: osx
osx_image: xcode8.0
env: provider_ios
env: change_notifier_provider_ios
before_install: *before_install_osx
script: travis_retry ./scripts/ci.sh ./provider
script: travis_retry ./scripts/ci.sh ./change_notifier_provider
- <<: *integration-test
os: linux
env: scoped_model_android
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Examples have been updated to Dart 2.
- [MVC Example](mvc) - Uses the [MVC](https://pub.dartlang.org/packages/mvc_pattern) library to implement the traditional MVC design pattern.
- [Frideos Example](frideos_library) - Uses the [Frideos](https://pub.dartlang.org/packages/frideos) library to manage app state and update widgets using streams.
- [MobX Example](mobx) - Uses the [MobX](https://pub.dev/packages/mobx) library to manage app state and update widgets using `Observables`, `Actions` and `Reactions`.
- [Provider Example](provider) - Uses the [provider](https://pub.dev/packages/provider) package now recommended by the Flutter team.
- [Change Notifier + Provider Example](change_notifier_provider) - Uses the [ChangeNotifier](https://api.flutter.dev/flutter/foundation/ChangeNotifier-class.html) class from Flutter with [provider](https://pub.dev/packages/provider) package now recommended by the Flutter team.

### Supporting Code

Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions provider/.metadata → change_notifier_provider/.metadata
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# This file should be version controlled and should not be manually edited.

version:
revision: 27321ebbad34b0a3fafe99fac037102196d655ff
channel: stable
revision: 18cd7a3601bcffb36fdf2f679f763b5e827c2e8e
channel: beta

project_type: app
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ android {

defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.provider"
applicationId "com.example.change_notifier_provider"
minSdkVersion 16
targetSdkVersion 28
versionCode flutterVersionCode.toInteger()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.provider">
package="com.example.change_notifier_provider">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.provider">
package="com.example.change_notifier_provider">
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
calls FlutterMain.startInitialization(this); in its onCreate method.
In most cases you can leave this as-is, but you if you want to provide
additional functionality it is fine to subclass or reimplement
FlutterApplication and put your custom class here. -->
<application
android:name="io.flutter.app.FlutterApplication"
android:label="provider"
android:label="change_notifier_provider"
android:icon="@mipmap/ic_launcher">
<activity
android:name=".MainActivity"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.provider
package com.example.change_notifier_provider

import androidx.annotation.NonNull;
import io.flutter.embedding.android.FlutterActivity
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.provider">
package="com.example.change_notifier_provider">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
PRODUCT_BUNDLE_IDENTIFIER = com.example.provider;
PRODUCT_BUNDLE_IDENTIFIER = com.example.changeNotifierProvider;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_VERSION = 5.0;
Expand Down Expand Up @@ -454,7 +454,7 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
PRODUCT_BUNDLE_IDENTIFIER = com.example.provider;
PRODUCT_BUNDLE_IDENTIFIER = com.example.changeNotifierProvider;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
Expand All @@ -481,7 +481,7 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
PRODUCT_BUNDLE_IDENTIFIER = com.example.provider;
PRODUCT_BUNDLE_IDENTIFIER = com.example.changeNotifierProvider;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_VERSION = 5.0;
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>provider</string>
<string>change_notifier_provider</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
import 'package:flutter/material.dart';
import 'package:meta/meta.dart';
import 'package:provider/provider.dart';
import 'package:provider_sample/add_todo_screen.dart';
import 'package:provider_sample/localization.dart';
import 'package:provider_sample/todo_list_model.dart';
import 'package:change_notifier_provider_sample/add_todo_screen.dart';
import 'package:change_notifier_provider_sample/localization.dart';
import 'package:change_notifier_provider_sample/todo_list_model.dart';
import 'package:todos_app_core/todos_app_core.dart';
import 'package:todos_repository_core/todos_repository_core.dart';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:provider_sample/todo_list_model.dart';
import 'package:change_notifier_provider_sample/todo_list_model.dart';
import 'package:todos_app_core/todos_app_core.dart';

import 'edit_todo_screen.dart';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:provider_sample/todo_list_model.dart';
import 'package:change_notifier_provider_sample/todo_list_model.dart';
import 'package:todos_app_core/todos_app_core.dart';

class EditTodoScreen extends StatefulWidget {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:provider_sample/todo_list_model.dart';
import 'package:change_notifier_provider_sample/todo_list_model.dart';
import 'package:todos_app_core/todos_app_core.dart';

class FilterButton extends StatelessWidget {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import 'package:flutter/material.dart' hide Action;
import 'package:provider/provider.dart';
import 'package:provider_sample/home/stats_view.dart';
import 'package:provider_sample/home/todo_list_view.dart';
import 'package:provider_sample/localization.dart';
import 'package:provider_sample/todo_list_model.dart';
import 'package:change_notifier_provider_sample/home/stats_view.dart';
import 'package:change_notifier_provider_sample/home/todo_list_view.dart';
import 'package:change_notifier_provider_sample/localization.dart';
import 'package:change_notifier_provider_sample/todo_list_model.dart';
import 'package:todos_app_core/todos_app_core.dart';

import '../models.dart';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:provider_sample/todo_list_model.dart';
import 'package:change_notifier_provider_sample/todo_list_model.dart';
import 'package:todos_app_core/todos_app_core.dart';

class StatsView extends StatelessWidget {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:provider_sample/todo_list_model.dart';
import 'package:change_notifier_provider_sample/todo_list_model.dart';
import 'package:todos_app_core/todos_app_core.dart';

import '../details_screen.dart';
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import 'package:flutter/material.dart';
import 'package:path_provider/path_provider.dart';
import 'package:provider_sample/app.dart';
import 'package:change_notifier_provider_sample/app.dart';
import 'package:todos_repository_simple/todos_repository_simple.dart';

void main() {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import 'dart:collection';

import 'package:flutter/widgets.dart';
import 'package:meta/meta.dart';
import 'package:provider_sample/models.dart';
import 'package:change_notifier_provider_sample/models.dart';
import 'package:todos_repository_core/todos_repository_core.dart';

enum VisibilityFilter { all, active, completed }
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: provider_sample
name: change_notifier_provider_sample
description: A new Flutter project.

# The following defines the version and build number for your application.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// Use of this source code is governed by the MIT license that can be found
// in the LICENSE file.

import 'package:provider_sample/models.dart';
import 'package:provider_sample/todo_list_model.dart';
import 'package:change_notifier_provider_sample/models.dart';
import 'package:change_notifier_provider_sample/todo_list_model.dart';
import 'package:test/test.dart';

import 'mock_repository.dart';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:provider/provider.dart';
import 'package:provider_sample/home/home_screen.dart';
import 'package:provider_sample/localization.dart';
import 'package:provider_sample/models.dart';
import 'package:provider_sample/todo_list_model.dart';
import 'package:change_notifier_provider_sample/home/home_screen.dart';
import 'package:change_notifier_provider_sample/localization.dart';
import 'package:change_notifier_provider_sample/models.dart';
import 'package:change_notifier_provider_sample/todo_list_model.dart';
import 'package:todos_app_core/todos_app_core.dart';
import 'package:todos_repository_core/todos_repository_core.dart';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Provides a Mock repository that can be used for testing in place of the real
// thing.
import 'package:provider_sample/models.dart';
import 'package:change_notifier_provider_sample/models.dart';
import 'package:todos_repository_core/todos_repository_core.dart';

class MockRepository extends TodosRepository {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

// This line imports the extension
import 'package:flutter_driver/driver_extension.dart';
import 'package:provider_sample/main.dart' as app;
import 'package:change_notifier_provider_sample/main.dart' as app;

void main() {
enableFlutterDriverExtension();
Expand Down
File renamed without changes.
10 changes: 10 additions & 0 deletions change_notifier_provider/web/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>change_notifier_provider</title>
</head>
<body>
<script src="main.dart.js" type="application/javascript"></script>
</body>
</html>
2 changes: 1 addition & 1 deletion scripts/line_counter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class Output {

void main() {
final samples = [
Sample('provider', ['provider']),
Sample('change_notifier_provider', ['change_notifier_provider']),
Sample('bloc', ['bloc_flutter', 'blocs']),
Sample('bloc library', ['bloc_library']),
Sample('built_redux', ['built_redux']),
Expand Down

0 comments on commit 9454959

Please sign in to comment.