diff --git a/.gitignore b/.gitignore
index 4a60d90..f7ae545 100644
--- a/.gitignore
+++ b/.gitignore
@@ -16,3 +16,6 @@ doc/api/
.classpath
.project
.settings/
+
+#
+.idea/
diff --git a/.idea/.gitignore b/.idea/.gitignore
new file mode 100644
index 0000000..26d3352
--- /dev/null
+++ b/.idea/.gitignore
@@ -0,0 +1,3 @@
+# Default ignored files
+/shelf/
+/workspace.xml
diff --git a/.idea/flutter_bloc_devtools.iml b/.idea/flutter_bloc_devtools.iml
new file mode 100644
index 0000000..011f2a8
--- /dev/null
+++ b/.idea/flutter_bloc_devtools.iml
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Dart_Packages.xml b/.idea/libraries/Dart_Packages.xml
new file mode 100644
index 0000000..de8d14a
--- /dev/null
+++ b/.idea/libraries/Dart_Packages.xml
@@ -0,0 +1,130 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Dart_SDK.xml b/.idea/libraries/Dart_SDK.xml
new file mode 100644
index 0000000..f531cdf
--- /dev/null
+++ b/.idea/libraries/Dart_SDK.xml
@@ -0,0 +1,28 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/KotlinJavaRuntime.xml b/.idea/libraries/KotlinJavaRuntime.xml
new file mode 100644
index 0000000..2b96ac4
--- /dev/null
+++ b/.idea/libraries/KotlinJavaRuntime.xml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/.idea/modules.xml b/.idea/modules.xml
new file mode 100644
index 0000000..abb41d6
--- /dev/null
+++ b/.idea/modules.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations/main_dart.xml b/.idea/runConfigurations/main_dart.xml
new file mode 100644
index 0000000..aab7b5c
--- /dev/null
+++ b/.idea/runConfigurations/main_dart.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
new file mode 100644
index 0000000..35eb1dd
--- /dev/null
+++ b/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/example/flutter_todos/.metadata b/.metadata
old mode 100755
new mode 100644
similarity index 76%
rename from example/flutter_todos/.metadata
rename to .metadata
index fd2a86f..a5584fc
--- a/example/flutter_todos/.metadata
+++ b/.metadata
@@ -4,7 +4,7 @@
# This file should be version controlled and should not be manually edited.
version:
- revision: 5391447fae6209bb21a89e6a5a6583cac1af9b4b
- channel: beta
+ revision: 18116933e77adc82f80866c928266a5b4f1ed645
+ channel: stable
project_type: app
diff --git a/CHANGELOG.md b/CHANGELOG.md
index e53f954..20d32da 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,9 @@
# Changelog
+## 0.1.2 (2021)
+
+* Update to v8.0.0 of bloc
+
## 0.1.1 (2020-11-15)
* Minor update to Readme.
diff --git a/README.md b/README.md
index 1329b37..b9f9f64 100644
--- a/README.md
+++ b/README.md
@@ -1,8 +1,25 @@
# Remote Devtools for flutter_bloc
+## Progress
+Fork of https://github.com/andrea689/flutter_bloc_devtools, which doesn't support v8.0.0 of bloc.
+This currently has rudimentary support for v8.0.0. It is a work in progress.
+
+NOTE: In general, I don't recommend using this devtool unless you have a large amount of blocs and messages to deal with. For a small number of blocs, it is easier just to use [BlocObserver](https://bloclibrary.dev/#/coreconcepts?id=blocobserver) to log all bloc actions, which takes about 5-10 minutes to setup. See examples in the tutorials in https://bloclibrary.dev/
+
+- [x] I got `flutter_bloc_devtools` to work with the example code. (see also the git branch "null_safety_migration")
+- [ ] Doesn't deal well with enumerate types.
+- [ ] Works with flutter_todos tutorial, v8.
+- [ ] Write tests
+- [ ] Update the package in pub.dev
+
+Create an issue if you want to help.
+
+
+## Original docs
+
Remote Devtools support for Blocs of [flutter_bloc](https://github.com/felangel/bloc/tree/master/packages/flutter_bloc).
-N.B. `Cubit` is not supported
+N.B. `Cubit` is *now* supported

@@ -12,26 +29,30 @@ Add the library to pubspec.yaml:
```yaml
dependencies:
- flutter_bloc_devtools: ^0.1.0
+ flutter_bloc_devtools:
+ git:
+ url: https://github.com/chonghorizons/flutter_bloc_devtools.git
+ ref: main
```
+Note: The version on pub.dev doesn't work with null safety and v8 of bloc.
+
## BlocObserver configuration
Add `RemoteDevToolsObserver` to your `Bloc.observer`:
```dart
void main() async {
- final observer = RemoteDevToolsObserver('192.168.1.7:8000');
- await observer.connect();
- Bloc.observer = observer;
-
- runApp(const CounterApp());
+ BlocOverrides.runZoned(
+ () async => runApp(const CounterApp()),
+ blocObserver: RemoteDevToolsObserver('127.0.0.1:8000'),
+ );
}
```
## Making your Events and States Mappable
-Events and States have to implements `Mappable`:
+Events and States ~~have to~~ may implement `Mappable`:
```dart
class CounterState extends Equatable implements Mappable {
@@ -67,4 +88,4 @@ Run your application. It will connect to the remotedev server. You can now debug
## Examples
- [Counter](example/counter)
-- [Todos](example/flutter_todos)
+
diff --git a/example/flutter_todos/android/.gitignore b/android/.gitignore
old mode 100755
new mode 100644
similarity index 91%
rename from example/flutter_todos/android/.gitignore
rename to android/.gitignore
index 0a741cb..6f56801
--- a/example/flutter_todos/android/.gitignore
+++ b/android/.gitignore
@@ -9,3 +9,5 @@ GeneratedPluginRegistrant.java
# Remember to never publicly share your keystore.
# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
key.properties
+**/*.keystore
+**/*.jks
diff --git a/example/flutter_todos/android/app/build.gradle b/android/app/build.gradle
old mode 100755
new mode 100644
similarity index 84%
rename from example/flutter_todos/android/app/build.gradle
rename to android/app/build.gradle
index 3aff7ed..7379693
--- a/example/flutter_todos/android/app/build.gradle
+++ b/android/app/build.gradle
@@ -26,21 +26,26 @@ apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
- compileSdkVersion 29
+ compileSdkVersion 30
- sourceSets {
- main.java.srcDirs += 'src/main/kotlin'
+ compileOptions {
+ sourceCompatibility JavaVersion.VERSION_1_8
+ targetCompatibility JavaVersion.VERSION_1_8
+ }
+
+ kotlinOptions {
+ jvmTarget = '1.8'
}
- lintOptions {
- disable 'InvalidPackage'
+ sourceSets {
+ main.java.srcDirs += 'src/main/kotlin'
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
- applicationId "com.example.flutter_todos"
+ applicationId "com.example.flutter_bloc_devtools"
minSdkVersion 16
- targetSdkVersion 29
+ targetSdkVersion 30
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
diff --git a/example/flutter_todos/android/app/src/debug/AndroidManifest.xml b/android/app/src/debug/AndroidManifest.xml
old mode 100755
new mode 100644
similarity index 85%
rename from example/flutter_todos/android/app/src/debug/AndroidManifest.xml
rename to android/app/src/debug/AndroidManifest.xml
index 5d41c03..0428507
--- a/example/flutter_todos/android/app/src/debug/AndroidManifest.xml
+++ b/android/app/src/debug/AndroidManifest.xml
@@ -1,5 +1,5 @@
+ package="com.example.flutter_bloc_devtools">
diff --git a/example/flutter_todos/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml
old mode 100755
new mode 100644
similarity index 79%
rename from example/flutter_todos/android/app/src/main/AndroidManifest.xml
rename to android/app/src/main/AndroidManifest.xml
index 4b89fc4..c6de4c4
--- a/example/flutter_todos/android/app/src/main/AndroidManifest.xml
+++ b/android/app/src/main/AndroidManifest.xml
@@ -1,13 +1,7 @@
-
-
+
+
+
+
+
+
+
+
diff --git a/example/flutter_todos/android/app/src/main/res/drawable/launch_background.xml b/android/app/src/main/res/drawable/launch_background.xml
old mode 100755
new mode 100644
similarity index 100%
rename from example/flutter_todos/android/app/src/main/res/drawable/launch_background.xml
rename to android/app/src/main/res/drawable/launch_background.xml
diff --git a/example/flutter_todos/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
old mode 100755
new mode 100644
similarity index 100%
rename from example/flutter_todos/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
rename to android/app/src/main/res/mipmap-hdpi/ic_launcher.png
diff --git a/example/flutter_todos/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
old mode 100755
new mode 100644
similarity index 100%
rename from example/flutter_todos/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
rename to android/app/src/main/res/mipmap-mdpi/ic_launcher.png
diff --git a/example/flutter_todos/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
old mode 100755
new mode 100644
similarity index 100%
rename from example/flutter_todos/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
rename to android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
diff --git a/example/flutter_todos/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
old mode 100755
new mode 100644
similarity index 100%
rename from example/flutter_todos/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
rename to android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
diff --git a/example/flutter_todos/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
old mode 100755
new mode 100644
similarity index 100%
rename from example/flutter_todos/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
rename to android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
diff --git a/example/flutter_todos/android/app/src/main/res/values/styles.xml b/android/app/src/main/res/values-night/styles.xml
old mode 100755
new mode 100644
similarity index 86%
rename from example/flutter_todos/android/app/src/main/res/values/styles.xml
rename to android/app/src/main/res/values-night/styles.xml
index 1f83a33..449a9f9
--- a/example/flutter_todos/android/app/src/main/res/values/styles.xml
+++ b/android/app/src/main/res/values-night/styles.xml
@@ -1,6 +1,6 @@
-
+
diff --git a/android/app/src/main/res/values/styles.xml b/android/app/src/main/res/values/styles.xml
new file mode 100644
index 0000000..d74aa35
--- /dev/null
+++ b/android/app/src/main/res/values/styles.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
diff --git a/example/flutter_todos/android/app/src/profile/AndroidManifest.xml b/android/app/src/profile/AndroidManifest.xml
old mode 100755
new mode 100644
similarity index 85%
rename from example/flutter_todos/android/app/src/profile/AndroidManifest.xml
rename to android/app/src/profile/AndroidManifest.xml
index 5d41c03..0428507
--- a/example/flutter_todos/android/app/src/profile/AndroidManifest.xml
+++ b/android/app/src/profile/AndroidManifest.xml
@@ -1,5 +1,5 @@
+ package="com.example.flutter_bloc_devtools">
diff --git a/example/flutter_todos/android/build.gradle b/android/build.gradle
old mode 100755
new mode 100644
similarity index 81%
rename from example/flutter_todos/android/build.gradle
rename to android/build.gradle
index 3100ad2..ed45c65
--- a/example/flutter_todos/android/build.gradle
+++ b/android/build.gradle
@@ -2,11 +2,11 @@ buildscript {
ext.kotlin_version = '1.3.50'
repositories {
google()
- jcenter()
+ mavenCentral()
}
dependencies {
- classpath 'com.android.tools.build:gradle:3.5.0'
+ classpath 'com.android.tools.build:gradle:4.1.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
@@ -14,15 +14,13 @@ buildscript {
allprojects {
repositories {
google()
- jcenter()
+ mavenCentral()
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
-}
-subprojects {
project.evaluationDependsOn(':app')
}
diff --git a/android/flutter_bloc_devtools_android.iml b/android/flutter_bloc_devtools_android.iml
new file mode 100644
index 0000000..1899969
--- /dev/null
+++ b/android/flutter_bloc_devtools_android.iml
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/example/flutter_todos/android/gradle.properties b/android/gradle.properties
old mode 100755
new mode 100644
similarity index 100%
rename from example/flutter_todos/android/gradle.properties
rename to android/gradle.properties
diff --git a/example/flutter_todos/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties
old mode 100755
new mode 100644
similarity index 93%
rename from example/flutter_todos/android/gradle/wrapper/gradle-wrapper.properties
rename to android/gradle/wrapper/gradle-wrapper.properties
index 296b146..bc6a58a
--- a/example/flutter_todos/android/gradle/wrapper/gradle-wrapper.properties
+++ b/android/gradle/wrapper/gradle-wrapper.properties
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip
diff --git a/example/flutter_todos/android/settings.gradle b/android/settings.gradle
old mode 100755
new mode 100644
similarity index 100%
rename from example/flutter_todos/android/settings.gradle
rename to android/settings.gradle
diff --git a/example/counter/analysis_options.yaml b/example/counter/analysis_options.yaml
new file mode 100644
index 0000000..61b6c4d
--- /dev/null
+++ b/example/counter/analysis_options.yaml
@@ -0,0 +1,29 @@
+# This file configures the analyzer, which statically analyzes Dart code to
+# check for errors, warnings, and lints.
+#
+# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
+# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
+# invoked from the command line by running `flutter analyze`.
+
+# The following line activates a set of recommended lints for Flutter apps,
+# packages, and plugins designed to encourage good coding practices.
+include: package:flutter_lints/flutter.yaml
+
+linter:
+ # The lint rules applied to this project can be customized in the
+ # section below to disable rules from the `package:flutter_lints/flutter.yaml`
+ # included above or to enable additional rules. A list of all available lints
+ # and their documentation is published at
+ # https://dart-lang.github.io/linter/lints/index.html.
+ #
+ # Instead of disabling a lint rule for the entire project in the
+ # section below, it can also be suppressed for a single line of code
+ # or a specific dart file by using the `// ignore: name_of_lint` and
+ # `// ignore_for_file: name_of_lint` syntax on the line or in the file
+ # producing the lint.
+ rules:
+ # avoid_print: false # Uncomment to disable the `avoid_print` rule
+ # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
+
+# Additional information about this file can be found at
+# https://dart.dev/guides/language/analysis-options
diff --git a/example/flutter_todos/android/app/src/main/kotlin/com/example/flutter_todos/MainActivity.kt b/example/counter/android/app/src/main/kotlin/com/example/counter/MainActivity.kt
old mode 100755
new mode 100644
similarity index 73%
rename from example/flutter_todos/android/app/src/main/kotlin/com/example/flutter_todos/MainActivity.kt
rename to example/counter/android/app/src/main/kotlin/com/example/counter/MainActivity.kt
index 2a86094..64a37ba
--- a/example/flutter_todos/android/app/src/main/kotlin/com/example/flutter_todos/MainActivity.kt
+++ b/example/counter/android/app/src/main/kotlin/com/example/counter/MainActivity.kt
@@ -1,4 +1,4 @@
-package com.example.flutter_todos
+package com.example.counter
import io.flutter.embedding.android.FlutterActivity
diff --git a/example/counter/android/app/src/main/res/drawable-v21/launch_background.xml b/example/counter/android/app/src/main/res/drawable-v21/launch_background.xml
new file mode 100644
index 0000000..f74085f
--- /dev/null
+++ b/example/counter/android/app/src/main/res/drawable-v21/launch_background.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
diff --git a/example/counter/android/app/src/main/res/values-night/styles.xml b/example/counter/android/app/src/main/res/values-night/styles.xml
new file mode 100644
index 0000000..449a9f9
--- /dev/null
+++ b/example/counter/android/app/src/main/res/values-night/styles.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
diff --git a/example/counter/lib/counter/bloc/counter_bloc.dart b/example/counter/lib/counter/bloc/counter_bloc.dart
index 3f9c71b..1eb0484 100644
--- a/example/counter/lib/counter/bloc/counter_bloc.dart
+++ b/example/counter/lib/counter/bloc/counter_bloc.dart
@@ -1,5 +1,3 @@
-import 'dart:async';
-
import 'package:bloc/bloc.dart';
import 'package:equatable/equatable.dart';
import 'package:flutter_bloc_devtools/flutter_bloc_devtools.dart';
@@ -8,21 +6,37 @@ part 'counter_event.dart';
part 'counter_state.dart';
class CounterBloc extends Bloc {
- CounterBloc() : super(CounterState(counter: 0));
+ CounterBloc() : super(CounterState(counter: 0)) {
+ on(_doIncrement);
+ on(_doDecrement);
+ }
- @override
- Stream mapEventToState(
- CounterEvent event,
- ) async* {
- if (event is IncrementCounterEvent) {
- yield state.copyWith(
- counter: state.counter + 1,
- );
- }
- if (event is DecrementCounterEvent) {
- yield state.copyWith(
- counter: state.counter - 1,
- );
- }
+ void _doIncrement(
+ IncrementCounterEvent event,
+ Emitter emit,
+ ) {
+ emit(state.copyWith(counter: state.counter + 1));
}
+
+ void _doDecrement(
+ DecrementCounterEvent event,
+ Emitter emit,
+ ) {
+ emit(state.copyWith(counter: state.counter - 1));
+ }
+
+ // Stream mapEventToState(
+ // CounterEvent event,
+ // ) async* {
+ // if (event is IncrementCounterEvent) {
+ // yield state.copyWith(
+ // counter: state.counter + 1,
+ // );
+ // }
+ // if (event is DecrementCounterEvent) {
+ // yield state.copyWith(
+ // counter: state.counter - 1,
+ // );
+ // }
+ // }
}
diff --git a/example/counter/lib/main.dart b/example/counter/lib/main.dart
index a5b37b8..c412947 100755
--- a/example/counter/lib/main.dart
+++ b/example/counter/lib/main.dart
@@ -1,13 +1,14 @@
import 'package:bloc/bloc.dart';
+import 'dart:developer';
import 'package:flutter/material.dart';
import 'package:flutter_bloc_devtools/flutter_bloc_devtools.dart';
import 'app.dart';
void main() async {
- final observer = RemoteDevToolsObserver('192.168.1.7:8000');
- await observer.connect();
- Bloc.observer = observer;
-
- runApp(const CounterApp());
+ BlocOverrides.runZoned(
+ () async => runApp(const CounterApp()),
+ blocObserver: RemoteDevToolsObserver('127.0.0.1:8000'),
+ // NOTE: 127.0.0.1 works for web builds. If you are building to the android device or emulator, you need your local ip, like 192.168.0.112.
+ );
}
diff --git a/example/counter/pubspec.yaml b/example/counter/pubspec.yaml
index 9817312..857efe5 100755
--- a/example/counter/pubspec.yaml
+++ b/example/counter/pubspec.yaml
@@ -12,7 +12,7 @@ dependencies:
flutter:
sdk: flutter
equatable: ^1.2.5
- flutter_bloc: ^6.1.0
+ flutter_bloc: ^8.0.0
flutter_bloc_devtools:
path: ../../
diff --git a/example/counter/test/widget_test.dart b/example/counter/test/widget_test.dart
new file mode 100644
index 0000000..94bbc85
--- /dev/null
+++ b/example/counter/test/widget_test.dart
@@ -0,0 +1,30 @@
+// This is a basic Flutter widget test.
+//
+// To perform an interaction with a widget in your test, use the WidgetTester
+// utility that Flutter provides. For example, you can send tap and scroll
+// gestures. You can also use WidgetTester to find child widgets in the widget
+// tree, read text, and verify that the values of widget properties are correct.
+
+import 'package:flutter/material.dart';
+import 'package:flutter_test/flutter_test.dart';
+
+import 'package:counter/main.dart';
+
+void main() {
+ testWidgets('Counter increments smoke test', (WidgetTester tester) async {
+ // Build our app and trigger a frame.
+ await tester.pumpWidget(const MyApp());
+
+ // Verify that our counter starts at 0.
+ expect(find.text('0'), findsOneWidget);
+ expect(find.text('1'), findsNothing);
+
+ // Tap the '+' icon and trigger a frame.
+ await tester.tap(find.byIcon(Icons.add));
+ await tester.pump();
+
+ // Verify that our counter has incremented.
+ expect(find.text('0'), findsNothing);
+ expect(find.text('1'), findsOneWidget);
+ });
+}
diff --git a/example/counter/web/favicon.png b/example/counter/web/favicon.png
new file mode 100644
index 0000000..8aaa46a
Binary files /dev/null and b/example/counter/web/favicon.png differ
diff --git a/example/counter/web/icons/Icon-192.png b/example/counter/web/icons/Icon-192.png
new file mode 100644
index 0000000..b749bfe
Binary files /dev/null and b/example/counter/web/icons/Icon-192.png differ
diff --git a/example/counter/web/icons/Icon-512.png b/example/counter/web/icons/Icon-512.png
new file mode 100644
index 0000000..88cfd48
Binary files /dev/null and b/example/counter/web/icons/Icon-512.png differ
diff --git a/example/counter/web/icons/Icon-maskable-192.png b/example/counter/web/icons/Icon-maskable-192.png
new file mode 100644
index 0000000..eb9b4d7
Binary files /dev/null and b/example/counter/web/icons/Icon-maskable-192.png differ
diff --git a/example/counter/web/icons/Icon-maskable-512.png b/example/counter/web/icons/Icon-maskable-512.png
new file mode 100644
index 0000000..d69c566
Binary files /dev/null and b/example/counter/web/icons/Icon-maskable-512.png differ
diff --git a/example/counter/web/index.html b/example/counter/web/index.html
new file mode 100644
index 0000000..6b9fb6a
--- /dev/null
+++ b/example/counter/web/index.html
@@ -0,0 +1,101 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ counter
+
+
+
+
+
+
+
diff --git a/example/counter/web/manifest.json b/example/counter/web/manifest.json
new file mode 100644
index 0000000..cd67d74
--- /dev/null
+++ b/example/counter/web/manifest.json
@@ -0,0 +1,35 @@
+{
+ "name": "counter",
+ "short_name": "counter",
+ "start_url": ".",
+ "display": "standalone",
+ "background_color": "#0175C2",
+ "theme_color": "#0175C2",
+ "description": "A new Flutter project.",
+ "orientation": "portrait-primary",
+ "prefer_related_applications": false,
+ "icons": [
+ {
+ "src": "icons/Icon-192.png",
+ "sizes": "192x192",
+ "type": "image/png"
+ },
+ {
+ "src": "icons/Icon-512.png",
+ "sizes": "512x512",
+ "type": "image/png"
+ },
+ {
+ "src": "icons/Icon-maskable-192.png",
+ "sizes": "192x192",
+ "type": "image/png",
+ "purpose": "maskable"
+ },
+ {
+ "src": "icons/Icon-maskable-512.png",
+ "sizes": "512x512",
+ "type": "image/png",
+ "purpose": "maskable"
+ }
+ ]
+}
diff --git a/example/flutter_todos/.flutter-plugins-dependencies b/example/flutter_todos/.flutter-plugins-dependencies
deleted file mode 100644
index ec62701..0000000
--- a/example/flutter_todos/.flutter-plugins-dependencies
+++ /dev/null
@@ -1 +0,0 @@
-{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"path_provider","path":"/Users/andrea/.pub-cache/hosted/pub.dartlang.org/path_provider-0.4.1/","dependencies":[]}],"android":[{"name":"path_provider","path":"/Users/andrea/.pub-cache/hosted/pub.dartlang.org/path_provider-0.4.1/","dependencies":[]}],"macos":[],"linux":[],"windows":[],"web":[]},"dependencyGraph":[{"name":"path_provider","dependencies":[]}],"date_created":"2020-11-15 12:52:55.520558","version":"1.22.2"}
\ No newline at end of file
diff --git a/example/flutter_todos/.gitignore b/example/flutter_todos/.gitignore
deleted file mode 100755
index 47e0b4d..0000000
--- a/example/flutter_todos/.gitignore
+++ /dev/null
@@ -1,71 +0,0 @@
-# Miscellaneous
-*.class
-*.lock
-*.log
-*.pyc
-*.swp
-.DS_Store
-.atom/
-.buildlog/
-.history
-.svn/
-
-# IntelliJ related
-*.iml
-*.ipr
-*.iws
-.idea/
-
-# Visual Studio Code related
-.vscode/
-
-# Flutter/Dart/Pub related
-**/doc/api/
-.dart_tool/
-.flutter-plugins
-.packages
-.pub-cache/
-.pub/
-build/
-
-# Android related
-**/android/**/gradle-wrapper.jar
-**/android/.gradle
-**/android/captures/
-**/android/gradlew
-**/android/gradlew.bat
-**/android/local.properties
-**/android/**/GeneratedPluginRegistrant.java
-
-# iOS/XCode related
-**/ios/**/*.mode1v3
-**/ios/**/*.mode2v3
-**/ios/**/*.moved-aside
-**/ios/**/*.pbxuser
-**/ios/**/*.perspectivev3
-**/ios/**/*sync/
-**/ios/**/.sconsign.dblite
-**/ios/**/.tags*
-**/ios/**/.vagrant/
-**/ios/**/DerivedData/
-**/ios/**/Icon?
-**/ios/**/Pods/
-**/ios/**/.symlinks/
-**/ios/**/profile
-**/ios/**/xcuserdata
-**/ios/.generated/
-**/ios/Flutter/App.framework
-**/ios/Flutter/Flutter.framework
-**/ios/Flutter/Generated.xcconfig
-**/ios/Flutter/app.flx
-**/ios/Flutter/app.zip
-**/ios/Flutter/flutter_assets/
-**/ios/ServiceDefinitions.json
-**/ios/Runner/GeneratedPluginRegistrant.*
-
-# Exceptions to above rules.
-!**/ios/**/default.mode1v3
-!**/ios/**/default.mode2v3
-!**/ios/**/default.pbxuser
-!**/ios/**/default.perspectivev3
-!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
diff --git a/example/flutter_todos/README.md b/example/flutter_todos/README.md
deleted file mode 100755
index d8d7052..0000000
--- a/example/flutter_todos/README.md
+++ /dev/null
@@ -1,18 +0,0 @@
-[](https://github.com/felangel/bloc/actions)
-
-# flutter_todos
-
-A new Flutter project.
-
-## Getting Started
-
-This project is a starting point for a Flutter application.
-
-A few resources to get you started if this is your first Flutter project:
-
-- [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab)
-- [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook)
-
-For help getting started with Flutter, view our
-[online documentation](https://flutter.dev/docs), which offers tutorials,
-samples, guidance on mobile development, and a full API reference.
diff --git a/example/flutter_todos/ios/Flutter/Debug.xcconfig b/example/flutter_todos/ios/Flutter/Debug.xcconfig
deleted file mode 100755
index e8efba1..0000000
--- a/example/flutter_todos/ios/Flutter/Debug.xcconfig
+++ /dev/null
@@ -1,2 +0,0 @@
-#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
-#include "Generated.xcconfig"
diff --git a/example/flutter_todos/ios/Flutter/Release.xcconfig b/example/flutter_todos/ios/Flutter/Release.xcconfig
deleted file mode 100755
index 399e934..0000000
--- a/example/flutter_todos/ios/Flutter/Release.xcconfig
+++ /dev/null
@@ -1,2 +0,0 @@
-#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
-#include "Generated.xcconfig"
diff --git a/example/flutter_todos/ios/Podfile b/example/flutter_todos/ios/Podfile
deleted file mode 100755
index 1e8c3c9..0000000
--- a/example/flutter_todos/ios/Podfile
+++ /dev/null
@@ -1,41 +0,0 @@
-# Uncomment this line to define a global platform for your project
-# platform :ios, '9.0'
-
-# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
-ENV['COCOAPODS_DISABLE_STATS'] = 'true'
-
-project 'Runner', {
- 'Debug' => :debug,
- 'Profile' => :release,
- 'Release' => :release,
-}
-
-def flutter_root
- generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
- unless File.exist?(generated_xcode_build_settings_path)
- raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
- end
-
- File.foreach(generated_xcode_build_settings_path) do |line|
- matches = line.match(/FLUTTER_ROOT\=(.*)/)
- return matches[1].strip if matches
- end
- raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
-end
-
-require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
-
-flutter_ios_podfile_setup
-
-target 'Runner' do
- use_frameworks!
- use_modular_headers!
-
- flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
-end
-
-post_install do |installer|
- installer.pods_project.targets.each do |target|
- flutter_additional_ios_build_settings(target)
- end
-end
diff --git a/example/flutter_todos/ios/Runner.xcworkspace/contents.xcworkspacedata b/example/flutter_todos/ios/Runner.xcworkspace/contents.xcworkspacedata
deleted file mode 100755
index 21a3cc1..0000000
--- a/example/flutter_todos/ios/Runner.xcworkspace/contents.xcworkspacedata
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
-
-
-
diff --git a/example/flutter_todos/lib/blocs/blocs.dart b/example/flutter_todos/lib/blocs/blocs.dart
deleted file mode 100755
index 13f7c63..0000000
--- a/example/flutter_todos/lib/blocs/blocs.dart
+++ /dev/null
@@ -1,4 +0,0 @@
-export './filtered_todos/filtered_todos.dart';
-export './stats/stats.dart';
-export './tab/tab.dart';
-export './todos/todos.dart';
diff --git a/example/flutter_todos/lib/blocs/filtered_todos/filtered_todos.dart b/example/flutter_todos/lib/blocs/filtered_todos/filtered_todos.dart
deleted file mode 100755
index f15a959..0000000
--- a/example/flutter_todos/lib/blocs/filtered_todos/filtered_todos.dart
+++ /dev/null
@@ -1,3 +0,0 @@
-export './filtered_todos_bloc.dart';
-export './filtered_todos_event.dart';
-export './filtered_todos_state.dart';
diff --git a/example/flutter_todos/lib/blocs/filtered_todos/filtered_todos_bloc.dart b/example/flutter_todos/lib/blocs/filtered_todos/filtered_todos_bloc.dart
deleted file mode 100755
index d5f14e1..0000000
--- a/example/flutter_todos/lib/blocs/filtered_todos/filtered_todos_bloc.dart
+++ /dev/null
@@ -1,84 +0,0 @@
-import 'dart:async';
-import 'package:bloc/bloc.dart';
-import 'package:meta/meta.dart';
-import 'package:flutter_todos/blocs/filtered_todos/filtered_todos.dart';
-import 'package:flutter_todos/blocs/todos/todos.dart';
-import 'package:flutter_todos/models/models.dart';
-
-class FilteredTodosBloc extends Bloc {
- final TodosBloc todosBloc;
- StreamSubscription todosSubscription;
-
- FilteredTodosBloc({@required this.todosBloc})
- : super(
- todosBloc.state is TodosLoadSuccess
- ? FilteredTodosLoadSuccess(
- (todosBloc.state as TodosLoadSuccess).todos,
- VisibilityFilter.all,
- )
- : FilteredTodosLoadInProgress(),
- ) {
- todosSubscription = todosBloc.listen((state) {
- if (state is TodosLoadSuccess) {
- add(TodosUpdated((todosBloc.state as TodosLoadSuccess).todos));
- }
- });
- }
-
- @override
- Stream mapEventToState(FilteredTodosEvent event) async* {
- if (event is FilterUpdated) {
- yield* _mapFilterUpdatedToState(event);
- } else if (event is TodosUpdated) {
- yield* _mapTodosUpdatedToState(event);
- }
- }
-
- Stream _mapFilterUpdatedToState(
- FilterUpdated event,
- ) async* {
- if (todosBloc.state is TodosLoadSuccess) {
- yield FilteredTodosLoadSuccess(
- _mapTodosToFilteredTodos(
- (todosBloc.state as TodosLoadSuccess).todos,
- event.filter,
- ),
- event.filter,
- );
- }
- }
-
- Stream _mapTodosUpdatedToState(
- TodosUpdated event,
- ) async* {
- final visibilityFilter = state is FilteredTodosLoadSuccess
- ? (state as FilteredTodosLoadSuccess).activeFilter
- : VisibilityFilter.all;
- yield FilteredTodosLoadSuccess(
- _mapTodosToFilteredTodos(
- (todosBloc.state as TodosLoadSuccess).todos,
- visibilityFilter,
- ),
- visibilityFilter,
- );
- }
-
- List _mapTodosToFilteredTodos(
- List todos, VisibilityFilter filter) {
- return todos.where((todo) {
- if (filter == VisibilityFilter.all) {
- return true;
- } else if (filter == VisibilityFilter.active) {
- return !todo.complete;
- } else {
- return todo.complete;
- }
- }).toList();
- }
-
- @override
- Future close() {
- todosSubscription.cancel();
- return super.close();
- }
-}
diff --git a/example/flutter_todos/lib/blocs/filtered_todos/filtered_todos_event.dart b/example/flutter_todos/lib/blocs/filtered_todos/filtered_todos_event.dart
deleted file mode 100755
index d780d17..0000000
--- a/example/flutter_todos/lib/blocs/filtered_todos/filtered_todos_event.dart
+++ /dev/null
@@ -1,38 +0,0 @@
-import 'package:equatable/equatable.dart';
-import 'package:flutter_todos/models/models.dart';
-import 'package:flutter_bloc_devtools/flutter_bloc_devtools.dart';
-
-abstract class FilteredTodosEvent extends Equatable implements Mappable {
- const FilteredTodosEvent();
-
- @override
- Map toMap() => {};
-}
-
-class FilterUpdated extends FilteredTodosEvent {
- final VisibilityFilter filter;
-
- const FilterUpdated(this.filter);
-
- @override
- List