diff --git a/example/lib/shared/modules/profile/settings/screen.dart b/example/lib/shared/modules/profile/settings/screen.dart index 19529db..583bc81 100644 --- a/example/lib/shared/modules/profile/settings/screen.dart +++ b/example/lib/shared/modules/profile/settings/screen.dart @@ -1,4 +1,3 @@ -import 'package:buzz_ui/events_list_view.dart'; import 'package:core/core.dart'; import 'package:flutter/material.dart'; import 'package:get/get.dart'; @@ -24,11 +23,8 @@ class SettingsScreen extends StatelessWidget { return Obx(() { return BasePage( name: 'Profile/Settings', - body: EventRecordsView( - eventsStoreStream: controller.eventsStore, - onDeleteEventsPressed: () { - controller.onDeleteEventsPressed(); - }, + body: const Center( + child: Text('TODO Implement'), ), action: MainAction( label: 'Go to the unknown', diff --git a/example/lib/shared/modules/profile/settings/view_controller.dart b/example/lib/shared/modules/profile/settings/view_controller.dart index 32856ee..96c716f 100644 --- a/example/lib/shared/modules/profile/settings/view_controller.dart +++ b/example/lib/shared/modules/profile/settings/view_controller.dart @@ -1,5 +1,4 @@ import 'package:buzz/buzz.dart'; -import 'package:buzz_ui/in_memory_events_store.dart'; import 'package:get/get.dart'; class SettingsViewController extends GetxController { @@ -9,10 +8,6 @@ class SettingsViewController extends GetxController { final String mainActionRoute; - Stream> get eventsStore { - return Get.find().listStateChanges(); - } - void onDeleteEventsPressed() {} void onMainActionPressed() { diff --git a/example/packages/buzz_ui/.gitignore b/example/packages/buzz_ui/.gitignore deleted file mode 100644 index 96486fd..0000000 --- a/example/packages/buzz_ui/.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/example/packages/buzz_ui/.metadata b/example/packages/buzz_ui/.metadata deleted file mode 100644 index c79dee4..0000000 --- a/example/packages/buzz_ui/.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/example/packages/buzz_ui/CHANGELOG.md b/example/packages/buzz_ui/CHANGELOG.md deleted file mode 100644 index 41cc7d8..0000000 --- a/example/packages/buzz_ui/CHANGELOG.md +++ /dev/null @@ -1,3 +0,0 @@ -## 0.0.1 - -* TODO: Describe initial release. diff --git a/example/packages/buzz_ui/LICENSE b/example/packages/buzz_ui/LICENSE deleted file mode 100644 index ba75c69..0000000 --- a/example/packages/buzz_ui/LICENSE +++ /dev/null @@ -1 +0,0 @@ -TODO: Add your license here. diff --git a/example/packages/buzz_ui/README.md b/example/packages/buzz_ui/README.md deleted file mode 100644 index 8b55e73..0000000 --- a/example/packages/buzz_ui/README.md +++ /dev/null @@ -1,39 +0,0 @@ - - -TODO: Put a short description of the package here that helps potential users -know whether this package might be useful for them. - -## 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 - -TODO: Include short and useful examples for package users. Add longer examples -to `/example` folder. - -```dart -const like = 'sample'; -``` - -## 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/packages/buzz_ui/analysis_options.yaml b/example/packages/buzz_ui/analysis_options.yaml deleted file mode 100644 index a5744c1..0000000 --- a/example/packages/buzz_ui/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/example/packages/buzz_ui/lib/buzz_ui.dart b/example/packages/buzz_ui/lib/buzz_ui.dart deleted file mode 100644 index 3248ccc..0000000 --- a/example/packages/buzz_ui/lib/buzz_ui.dart +++ /dev/null @@ -1 +0,0 @@ -library buzz_ui; diff --git a/example/packages/buzz_ui/lib/events_list_view.dart b/example/packages/buzz_ui/lib/events_list_view.dart deleted file mode 100644 index e9f4199..0000000 --- a/example/packages/buzz_ui/lib/events_list_view.dart +++ /dev/null @@ -1,142 +0,0 @@ -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 = "/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, - ), - ), - ); - } -} - -class EventRecordsViewStreamBuilder extends StatelessWidget { - const EventRecordsViewStreamBuilder({ - Key? key, - required this.eventsStoreStream, - this.customColorDecorator, - }) : super(key: key); - - final Stream> eventsStoreStream; - final Color Function(EventRecord)? customColorDecorator; - - @override - Widget build(BuildContext context) { - return ManagedStreamBuilder>( - stream: eventsStoreStream, - onLoading: () => const Center(child: CircularProgressIndicator()), - onError: (error) => Center(child: Text(error)), - onData: (data) => EventRecordsListView( - items: data ?? const [], - colorDecorator: customColorDecorator, - ), - ); - } -} - -class EventRecordsListView extends StatelessWidget { - const EventRecordsListView({ - Key? key, - required this.items, - this.colorDecorator, - }) : super(key: key); - - final List items; - final Color Function(EventRecord)? colorDecorator; - - Color _getDecorationColor(EventRecord event) { - if (colorDecorator == null) return Colors.grey; - return colorDecorator!(event); - } - - @override - Widget build(BuildContext context) { - if (items.isEmpty) { - return const Center( - child: Text('No items yet'), - ); - } - - return ListView.builder( - itemCount: items.length, - itemBuilder: (context, index) { - final event = items[index]; - - return Container( - margin: const EdgeInsets.only(top: 4), - decoration: BoxDecoration( - border: Border( - bottom: BorderSide( - width: 3, - color: Colors.grey.shade300, - ), - ), - ), - child: ListTile( - leading: Container( - height: 40, - width: 40, - decoration: BoxDecoration( - color: _getDecorationColor(event), - shape: BoxShape.circle, - ), - child: Center( - child: Text('${index + 1}'), - ), - ), - title: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Text( - event.name, - style: const TextStyle(fontWeight: FontWeight.w500), - ), - ], - ), - subtitle: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - if (event.params != null) ...[ - const SizedBox(height: 4), - Text(event.params.toString()), - ], - const SizedBox(height: 6), - Text(event.timestamp.toIso8601String()), - ], - ), - ), - ); - }, - ); - } -} diff --git a/example/packages/buzz_ui/lib/in_memory_events_store.dart b/example/packages/buzz_ui/lib/in_memory_events_store.dart deleted file mode 100644 index 5e185b9..0000000 --- a/example/packages/buzz_ui/lib/in_memory_events_store.dart +++ /dev/null @@ -1,34 +0,0 @@ -import 'package:core/core.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); - } -} diff --git a/example/packages/buzz_ui/pubspec.yaml b/example/packages/buzz_ui/pubspec.yaml deleted file mode 100644 index 7d17eda..0000000 --- a/example/packages/buzz_ui/pubspec.yaml +++ /dev/null @@ -1,57 +0,0 @@ -name: buzz_ui -description: Buzz UI Components -version: 0.0.1 -publish_to: none - -environment: - sdk: ">=2.17.0 <3.0.0" - flutter: ">=1.17.0" - -dependencies: - flutter: - sdk: flutter - rxdart: 0.27.4 - core: - path: '../../packages/core' - -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 9d29030..b3deac3 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -22,13 +22,6 @@ packages: relative: true source: path version: "0.0.6" - buzz_ui: - dependency: "direct main" - description: - path: "packages/buzz_ui" - relative: true - source: path - version: "0.0.1" characters: dependency: transitive description: diff --git a/example/pubspec.yaml b/example/pubspec.yaml index fd7115d..785e10a 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -16,8 +16,6 @@ dependencies: get_storage: 2.0.3 core: path: 'packages/core' - buzz_ui: - path: 'packages/buzz_ui' buzz: path: '../'