Commit 249e5b6

derdilla <82763757+NobodyForNothing@users.noreply.github.com>
2024-03-16 09:39:52
add package structure
Signed-off-by: derdilla <82763757+NobodyForNothing@users.noreply.github.com>
1 parent becf884
health_data_store/lib/src/health_data_store.dart
@@ -0,0 +1,21 @@
+
+import 'package:sqflite_common/sqflite.dart';
+
+// TODO: document once finished
+abstract class HealthDataStore {
+
+  const HealthDataStore._create();
+
+  /// Initializes objects from [db].
+  ///
+  /// [db] must be exclusive to the package and will be initialized by it.
+  static Future<HealthDataStore?> load(Database db) async {
+    if (!db.isOpen) return null;
+    // TODO
+    throw UnimplementedError();
+  }
+
+  // TODO: Future<BloodPressureRepository> getBloodPressureRepository();
+  // ...
+
+}
health_data_store/lib/health_data_store.dart
@@ -0,0 +1,4 @@
+/// Package to easily store health domain data.
+library;
+
+export 'src/health_data_store.dart';
health_data_store/test/src/health_data_store_test.dart
@@ -0,0 +1,6 @@
+// ignore_for_file: prefer_const_constructors
+
+
+void main() {
+
+}
health_data_store/.gitignore
@@ -0,0 +1,7 @@
+# See https://www.dartlang.org/guides/libraries/private-files
+
+# Files and directories created by pub
+.dart_tool/
+.packages
+build/
+pubspec.lock
\ No newline at end of file
health_data_store/analysis_options.yaml
@@ -0,0 +1,46 @@
+# This file configures the analyzer, which statically analyzes Dart code to
+# check for errors, warnings, and lints.
+
+linter:
+  rules:
+    # Error:
+    - always_use_package_imports
+    - avoid_slow_async_io
+    - comment_references
+    - no_wildcard_variable_uses
+    - prefer_void_to_null
+
+    # Style:
+    - always_declare_return_types
+    - avoid_annotating_with_dynamic
+    - avoid_bool_literals_in_conditional_expressions
+    - avoid_double_and_int_checks
+    - avoid_escaping_inner_quotes
+    - avoid_redundant_argument_values
+    - directives_ordering
+    - eol_at_end_of_file
+    - leading_newlines_in_multiline_strings
+    - library_annotations
+    - lines_longer_than_80_chars
+    - matching_super_parameters
+    - no_literal_bool_comparisons
+    - noop_primitive_operations
+    - package_api_docs
+    - prefer_asserts_in_initializer_lists
+    - prefer_expression_function_bodies
+    - prefer_final_in_for_each
+    - prefer_final_locals
+    - prefer_if_elements_to_conditional_expressions
+    - prefer_mixin
+    - prefer_single_quotes
+    - public_member_api_docs
+    - sort_constructors_first
+    - type_annotate_public_apis
+    - unnecessary_await_in_return
+    - unnecessary_lambdas
+    - unnecessary_null_aware_operator_on_extension_on_nullable
+    - use_if_null_to_convert_nulls_to_bools
+    - use_to_and_as_if_applicable
+
+    # Pub
+    - sort_pub_dependencies
health_data_store/pubspec.yaml
@@ -0,0 +1,19 @@
+name: health_data_store
+description: A package to easily store health related data.
+version: 0.1.0+1
+publish_to: none
+
+environment:
+  sdk: "^3.3.0"
+
+dependencies:
+  freezed_annotation: ^2.4.1
+  sqflite_common: ^2.5.3
+
+dev_dependencies:
+  mocktail: ^1.0.3
+  sqflite_common_ffi: ^2.1.1+1
+  test: ^1.25.2
+  build_runner: ^2.4.8
+  freezed: ^2.4.7
+
health_data_store/README.md
@@ -0,0 +1,6 @@
+# Health Data Store
+
+A package to easily store health related data.
+
+The main goal of this package is to abstract away all the database logic and 
+schemas and provide a simple extensible api. 
.flutter-plugins
@@ -0,0 +1,23 @@
+# This is a generated file; do not edit or check into version control.
+file_picker=/home/derdilla/.pub-cache/hosted/pub.dev/file_picker-5.5.0/
+flutter_plugin_android_lifecycle=/home/derdilla/.pub-cache/hosted/pub.dev/flutter_plugin_android_lifecycle-2.0.17/
+fluttertoast=/home/derdilla/.pub-cache/hosted/pub.dev/fluttertoast-8.2.4/
+jsaver=/home/derdilla/.pub-cache/hosted/pub.dev/jsaver-1.3.0/
+package_info_plus=/home/derdilla/.pub-cache/hosted/pub.dev/package_info_plus-4.2.0/
+path_provider_linux=/home/derdilla/.pub-cache/hosted/pub.dev/path_provider_linux-2.2.1/
+path_provider_windows=/home/derdilla/.pub-cache/hosted/pub.dev/path_provider_windows-2.2.1/
+restart_app=/home/derdilla/.pub-cache/hosted/pub.dev/restart_app-1.2.1/
+shared_preferences=/home/derdilla/.pub-cache/hosted/pub.dev/shared_preferences-2.2.2/
+shared_preferences_android=/home/derdilla/.pub-cache/hosted/pub.dev/shared_preferences_android-2.2.1/
+shared_preferences_foundation=/home/derdilla/.pub-cache/hosted/pub.dev/shared_preferences_foundation-2.3.5/
+shared_preferences_linux=/home/derdilla/.pub-cache/hosted/pub.dev/shared_preferences_linux-2.3.2/
+shared_preferences_web=/home/derdilla/.pub-cache/hosted/pub.dev/shared_preferences_web-2.3.0/
+shared_preferences_windows=/home/derdilla/.pub-cache/hosted/pub.dev/shared_preferences_windows-2.3.2/
+sqflite=/home/derdilla/.pub-cache/hosted/pub.dev/sqflite-2.3.2/
+url_launcher=/home/derdilla/.pub-cache/hosted/pub.dev/url_launcher-6.2.5/
+url_launcher_android=/home/derdilla/.pub-cache/hosted/pub.dev/url_launcher_android-6.3.0/
+url_launcher_ios=/home/derdilla/.pub-cache/hosted/pub.dev/url_launcher_ios-6.2.5/
+url_launcher_linux=/home/derdilla/.pub-cache/hosted/pub.dev/url_launcher_linux-3.1.1/
+url_launcher_macos=/home/derdilla/.pub-cache/hosted/pub.dev/url_launcher_macos-3.1.0/
+url_launcher_web=/home/derdilla/.pub-cache/hosted/pub.dev/url_launcher_web-2.3.0/
+url_launcher_windows=/home/derdilla/.pub-cache/hosted/pub.dev/url_launcher_windows-3.1.1/
.flutter-plugins-dependencies
@@ -0,0 +1,1 @@
+{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"file_picker","path":"/home/derdilla/.pub-cache/hosted/pub.dev/file_picker-5.5.0/","native_build":true,"dependencies":[]},{"name":"fluttertoast","path":"/home/derdilla/.pub-cache/hosted/pub.dev/fluttertoast-8.2.4/","native_build":true,"dependencies":[]},{"name":"package_info_plus","path":"/home/derdilla/.pub-cache/hosted/pub.dev/package_info_plus-4.2.0/","native_build":true,"dependencies":[]},{"name":"restart_app","path":"/home/derdilla/.pub-cache/hosted/pub.dev/restart_app-1.2.1/","native_build":true,"dependencies":[]},{"name":"shared_preferences_foundation","path":"/home/derdilla/.pub-cache/hosted/pub.dev/shared_preferences_foundation-2.3.5/","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"sqflite","path":"/home/derdilla/.pub-cache/hosted/pub.dev/sqflite-2.3.2/","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"url_launcher_ios","path":"/home/derdilla/.pub-cache/hosted/pub.dev/url_launcher_ios-6.2.5/","native_build":true,"dependencies":[]}],"android":[{"name":"file_picker","path":"/home/derdilla/.pub-cache/hosted/pub.dev/file_picker-5.5.0/","native_build":true,"dependencies":["flutter_plugin_android_lifecycle"]},{"name":"flutter_plugin_android_lifecycle","path":"/home/derdilla/.pub-cache/hosted/pub.dev/flutter_plugin_android_lifecycle-2.0.17/","native_build":true,"dependencies":[]},{"name":"fluttertoast","path":"/home/derdilla/.pub-cache/hosted/pub.dev/fluttertoast-8.2.4/","native_build":true,"dependencies":[]},{"name":"jsaver","path":"/home/derdilla/.pub-cache/hosted/pub.dev/jsaver-1.3.0/","native_build":true,"dependencies":[]},{"name":"package_info_plus","path":"/home/derdilla/.pub-cache/hosted/pub.dev/package_info_plus-4.2.0/","native_build":true,"dependencies":[]},{"name":"restart_app","path":"/home/derdilla/.pub-cache/hosted/pub.dev/restart_app-1.2.1/","native_build":true,"dependencies":[]},{"name":"shared_preferences_android","path":"/home/derdilla/.pub-cache/hosted/pub.dev/shared_preferences_android-2.2.1/","native_build":true,"dependencies":[]},{"name":"sqflite","path":"/home/derdilla/.pub-cache/hosted/pub.dev/sqflite-2.3.2/","native_build":true,"dependencies":[]},{"name":"url_launcher_android","path":"/home/derdilla/.pub-cache/hosted/pub.dev/url_launcher_android-6.3.0/","native_build":true,"dependencies":[]}],"macos":[{"name":"package_info_plus","path":"/home/derdilla/.pub-cache/hosted/pub.dev/package_info_plus-4.2.0/","native_build":true,"dependencies":[]},{"name":"shared_preferences_foundation","path":"/home/derdilla/.pub-cache/hosted/pub.dev/shared_preferences_foundation-2.3.5/","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"sqflite","path":"/home/derdilla/.pub-cache/hosted/pub.dev/sqflite-2.3.2/","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"url_launcher_macos","path":"/home/derdilla/.pub-cache/hosted/pub.dev/url_launcher_macos-3.1.0/","native_build":true,"dependencies":[]}],"linux":[{"name":"package_info_plus","path":"/home/derdilla/.pub-cache/hosted/pub.dev/package_info_plus-4.2.0/","native_build":false,"dependencies":[]},{"name":"path_provider_linux","path":"/home/derdilla/.pub-cache/hosted/pub.dev/path_provider_linux-2.2.1/","native_build":false,"dependencies":[]},{"name":"shared_preferences_linux","path":"/home/derdilla/.pub-cache/hosted/pub.dev/shared_preferences_linux-2.3.2/","native_build":false,"dependencies":["path_provider_linux"]},{"name":"url_launcher_linux","path":"/home/derdilla/.pub-cache/hosted/pub.dev/url_launcher_linux-3.1.1/","native_build":true,"dependencies":[]}],"windows":[{"name":"package_info_plus","path":"/home/derdilla/.pub-cache/hosted/pub.dev/package_info_plus-4.2.0/","native_build":false,"dependencies":[]},{"name":"path_provider_windows","path":"/home/derdilla/.pub-cache/hosted/pub.dev/path_provider_windows-2.2.1/","native_build":false,"dependencies":[]},{"name":"shared_preferences_windows","path":"/home/derdilla/.pub-cache/hosted/pub.dev/shared_preferences_windows-2.3.2/","native_build":false,"dependencies":["path_provider_windows"]},{"name":"url_launcher_windows","path":"/home/derdilla/.pub-cache/hosted/pub.dev/url_launcher_windows-3.1.1/","native_build":true,"dependencies":[]}],"web":[{"name":"file_picker","path":"/home/derdilla/.pub-cache/hosted/pub.dev/file_picker-5.5.0/","dependencies":[]},{"name":"fluttertoast","path":"/home/derdilla/.pub-cache/hosted/pub.dev/fluttertoast-8.2.4/","dependencies":[]},{"name":"jsaver","path":"/home/derdilla/.pub-cache/hosted/pub.dev/jsaver-1.3.0/","dependencies":[]},{"name":"package_info_plus","path":"/home/derdilla/.pub-cache/hosted/pub.dev/package_info_plus-4.2.0/","dependencies":[]},{"name":"restart_app","path":"/home/derdilla/.pub-cache/hosted/pub.dev/restart_app-1.2.1/","dependencies":[]},{"name":"shared_preferences_web","path":"/home/derdilla/.pub-cache/hosted/pub.dev/shared_preferences_web-2.3.0/","dependencies":[]},{"name":"url_launcher_web","path":"/home/derdilla/.pub-cache/hosted/pub.dev/url_launcher_web-2.3.0/","dependencies":[]}]},"dependencyGraph":[{"name":"file_picker","dependencies":["flutter_plugin_android_lifecycle"]},{"name":"flutter_plugin_android_lifecycle","dependencies":[]},{"name":"fluttertoast","dependencies":[]},{"name":"jsaver","dependencies":[]},{"name":"package_info_plus","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"restart_app","dependencies":[]},{"name":"shared_preferences","dependencies":["shared_preferences_android","shared_preferences_foundation","shared_preferences_linux","shared_preferences_web","shared_preferences_windows"]},{"name":"shared_preferences_android","dependencies":[]},{"name":"shared_preferences_foundation","dependencies":[]},{"name":"shared_preferences_linux","dependencies":["path_provider_linux"]},{"name":"shared_preferences_web","dependencies":[]},{"name":"shared_preferences_windows","dependencies":["path_provider_windows"]},{"name":"sqflite","dependencies":[]},{"name":"url_launcher","dependencies":["url_launcher_android","url_launcher_ios","url_launcher_linux","url_launcher_macos","url_launcher_web","url_launcher_windows"]},{"name":"url_launcher_android","dependencies":[]},{"name":"url_launcher_ios","dependencies":[]},{"name":"url_launcher_linux","dependencies":[]},{"name":"url_launcher_macos","dependencies":[]},{"name":"url_launcher_web","dependencies":[]},{"name":"url_launcher_windows","dependencies":[]}],"date_created":"2024-03-15 19:50:44.507121","version":"3.21.0-1.0.pre.2"}
\ No newline at end of file
blood_pressure_app.iml
@@ -145,5 +145,6 @@
     <orderEntry type="sourceFolder" forTests="false" />
     <orderEntry type="library" name="Dart SDK" level="project" />
     <orderEntry type="library" name="Flutter Plugins" level="project" />
+    <orderEntry type="library" name="Dart Packages" level="project" />
   </component>
 </module>
\ No newline at end of file