diff --git a/example/lib/get/core_module.dart b/example/lib/get/core_module.dart index 71ca09f..42b6250 100644 --- a/example/lib/get/core_module.dart +++ b/example/lib/get/core_module.dart @@ -1,7 +1,8 @@ import 'package:buzz/buzz.dart'; import 'package:get/get.dart'; -import 'package:profile/profile.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'; diff --git a/example/lib/get/profile/module.dart b/example/lib/get/profile/module.dart index fb9c5a6..16a0c05 100644 --- a/example/lib/get/profile/module.dart +++ b/example/lib/get/profile/module.dart @@ -1,7 +1,7 @@ import 'package:example/get/profile/page.dart'; import 'package:get/get.dart'; -import 'package:profile/profile.dart'; +import '../../shared/modules/profile/data/profile_repository.dart'; import '../extensions/get_module.dart'; class ProfileModule extends GetModule { diff --git a/example/lib/get/profile/page.dart b/example/lib/get/profile/page.dart index 4db1087..45d1d79 100644 --- a/example/lib/get/profile/page.dart +++ b/example/lib/get/profile/page.dart @@ -1,8 +1,8 @@ import 'package:buzz/buzz.dart'; import 'package:get/get.dart'; -import 'package:profile/profile.dart'; import '../../shared/app_routes.dart'; +import '../../shared/modules/profile/presentation/screen.dart'; import '../extensions/get_module.dart'; class ProfileRoute extends GetRoute { diff --git a/example/lib/modular/core_module.dart b/example/lib/modular/core_module.dart index e5e6845..39b657b 100644 --- a/example/lib/modular/core_module.dart +++ b/example/lib/modular/core_module.dart @@ -1,8 +1,9 @@ import 'package:buzz/buzz.dart'; import 'package:flutter_modular/flutter_modular.dart'; -import 'package:profile/profile.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'; diff --git a/example/lib/modular/profile/module.dart b/example/lib/modular/profile/module.dart index 1377593..bbfb556 100644 --- a/example/lib/modular/profile/module.dart +++ b/example/lib/modular/profile/module.dart @@ -1,6 +1,6 @@ import 'package:flutter_modular/flutter_modular.dart'; -import 'package:profile/profile.dart'; +import '../../shared/modules/profile/data/profile_repository.dart'; import 'page.dart'; class ProfileModule extends Module { diff --git a/example/lib/modular/profile/page.dart b/example/lib/modular/profile/page.dart index c82d05d..e67acff 100644 --- a/example/lib/modular/profile/page.dart +++ b/example/lib/modular/profile/page.dart @@ -1,8 +1,8 @@ import 'package:buzz/buzz.dart'; import 'package:flutter_modular/flutter_modular.dart'; -import 'package:profile/profile.dart'; import '../../shared/app_routes.dart'; +import '../../shared/modules/profile/presentation/screen.dart'; class ProfileRoute extends ChildRoute { ProfileRoute() diff --git a/example/profile/lib/commands/change_user_name_command.dart b/example/lib/shared/modules/profile/commands/change_user_name_command.dart similarity index 96% rename from example/profile/lib/commands/change_user_name_command.dart rename to example/lib/shared/modules/profile/commands/change_user_name_command.dart index 76052cd..3900753 100644 --- a/example/profile/lib/commands/change_user_name_command.dart +++ b/example/lib/shared/modules/profile/commands/change_user_name_command.dart @@ -1,6 +1,6 @@ import 'package:buzz/buzz.dart'; -import '../profile.dart'; +import '../data/profile_repository.dart'; class ChangeUserNameCommand extends Command { ChangeUserNameCommand({required this.newName}); diff --git a/example/profile/lib/data/profile_repository.dart b/example/lib/shared/modules/profile/data/profile_repository.dart similarity index 97% rename from example/profile/lib/data/profile_repository.dart rename to example/lib/shared/modules/profile/data/profile_repository.dart index 2517c36..01893f3 100644 --- a/example/profile/lib/data/profile_repository.dart +++ b/example/lib/shared/modules/profile/data/profile_repository.dart @@ -1,4 +1,4 @@ -import 'package:core/in_memory_store.dart'; +import 'package:buzz_ui/in_memory_events_store.dart'; import '../model/profile.dart'; import '../model/profile_user_info.dart'; diff --git a/example/profile/lib/model/profile.dart b/example/lib/shared/modules/profile/model/profile.dart similarity index 100% rename from example/profile/lib/model/profile.dart rename to example/lib/shared/modules/profile/model/profile.dart diff --git a/example/profile/lib/model/profile_option.dart b/example/lib/shared/modules/profile/model/profile_option.dart similarity index 100% rename from example/profile/lib/model/profile_option.dart rename to example/lib/shared/modules/profile/model/profile_option.dart diff --git a/example/profile/lib/model/profile_user_info.dart b/example/lib/shared/modules/profile/model/profile_user_info.dart similarity index 100% rename from example/profile/lib/model/profile_user_info.dart rename to example/lib/shared/modules/profile/model/profile_user_info.dart diff --git a/example/profile/lib/module_registry.dart b/example/lib/shared/modules/profile/module_registry.dart similarity index 86% rename from example/profile/lib/module_registry.dart rename to example/lib/shared/modules/profile/module_registry.dart index 60b3d03..3787a53 100644 --- a/example/profile/lib/module_registry.dart +++ b/example/lib/shared/modules/profile/module_registry.dart @@ -1,8 +1,8 @@ import 'package:buzz/buzz.dart'; -import 'package:profile/data/profile_repository.dart'; -import 'package:profile/presentation/ui_event.dart'; import 'commands/change_user_name_command.dart'; +import 'data/profile_repository.dart'; +import 'presentation/ui_event.dart'; class ProfileModuleRegistries extends ModuleBuzzRegistries { ProfileModuleRegistries(this.findRepository); diff --git a/example/profile/lib/presentation/screen.dart b/example/lib/shared/modules/profile/presentation/screen.dart similarity index 86% rename from example/profile/lib/presentation/screen.dart rename to example/lib/shared/modules/profile/presentation/screen.dart index 1ed923e..6bd3d26 100644 --- a/example/profile/lib/presentation/screen.dart +++ b/example/lib/shared/modules/profile/presentation/screen.dart @@ -1,5 +1,6 @@ import 'package:flutter/material.dart'; -import 'package:profile/presentation/view.dart'; + +import 'view.dart'; class ProfileScreen extends StatelessWidget { const ProfileScreen({ diff --git a/example/profile/lib/presentation/ui_event.dart b/example/lib/shared/modules/profile/presentation/ui_event.dart similarity index 100% rename from example/profile/lib/presentation/ui_event.dart rename to example/lib/shared/modules/profile/presentation/ui_event.dart diff --git a/example/profile/lib/presentation/view.dart b/example/lib/shared/modules/profile/presentation/view.dart similarity index 100% rename from example/profile/lib/presentation/view.dart rename to example/lib/shared/modules/profile/presentation/view.dart diff --git a/example/profile/lib/presentation/view_controller.dart b/example/lib/shared/modules/profile/presentation/view_controller.dart similarity index 91% rename from example/profile/lib/presentation/view_controller.dart rename to example/lib/shared/modules/profile/presentation/view_controller.dart index ca1db2c..701a28f 100644 --- a/example/profile/lib/presentation/view_controller.dart +++ b/example/lib/shared/modules/profile/presentation/view_controller.dart @@ -1,7 +1,7 @@ import 'package:buzz/buzz.dart'; import 'package:get/get.dart'; -import 'package:profile/data/profile_repository.dart'; +import '../data/profile_repository.dart'; import '../model/profile.dart'; import 'ui_event.dart'; diff --git a/example/profile/lib/presentation/view_template.dart b/example/lib/shared/modules/profile/presentation/view_template.dart similarity index 98% rename from example/profile/lib/presentation/view_template.dart rename to example/lib/shared/modules/profile/presentation/view_template.dart index 8910441..f8582e8 100644 --- a/example/profile/lib/presentation/view_template.dart +++ b/example/lib/shared/modules/profile/presentation/view_template.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; -import '../profile.dart'; +import '../model/profile_option.dart'; class ProfileViewTemplate extends StatelessWidget { const ProfileViewTemplate({ diff --git a/example/profile/lib/routes.dart b/example/lib/shared/modules/profile/routes.dart similarity index 100% rename from example/profile/lib/routes.dart rename to example/lib/shared/modules/profile/routes.dart diff --git a/example/profile/lib/settings/screen.dart b/example/lib/shared/modules/profile/settings/screen.dart similarity index 60% rename from example/profile/lib/settings/screen.dart rename to example/lib/shared/modules/profile/settings/screen.dart index 313d265..19529db 100644 --- a/example/profile/lib/settings/screen.dart +++ b/example/lib/shared/modules/profile/settings/screen.dart @@ -1,4 +1,3 @@ -import 'package:buzz/buzz.dart'; import 'package:buzz_ui/events_list_view.dart'; import 'package:core/core.dart'; import 'package:flutter/material.dart'; @@ -7,24 +6,34 @@ import 'package:get/get.dart'; import 'view_controller.dart'; class SettingsScreen extends StatelessWidget { - const SettingsScreen({Key? key}) : super(key: key); + const SettingsScreen({ + Key? key, + required this.mainActionRoute, + }) : super(key: key); + + final String mainActionRoute; @override Widget build(BuildContext context) { - final controller = Get.put(SettingsViewController()); + final controller = Get.put( + SettingsViewController( + mainActionRoute: mainActionRoute, + ), + ); return Obx(() { return BasePage( name: 'Profile/Settings', body: EventRecordsView( eventsStoreStream: controller.eventsStore, + onDeleteEventsPressed: () { + controller.onDeleteEventsPressed(); + }, ), action: MainAction( label: 'Go to the unknown', onPressed: () { - Buzz.fire( - NavigateToCommand.named('/asdasd'), - ); + controller.onMainActionPressed(); }, ), ); diff --git a/example/lib/shared/modules/profile/settings/view_controller.dart b/example/lib/shared/modules/profile/settings/view_controller.dart new file mode 100644 index 0000000..32856ee --- /dev/null +++ b/example/lib/shared/modules/profile/settings/view_controller.dart @@ -0,0 +1,23 @@ +import 'package:buzz/buzz.dart'; +import 'package:buzz_ui/in_memory_events_store.dart'; +import 'package:get/get.dart'; + +class SettingsViewController extends GetxController { + SettingsViewController({ + required this.mainActionRoute, + }); + + final String mainActionRoute; + + Stream> get eventsStore { + return Get.find().listStateChanges(); + } + + void onDeleteEventsPressed() {} + + void onMainActionPressed() { + Buzz.fire( + NavigateToCommand.named(mainActionRoute), + ); + } +} diff --git a/example/profile/lib/utils.dart b/example/lib/shared/modules/profile/utils.dart similarity index 100% rename from example/profile/lib/utils.dart rename to example/lib/shared/modules/profile/utils.dart diff --git a/example/buzz_ui/.gitignore b/example/packages/buzz_ui/.gitignore similarity index 100% rename from example/buzz_ui/.gitignore rename to example/packages/buzz_ui/.gitignore diff --git a/example/buzz_ui/.metadata b/example/packages/buzz_ui/.metadata similarity index 100% rename from example/buzz_ui/.metadata rename to example/packages/buzz_ui/.metadata diff --git a/example/buzz_ui/CHANGELOG.md b/example/packages/buzz_ui/CHANGELOG.md similarity index 100% rename from example/buzz_ui/CHANGELOG.md rename to example/packages/buzz_ui/CHANGELOG.md diff --git a/example/buzz_ui/LICENSE b/example/packages/buzz_ui/LICENSE similarity index 100% rename from example/buzz_ui/LICENSE rename to example/packages/buzz_ui/LICENSE diff --git a/example/buzz_ui/README.md b/example/packages/buzz_ui/README.md similarity index 100% rename from example/buzz_ui/README.md rename to example/packages/buzz_ui/README.md diff --git a/example/buzz_ui/analysis_options.yaml b/example/packages/buzz_ui/analysis_options.yaml similarity index 100% rename from example/buzz_ui/analysis_options.yaml rename to example/packages/buzz_ui/analysis_options.yaml diff --git a/example/buzz_ui/lib/buzz_ui.dart b/example/packages/buzz_ui/lib/buzz_ui.dart similarity index 100% rename from example/buzz_ui/lib/buzz_ui.dart rename to example/packages/buzz_ui/lib/buzz_ui.dart diff --git a/example/buzz_ui/lib/events_list_view.dart b/example/packages/buzz_ui/lib/events_list_view.dart similarity index 90% rename from example/buzz_ui/lib/events_list_view.dart rename to example/packages/buzz_ui/lib/events_list_view.dart index 63694cf..dcc2968 100644 --- a/example/buzz_ui/lib/events_list_view.dart +++ b/example/packages/buzz_ui/lib/events_list_view.dart @@ -1,23 +1,35 @@ import 'package:core/core.dart'; import 'package:flutter/material.dart'; +import 'in_memory_events_store.dart'; + ///TODO: Add clear events cache log action class EventRecordsView extends StatelessWidget { - static const String routeName = "/app-behavior"; + static const String routeName = "/buzz-events"; const EventRecordsView({ Key? key, required this.eventsStoreStream, this.customColorDecorator, + required this.onDeleteEventsPressed, }) : super(key: key); final Stream> eventsStoreStream; final Color Function(EventRecord)? customColorDecorator; + final Function() onDeleteEventsPressed; @override Widget build(BuildContext context) { return SafeArea( child: Scaffold( + appBar: AppBar( + actions: [ + IconButton( + icon: const Icon(Icons.delete_forever), + onPressed: onDeleteEventsPressed, + ) + ], + ), body: EventRecordsViewStreamBuilder( eventsStoreStream: eventsStoreStream, customColorDecorator: customColorDecorator, diff --git a/packages/core/lib/in_memory_store.dart b/example/packages/buzz_ui/lib/in_memory_events_store.dart similarity index 50% rename from packages/core/lib/in_memory_store.dart rename to example/packages/buzz_ui/lib/in_memory_events_store.dart index 142257e..890fef7 100644 --- a/packages/core/lib/in_memory_store.dart +++ b/example/packages/buzz_ui/lib/in_memory_events_store.dart @@ -1,4 +1,37 @@ -import 'package:rxdart/rxdart.dart' show BehaviorSubject; +import 'package:rxdart/rxdart.dart'; + +abstract class EventRecord { + String get name; + Map? get params; + DateTime get timestamp; + + @override + String toString() { + return "[$name, $params, $timestamp]"; + } +} + +class EventRecordsInMemoryStore { + final _state = InMemoryStore>([]); + + Stream> listStateChanges() => _state.stream; + + List get currentList => _state.value; + + Future loadList() async { + //TODO: Implement loading items from a local file or a remote. + } + + Future wipeList() async { + _state.value = []; + } + + void dispose() => _state.close(); + + void add(EventRecord event) { + _state.value.add(event); + } +} /// An in-memory store backed by BehaviorSubject that can be used to /// store the data for all the fake repositories in the app. diff --git a/example/buzz_ui/pubspec.yaml b/example/packages/buzz_ui/pubspec.yaml similarity index 98% rename from example/buzz_ui/pubspec.yaml rename to example/packages/buzz_ui/pubspec.yaml index 8ea298d..7d17eda 100644 --- a/example/buzz_ui/pubspec.yaml +++ b/example/packages/buzz_ui/pubspec.yaml @@ -10,6 +10,7 @@ environment: dependencies: flutter: sdk: flutter + rxdart: 0.27.4 core: path: '../../packages/core' diff --git a/example/buzz_ui/test/buzz_ui_test.dart b/example/packages/buzz_ui/test/buzz_ui_test.dart similarity index 100% rename from example/buzz_ui/test/buzz_ui_test.dart rename to example/packages/buzz_ui/test/buzz_ui_test.dart diff --git a/example/profile/.gitignore b/example/packages/core/.gitignore similarity index 100% rename from example/profile/.gitignore rename to example/packages/core/.gitignore diff --git a/example/profile/.metadata b/example/packages/core/.metadata similarity index 100% rename from example/profile/.metadata rename to example/packages/core/.metadata diff --git a/example/profile/CHANGELOG.md b/example/packages/core/CHANGELOG.md similarity index 100% rename from example/profile/CHANGELOG.md rename to example/packages/core/CHANGELOG.md diff --git a/example/profile/LICENSE b/example/packages/core/LICENSE similarity index 100% rename from example/profile/LICENSE rename to example/packages/core/LICENSE diff --git a/packages/core/README.md b/example/packages/core/README.md similarity index 100% rename from packages/core/README.md rename to example/packages/core/README.md diff --git a/example/profile/analysis_options.yaml b/example/packages/core/analysis_options.yaml similarity index 100% rename from example/profile/analysis_options.yaml rename to example/packages/core/analysis_options.yaml diff --git a/packages/core/lib/core.dart b/example/packages/core/lib/core.dart similarity index 64% rename from packages/core/lib/core.dart rename to example/packages/core/lib/core.dart index 90c78ac..1a2f472 100644 --- a/packages/core/lib/core.dart +++ b/example/packages/core/lib/core.dart @@ -1,7 +1,5 @@ library core; -export 'event_record.dart'; -export 'in_memory_store.dart'; export 'json_reader.dart'; export 'managed_stream_builder.dart'; export 'named_page.dart'; diff --git a/packages/core/lib/json_reader.dart b/example/packages/core/lib/json_reader.dart similarity index 100% rename from packages/core/lib/json_reader.dart rename to example/packages/core/lib/json_reader.dart diff --git a/packages/core/lib/managed_stream_builder.dart b/example/packages/core/lib/managed_stream_builder.dart similarity index 100% rename from packages/core/lib/managed_stream_builder.dart rename to example/packages/core/lib/managed_stream_builder.dart diff --git a/packages/core/lib/named_page.dart b/example/packages/core/lib/named_page.dart similarity index 100% rename from packages/core/lib/named_page.dart rename to example/packages/core/lib/named_page.dart diff --git a/packages/core/pubspec.yaml b/example/packages/core/pubspec.yaml similarity index 100% rename from packages/core/pubspec.yaml rename to example/packages/core/pubspec.yaml diff --git a/example/profile/README.md b/example/profile/README.md deleted file mode 100644 index 11835bc..0000000 --- a/example/profile/README.md +++ /dev/null @@ -1,29 +0,0 @@ -## Features - -TODO: List what your package can do. Maybe include images, gifs, or videos. - -## Getting started - -TODO: List prerequisites and provide or point to information on how to -start using the package. - -## Usage - -### Commands - -- `ChangeUserNameCommand` -- `??` - -### Entities - -- `??` -- `??` - - -The ViewTemplate - -## Additional information - -TODO: Tell users more about the package: where to find more information, how to -contribute to the package, how to file issues, what response they can expect -from the package authors, and more. diff --git a/example/profile/lib/profile.dart b/example/profile/lib/profile.dart deleted file mode 100644 index 0d408ac..0000000 --- a/example/profile/lib/profile.dart +++ /dev/null @@ -1,8 +0,0 @@ -library profile; - -export 'data/profile_repository.dart'; -export 'model/profile.dart'; -export 'model/profile_option.dart'; -export 'model/profile_user_info.dart'; -export 'module_registry.dart'; -export 'presentation/screen.dart'; diff --git a/example/profile/lib/settings/view_controller.dart b/example/profile/lib/settings/view_controller.dart deleted file mode 100644 index 036fb63..0000000 --- a/example/profile/lib/settings/view_controller.dart +++ /dev/null @@ -1,8 +0,0 @@ -import 'package:buzz/buzz.dart' show EventRecordsInMemoryStore; -import 'package:core/core.dart'; -import 'package:get/get.dart'; - -class SettingsViewController extends GetxController { - Stream> get eventsStore => - Get.find().listStateChanges(); -} diff --git a/example/profile/pubspec.yaml b/example/profile/pubspec.yaml deleted file mode 100644 index 76bfd17..0000000 --- a/example/profile/pubspec.yaml +++ /dev/null @@ -1,62 +0,0 @@ -name: profile -description: Example profile feature module -version: 0.0.1 -publish_to: 'none' - -environment: - sdk: ">=2.17.0 <3.0.0" - flutter: ">=1.17.0" - -dependencies: - flutter: - sdk: flutter - get: 4.6.5 - rxdart: 0.27.4 - core: - path: '../../packages/core' - buzz: - path: '../../' - buzz_ui: - path: '../buzz_ui' - -dev_dependencies: - flutter_test: - sdk: flutter - flutter_lints: ^2.0.0 - -# For information on the generic Dart part of this file, see the -# following page: https://dart.dev/tools/pub/pubspec - -# The following section is specific to Flutter packages. -flutter: - - # To add assets to your package, add an assets section, like this: - # assets: - # - images/a_dot_burr.jpeg - # - images/a_dot_ham.jpeg - # - # For details regarding assets in packages, see - # https://flutter.dev/assets-and-images/#from-packages - # - # An image asset can refer to one or more resolution-specific "variants", see - # https://flutter.dev/assets-and-images/#resolution-aware - - # To add custom fonts to your package, add a fonts section here, - # in this "flutter" section. Each entry in this list should have a - # "family" key with the font family name, and a "fonts" key with a - # list giving the asset and other descriptors for the font. For - # example: - # fonts: - # - family: Schyler - # fonts: - # - asset: fonts/Schyler-Regular.ttf - # - asset: fonts/Schyler-Italic.ttf - # style: italic - # - family: Trajan Pro - # fonts: - # - asset: fonts/TrajanPro.ttf - # - asset: fonts/TrajanPro_Bold.ttf - # weight: 700 - # - # For details regarding fonts in packages, see - # https://flutter.dev/custom-fonts/#from-packages diff --git a/example/pubspec.lock b/example/pubspec.lock index cc0f433..dbff93e 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -23,9 +23,9 @@ packages: source: path version: "0.0.1" buzz_ui: - dependency: transitive + dependency: "direct main" description: - path: buzz_ui + path: "packages/buzz_ui" relative: true source: path version: "0.0.1" @@ -60,7 +60,7 @@ packages: core: dependency: "direct main" description: - path: "../packages/core" + path: "packages/core" relative: true source: path version: "0.0.1" @@ -256,13 +256,6 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "4.2.4" - profile: - dependency: "direct main" - description: - path: profile - relative: true - source: path - version: "0.0.1" rxdart: dependency: transitive description: diff --git a/example/pubspec.yaml b/example/pubspec.yaml index 368f04f..fd7115d 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -1,93 +1,30 @@ name: example description: A new Flutter project. -# The following line prevents the package from being accidentally published to -# pub.dev using `flutter pub publish`. This is preferred for private packages. -publish_to: 'none' # Remove this line if you wish to publish to pub.dev +publish_to: 'none' -# The following defines the version and build number for your application. -# A version number is three numbers separated by dots, like 1.2.43 -# followed by an optional build number separated by a +. -# Both the version and the builder number may be overridden in flutter -# build by specifying --build-name and --build-number, respectively. -# In Android, build-name is used as versionName while build-number used as versionCode. -# Read more about Android versioning at https://developer.android.com/studio/publish/versioning -# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. -# Read more about iOS versioning at -# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html version: 1.0.0+1 environment: sdk: ">=2.17.0 <3.0.0" -# Dependencies specify other packages that your package needs in order to work. -# To automatically upgrade your package dependencies to the latest versions -# consider running `flutter pub upgrade --major-versions`. Alternatively, -# dependencies can be manually updated by changing the version numbers below to -# the latest version available on pub.dev. To see which dependencies have newer -# versions available, run `flutter pub outdated`. dependencies: flutter: sdk: flutter get: 4.6.5 flutter_modular: 5.0.2 get_storage: 2.0.3 - profile: - path: './profile' core: - path: '../packages/core' + path: 'packages/core' + buzz_ui: + path: 'packages/buzz_ui' buzz: path: '../' dev_dependencies: flutter_test: sdk: flutter - - # The "flutter_lints" package below contains a set of recommended lints to - # encourage good coding practices. The lint set provided by the package is - # activated in the `analysis_options.yaml` file located at the root of your - # package. See that file for information about deactivating specific lint - # rules and activating additional ones. flutter_lints: ^2.0.0 -# For information on the generic Dart part of this file, see the -# following page: https://dart.dev/tools/pub/pubspec - -# The following section is specific to Flutter packages. flutter: - - # The following line ensures that the Material Icons font is - # included with your application, so that you can use the icons in - # the material Icons class. uses-material-design: true - - # To add assets to your application, add an assets section, like this: - # assets: - # - images/a_dot_burr.jpeg - # - images/a_dot_ham.jpeg - - # An image asset can refer to one or more resolution-specific "variants", see - # https://flutter.dev/assets-and-images/#resolution-aware - - # For details regarding adding assets from package dependencies, see - # https://flutter.dev/assets-and-images/#from-packages - - # To add custom fonts to your application, add a fonts section here, - # in this "flutter" section. Each entry in this list should have a - # "family" key with the font family name, and a "fonts" key with a - # list giving the asset and other descriptors for the font. For - # example: - # fonts: - # - family: Schyler - # fonts: - # - asset: fonts/Schyler-Regular.ttf - # - asset: fonts/Schyler-Italic.ttf - # style: italic - # - family: Trajan Pro - # fonts: - # - asset: fonts/TrajanPro.ttf - # - asset: fonts/TrajanPro_Bold.ttf - # weight: 700 - # - # For details regarding fonts from package dependencies, - # see https://flutter.dev/custom-fonts/#from-packages diff --git a/lib/buzz.dart b/lib/buzz.dart index f80c512..0e16cbd 100644 --- a/lib/buzz.dart +++ b/lib/buzz.dart @@ -11,5 +11,4 @@ export 'kinds/app_events.dart'; export 'kinds/commands.dart'; export 'kinds/ui_events.dart'; export 'navigation/navigation.dart'; -export 'utils/in_memory_events_store.dart'; export 'utils/utils.dart'; diff --git a/lib/utils/in_memory_events_store.dart b/lib/utils/in_memory_events_store.dart deleted file mode 100644 index ee6e28b..0000000 --- a/lib/utils/in_memory_events_store.dart +++ /dev/null @@ -1,23 +0,0 @@ -import 'package:core/core.dart'; - -class EventRecordsInMemoryStore { - final _state = InMemoryStore>([]); - - Stream> listStateChanges() => _state.stream; - - List get currentList => _state.value; - - Future loadList() async { - //TODO: Implement loading items from a local file or a remote. - } - - Future wipeList() async { - _state.value = []; - } - - void dispose() => _state.close(); - - void add(EventRecord event) { - _state.value.add(event); - } -} diff --git a/packages/core/.gitignore b/packages/core/.gitignore deleted file mode 100644 index 96486fd..0000000 --- a/packages/core/.gitignore +++ /dev/null @@ -1,30 +0,0 @@ -# Miscellaneous -*.class -*.log -*.pyc -*.swp -.DS_Store -.atom/ -.buildlog/ -.history -.svn/ -migrate_working_dir/ - -# IntelliJ related -*.iml -*.ipr -*.iws -.idea/ - -# The .vscode folder contains launch configuration and tasks you configure in -# VS Code which you may wish to be included in version control, so this line -# is commented out by default. -#.vscode/ - -# Flutter/Dart/Pub related -# Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock. -/pubspec.lock -**/doc/api/ -.dart_tool/ -.packages -build/ diff --git a/packages/core/.metadata b/packages/core/.metadata deleted file mode 100644 index c79dee4..0000000 --- a/packages/core/.metadata +++ /dev/null @@ -1,10 +0,0 @@ -# This file tracks properties of this Flutter project. -# Used by Flutter tool to assess capabilities and perform upgrades etc. -# -# This file should be version controlled and should not be manually edited. - -version: - revision: ee4e09cce01d6f2d7f4baebd247fde02e5008851 - channel: stable - -project_type: package diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md deleted file mode 100644 index 41cc7d8..0000000 --- a/packages/core/CHANGELOG.md +++ /dev/null @@ -1,3 +0,0 @@ -## 0.0.1 - -* TODO: Describe initial release. diff --git a/packages/core/LICENSE b/packages/core/LICENSE deleted file mode 100644 index ba75c69..0000000 --- a/packages/core/LICENSE +++ /dev/null @@ -1 +0,0 @@ -TODO: Add your license here. diff --git a/packages/core/analysis_options.yaml b/packages/core/analysis_options.yaml deleted file mode 100644 index a5744c1..0000000 --- a/packages/core/analysis_options.yaml +++ /dev/null @@ -1,4 +0,0 @@ -include: package:flutter_lints/flutter.yaml - -# Additional information about this file can be found at -# https://dart.dev/guides/language/analysis-options diff --git a/packages/core/lib/event_record.dart b/packages/core/lib/event_record.dart deleted file mode 100644 index 6af80ba..0000000 --- a/packages/core/lib/event_record.dart +++ /dev/null @@ -1,10 +0,0 @@ -abstract class EventRecord { - String get name; - Map? get params; - DateTime get timestamp; - - @override - String toString() { - return "[$name, $params, $timestamp]"; - } -} diff --git a/pubspec.yaml b/pubspec.yaml index 380e29c..5b05cae 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -2,7 +2,6 @@ name: buzz description: An opinionated scalable framework for modern mobile apps version: 0.0.1 homepage: https://github.com/LuisBurgos/buzz -publish_to: none environment: sdk: '>=2.15.1 <3.0.0' @@ -10,11 +9,8 @@ environment: dependencies: flutter: sdk: flutter - event_bus: 2.0.0 rxdart: 0.27.4 - core: - path: 'packages/core' dev_dependencies: lints: ^1.0.0