Skip to content

Commit

Permalink
feat: redo main lib api
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Main Buzz interface was completely changed.
  • Loading branch information
luisburgos committed Sep 7, 2022
1 parent 1c018b8 commit f8079cf
Show file tree
Hide file tree
Showing 60 changed files with 1,416 additions and 711 deletions.
7 changes: 7 additions & 0 deletions .flutter-plugins
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# This is a generated file; do not edit or check into version control.
path_provider=/usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-2.0.11/
path_provider_android=/usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_android-2.0.20/
path_provider_ios=/usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_ios-2.0.11/
path_provider_linux=/usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_linux-2.1.7/
path_provider_macos=/usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_macos-2.0.6/
path_provider_windows=/usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_windows-2.1.2/
1 change: 1 addition & 0 deletions .flutter-plugins-dependencies
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"path_provider_ios","path":"/usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_ios-2.0.11/","native_build":true,"dependencies":[]}],"android":[{"name":"path_provider_android","path":"/usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_android-2.0.20/","native_build":true,"dependencies":[]}],"macos":[{"name":"path_provider_macos","path":"/usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_macos-2.0.6/","native_build":true,"dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"/usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_linux-2.1.7/","native_build":false,"dependencies":[]}],"windows":[{"name":"path_provider_windows","path":"/usr/local/Caskroom/flutter/2.8.1/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_windows-2.1.2/","native_build":false,"dependencies":[]}],"web":[]},"dependencyGraph":[{"name":"path_provider","dependencies":["path_provider_android","path_provider_ios","path_provider_linux","path_provider_macos","path_provider_windows"]},{"name":"path_provider_android","dependencies":[]},{"name":"path_provider_ios","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_macos","dependencies":[]},{"name":"path_provider_windows","dependencies":[]}],"date_created":"2022-09-03 21:45:49.096980","version":"3.0.0"}
6 changes: 2 additions & 4 deletions example/lib/get/core_module.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import 'package:buzz/buzz.dart';
import 'package:get/get.dart';

import '../shared/modules/profile/data/profile_repository.dart';
import '../shared/modules/profile/module_registry.dart';
import 'extensions/get_module.dart';
import 'home/module.dart';
import 'overrides/app_navigator.dart';
Expand All @@ -18,11 +16,11 @@ class CoreModule extends GetModule {
..init(
navigator: GetAppNavigator(),
feedbacksExecutor: GetFeedbacksExecutor(),
registries: [
/*registries: [
ProfileModuleRegistries(
() => Get.find<IProfileRepository>(),
),
],
],*/
),
);
}),
Expand Down
2 changes: 1 addition & 1 deletion example/lib/get/home/page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class HomeRoute extends GetRoute {
name: AppRoutes.root,
page: () => HomePage(
onGoToProfilePressed: () {
Get.find<IBuzzBase>().fire(
Get.find<BuzzBase>().fire(
NavigateToCommand.named(AppRoutes.profileRoot),
);
},
Expand Down
2 changes: 1 addition & 1 deletion example/lib/get/profile/page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class ProfileRoute extends GetRoute {
name: AppRoutes.profileRoot,
page: () => ProfileScreen(
onBackToHomePressed: () {
Get.find<IBuzzBase>().fire(
Get.find<BuzzBase>().fire(
NavigateBackCommand(),
);
},
Expand Down
6 changes: 2 additions & 4 deletions example/lib/modular/core_module.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ import 'package:buzz/buzz.dart';
import 'package:flutter_modular/flutter_modular.dart';

import '../shared/app_routes.dart';
import '../shared/modules/profile/data/profile_repository.dart';
import '../shared/modules/profile/module_registry.dart';
import '../shared/not_found_page.dart';
import 'home/home_module.dart';
import 'overrides/app_navigator.dart';
Expand All @@ -16,11 +14,11 @@ class CoreModule extends Module {
(i) => Buzz
..init(
navigator: ModularAppNavigator(),
registries: [
/*registries: [
ProfileModuleRegistries(
() => Modular.get<IProfileRepository>(),
),
],
],*/
),
export: true,
),
Expand Down
2 changes: 1 addition & 1 deletion example/lib/modular/home/home_module.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class HomeModule extends Module {
AppRoutes.root,
child: (context, args) => HomePage(
onGoToProfilePressed: () {
Modular.get<IBuzzBase>().fire(
Modular.get<BuzzBase>().fire(
NavigateToCommand.named(AppRoutes.profileRoot),
);
},
Expand Down
2 changes: 1 addition & 1 deletion example/lib/modular/profile/page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class ProfileRoute extends ChildRoute {
AppRoutes.profileRoot,
child: (context, args) => ProfileScreen(
onBackToHomePressed: () {
Modular.get<IBuzzBase>().fire(
Modular.get<BuzzBase>().fire(
NavigateBackCommand(),
);
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class ChangeUserNameCommand extends Command {
}

class ChangeUserNameCommandHandler
extends TypedEventHandler<ChangeUserNameCommand> {
extends BuzzEventHandler<ChangeUserNameCommand> {
ChangeUserNameCommandHandler(this.repository);

final IProfileRepository repository;
Expand Down
27 changes: 0 additions & 27 deletions example/lib/shared/modules/profile/module_registry.dart

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class OnGoToSettingsTapped extends OnTappedProfiledUiEvent {}
class OnOptionSelected extends OnTappedProfiledUiEvent {}

class GlobalProfileUiEventHandler
extends TypedEventHandler<OnTappedProfiledUiEvent> {
extends BuzzEventHandler<OnTappedProfiledUiEvent> {
@override
void handle(OnTappedProfiledUiEvent event) {
buzzLog('$runtimeType - ${event.toString()}');
Expand Down
2 changes: 1 addition & 1 deletion example/lib/shared/not_found_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class NotFoundPage extends StatelessWidget {
action: MainAction(
label: 'Go Home',
onPressed: () {
Modular.get<IBuzzBase>().fire(
Modular.get<BuzzBase>().fire(
NavigateBackCommand(),
);
},
Expand Down
44 changes: 43 additions & 1 deletion example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ packages:
path: ".."
relative: true
source: path
version: "0.0.5"
version: "0.0.6"
buzz_ui:
dependency: "direct main"
description:
Expand Down Expand Up @@ -64,6 +64,13 @@ packages:
relative: true
source: path
version: "0.0.1"
crypto:
dependency: transitive
description:
name: crypto
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.2"
event_bus:
dependency: transitive
description:
Expand Down Expand Up @@ -137,6 +144,27 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.3"
google_fonts:
dependency: transitive
description:
name: google_fonts
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.1"
http:
dependency: transitive
description:
name: http
url: "https://pub.dartlang.org"
source: hosted
version: "0.13.5"
http_parser:
dependency: transitive
description:
name: http_parser
url: "https://pub.dartlang.org"
source: hosted
version: "4.0.1"
lints:
dependency: transitive
description:
Expand Down Expand Up @@ -179,6 +207,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.2"
neopop:
dependency: transitive
description:
name: neopop
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.2"
path:
dependency: transitive
description:
Expand Down Expand Up @@ -310,6 +345,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "0.4.9"
typed_data:
dependency: transitive
description:
name: typed_data
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.1"
vector_math:
dependency: transitive
description:
Expand Down
10 changes: 5 additions & 5 deletions lib/buzz.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ library buzz;

export 'buzz_impl.dart';
export 'feedbacks/feedbacks.dart';
export 'infra/buzz_event_handler.dart';
export 'infra/errors.dart';
export 'infra/event_bus_holder.dart';
export 'infra/registries.dart';
export 'infra/typed_event_bus.dart';
export 'infra/typed_event_handler.dart';
export 'kinds/app_events.dart';
export 'kinds/commands.dart';
export 'kinds/ui_events.dart';
export 'navigation/navigation.dart';
export 'navigation/buzz_registry.dart';
export 'navigation/commands.dart';
export 'navigation/events.dart';
export 'navigation/navigator.dart';
export 'utils/utils.dart';
Loading

0 comments on commit f8079cf

Please sign in to comment.