diff --git a/.dart_tool/package_config.json b/.dart_tool/package_config.json index 1edcde5..67dc52b 100644 --- a/.dart_tool/package_config.json +++ b/.dart_tool/package_config.json @@ -3,435 +3,435 @@ "packages": [ { "name": "_fe_analyzer_shared", - "rootUri": "file:///Users/huseyintokpinar/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/_fe_analyzer_shared-40.0.0", + "rootUri": "file:///Users/huseyintokpinar/.pub-cache/hosted/pub.dev/_fe_analyzer_shared-47.0.0", "packageUri": "lib/", - "languageVersion": "2.12" + "languageVersion": "2.17" }, { "name": "analyzer", - "rootUri": "file:///Users/huseyintokpinar/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/analyzer-4.1.0", + "rootUri": "file:///Users/huseyintokpinar/.pub-cache/hosted/pub.dev/analyzer-4.7.0", "packageUri": "lib/", - "languageVersion": "2.15" + "languageVersion": "2.17" }, { "name": "args", - "rootUri": "file:///Users/huseyintokpinar/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/args-2.3.1", + "rootUri": "file:///Users/huseyintokpinar/.pub-cache/hosted/pub.dev/args-2.4.2", "packageUri": "lib/", - "languageVersion": "2.12" + "languageVersion": "2.19" }, { "name": "async", - "rootUri": "file:///Users/huseyintokpinar/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/async-2.9.0", + "rootUri": "file:///Users/huseyintokpinar/.pub-cache/hosted/pub.dev/async-2.11.0", "packageUri": "lib/", - "languageVersion": "2.14" + "languageVersion": "2.18" }, { "name": "boolean_selector", - "rootUri": "file:///Users/huseyintokpinar/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/boolean_selector-2.1.0", + "rootUri": "file:///Users/huseyintokpinar/.pub-cache/hosted/pub.dev/boolean_selector-2.1.1", "packageUri": "lib/", - "languageVersion": "2.12" + "languageVersion": "2.17" }, { "name": "build", - "rootUri": "file:///Users/huseyintokpinar/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/build-2.3.0", + "rootUri": "file:///Users/huseyintokpinar/.pub-cache/hosted/pub.dev/build-2.4.1", "packageUri": "lib/", - "languageVersion": "2.14" + "languageVersion": "2.19" }, { "name": "build_config", - "rootUri": "file:///Users/huseyintokpinar/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/build_config-1.0.0", + "rootUri": "file:///Users/huseyintokpinar/.pub-cache/hosted/pub.dev/build_config-1.1.1", "packageUri": "lib/", - "languageVersion": "2.12" + "languageVersion": "2.14" }, { "name": "build_daemon", - "rootUri": "file:///Users/huseyintokpinar/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/build_daemon-3.1.0", + "rootUri": "file:///Users/huseyintokpinar/.pub-cache/hosted/pub.dev/build_daemon-4.0.0", "packageUri": "lib/", "languageVersion": "2.14" }, { "name": "build_resolvers", - "rootUri": "file:///Users/huseyintokpinar/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/build_resolvers-2.0.9", + "rootUri": "file:///Users/huseyintokpinar/.pub-cache/hosted/pub.dev/build_resolvers-2.0.10", "packageUri": "lib/", - "languageVersion": "2.14" + "languageVersion": "2.17" }, { "name": "build_runner", - "rootUri": "file:///Users/huseyintokpinar/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/build_runner-2.1.11", + "rootUri": "file:///Users/huseyintokpinar/.pub-cache/hosted/pub.dev/build_runner-2.4.6", "packageUri": "lib/", - "languageVersion": "2.14" + "languageVersion": "3.0" }, { "name": "build_runner_core", - "rootUri": "file:///Users/huseyintokpinar/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/build_runner_core-7.2.3", + "rootUri": "file:///Users/huseyintokpinar/.pub-cache/hosted/pub.dev/build_runner_core-7.2.10", "packageUri": "lib/", - "languageVersion": "2.14" + "languageVersion": "2.19" }, { "name": "build_verify", - "rootUri": "file:///Users/huseyintokpinar/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/build_verify-3.0.0", + "rootUri": "file:///Users/huseyintokpinar/.pub-cache/hosted/pub.dev/build_verify-3.1.0", "packageUri": "lib/", - "languageVersion": "2.12" + "languageVersion": "2.18" }, { "name": "built_collection", - "rootUri": "file:///Users/huseyintokpinar/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/built_collection-5.1.1", + "rootUri": "file:///Users/huseyintokpinar/.pub-cache/hosted/pub.dev/built_collection-5.1.1", "packageUri": "lib/", "languageVersion": "2.12" }, { "name": "built_value", - "rootUri": "file:///Users/huseyintokpinar/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/built_value-8.3.3", + "rootUri": "file:///Users/huseyintokpinar/.pub-cache/hosted/pub.dev/built_value-8.6.1", "packageUri": "lib/", "languageVersion": "2.12" }, { "name": "characters", - "rootUri": "file:///Users/huseyintokpinar/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/characters-1.2.0", + "rootUri": "file:///Users/huseyintokpinar/.pub-cache/hosted/pub.dev/characters-1.3.0", "packageUri": "lib/", "languageVersion": "2.12" }, { "name": "checked_yaml", - "rootUri": "file:///Users/huseyintokpinar/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/checked_yaml-2.0.1", + "rootUri": "file:///Users/huseyintokpinar/.pub-cache/hosted/pub.dev/checked_yaml-2.0.3", "packageUri": "lib/", - "languageVersion": "2.12" + "languageVersion": "2.19" }, { "name": "clock", - "rootUri": "file:///Users/huseyintokpinar/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/clock-1.1.1", + "rootUri": "file:///Users/huseyintokpinar/.pub-cache/hosted/pub.dev/clock-1.1.1", "packageUri": "lib/", "languageVersion": "2.12" }, { "name": "code_builder", - "rootUri": "file:///Users/huseyintokpinar/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/code_builder-4.1.0", + "rootUri": "file:///Users/huseyintokpinar/.pub-cache/hosted/pub.dev/code_builder-4.5.0", "packageUri": "lib/", - "languageVersion": "2.12" + "languageVersion": "2.19" }, { "name": "collection", - "rootUri": "file:///Users/huseyintokpinar/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/collection-1.16.0", + "rootUri": "file:///Users/huseyintokpinar/.pub-cache/hosted/pub.dev/collection-1.17.1", "packageUri": "lib/", - "languageVersion": "2.12" + "languageVersion": "2.18" }, { "name": "convert", - "rootUri": "file:///Users/huseyintokpinar/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/convert-3.0.2", + "rootUri": "file:///Users/huseyintokpinar/.pub-cache/hosted/pub.dev/convert-3.1.1", "packageUri": "lib/", - "languageVersion": "2.12" + "languageVersion": "2.18" }, { "name": "coverage", - "rootUri": "file:///Users/huseyintokpinar/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/coverage-1.3.2", + "rootUri": "file:///Users/huseyintokpinar/.pub-cache/hosted/pub.dev/coverage-1.6.3", "packageUri": "lib/", - "languageVersion": "2.15" + "languageVersion": "2.18" }, { "name": "crypto", - "rootUri": "file:///Users/huseyintokpinar/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/crypto-3.0.2", + "rootUri": "file:///Users/huseyintokpinar/.pub-cache/hosted/pub.dev/crypto-3.0.3", "packageUri": "lib/", - "languageVersion": "2.14" + "languageVersion": "2.19" }, { "name": "dart_style", - "rootUri": "file:///Users/huseyintokpinar/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/dart_style-2.2.3", + "rootUri": "file:///Users/huseyintokpinar/.pub-cache/hosted/pub.dev/dart_style-2.2.4", "packageUri": "lib/", - "languageVersion": "2.12" + "languageVersion": "2.17" }, { "name": "file", - "rootUri": "file:///Users/huseyintokpinar/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/file-6.1.2", + "rootUri": "file:///Users/huseyintokpinar/.pub-cache/hosted/pub.dev/file-7.0.0", "packageUri": "lib/", - "languageVersion": "2.12" + "languageVersion": "3.0" }, { "name": "fixnum", - "rootUri": "file:///Users/huseyintokpinar/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/fixnum-1.0.1", + "rootUri": "file:///Users/huseyintokpinar/.pub-cache/hosted/pub.dev/fixnum-1.1.0", "packageUri": "lib/", - "languageVersion": "2.12" + "languageVersion": "2.19" }, { "name": "flutter", - "rootUri": "file:///Users/huseyintokpinar/Dev/flutter/packages/flutter", + "rootUri": "file:///Users/huseyintokpinar/dev/flutter/packages/flutter", "packageUri": "lib/", - "languageVersion": "2.12" + "languageVersion": "3.0" }, { "name": "frontend_server_client", - "rootUri": "file:///Users/huseyintokpinar/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/frontend_server_client-2.1.3", + "rootUri": "file:///Users/huseyintokpinar/.pub-cache/hosted/pub.dev/frontend_server_client-3.2.0", "packageUri": "lib/", "languageVersion": "2.12" }, { "name": "glob", - "rootUri": "file:///Users/huseyintokpinar/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/glob-2.1.0", + "rootUri": "file:///Users/huseyintokpinar/.pub-cache/hosted/pub.dev/glob-2.1.2", "packageUri": "lib/", - "languageVersion": "2.15" + "languageVersion": "2.19" }, { "name": "graphs", - "rootUri": "file:///Users/huseyintokpinar/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/graphs-2.1.0", + "rootUri": "file:///Users/huseyintokpinar/.pub-cache/hosted/pub.dev/graphs-2.3.1", "packageUri": "lib/", - "languageVersion": "2.12" + "languageVersion": "2.18" }, { "name": "http_multi_server", - "rootUri": "file:///Users/huseyintokpinar/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/http_multi_server-3.2.1", + "rootUri": "file:///Users/huseyintokpinar/.pub-cache/hosted/pub.dev/http_multi_server-3.2.1", "packageUri": "lib/", "languageVersion": "2.12" }, { "name": "http_parser", - "rootUri": "file:///Users/huseyintokpinar/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/http_parser-4.0.1", + "rootUri": "file:///Users/huseyintokpinar/.pub-cache/hosted/pub.dev/http_parser-4.0.2", "packageUri": "lib/", "languageVersion": "2.12" }, { "name": "intl", - "rootUri": "file:///Users/huseyintokpinar/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/intl-0.17.0", + "rootUri": "file:///Users/huseyintokpinar/.pub-cache/hosted/pub.dev/intl-0.18.1", "packageUri": "lib/", "languageVersion": "2.12" }, { "name": "io", - "rootUri": "file:///Users/huseyintokpinar/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/io-1.0.3", + "rootUri": "file:///Users/huseyintokpinar/.pub-cache/hosted/pub.dev/io-1.0.4", "packageUri": "lib/", "languageVersion": "2.12" }, { "name": "js", - "rootUri": "file:///Users/huseyintokpinar/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/js-0.6.4", + "rootUri": "file:///Users/huseyintokpinar/.pub-cache/hosted/pub.dev/js-0.6.7", "packageUri": "lib/", - "languageVersion": "2.16" + "languageVersion": "2.19" }, { "name": "json_annotation", - "rootUri": "file:///Users/huseyintokpinar/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/json_annotation-4.5.0", + "rootUri": "file:///Users/huseyintokpinar/.pub-cache/hosted/pub.dev/json_annotation-4.8.1", "packageUri": "lib/", - "languageVersion": "2.14" + "languageVersion": "2.19" }, { "name": "logging", - "rootUri": "file:///Users/huseyintokpinar/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/logging-1.0.2", + "rootUri": "file:///Users/huseyintokpinar/.pub-cache/hosted/pub.dev/logging-1.2.0", "packageUri": "lib/", - "languageVersion": "2.12" + "languageVersion": "2.19" }, { "name": "matcher", - "rootUri": "file:///Users/huseyintokpinar/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/matcher-0.12.11", + "rootUri": "file:///Users/huseyintokpinar/.pub-cache/hosted/pub.dev/matcher-0.12.16", "packageUri": "lib/", - "languageVersion": "2.12" + "languageVersion": "2.18" }, { "name": "material_color_utilities", - "rootUri": "file:///Users/huseyintokpinar/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/material_color_utilities-0.1.4", + "rootUri": "file:///Users/huseyintokpinar/.pub-cache/hosted/pub.dev/material_color_utilities-0.2.0", "packageUri": "lib/", "languageVersion": "2.13" }, { "name": "meta", - "rootUri": "file:///Users/huseyintokpinar/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/meta-1.7.0", + "rootUri": "file:///Users/huseyintokpinar/.pub-cache/hosted/pub.dev/meta-1.9.1", "packageUri": "lib/", "languageVersion": "2.12" }, { "name": "mime", - "rootUri": "file:///Users/huseyintokpinar/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/mime-1.0.2", + "rootUri": "file:///Users/huseyintokpinar/.pub-cache/hosted/pub.dev/mime-1.0.4", "packageUri": "lib/", - "languageVersion": "2.12" + "languageVersion": "2.18" }, { "name": "node_preamble", - "rootUri": "file:///Users/huseyintokpinar/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/node_preamble-2.0.1", + "rootUri": "file:///Users/huseyintokpinar/.pub-cache/hosted/pub.dev/node_preamble-2.0.2", "packageUri": "lib/", "languageVersion": "2.12" }, { "name": "package_config", - "rootUri": "file:///Users/huseyintokpinar/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/package_config-2.1.0", + "rootUri": "file:///Users/huseyintokpinar/.pub-cache/hosted/pub.dev/package_config-2.1.0", "packageUri": "lib/", "languageVersion": "2.12" }, { "name": "path", - "rootUri": "file:///Users/huseyintokpinar/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/path-1.8.2", + "rootUri": "file:///Users/huseyintokpinar/.pub-cache/hosted/pub.dev/path-1.8.3", "packageUri": "lib/", "languageVersion": "2.12" }, { "name": "pool", - "rootUri": "file:///Users/huseyintokpinar/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/pool-1.5.1", + "rootUri": "file:///Users/huseyintokpinar/.pub-cache/hosted/pub.dev/pool-1.5.1", "packageUri": "lib/", "languageVersion": "2.12" }, { "name": "pub_semver", - "rootUri": "file:///Users/huseyintokpinar/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/pub_semver-2.1.1", + "rootUri": "file:///Users/huseyintokpinar/.pub-cache/hosted/pub.dev/pub_semver-2.1.4", "packageUri": "lib/", - "languageVersion": "2.12" + "languageVersion": "2.17" }, { "name": "pubspec_parse", - "rootUri": "file:///Users/huseyintokpinar/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/pubspec_parse-1.2.0", + "rootUri": "file:///Users/huseyintokpinar/.pub-cache/hosted/pub.dev/pubspec_parse-1.2.3", "packageUri": "lib/", - "languageVersion": "2.14" + "languageVersion": "2.18" }, { "name": "shelf", - "rootUri": "file:///Users/huseyintokpinar/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/shelf-1.3.1", + "rootUri": "file:///Users/huseyintokpinar/.pub-cache/hosted/pub.dev/shelf-1.4.1", "packageUri": "lib/", - "languageVersion": "2.16" + "languageVersion": "2.17" }, { "name": "shelf_packages_handler", - "rootUri": "file:///Users/huseyintokpinar/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/shelf_packages_handler-3.0.1", + "rootUri": "file:///Users/huseyintokpinar/.pub-cache/hosted/pub.dev/shelf_packages_handler-3.0.2", "packageUri": "lib/", - "languageVersion": "2.14" + "languageVersion": "2.17" }, { "name": "shelf_static", - "rootUri": "file:///Users/huseyintokpinar/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/shelf_static-1.1.1", + "rootUri": "file:///Users/huseyintokpinar/.pub-cache/hosted/pub.dev/shelf_static-1.1.2", "packageUri": "lib/", - "languageVersion": "2.14" + "languageVersion": "2.17" }, { "name": "shelf_web_socket", - "rootUri": "file:///Users/huseyintokpinar/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/shelf_web_socket-1.0.2", + "rootUri": "file:///Users/huseyintokpinar/.pub-cache/hosted/pub.dev/shelf_web_socket-1.0.4", "packageUri": "lib/", - "languageVersion": "2.14" + "languageVersion": "2.17" }, { "name": "sky_engine", - "rootUri": "file:///Users/huseyintokpinar/Dev/flutter/bin/cache/pkg/sky_engine", + "rootUri": "file:///Users/huseyintokpinar/dev/flutter/bin/cache/pkg/sky_engine", "packageUri": "lib/", - "languageVersion": "2.12" + "languageVersion": "3.0" }, { "name": "source_gen", - "rootUri": "file:///Users/huseyintokpinar/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/source_gen-1.2.2", + "rootUri": "file:///Users/huseyintokpinar/.pub-cache/hosted/pub.dev/source_gen-1.2.6", "packageUri": "lib/", - "languageVersion": "2.12" + "languageVersion": "2.17" }, { "name": "source_map_stack_trace", - "rootUri": "file:///Users/huseyintokpinar/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/source_map_stack_trace-2.1.0", + "rootUri": "file:///Users/huseyintokpinar/.pub-cache/hosted/pub.dev/source_map_stack_trace-2.1.1", "packageUri": "lib/", "languageVersion": "2.12" }, { "name": "source_maps", - "rootUri": "file:///Users/huseyintokpinar/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/source_maps-0.10.10", + "rootUri": "file:///Users/huseyintokpinar/.pub-cache/hosted/pub.dev/source_maps-0.10.12", "packageUri": "lib/", - "languageVersion": "2.12" + "languageVersion": "2.18" }, { "name": "source_span", - "rootUri": "file:///Users/huseyintokpinar/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/source_span-1.9.0", + "rootUri": "file:///Users/huseyintokpinar/.pub-cache/hosted/pub.dev/source_span-1.10.0", "packageUri": "lib/", - "languageVersion": "2.14" + "languageVersion": "2.18" }, { "name": "sqfentity_gen", "rootUri": "../sqfentity_gen", "packageUri": "lib/", - "languageVersion": "2.12" + "languageVersion": "2.17" }, { "name": "stack_trace", - "rootUri": "file:///Users/huseyintokpinar/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/stack_trace-1.10.0", + "rootUri": "file:///Users/huseyintokpinar/.pub-cache/hosted/pub.dev/stack_trace-1.11.1", "packageUri": "lib/", - "languageVersion": "2.12" + "languageVersion": "2.18" }, { "name": "stream_channel", - "rootUri": "file:///Users/huseyintokpinar/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/stream_channel-2.1.0", + "rootUri": "file:///Users/huseyintokpinar/.pub-cache/hosted/pub.dev/stream_channel-2.1.2", "packageUri": "lib/", - "languageVersion": "2.12" + "languageVersion": "2.19" }, { "name": "stream_transform", - "rootUri": "file:///Users/huseyintokpinar/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/stream_transform-2.0.0", + "rootUri": "file:///Users/huseyintokpinar/.pub-cache/hosted/pub.dev/stream_transform-2.1.0", "packageUri": "lib/", - "languageVersion": "2.12" + "languageVersion": "2.14" }, { "name": "string_scanner", - "rootUri": "file:///Users/huseyintokpinar/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/string_scanner-1.1.1", + "rootUri": "file:///Users/huseyintokpinar/.pub-cache/hosted/pub.dev/string_scanner-1.2.0", "packageUri": "lib/", - "languageVersion": "2.12" + "languageVersion": "2.18" }, { "name": "term_glyph", - "rootUri": "file:///Users/huseyintokpinar/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/term_glyph-1.2.1", + "rootUri": "file:///Users/huseyintokpinar/.pub-cache/hosted/pub.dev/term_glyph-1.2.1", "packageUri": "lib/", "languageVersion": "2.12" }, { "name": "test", - "rootUri": "file:///Users/huseyintokpinar/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/test-1.21.3", + "rootUri": "file:///Users/huseyintokpinar/.pub-cache/hosted/pub.dev/test-1.24.3", "packageUri": "lib/", - "languageVersion": "2.14" + "languageVersion": "2.18" }, { "name": "test_api", - "rootUri": "file:///Users/huseyintokpinar/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/test_api-0.4.11", + "rootUri": "file:///Users/huseyintokpinar/.pub-cache/hosted/pub.dev/test_api-0.6.0", "packageUri": "lib/", - "languageVersion": "2.12" + "languageVersion": "2.18" }, { "name": "test_core", - "rootUri": "file:///Users/huseyintokpinar/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/test_core-0.4.15", + "rootUri": "file:///Users/huseyintokpinar/.pub-cache/hosted/pub.dev/test_core-0.5.3", "packageUri": "lib/", - "languageVersion": "2.14" + "languageVersion": "2.18" }, { "name": "timing", - "rootUri": "file:///Users/huseyintokpinar/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/timing-1.0.0", + "rootUri": "file:///Users/huseyintokpinar/.pub-cache/hosted/pub.dev/timing-1.0.1", "packageUri": "lib/", - "languageVersion": "2.12" + "languageVersion": "2.14" }, { "name": "typed_data", - "rootUri": "file:///Users/huseyintokpinar/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/typed_data-1.3.0", + "rootUri": "file:///Users/huseyintokpinar/.pub-cache/hosted/pub.dev/typed_data-1.3.2", "packageUri": "lib/", - "languageVersion": "2.12" + "languageVersion": "2.17" }, { "name": "vector_math", - "rootUri": "file:///Users/huseyintokpinar/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/vector_math-2.1.2", + "rootUri": "file:///Users/huseyintokpinar/.pub-cache/hosted/pub.dev/vector_math-2.1.4", "packageUri": "lib/", "languageVersion": "2.14" }, { "name": "vm_service", - "rootUri": "file:///Users/huseyintokpinar/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/vm_service-8.3.0", + "rootUri": "file:///Users/huseyintokpinar/.pub-cache/hosted/pub.dev/vm_service-11.7.2", "packageUri": "lib/", - "languageVersion": "2.15" + "languageVersion": "2.19" }, { "name": "watcher", - "rootUri": "file:///Users/huseyintokpinar/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/watcher-1.0.1", + "rootUri": "file:///Users/huseyintokpinar/.pub-cache/hosted/pub.dev/watcher-1.1.0", "packageUri": "lib/", - "languageVersion": "2.14" + "languageVersion": "3.0" }, { "name": "web_socket_channel", - "rootUri": "file:///Users/huseyintokpinar/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/web_socket_channel-2.2.0", + "rootUri": "file:///Users/huseyintokpinar/.pub-cache/hosted/pub.dev/web_socket_channel-2.4.0", "packageUri": "lib/", - "languageVersion": "2.12" + "languageVersion": "2.15" }, { "name": "webkit_inspection_protocol", - "rootUri": "file:///Users/huseyintokpinar/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/webkit_inspection_protocol-1.1.0", + "rootUri": "file:///Users/huseyintokpinar/.pub-cache/hosted/pub.dev/webkit_inspection_protocol-1.2.0", "packageUri": "lib/", "languageVersion": "2.12" }, { "name": "yaml", - "rootUri": "file:///Users/huseyintokpinar/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/yaml-3.1.1", + "rootUri": "file:///Users/huseyintokpinar/.pub-cache/hosted/pub.dev/yaml-3.1.2", "packageUri": "lib/", - "languageVersion": "2.12" + "languageVersion": "2.19" }, { "name": "sqfentity", @@ -440,7 +440,7 @@ "languageVersion": "2.12" } ], - "generated": "2022-08-16T11:24:56.152739Z", + "generated": "2023-07-15T15:30:04.622786Z", "generator": "pub", - "generatorVersion": "2.17.6" + "generatorVersion": "3.0.3" } diff --git a/.gitignore b/.gitignore index de14256..5eb4cc9 100644 --- a/.gitignore +++ b/.gitignore @@ -83,3 +83,4 @@ example/lib/model/test.g.dart .dart_tool/build/generated/sqfentity/example/lib/model/chinook.sqfentity.g.part example_ns .DS_Store +sqfentity/example/ios/Flutter/flutter_export_environment.sh diff --git a/README.md b/README.md index c442859..f433992 100644 --- a/README.md +++ b/README.md @@ -298,7 +298,7 @@ That's all. Set clipboard to paste codes await Clipboard.setData(ClipboardData(text: modelConstString)); ``` -Model were created succesfuly and set to the Clipboard. +Model were created successfully and set to the Clipboard. Open model.dart file in lib/model folder and paste models after following line diff --git a/example/.flutter-plugins b/example/.flutter-plugins index 8c4bba9..6d2e8f9 100644 --- a/example/.flutter-plugins +++ b/example/.flutter-plugins @@ -1,2 +1,2 @@ # This is a generated file; do not edit or check into version control. -sqflite_sqlcipher=/Users/huseyintokpinar/dev/flutter/.pub-cache/hosted/pub.dartlang.org/sqflite_sqlcipher-2.1.1/ +sqflite_sqlcipher=/Users/huseyintokpinar/.pub-cache/hosted/pub.dev/sqflite_sqlcipher-2.1.1+1/ diff --git a/example/.flutter-plugins-dependencies b/example/.flutter-plugins-dependencies index b42f45d..e3883f7 100644 --- a/example/.flutter-plugins-dependencies +++ b/example/.flutter-plugins-dependencies @@ -1 +1 @@ -{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"sqflite_sqlcipher","path":"/Users/huseyintokpinar/dev/flutter/.pub-cache/hosted/pub.dartlang.org/sqflite_sqlcipher-2.1.1/","native_build":true,"dependencies":[]}],"android":[{"name":"sqflite_sqlcipher","path":"/Users/huseyintokpinar/dev/flutter/.pub-cache/hosted/pub.dartlang.org/sqflite_sqlcipher-2.1.1/","native_build":true,"dependencies":[]}],"macos":[{"name":"sqflite_sqlcipher","path":"/Users/huseyintokpinar/dev/flutter/.pub-cache/hosted/pub.dartlang.org/sqflite_sqlcipher-2.1.1/","native_build":true,"dependencies":[]}],"linux":[],"windows":[],"web":[]},"dependencyGraph":[{"name":"sqflite_sqlcipher","dependencies":[]}],"date_created":"2022-09-05 16:52:55.440929","version":"3.0.5"} \ No newline at end of file +{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"sqflite_sqlcipher","path":"/Users/huseyintokpinar/.pub-cache/hosted/pub.dev/sqflite_sqlcipher-2.1.1+1/","native_build":true,"dependencies":[]}],"android":[{"name":"sqflite_sqlcipher","path":"/Users/huseyintokpinar/.pub-cache/hosted/pub.dev/sqflite_sqlcipher-2.1.1+1/","native_build":true,"dependencies":[]}],"macos":[{"name":"sqflite_sqlcipher","path":"/Users/huseyintokpinar/.pub-cache/hosted/pub.dev/sqflite_sqlcipher-2.1.1+1/","native_build":true,"dependencies":[]}],"linux":[],"windows":[],"web":[]},"dependencyGraph":[{"name":"sqflite_sqlcipher","dependencies":[]}],"date_created":"2023-07-15 19:15:49.072106","version":"3.10.4"} \ No newline at end of file diff --git a/example/.metadata b/example/.metadata index cfa9183..8ba2206 100644 --- a/example/.metadata +++ b/example/.metadata @@ -1,10 +1,30 @@ # 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. +# This file should be version controlled. version: - revision: 456d80b9ddd74b4b5ca3b77bbfb70ab0e05d3fa8 - channel: dev + revision: 682aa387cfe4fbd71ccd5418b2c2a075729a1c66 + channel: stable project_type: app + +# Tracks metadata for the flutter migrate command +migration: + platforms: + - platform: root + create_revision: 682aa387cfe4fbd71ccd5418b2c2a075729a1c66 + base_revision: 682aa387cfe4fbd71ccd5418b2c2a075729a1c66 + - platform: android + create_revision: 682aa387cfe4fbd71ccd5418b2c2a075729a1c66 + base_revision: 682aa387cfe4fbd71ccd5418b2c2a075729a1c66 + + # User provided section + + # List of Local paths (relative to this file) that should be + # ignored by the migrate tool. + # + # Files that are not part of the templates will be ignored by default. + unmanaged_files: + - 'lib/main.dart' + - 'ios/Runner.xcodeproj/project.pbxproj' diff --git a/example/analysis_options.yaml b/example/analysis_options.yaml index a60683e..4cb468d 100644 --- a/example/analysis_options.yaml +++ b/example/analysis_options.yaml @@ -1,6 +1,5 @@ analyzer: strong-mode: - implicit-casts: false #implicit-dynamic: false errors: diff --git a/example/android/.gitignore b/example/android/.gitignore index 0a741cb..6f56801 100644 --- a/example/android/.gitignore +++ b/example/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/android/app/build.gradle b/example/android/app/build.gradle index 6ca2344..4c908eb 100644 --- a/example/android/app/build.gradle +++ b/example/android/app/build.gradle @@ -26,7 +26,18 @@ apply plugin: 'kotlin-android' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { - compileSdkVersion 30 + namespace "com.example.example" + compileSdkVersion flutter.compileSdkVersion + ndkVersion flutter.ndkVersion + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + + kotlinOptions { + jvmTarget = '1.8' + } sourceSets { main.java.srcDirs += 'src/main/kotlin' @@ -35,8 +46,10 @@ android { defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "com.example.example" - minSdkVersion 16 - targetSdkVersion 30 + // You can update the following values to match your application needs. + // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. + minSdkVersion flutter.minSdkVersion + targetSdkVersion flutter.targetSdkVersion versionCode flutterVersionCode.toInteger() versionName flutterVersionName } diff --git a/example/android/app/proguard-rules.pro b/example/android/app/proguard-rules.pro deleted file mode 100644 index d0e0fbc..0000000 --- a/example/android/app/proguard-rules.pro +++ /dev/null @@ -1 +0,0 @@ --keep class net.sqlcipher.** { *; } \ No newline at end of file diff --git a/example/android/app/src/debug/AndroidManifest.xml b/example/android/app/src/debug/AndroidManifest.xml index c208884..399f698 100644 --- a/example/android/app/src/debug/AndroidManifest.xml +++ b/example/android/app/src/debug/AndroidManifest.xml @@ -1,6 +1,6 @@ - - diff --git a/example/android/app/src/main/AndroidManifest.xml b/example/android/app/src/main/AndroidManifest.xml index 34dd77e..19b862e 100644 --- a/example/android/app/src/main/AndroidManifest.xml +++ b/example/android/app/src/main/AndroidManifest.xml @@ -1,10 +1,11 @@ - - + - - diff --git a/example/android/app/src/main/res/values-night/styles.xml b/example/android/app/src/main/res/values-night/styles.xml index 449a9f9..06952be 100644 --- a/example/android/app/src/main/res/values-night/styles.xml +++ b/example/android/app/src/main/res/values-night/styles.xml @@ -3,14 +3,14 @@ + + + diff --git a/sqfentity/example/android/app/src/main/res/values/styles.xml b/sqfentity/example/android/app/src/main/res/values/styles.xml new file mode 100644 index 0000000..cb1ef88 --- /dev/null +++ b/sqfentity/example/android/app/src/main/res/values/styles.xml @@ -0,0 +1,18 @@ + + + + + + + diff --git a/sqfentity/example/android/app/src/profile/AndroidManifest.xml b/sqfentity/example/android/app/src/profile/AndroidManifest.xml new file mode 100644 index 0000000..399f698 --- /dev/null +++ b/sqfentity/example/android/app/src/profile/AndroidManifest.xml @@ -0,0 +1,7 @@ + + + + diff --git a/sqfentity/example/android/build.gradle b/sqfentity/example/android/build.gradle new file mode 100644 index 0000000..f7eb7f6 --- /dev/null +++ b/sqfentity/example/android/build.gradle @@ -0,0 +1,31 @@ +buildscript { + ext.kotlin_version = '1.7.10' + repositories { + google() + mavenCentral() + } + + dependencies { + classpath 'com.android.tools.build:gradle:7.3.0' + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + } +} + +allprojects { + repositories { + google() + mavenCentral() + } +} + +rootProject.buildDir = '../build' +subprojects { + project.buildDir = "${rootProject.buildDir}/${project.name}" +} +subprojects { + project.evaluationDependsOn(':app') +} + +tasks.register("clean", Delete) { + delete rootProject.buildDir +} diff --git a/sqfentity/example/android/gradle.properties b/sqfentity/example/android/gradle.properties new file mode 100644 index 0000000..94adc3a --- /dev/null +++ b/sqfentity/example/android/gradle.properties @@ -0,0 +1,3 @@ +org.gradle.jvmargs=-Xmx1536M +android.useAndroidX=true +android.enableJetifier=true diff --git a/sqfentity/example/android/gradle/wrapper/gradle-wrapper.properties b/sqfentity/example/android/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..3c472b9 --- /dev/null +++ b/sqfentity/example/android/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,5 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip diff --git a/sqfentity/example/android/settings.gradle b/sqfentity/example/android/settings.gradle new file mode 100644 index 0000000..44e62bc --- /dev/null +++ b/sqfentity/example/android/settings.gradle @@ -0,0 +1,11 @@ +include ':app' + +def localPropertiesFile = new File(rootProject.projectDir, "local.properties") +def properties = new Properties() + +assert localPropertiesFile.exists() +localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } + +def flutterSdkPath = properties.getProperty("flutter.sdk") +assert flutterSdkPath != null, "flutter.sdk not set in local.properties" +apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" diff --git a/sqfentity/example/ios/.gitignore b/sqfentity/example/ios/.gitignore new file mode 100644 index 0000000..7a7f987 --- /dev/null +++ b/sqfentity/example/ios/.gitignore @@ -0,0 +1,34 @@ +**/dgph +*.mode1v3 +*.mode2v3 +*.moved-aside +*.pbxuser +*.perspectivev3 +**/*sync/ +.sconsign.dblite +.tags* +**/.vagrant/ +**/DerivedData/ +Icon? +**/Pods/ +**/.symlinks/ +profile +xcuserdata +**/.generated/ +Flutter/App.framework +Flutter/Flutter.framework +Flutter/Flutter.podspec +Flutter/Generated.xcconfig +Flutter/ephemeral/ +Flutter/app.flx +Flutter/app.zip +Flutter/flutter_assets/ +Flutter/flutter_export_environment.sh +ServiceDefinitions.json +Runner/GeneratedPluginRegistrant.* + +# Exceptions to above rules. +!default.mode1v3 +!default.mode2v3 +!default.pbxuser +!default.perspectivev3 diff --git a/sqfentity/example/ios/Flutter/AppFrameworkInfo.plist b/sqfentity/example/ios/Flutter/AppFrameworkInfo.plist new file mode 100644 index 0000000..9625e10 --- /dev/null +++ b/sqfentity/example/ios/Flutter/AppFrameworkInfo.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + App + CFBundleIdentifier + io.flutter.flutter.app + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + App + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + MinimumOSVersion + 11.0 + + diff --git a/sqfentity/example/ios/Flutter/Debug.xcconfig b/sqfentity/example/ios/Flutter/Debug.xcconfig new file mode 100644 index 0000000..ec97fc6 --- /dev/null +++ b/sqfentity/example/ios/Flutter/Debug.xcconfig @@ -0,0 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" +#include "Generated.xcconfig" diff --git a/sqfentity/example/ios/Flutter/Release.xcconfig b/sqfentity/example/ios/Flutter/Release.xcconfig new file mode 100644 index 0000000..c4855bf --- /dev/null +++ b/sqfentity/example/ios/Flutter/Release.xcconfig @@ -0,0 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" +#include "Generated.xcconfig" diff --git a/sqfentity/example/ios/Flutter/flutter_export_environment.sh b/sqfentity/example/ios/Flutter/flutter_export_environment.sh index cd75577..d50c3ab 100755 --- a/sqfentity/example/ios/Flutter/flutter_export_environment.sh +++ b/sqfentity/example/ios/Flutter/flutter_export_environment.sh @@ -3,11 +3,12 @@ export "FLUTTER_ROOT=/Users/huseyintokpinar/Dev/flutter" export "FLUTTER_APPLICATION_PATH=/Volumes/DEPO/Projeler/sqfEntity/sqfentity/example" export "COCOAPODS_PARALLEL_CODE_SIGN=true" -export "FLUTTER_TARGET=lib/main.dart" +export "FLUTTER_TARGET=/Volumes/DEPO/Projeler/sqfEntity/sqfentity/example/main.dart" export "FLUTTER_BUILD_DIR=build" export "FLUTTER_BUILD_NAME=1.0.0" export "FLUTTER_BUILD_NUMBER=1" +export "DART_DEFINES=RkxVVFRFUl9XRUJfQVVUT19ERVRFQ1Q9dHJ1ZQ==,RkxVVFRFUl9XRUJfQ0FOVkFTS0lUX1VSTD1odHRwczovL3d3dy5nc3RhdGljLmNvbS9mbHV0dGVyLWNhbnZhc2tpdC8yYTM0MDFjOWJiYjVhOWE5YWVjNzRkNGY3MzVkMThhOWRkM2ViZjJkLw==" export "DART_OBFUSCATION=false" -export "TRACK_WIDGET_CREATION=false" +export "TRACK_WIDGET_CREATION=true" export "TREE_SHAKE_ICONS=false" -export "PACKAGE_CONFIG=.dart_tool/package_config.json" +export "PACKAGE_CONFIG=/Volumes/DEPO/Projeler/sqfEntity/sqfentity/example/.dart_tool/package_config.json" diff --git a/sqfentity/example/ios/Podfile b/sqfentity/example/ios/Podfile new file mode 100644 index 0000000..fdcc671 --- /dev/null +++ b/sqfentity/example/ios/Podfile @@ -0,0 +1,44 @@ +# Uncomment this line to define a global platform for your project +# platform :ios, '11.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__)) + target 'RunnerTests' do + inherit! :search_paths + end +end + +post_install do |installer| + installer.pods_project.targets.each do |target| + flutter_additional_ios_build_settings(target) + end +end diff --git a/sqfentity/example/ios/Podfile.lock b/sqfentity/example/ios/Podfile.lock new file mode 100644 index 0000000..51317a7 --- /dev/null +++ b/sqfentity/example/ios/Podfile.lock @@ -0,0 +1,45 @@ +PODS: + - Flutter (1.0.0) + - FMDB/SQLCipher (2.7.5): + - SQLCipher + - path_provider_foundation (0.0.1): + - Flutter + - FlutterMacOS + - sqflite_sqlcipher (0.0.1): + - Flutter + - FMDB/SQLCipher (~> 2.7.5) + - SQLCipher (= 4.4.2) + - SQLCipher (4.4.2): + - SQLCipher/standard (= 4.4.2) + - SQLCipher/common (4.4.2) + - SQLCipher/standard (4.4.2): + - SQLCipher/common + +DEPENDENCIES: + - Flutter (from `Flutter`) + - path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`) + - sqflite_sqlcipher (from `.symlinks/plugins/sqflite_sqlcipher/ios`) + +SPEC REPOS: + trunk: + - FMDB + - SQLCipher + +EXTERNAL SOURCES: + Flutter: + :path: Flutter + path_provider_foundation: + :path: ".symlinks/plugins/path_provider_foundation/darwin" + sqflite_sqlcipher: + :path: ".symlinks/plugins/sqflite_sqlcipher/ios" + +SPEC CHECKSUMS: + Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854 + FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a + path_provider_foundation: 29f094ae23ebbca9d3d0cec13889cd9060c0e943 + sqflite_sqlcipher: 70eb7fd8d4f0b0352d0bde5cf345b810737f54bb + SQLCipher: 1ab0b9486a77d141e72e92ff30681926ed79c07a + +PODFILE CHECKSUM: 70d9d25280d0dd177a5f637cdb0f0b0b12c6a189 + +COCOAPODS: 1.12.1 diff --git a/sqfentity/example/ios/Runner.xcodeproj/project.pbxproj b/sqfentity/example/ios/Runner.xcodeproj/project.pbxproj new file mode 100644 index 0000000..8f36597 --- /dev/null +++ b/sqfentity/example/ios/Runner.xcodeproj/project.pbxproj @@ -0,0 +1,724 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 54; + objects = { + +/* Begin PBXBuildFile section */ + 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; + 1C402CE131C2409B77C0CDA1 /* Pods_RunnerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 208A241A804368FC9C3FE871 /* Pods_RunnerTests.framework */; }; + 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C807B294A618700263BE5 /* RunnerTests.swift */; }; + 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; + 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; + 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; + 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; + 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; + F6F2DF847EAB7AEE6E203B8A /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 62655715ACC8A523862A96A5 /* Pods_Runner.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 331C8085294A63A400263BE5 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 97C146E61CF9000F007C117D /* Project object */; + proxyType = 1; + remoteGlobalIDString = 97C146ED1CF9000F007C117D; + remoteInfo = Runner; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 9705A1C41CF9048500538489 /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; + 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; + 18A35B1AA11DA39268323438 /* Pods-RunnerTests.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.profile.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.profile.xcconfig"; sourceTree = ""; }; + 208A241A804368FC9C3FE871 /* Pods_RunnerTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RunnerTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 331C807B294A618700263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = ""; }; + 331C8081294A63A400263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 3B0BABAD1C5344DA91F3329C /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; + 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; + 43788D6D611781E49688B832 /* Pods-RunnerTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.debug.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.debug.xcconfig"; sourceTree = ""; }; + 62655715ACC8A523862A96A5 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; + 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; + 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; + 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; + 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 9B8B7E2707102EA8C9D77D4F /* Pods-RunnerTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.release.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.release.xcconfig"; sourceTree = ""; }; + A17AEFE8625B9C8F4596C390 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; + DDB437236452165C41256970 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 97C146EB1CF9000F007C117D /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + F6F2DF847EAB7AEE6E203B8A /* Pods_Runner.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + AFCF98861EF7EAF7FD847DE9 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 1C402CE131C2409B77C0CDA1 /* Pods_RunnerTests.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 331C8082294A63A400263BE5 /* RunnerTests */ = { + isa = PBXGroup; + children = ( + 331C807B294A618700263BE5 /* RunnerTests.swift */, + ); + path = RunnerTests; + sourceTree = ""; + }; + 3C31E9D2DBB545A81D636A35 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 62655715ACC8A523862A96A5 /* Pods_Runner.framework */, + 208A241A804368FC9C3FE871 /* Pods_RunnerTests.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 76433C3CB8D0821CE40AF6A1 /* Pods */ = { + isa = PBXGroup; + children = ( + 3B0BABAD1C5344DA91F3329C /* Pods-Runner.debug.xcconfig */, + DDB437236452165C41256970 /* Pods-Runner.release.xcconfig */, + A17AEFE8625B9C8F4596C390 /* Pods-Runner.profile.xcconfig */, + 43788D6D611781E49688B832 /* Pods-RunnerTests.debug.xcconfig */, + 9B8B7E2707102EA8C9D77D4F /* Pods-RunnerTests.release.xcconfig */, + 18A35B1AA11DA39268323438 /* Pods-RunnerTests.profile.xcconfig */, + ); + name = Pods; + path = Pods; + sourceTree = ""; + }; + 9740EEB11CF90186004384FC /* Flutter */ = { + isa = PBXGroup; + children = ( + 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, + 9740EEB21CF90195004384FC /* Debug.xcconfig */, + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, + 9740EEB31CF90195004384FC /* Generated.xcconfig */, + ); + name = Flutter; + sourceTree = ""; + }; + 97C146E51CF9000F007C117D = { + isa = PBXGroup; + children = ( + 9740EEB11CF90186004384FC /* Flutter */, + 97C146F01CF9000F007C117D /* Runner */, + 97C146EF1CF9000F007C117D /* Products */, + 331C8082294A63A400263BE5 /* RunnerTests */, + 76433C3CB8D0821CE40AF6A1 /* Pods */, + 3C31E9D2DBB545A81D636A35 /* Frameworks */, + ); + sourceTree = ""; + }; + 97C146EF1CF9000F007C117D /* Products */ = { + isa = PBXGroup; + children = ( + 97C146EE1CF9000F007C117D /* Runner.app */, + 331C8081294A63A400263BE5 /* RunnerTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 97C146F01CF9000F007C117D /* Runner */ = { + isa = PBXGroup; + children = ( + 97C146FA1CF9000F007C117D /* Main.storyboard */, + 97C146FD1CF9000F007C117D /* Assets.xcassets */, + 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, + 97C147021CF9000F007C117D /* Info.plist */, + 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, + 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, + 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, + 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, + ); + path = Runner; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 331C8080294A63A400263BE5 /* RunnerTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */; + buildPhases = ( + F50221DEBF97E2535C27EC88 /* [CP] Check Pods Manifest.lock */, + 331C807D294A63A400263BE5 /* Sources */, + 331C807F294A63A400263BE5 /* Resources */, + AFCF98861EF7EAF7FD847DE9 /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + 331C8086294A63A400263BE5 /* PBXTargetDependency */, + ); + name = RunnerTests; + productName = RunnerTests; + productReference = 331C8081294A63A400263BE5 /* RunnerTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; + 97C146ED1CF9000F007C117D /* Runner */ = { + isa = PBXNativeTarget; + buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; + buildPhases = ( + C2A1C07DA864ACB43033C641 /* [CP] Check Pods Manifest.lock */, + 9740EEB61CF901F6004384FC /* Run Script */, + 97C146EA1CF9000F007C117D /* Sources */, + 97C146EB1CF9000F007C117D /* Frameworks */, + 97C146EC1CF9000F007C117D /* Resources */, + 9705A1C41CF9048500538489 /* Embed Frameworks */, + 3B06AD1E1E4923F5004D2608 /* Thin Binary */, + 685737EC7EC134A50DA85C18 /* [CP] Embed Pods Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Runner; + productName = Runner; + productReference = 97C146EE1CF9000F007C117D /* Runner.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 97C146E61CF9000F007C117D /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 1300; + ORGANIZATIONNAME = ""; + TargetAttributes = { + 331C8080294A63A400263BE5 = { + CreatedOnToolsVersion = 14.0; + TestTargetID = 97C146ED1CF9000F007C117D; + }; + 97C146ED1CF9000F007C117D = { + CreatedOnToolsVersion = 7.3.1; + LastSwiftMigration = 1100; + }; + }; + }; + buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 97C146E51CF9000F007C117D; + productRefGroup = 97C146EF1CF9000F007C117D /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 97C146ED1CF9000F007C117D /* Runner */, + 331C8080294A63A400263BE5 /* RunnerTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 331C807F294A63A400263BE5 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 97C146EC1CF9000F007C117D /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, + 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, + 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, + 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}", + ); + name = "Thin Binary"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; + }; + 685737EC7EC134A50DA85C18 /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", + ); + name = "[CP] Embed Pods Frameworks"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; + 9740EEB61CF901F6004384FC /* Run Script */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Run Script"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; + }; + C2A1C07DA864ACB43033C641 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; + F50221DEBF97E2535C27EC88 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-RunnerTests-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 331C807D294A63A400263BE5 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 97C146EA1CF9000F007C117D /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, + 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 331C8086294A63A400263BE5 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 97C146ED1CF9000F007C117D /* Runner */; + targetProxy = 331C8085294A63A400263BE5 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 97C146FA1CF9000F007C117D /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 97C146FB1CF9000F007C117D /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 97C147001CF9000F007C117D /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 249021D3217E4FDB00AE95B9 /* Profile */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Profile; + }; + 249021D4217E4FDB00AE95B9 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = LSFNV667SB; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.example.example; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Profile; + }; + 331C8088294A63A400263BE5 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 43788D6D611781E49688B832 /* Pods-RunnerTests.debug.xcconfig */; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.example.example.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; + }; + name = Debug; + }; + 331C8089294A63A400263BE5 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 9B8B7E2707102EA8C9D77D4F /* Pods-RunnerTests.release.xcconfig */; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.example.example.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; + }; + name = Release; + }; + 331C808A294A63A400263BE5 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 18A35B1AA11DA39268323438 /* Pods-RunnerTests.profile.xcconfig */; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.example.example.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; + }; + name = Profile; + }; + 97C147031CF9000F007C117D /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 97C147041CF9000F007C117D /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 97C147061CF9000F007C117D /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = LSFNV667SB; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.example.example; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Debug; + }; + 97C147071CF9000F007C117D /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = LSFNV667SB; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.example.example; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 331C8088294A63A400263BE5 /* Debug */, + 331C8089294A63A400263BE5 /* Release */, + 331C808A294A63A400263BE5 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 97C147031CF9000F007C117D /* Debug */, + 97C147041CF9000F007C117D /* Release */, + 249021D3217E4FDB00AE95B9 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 97C147061CF9000F007C117D /* Debug */, + 97C147071CF9000F007C117D /* Release */, + 249021D4217E4FDB00AE95B9 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 97C146E61CF9000F007C117D /* Project object */; +} diff --git a/sqfentity/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/sqfentity/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..919434a --- /dev/null +++ b/sqfentity/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/sqfentity/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/sqfentity/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/sqfentity/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/sqfentity/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/sqfentity/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..f9b0d7c --- /dev/null +++ b/sqfentity/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + PreviewsEnabled + + + diff --git a/sqfentity/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/sqfentity/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme new file mode 100644 index 0000000..e42adcb --- /dev/null +++ b/sqfentity/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -0,0 +1,98 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sqfentity/example/ios/Runner.xcworkspace/contents.xcworkspacedata b/sqfentity/example/ios/Runner.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..21a3cc1 --- /dev/null +++ b/sqfentity/example/ios/Runner.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,10 @@ + + + + + + + diff --git a/sqfentity/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/sqfentity/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/sqfentity/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/sqfentity/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/sqfentity/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..f9b0d7c --- /dev/null +++ b/sqfentity/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + PreviewsEnabled + + + diff --git a/sqfentity/example/ios/Runner/AppDelegate.swift b/sqfentity/example/ios/Runner/AppDelegate.swift new file mode 100644 index 0000000..70693e4 --- /dev/null +++ b/sqfentity/example/ios/Runner/AppDelegate.swift @@ -0,0 +1,13 @@ +import UIKit +import Flutter + +@UIApplicationMain +@objc class AppDelegate: FlutterAppDelegate { + override func application( + _ application: UIApplication, + didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? + ) -> Bool { + GeneratedPluginRegistrant.register(with: self) + return super.application(application, didFinishLaunchingWithOptions: launchOptions) + } +} diff --git a/sqfentity/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/sqfentity/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..d36b1fa --- /dev/null +++ b/sqfentity/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,122 @@ +{ + "images" : [ + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "Icon-App-20x20@2x.png", + "scale" : "2x" + }, + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "Icon-App-20x20@3x.png", + "scale" : "3x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@1x.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@3x.png", + "scale" : "3x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-App-40x40@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-App-40x40@3x.png", + "scale" : "3x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-App-60x60@2x.png", + "scale" : "2x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-App-60x60@3x.png", + "scale" : "3x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "Icon-App-20x20@1x.png", + "scale" : "1x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "Icon-App-20x20@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-App-29x29@1x.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-App-29x29@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "Icon-App-40x40@1x.png", + "scale" : "1x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "Icon-App-40x40@2x.png", + "scale" : "2x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-App-76x76@1x.png", + "scale" : "1x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-App-76x76@2x.png", + "scale" : "2x" + }, + { + "size" : "83.5x83.5", + "idiom" : "ipad", + "filename" : "Icon-App-83.5x83.5@2x.png", + "scale" : "2x" + }, + { + "size" : "1024x1024", + "idiom" : "ios-marketing", + "filename" : "Icon-App-1024x1024@1x.png", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/sqfentity/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/sqfentity/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png new file mode 100644 index 0000000..dc9ada4 Binary files /dev/null and b/sqfentity/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png differ diff --git a/sqfentity/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/sqfentity/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png new file mode 100644 index 0000000..7353c41 Binary files /dev/null and b/sqfentity/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png differ diff --git a/sqfentity/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/sqfentity/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png new file mode 100644 index 0000000..797d452 Binary files /dev/null and b/sqfentity/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png differ diff --git a/sqfentity/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/sqfentity/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png new file mode 100644 index 0000000..6ed2d93 Binary files /dev/null and b/sqfentity/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png differ diff --git a/sqfentity/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/sqfentity/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png new file mode 100644 index 0000000..4cd7b00 Binary files /dev/null and b/sqfentity/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png differ diff --git a/sqfentity/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/sqfentity/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png new file mode 100644 index 0000000..fe73094 Binary files /dev/null and b/sqfentity/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png differ diff --git a/sqfentity/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/sqfentity/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png new file mode 100644 index 0000000..321773c Binary files /dev/null and b/sqfentity/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png differ diff --git a/sqfentity/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/sqfentity/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png new file mode 100644 index 0000000..797d452 Binary files /dev/null and b/sqfentity/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png differ diff --git a/sqfentity/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/sqfentity/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png new file mode 100644 index 0000000..502f463 Binary files /dev/null and b/sqfentity/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png differ diff --git a/sqfentity/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/sqfentity/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png new file mode 100644 index 0000000..0ec3034 Binary files /dev/null and b/sqfentity/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png differ diff --git a/sqfentity/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/sqfentity/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png new file mode 100644 index 0000000..0ec3034 Binary files /dev/null and b/sqfentity/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png differ diff --git a/sqfentity/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/sqfentity/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png new file mode 100644 index 0000000..e9f5fea Binary files /dev/null and b/sqfentity/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png differ diff --git a/sqfentity/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/sqfentity/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png new file mode 100644 index 0000000..84ac32a Binary files /dev/null and b/sqfentity/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png differ diff --git a/sqfentity/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/sqfentity/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png new file mode 100644 index 0000000..8953cba Binary files /dev/null and b/sqfentity/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png differ diff --git a/sqfentity/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/sqfentity/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png new file mode 100644 index 0000000..0467bf1 Binary files /dev/null and b/sqfentity/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png differ diff --git a/sqfentity/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json b/sqfentity/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json new file mode 100644 index 0000000..0bedcf2 --- /dev/null +++ b/sqfentity/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "LaunchImage.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "LaunchImage@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "LaunchImage@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/sqfentity/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png b/sqfentity/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png new file mode 100644 index 0000000..9da19ea Binary files /dev/null and b/sqfentity/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png differ diff --git a/sqfentity/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/sqfentity/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png new file mode 100644 index 0000000..9da19ea Binary files /dev/null and b/sqfentity/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png differ diff --git a/sqfentity/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/sqfentity/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png new file mode 100644 index 0000000..9da19ea Binary files /dev/null and b/sqfentity/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png differ diff --git a/sqfentity/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md b/sqfentity/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md new file mode 100644 index 0000000..89c2725 --- /dev/null +++ b/sqfentity/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md @@ -0,0 +1,5 @@ +# Launch Screen Assets + +You can customize the launch screen with your own desired assets by replacing the image files in this directory. + +You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. \ No newline at end of file diff --git a/sqfentity/example/ios/Runner/Base.lproj/LaunchScreen.storyboard b/sqfentity/example/ios/Runner/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 0000000..f2e259c --- /dev/null +++ b/sqfentity/example/ios/Runner/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sqfentity/example/ios/Runner/Base.lproj/Main.storyboard b/sqfentity/example/ios/Runner/Base.lproj/Main.storyboard new file mode 100644 index 0000000..f3c2851 --- /dev/null +++ b/sqfentity/example/ios/Runner/Base.lproj/Main.storyboard @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sqfentity/example/ios/Runner/Info.plist b/sqfentity/example/ios/Runner/Info.plist new file mode 100644 index 0000000..7f55346 --- /dev/null +++ b/sqfentity/example/ios/Runner/Info.plist @@ -0,0 +1,51 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleDisplayName + Example + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + example + CFBundlePackageType + APPL + CFBundleShortVersionString + $(FLUTTER_BUILD_NAME) + CFBundleSignature + ???? + CFBundleVersion + $(FLUTTER_BUILD_NUMBER) + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UIViewControllerBasedStatusBarAppearance + + CADisableMinimumFrameDurationOnPhone + + UIApplicationSupportsIndirectInputEvents + + + diff --git a/sqfentity/example/ios/Runner/Runner-Bridging-Header.h b/sqfentity/example/ios/Runner/Runner-Bridging-Header.h new file mode 100644 index 0000000..308a2a5 --- /dev/null +++ b/sqfentity/example/ios/Runner/Runner-Bridging-Header.h @@ -0,0 +1 @@ +#import "GeneratedPluginRegistrant.h" diff --git a/sqfentity/example/ios/RunnerTests/RunnerTests.swift b/sqfentity/example/ios/RunnerTests/RunnerTests.swift new file mode 100644 index 0000000..86a7c3b --- /dev/null +++ b/sqfentity/example/ios/RunnerTests/RunnerTests.swift @@ -0,0 +1,12 @@ +import Flutter +import UIKit +import XCTest + +class RunnerTests: XCTestCase { + + func testExample() { + // If you add code to the Runner application, consider adding tests here. + // See https://developer.apple.com/documentation/xctest for more information about using XCTest. + } + +} diff --git a/sqfentity/example/lib/main.dart b/sqfentity/example/lib/main.dart new file mode 100644 index 0000000..2425002 --- /dev/null +++ b/sqfentity/example/lib/main.dart @@ -0,0 +1,125 @@ +import 'package:flutter/material.dart'; + +void main() { + runApp(const MyApp()); +} + +class MyApp extends StatelessWidget { + const MyApp({Key? key}) : super(key: key); + + // This widget is the root of your application. + @override + Widget build(BuildContext context) { + return MaterialApp( + title: 'Flutter Demo', + theme: ThemeData( + // This is the theme of your application. + // + // TRY THIS: Try running your application with "flutter run". You'll see + // the application has a blue toolbar. Then, without quitting the app, + // try changing the seedColor in the colorScheme below to Colors.green + // and then invoke "hot reload" (save your changes or press the "hot + // reload" button in a Flutter-supported IDE, or press "r" if you used + // the command line to start the app). + // + // Notice that the counter didn't reset back to zero; the application + // state is not lost during the reload. To reset the state, use hot + // restart instead. + // + // This works for code too, not just values: Most code changes can be + // tested with just a hot reload. + colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple), + useMaterial3: true, + ), + home: const MyHomePage(title: 'Flutter Demo Home Page'), + ); + } +} + +class MyHomePage extends StatefulWidget { + const MyHomePage({Key? key, required this.title}) : super(key: key); + + // This widget is the home page of your application. It is stateful, meaning + // that it has a State object (defined below) that contains fields that affect + // how it looks. + + // This class is the configuration for the state. It holds the values (in this + // case the title) provided by the parent (in this case the App widget) and + // used by the build method of the State. Fields in a Widget subclass are + // always marked "final". + + final String title; + + @override + State createState() => _MyHomePageState(); +} + +class _MyHomePageState extends State { + int _counter = 0; + + void _incrementCounter() { + setState(() { + // This call to setState tells the Flutter framework that something has + // changed in this State, which causes it to rerun the build method below + // so that the display can reflect the updated values. If we changed + // _counter without calling setState(), then the build method would not be + // called again, and so nothing would appear to happen. + _counter++; + }); + } + + @override + Widget build(BuildContext context) { + // This method is rerun every time setState is called, for instance as done + // by the _incrementCounter method above. + // + // The Flutter framework has been optimized to make rerunning build methods + // fast, so that you can just rebuild anything that needs updating rather + // than having to individually change instances of widgets. + return Scaffold( + appBar: AppBar( + // TRY THIS: Try changing the color here to a specific color (to + // Colors.amber, perhaps?) and trigger a hot reload to see the AppBar + // change color while the other colors stay the same. + backgroundColor: Theme.of(context).colorScheme.inversePrimary, + // Here we take the value from the MyHomePage object that was created by + // the App.build method, and use it to set our appbar title. + title: Text(widget.title), + ), + body: Center( + // Center is a layout widget. It takes a single child and positions it + // in the middle of the parent. + child: Column( + // Column is also a layout widget. It takes a list of children and + // arranges them vertically. By default, it sizes itself to fit its + // children horizontally, and tries to be as tall as its parent. + // + // Column has various properties to control how it sizes itself and + // how it positions its children. Here we use mainAxisAlignment to + // center the children vertically; the main axis here is the vertical + // axis because Columns are vertical (the cross axis would be + // horizontal). + // + // TRY THIS: Invoke "debug painting" (choose the "Toggle Debug Paint" + // action in the IDE, or press "p" in the console), to see the + // wireframe for each widget. + mainAxisAlignment: MainAxisAlignment.center, + children: [ + const Text( + 'You have pushed the button this many times:', + ), + Text( + '$_counter', + style: Theme.of(context).textTheme.headlineMedium, + ), + ], + ), + ), + floatingActionButton: FloatingActionButton( + onPressed: _incrementCounter, + tooltip: 'Increment', + child: const Icon(Icons.add), + ), // This trailing comma makes auto-formatting nicer for build methods. + ); + } +} diff --git a/sqfentity/example/linux/.gitignore b/sqfentity/example/linux/.gitignore new file mode 100644 index 0000000..d3896c9 --- /dev/null +++ b/sqfentity/example/linux/.gitignore @@ -0,0 +1 @@ +flutter/ephemeral diff --git a/sqfentity/example/linux/CMakeLists.txt b/sqfentity/example/linux/CMakeLists.txt new file mode 100644 index 0000000..d67bd4e --- /dev/null +++ b/sqfentity/example/linux/CMakeLists.txt @@ -0,0 +1,139 @@ +# Project-level configuration. +cmake_minimum_required(VERSION 3.10) +project(runner LANGUAGES CXX) + +# The name of the executable created for the application. Change this to change +# the on-disk name of your application. +set(BINARY_NAME "example") +# The unique GTK application identifier for this application. See: +# https://wiki.gnome.org/HowDoI/ChooseApplicationID +set(APPLICATION_ID "com.example.example") + +# Explicitly opt in to modern CMake behaviors to avoid warnings with recent +# versions of CMake. +cmake_policy(SET CMP0063 NEW) + +# Load bundled libraries from the lib/ directory relative to the binary. +set(CMAKE_INSTALL_RPATH "$ORIGIN/lib") + +# Root filesystem for cross-building. +if(FLUTTER_TARGET_PLATFORM_SYSROOT) + set(CMAKE_SYSROOT ${FLUTTER_TARGET_PLATFORM_SYSROOT}) + set(CMAKE_FIND_ROOT_PATH ${CMAKE_SYSROOT}) + set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) + set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) + set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) + set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) +endif() + +# Define build configuration options. +if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) + set(CMAKE_BUILD_TYPE "Debug" CACHE + STRING "Flutter build mode" FORCE) + set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS + "Debug" "Profile" "Release") +endif() + +# Compilation settings that should be applied to most targets. +# +# Be cautious about adding new options here, as plugins use this function by +# default. In most cases, you should add new options to specific targets instead +# of modifying this function. +function(APPLY_STANDARD_SETTINGS TARGET) + target_compile_features(${TARGET} PUBLIC cxx_std_14) + target_compile_options(${TARGET} PRIVATE -Wall -Werror) + target_compile_options(${TARGET} PRIVATE "$<$>:-O3>") + target_compile_definitions(${TARGET} PRIVATE "$<$>:NDEBUG>") +endfunction() + +# Flutter library and tool build rules. +set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") +add_subdirectory(${FLUTTER_MANAGED_DIR}) + +# System-level dependencies. +find_package(PkgConfig REQUIRED) +pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) + +add_definitions(-DAPPLICATION_ID="${APPLICATION_ID}") + +# Define the application target. To change its name, change BINARY_NAME above, +# not the value here, or `flutter run` will no longer work. +# +# Any new source files that you add to the application should be added here. +add_executable(${BINARY_NAME} + "main.cc" + "my_application.cc" + "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" +) + +# Apply the standard set of build settings. This can be removed for applications +# that need different build settings. +apply_standard_settings(${BINARY_NAME}) + +# Add dependency libraries. Add any application-specific dependencies here. +target_link_libraries(${BINARY_NAME} PRIVATE flutter) +target_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::GTK) + +# Run the Flutter tool portions of the build. This must not be removed. +add_dependencies(${BINARY_NAME} flutter_assemble) + +# Only the install-generated bundle's copy of the executable will launch +# correctly, since the resources must in the right relative locations. To avoid +# people trying to run the unbundled copy, put it in a subdirectory instead of +# the default top-level location. +set_target_properties(${BINARY_NAME} + PROPERTIES + RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/intermediates_do_not_run" +) + + +# Generated plugin build rules, which manage building the plugins and adding +# them to the application. +include(flutter/generated_plugins.cmake) + + +# === Installation === +# By default, "installing" just makes a relocatable bundle in the build +# directory. +set(BUILD_BUNDLE_DIR "${PROJECT_BINARY_DIR}/bundle") +if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) + set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) +endif() + +# Start with a clean build bundle directory every time. +install(CODE " + file(REMOVE_RECURSE \"${BUILD_BUNDLE_DIR}/\") + " COMPONENT Runtime) + +set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") +set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib") + +install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" + COMPONENT Runtime) + +install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" + COMPONENT Runtime) + +install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) + +foreach(bundled_library ${PLUGIN_BUNDLED_LIBRARIES}) + install(FILES "${bundled_library}" + DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) +endforeach(bundled_library) + +# Fully re-copy the assets directory on each build to avoid having stale files +# from a previous install. +set(FLUTTER_ASSET_DIR_NAME "flutter_assets") +install(CODE " + file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") + " COMPONENT Runtime) +install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" + DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) + +# Install the AOT library on non-Debug builds only. +if(NOT CMAKE_BUILD_TYPE MATCHES "Debug") + install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) +endif() diff --git a/sqfentity/example/linux/flutter/CMakeLists.txt b/sqfentity/example/linux/flutter/CMakeLists.txt new file mode 100644 index 0000000..d5bd016 --- /dev/null +++ b/sqfentity/example/linux/flutter/CMakeLists.txt @@ -0,0 +1,88 @@ +# This file controls Flutter-level build steps. It should not be edited. +cmake_minimum_required(VERSION 3.10) + +set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") + +# Configuration provided via flutter tool. +include(${EPHEMERAL_DIR}/generated_config.cmake) + +# TODO: Move the rest of this into files in ephemeral. See +# https://github.com/flutter/flutter/issues/57146. + +# Serves the same purpose as list(TRANSFORM ... PREPEND ...), +# which isn't available in 3.10. +function(list_prepend LIST_NAME PREFIX) + set(NEW_LIST "") + foreach(element ${${LIST_NAME}}) + list(APPEND NEW_LIST "${PREFIX}${element}") + endforeach(element) + set(${LIST_NAME} "${NEW_LIST}" PARENT_SCOPE) +endfunction() + +# === Flutter Library === +# System-level dependencies. +find_package(PkgConfig REQUIRED) +pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) +pkg_check_modules(GLIB REQUIRED IMPORTED_TARGET glib-2.0) +pkg_check_modules(GIO REQUIRED IMPORTED_TARGET gio-2.0) + +set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/libflutter_linux_gtk.so") + +# Published to parent scope for install step. +set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) +set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) +set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) +set(AOT_LIBRARY "${PROJECT_DIR}/build/lib/libapp.so" PARENT_SCOPE) + +list(APPEND FLUTTER_LIBRARY_HEADERS + "fl_basic_message_channel.h" + "fl_binary_codec.h" + "fl_binary_messenger.h" + "fl_dart_project.h" + "fl_engine.h" + "fl_json_message_codec.h" + "fl_json_method_codec.h" + "fl_message_codec.h" + "fl_method_call.h" + "fl_method_channel.h" + "fl_method_codec.h" + "fl_method_response.h" + "fl_plugin_registrar.h" + "fl_plugin_registry.h" + "fl_standard_message_codec.h" + "fl_standard_method_codec.h" + "fl_string_codec.h" + "fl_value.h" + "fl_view.h" + "flutter_linux.h" +) +list_prepend(FLUTTER_LIBRARY_HEADERS "${EPHEMERAL_DIR}/flutter_linux/") +add_library(flutter INTERFACE) +target_include_directories(flutter INTERFACE + "${EPHEMERAL_DIR}" +) +target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}") +target_link_libraries(flutter INTERFACE + PkgConfig::GTK + PkgConfig::GLIB + PkgConfig::GIO +) +add_dependencies(flutter flutter_assemble) + +# === Flutter tool backend === +# _phony_ is a non-existent file to force this command to run every time, +# since currently there's no way to get a full input/output list from the +# flutter tool. +add_custom_command( + OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} + ${CMAKE_CURRENT_BINARY_DIR}/_phony_ + COMMAND ${CMAKE_COMMAND} -E env + ${FLUTTER_TOOL_ENVIRONMENT} + "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.sh" + ${FLUTTER_TARGET_PLATFORM} ${CMAKE_BUILD_TYPE} + VERBATIM +) +add_custom_target(flutter_assemble DEPENDS + "${FLUTTER_LIBRARY}" + ${FLUTTER_LIBRARY_HEADERS} +) diff --git a/sqfentity/example/linux/flutter/generated_plugin_registrant.cc b/sqfentity/example/linux/flutter/generated_plugin_registrant.cc new file mode 100644 index 0000000..e71a16d --- /dev/null +++ b/sqfentity/example/linux/flutter/generated_plugin_registrant.cc @@ -0,0 +1,11 @@ +// +// Generated file. Do not edit. +// + +// clang-format off + +#include "generated_plugin_registrant.h" + + +void fl_register_plugins(FlPluginRegistry* registry) { +} diff --git a/sqfentity/example/linux/flutter/generated_plugin_registrant.h b/sqfentity/example/linux/flutter/generated_plugin_registrant.h new file mode 100644 index 0000000..e0f0a47 --- /dev/null +++ b/sqfentity/example/linux/flutter/generated_plugin_registrant.h @@ -0,0 +1,15 @@ +// +// Generated file. Do not edit. +// + +// clang-format off + +#ifndef GENERATED_PLUGIN_REGISTRANT_ +#define GENERATED_PLUGIN_REGISTRANT_ + +#include + +// Registers Flutter plugins. +void fl_register_plugins(FlPluginRegistry* registry); + +#endif // GENERATED_PLUGIN_REGISTRANT_ diff --git a/sqfentity/example/linux/flutter/generated_plugins.cmake b/sqfentity/example/linux/flutter/generated_plugins.cmake new file mode 100644 index 0000000..2e1de87 --- /dev/null +++ b/sqfentity/example/linux/flutter/generated_plugins.cmake @@ -0,0 +1,23 @@ +# +# Generated file, do not edit. +# + +list(APPEND FLUTTER_PLUGIN_LIST +) + +list(APPEND FLUTTER_FFI_PLUGIN_LIST +) + +set(PLUGIN_BUNDLED_LIBRARIES) + +foreach(plugin ${FLUTTER_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/linux plugins/${plugin}) + target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) + list(APPEND PLUGIN_BUNDLED_LIBRARIES $) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) +endforeach(plugin) + +foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin}) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) +endforeach(ffi_plugin) diff --git a/sqfentity/example/linux/main.cc b/sqfentity/example/linux/main.cc new file mode 100644 index 0000000..e7c5c54 --- /dev/null +++ b/sqfentity/example/linux/main.cc @@ -0,0 +1,6 @@ +#include "my_application.h" + +int main(int argc, char** argv) { + g_autoptr(MyApplication) app = my_application_new(); + return g_application_run(G_APPLICATION(app), argc, argv); +} diff --git a/sqfentity/example/linux/my_application.cc b/sqfentity/example/linux/my_application.cc new file mode 100644 index 0000000..0ba8f43 --- /dev/null +++ b/sqfentity/example/linux/my_application.cc @@ -0,0 +1,104 @@ +#include "my_application.h" + +#include +#ifdef GDK_WINDOWING_X11 +#include +#endif + +#include "flutter/generated_plugin_registrant.h" + +struct _MyApplication { + GtkApplication parent_instance; + char** dart_entrypoint_arguments; +}; + +G_DEFINE_TYPE(MyApplication, my_application, GTK_TYPE_APPLICATION) + +// Implements GApplication::activate. +static void my_application_activate(GApplication* application) { + MyApplication* self = MY_APPLICATION(application); + GtkWindow* window = + GTK_WINDOW(gtk_application_window_new(GTK_APPLICATION(application))); + + // Use a header bar when running in GNOME as this is the common style used + // by applications and is the setup most users will be using (e.g. Ubuntu + // desktop). + // If running on X and not using GNOME then just use a traditional title bar + // in case the window manager does more exotic layout, e.g. tiling. + // If running on Wayland assume the header bar will work (may need changing + // if future cases occur). + gboolean use_header_bar = TRUE; +#ifdef GDK_WINDOWING_X11 + GdkScreen* screen = gtk_window_get_screen(window); + if (GDK_IS_X11_SCREEN(screen)) { + const gchar* wm_name = gdk_x11_screen_get_window_manager_name(screen); + if (g_strcmp0(wm_name, "GNOME Shell") != 0) { + use_header_bar = FALSE; + } + } +#endif + if (use_header_bar) { + GtkHeaderBar* header_bar = GTK_HEADER_BAR(gtk_header_bar_new()); + gtk_widget_show(GTK_WIDGET(header_bar)); + gtk_header_bar_set_title(header_bar, "example"); + gtk_header_bar_set_show_close_button(header_bar, TRUE); + gtk_window_set_titlebar(window, GTK_WIDGET(header_bar)); + } else { + gtk_window_set_title(window, "example"); + } + + gtk_window_set_default_size(window, 1280, 720); + gtk_widget_show(GTK_WIDGET(window)); + + g_autoptr(FlDartProject) project = fl_dart_project_new(); + fl_dart_project_set_dart_entrypoint_arguments(project, self->dart_entrypoint_arguments); + + FlView* view = fl_view_new(project); + gtk_widget_show(GTK_WIDGET(view)); + gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(view)); + + fl_register_plugins(FL_PLUGIN_REGISTRY(view)); + + gtk_widget_grab_focus(GTK_WIDGET(view)); +} + +// Implements GApplication::local_command_line. +static gboolean my_application_local_command_line(GApplication* application, gchar*** arguments, int* exit_status) { + MyApplication* self = MY_APPLICATION(application); + // Strip out the first argument as it is the binary name. + self->dart_entrypoint_arguments = g_strdupv(*arguments + 1); + + g_autoptr(GError) error = nullptr; + if (!g_application_register(application, nullptr, &error)) { + g_warning("Failed to register: %s", error->message); + *exit_status = 1; + return TRUE; + } + + g_application_activate(application); + *exit_status = 0; + + return TRUE; +} + +// Implements GObject::dispose. +static void my_application_dispose(GObject* object) { + MyApplication* self = MY_APPLICATION(object); + g_clear_pointer(&self->dart_entrypoint_arguments, g_strfreev); + G_OBJECT_CLASS(my_application_parent_class)->dispose(object); +} + +static void my_application_class_init(MyApplicationClass* klass) { + G_APPLICATION_CLASS(klass)->activate = my_application_activate; + G_APPLICATION_CLASS(klass)->local_command_line = my_application_local_command_line; + G_OBJECT_CLASS(klass)->dispose = my_application_dispose; +} + +static void my_application_init(MyApplication* self) {} + +MyApplication* my_application_new() { + return MY_APPLICATION(g_object_new(my_application_get_type(), + "application-id", APPLICATION_ID, + "flags", G_APPLICATION_NON_UNIQUE, + nullptr)); +} diff --git a/sqfentity/example/linux/my_application.h b/sqfentity/example/linux/my_application.h new file mode 100644 index 0000000..72271d5 --- /dev/null +++ b/sqfentity/example/linux/my_application.h @@ -0,0 +1,18 @@ +#ifndef FLUTTER_MY_APPLICATION_H_ +#define FLUTTER_MY_APPLICATION_H_ + +#include + +G_DECLARE_FINAL_TYPE(MyApplication, my_application, MY, APPLICATION, + GtkApplication) + +/** + * my_application_new: + * + * Creates a new Flutter-based application. + * + * Returns: a new #MyApplication. + */ +MyApplication* my_application_new(); + +#endif // FLUTTER_MY_APPLICATION_H_ diff --git a/sqfentity/example/macos/.gitignore b/sqfentity/example/macos/.gitignore new file mode 100644 index 0000000..746adbb --- /dev/null +++ b/sqfentity/example/macos/.gitignore @@ -0,0 +1,7 @@ +# Flutter-related +**/Flutter/ephemeral/ +**/Pods/ + +# Xcode-related +**/dgph +**/xcuserdata/ diff --git a/sqfentity/example/macos/Flutter/Flutter-Debug.xcconfig b/sqfentity/example/macos/Flutter/Flutter-Debug.xcconfig new file mode 100644 index 0000000..4b81f9b --- /dev/null +++ b/sqfentity/example/macos/Flutter/Flutter-Debug.xcconfig @@ -0,0 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" +#include "ephemeral/Flutter-Generated.xcconfig" diff --git a/sqfentity/example/macos/Flutter/Flutter-Release.xcconfig b/sqfentity/example/macos/Flutter/Flutter-Release.xcconfig new file mode 100644 index 0000000..5caa9d1 --- /dev/null +++ b/sqfentity/example/macos/Flutter/Flutter-Release.xcconfig @@ -0,0 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" +#include "ephemeral/Flutter-Generated.xcconfig" diff --git a/sqfentity/example/macos/Flutter/GeneratedPluginRegistrant.swift b/sqfentity/example/macos/Flutter/GeneratedPluginRegistrant.swift new file mode 100644 index 0000000..98bacc0 --- /dev/null +++ b/sqfentity/example/macos/Flutter/GeneratedPluginRegistrant.swift @@ -0,0 +1,14 @@ +// +// Generated file. Do not edit. +// + +import FlutterMacOS +import Foundation + +import path_provider_foundation +import sqflite_sqlcipher + +func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { + PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) + SqfliteSqlCipherPlugin.register(with: registry.registrar(forPlugin: "SqfliteSqlCipherPlugin")) +} diff --git a/sqfentity/example/macos/Podfile b/sqfentity/example/macos/Podfile new file mode 100644 index 0000000..c795730 --- /dev/null +++ b/sqfentity/example/macos/Podfile @@ -0,0 +1,43 @@ +platform :osx, '10.14' + +# 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', 'ephemeral', '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 Flutter-Generated.xcconfig, then run \"flutter pub get\"" +end + +require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) + +flutter_macos_podfile_setup + +target 'Runner' do + use_frameworks! + use_modular_headers! + + flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__)) + target 'RunnerTests' do + inherit! :search_paths + end +end + +post_install do |installer| + installer.pods_project.targets.each do |target| + flutter_additional_macos_build_settings(target) + end +end diff --git a/sqfentity/example/macos/Runner.xcodeproj/project.pbxproj b/sqfentity/example/macos/Runner.xcodeproj/project.pbxproj new file mode 100644 index 0000000..79158a2 --- /dev/null +++ b/sqfentity/example/macos/Runner.xcodeproj/project.pbxproj @@ -0,0 +1,695 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 54; + objects = { + +/* Begin PBXAggregateTarget section */ + 33CC111A2044C6BA0003C045 /* Flutter Assemble */ = { + isa = PBXAggregateTarget; + buildConfigurationList = 33CC111B2044C6BA0003C045 /* Build configuration list for PBXAggregateTarget "Flutter Assemble" */; + buildPhases = ( + 33CC111E2044C6BF0003C045 /* ShellScript */, + ); + dependencies = ( + ); + name = "Flutter Assemble"; + productName = FLX; + }; +/* End PBXAggregateTarget section */ + +/* Begin PBXBuildFile section */ + 331C80D8294CF71000263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C80D7294CF71000263BE5 /* RunnerTests.swift */; }; + 335BBD1B22A9A15E00E9071D /* GeneratedPluginRegistrant.swift in Sources */ = {isa = PBXBuildFile; fileRef = 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */; }; + 33CC10F12044A3C60003C045 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC10F02044A3C60003C045 /* AppDelegate.swift */; }; + 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F22044A3C60003C045 /* Assets.xcassets */; }; + 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; }; + 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 331C80D9294CF71000263BE5 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 33CC10E52044A3C60003C045 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 33CC10EC2044A3C60003C045; + remoteInfo = Runner; + }; + 33CC111F2044C79F0003C045 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 33CC10E52044A3C60003C045 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 33CC111A2044C6BA0003C045; + remoteInfo = FLX; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 33CC110E2044A8840003C045 /* Bundle Framework */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + ); + name = "Bundle Framework"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 331C80D5294CF71000263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 331C80D7294CF71000263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = ""; }; + 333000ED22D3DE5D00554162 /* Warnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Warnings.xcconfig; sourceTree = ""; }; + 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GeneratedPluginRegistrant.swift; sourceTree = ""; }; + 33CC10ED2044A3C60003C045 /* example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "example.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 33CC10F02044A3C60003C045 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 33CC10F22044A3C60003C045 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = Runner/Assets.xcassets; sourceTree = ""; }; + 33CC10F52044A3C60003C045 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; + 33CC10F72044A3C60003C045 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Info.plist; path = Runner/Info.plist; sourceTree = ""; }; + 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainFlutterWindow.swift; sourceTree = ""; }; + 33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Flutter-Debug.xcconfig"; sourceTree = ""; }; + 33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Flutter-Release.xcconfig"; sourceTree = ""; }; + 33CEB47722A0578A004F2AC0 /* Flutter-Generated.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = "Flutter-Generated.xcconfig"; path = "ephemeral/Flutter-Generated.xcconfig"; sourceTree = ""; }; + 33E51913231747F40026EE4D /* DebugProfile.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = DebugProfile.entitlements; sourceTree = ""; }; + 33E51914231749380026EE4D /* Release.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = Release.entitlements; sourceTree = ""; }; + 33E5194F232828860026EE4D /* AppInfo.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = AppInfo.xcconfig; sourceTree = ""; }; + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = ""; }; + 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 331C80D2294CF70F00263BE5 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 33CC10EA2044A3C60003C045 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 331C80D6294CF71000263BE5 /* RunnerTests */ = { + isa = PBXGroup; + children = ( + 331C80D7294CF71000263BE5 /* RunnerTests.swift */, + ); + path = RunnerTests; + sourceTree = ""; + }; + 33BA886A226E78AF003329D5 /* Configs */ = { + isa = PBXGroup; + children = ( + 33E5194F232828860026EE4D /* AppInfo.xcconfig */, + 9740EEB21CF90195004384FC /* Debug.xcconfig */, + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, + 333000ED22D3DE5D00554162 /* Warnings.xcconfig */, + ); + path = Configs; + sourceTree = ""; + }; + 33CC10E42044A3C60003C045 = { + isa = PBXGroup; + children = ( + 33FAB671232836740065AC1E /* Runner */, + 33CEB47122A05771004F2AC0 /* Flutter */, + 331C80D6294CF71000263BE5 /* RunnerTests */, + 33CC10EE2044A3C60003C045 /* Products */, + D73912EC22F37F3D000D13A0 /* Frameworks */, + ); + sourceTree = ""; + }; + 33CC10EE2044A3C60003C045 /* Products */ = { + isa = PBXGroup; + children = ( + 33CC10ED2044A3C60003C045 /* example.app */, + 331C80D5294CF71000263BE5 /* RunnerTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 33CC11242044D66E0003C045 /* Resources */ = { + isa = PBXGroup; + children = ( + 33CC10F22044A3C60003C045 /* Assets.xcassets */, + 33CC10F42044A3C60003C045 /* MainMenu.xib */, + 33CC10F72044A3C60003C045 /* Info.plist */, + ); + name = Resources; + path = ..; + sourceTree = ""; + }; + 33CEB47122A05771004F2AC0 /* Flutter */ = { + isa = PBXGroup; + children = ( + 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */, + 33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */, + 33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */, + 33CEB47722A0578A004F2AC0 /* Flutter-Generated.xcconfig */, + ); + path = Flutter; + sourceTree = ""; + }; + 33FAB671232836740065AC1E /* Runner */ = { + isa = PBXGroup; + children = ( + 33CC10F02044A3C60003C045 /* AppDelegate.swift */, + 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */, + 33E51913231747F40026EE4D /* DebugProfile.entitlements */, + 33E51914231749380026EE4D /* Release.entitlements */, + 33CC11242044D66E0003C045 /* Resources */, + 33BA886A226E78AF003329D5 /* Configs */, + ); + path = Runner; + sourceTree = ""; + }; + D73912EC22F37F3D000D13A0 /* Frameworks */ = { + isa = PBXGroup; + children = ( + ); + name = Frameworks; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 331C80D4294CF70F00263BE5 /* RunnerTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 331C80DE294CF71000263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */; + buildPhases = ( + 331C80D1294CF70F00263BE5 /* Sources */, + 331C80D2294CF70F00263BE5 /* Frameworks */, + 331C80D3294CF70F00263BE5 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 331C80DA294CF71000263BE5 /* PBXTargetDependency */, + ); + name = RunnerTests; + productName = RunnerTests; + productReference = 331C80D5294CF71000263BE5 /* RunnerTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; + 33CC10EC2044A3C60003C045 /* Runner */ = { + isa = PBXNativeTarget; + buildConfigurationList = 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */; + buildPhases = ( + 33CC10E92044A3C60003C045 /* Sources */, + 33CC10EA2044A3C60003C045 /* Frameworks */, + 33CC10EB2044A3C60003C045 /* Resources */, + 33CC110E2044A8840003C045 /* Bundle Framework */, + 3399D490228B24CF009A79C7 /* ShellScript */, + ); + buildRules = ( + ); + dependencies = ( + 33CC11202044C79F0003C045 /* PBXTargetDependency */, + ); + name = Runner; + productName = Runner; + productReference = 33CC10ED2044A3C60003C045 /* example.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 33CC10E52044A3C60003C045 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 0920; + LastUpgradeCheck = 1300; + ORGANIZATIONNAME = ""; + TargetAttributes = { + 331C80D4294CF70F00263BE5 = { + CreatedOnToolsVersion = 14.0; + TestTargetID = 33CC10EC2044A3C60003C045; + }; + 33CC10EC2044A3C60003C045 = { + CreatedOnToolsVersion = 9.2; + LastSwiftMigration = 1100; + ProvisioningStyle = Automatic; + SystemCapabilities = { + com.apple.Sandbox = { + enabled = 1; + }; + }; + }; + 33CC111A2044C6BA0003C045 = { + CreatedOnToolsVersion = 9.2; + ProvisioningStyle = Manual; + }; + }; + }; + buildConfigurationList = 33CC10E82044A3C60003C045 /* Build configuration list for PBXProject "Runner" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 33CC10E42044A3C60003C045; + productRefGroup = 33CC10EE2044A3C60003C045 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 33CC10EC2044A3C60003C045 /* Runner */, + 331C80D4294CF70F00263BE5 /* RunnerTests */, + 33CC111A2044C6BA0003C045 /* Flutter Assemble */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 331C80D3294CF70F00263BE5 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 33CC10EB2044A3C60003C045 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */, + 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 3399D490228B24CF009A79C7 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + ); + outputFileListPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "echo \"$PRODUCT_NAME.app\" > \"$PROJECT_DIR\"/Flutter/ephemeral/.app_filename && \"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh embed\n"; + }; + 33CC111E2044C6BF0003C045 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + Flutter/ephemeral/FlutterInputs.xcfilelist, + ); + inputPaths = ( + Flutter/ephemeral/tripwire, + ); + outputFileListPaths = ( + Flutter/ephemeral/FlutterOutputs.xcfilelist, + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh && touch Flutter/ephemeral/tripwire"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 331C80D1294CF70F00263BE5 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 331C80D8294CF71000263BE5 /* RunnerTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 33CC10E92044A3C60003C045 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */, + 33CC10F12044A3C60003C045 /* AppDelegate.swift in Sources */, + 335BBD1B22A9A15E00E9071D /* GeneratedPluginRegistrant.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 331C80DA294CF71000263BE5 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 33CC10EC2044A3C60003C045 /* Runner */; + targetProxy = 331C80D9294CF71000263BE5 /* PBXContainerItemProxy */; + }; + 33CC11202044C79F0003C045 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 33CC111A2044C6BA0003C045 /* Flutter Assemble */; + targetProxy = 33CC111F2044C79F0003C045 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 33CC10F42044A3C60003C045 /* MainMenu.xib */ = { + isa = PBXVariantGroup; + children = ( + 33CC10F52044A3C60003C045 /* Base */, + ); + name = MainMenu.xib; + path = Runner; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 331C80DB294CF71000263BE5 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.example.example.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/example.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/example"; + }; + name = Debug; + }; + 331C80DC294CF71000263BE5 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.example.example.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/example.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/example"; + }; + name = Release; + }; + 331C80DD294CF71000263BE5 /* Profile */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.example.example.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/example.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/example"; + }; + name = Profile; + }; + 338D0CE9231458BD00FA5F75 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CODE_SIGN_IDENTITY = "-"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.14; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = macosx; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + }; + name = Profile; + }; + 338D0CEA231458BD00FA5F75 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + ); + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_VERSION = 5.0; + }; + name = Profile; + }; + 338D0CEB231458BD00FA5F75 /* Profile */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Manual; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Profile; + }; + 33CC10F92044A3C60003C045 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CODE_SIGN_IDENTITY = "-"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.14; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = macosx; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 33CC10FA2044A3C60003C045 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CODE_SIGN_IDENTITY = "-"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.14; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = macosx; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + }; + name = Release; + }; + 33CC10FC2044A3C60003C045 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + ); + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + }; + name = Debug; + }; + 33CC10FD2044A3C60003C045 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = Runner/Release.entitlements; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + ); + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_VERSION = 5.0; + }; + name = Release; + }; + 33CC111C2044C6BA0003C045 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Manual; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + 33CC111D2044C6BA0003C045 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 331C80DE294CF71000263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 331C80DB294CF71000263BE5 /* Debug */, + 331C80DC294CF71000263BE5 /* Release */, + 331C80DD294CF71000263BE5 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 33CC10E82044A3C60003C045 /* Build configuration list for PBXProject "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 33CC10F92044A3C60003C045 /* Debug */, + 33CC10FA2044A3C60003C045 /* Release */, + 338D0CE9231458BD00FA5F75 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 33CC10FC2044A3C60003C045 /* Debug */, + 33CC10FD2044A3C60003C045 /* Release */, + 338D0CEA231458BD00FA5F75 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 33CC111B2044C6BA0003C045 /* Build configuration list for PBXAggregateTarget "Flutter Assemble" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 33CC111C2044C6BA0003C045 /* Debug */, + 33CC111D2044C6BA0003C045 /* Release */, + 338D0CEB231458BD00FA5F75 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 33CC10E52044A3C60003C045 /* Project object */; +} diff --git a/sqfentity/example/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/sqfentity/example/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/sqfentity/example/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/sqfentity/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/sqfentity/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme new file mode 100644 index 0000000..8fedab6 --- /dev/null +++ b/sqfentity/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -0,0 +1,98 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sqfentity/example/macos/Runner.xcworkspace/contents.xcworkspacedata b/sqfentity/example/macos/Runner.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..1d526a1 --- /dev/null +++ b/sqfentity/example/macos/Runner.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/sqfentity/example/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/sqfentity/example/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/sqfentity/example/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/sqfentity/example/macos/Runner/AppDelegate.swift b/sqfentity/example/macos/Runner/AppDelegate.swift new file mode 100644 index 0000000..d53ef64 --- /dev/null +++ b/sqfentity/example/macos/Runner/AppDelegate.swift @@ -0,0 +1,9 @@ +import Cocoa +import FlutterMacOS + +@NSApplicationMain +class AppDelegate: FlutterAppDelegate { + override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { + return true + } +} diff --git a/sqfentity/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/sqfentity/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..a2ec33f --- /dev/null +++ b/sqfentity/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,68 @@ +{ + "images" : [ + { + "size" : "16x16", + "idiom" : "mac", + "filename" : "app_icon_16.png", + "scale" : "1x" + }, + { + "size" : "16x16", + "idiom" : "mac", + "filename" : "app_icon_32.png", + "scale" : "2x" + }, + { + "size" : "32x32", + "idiom" : "mac", + "filename" : "app_icon_32.png", + "scale" : "1x" + }, + { + "size" : "32x32", + "idiom" : "mac", + "filename" : "app_icon_64.png", + "scale" : "2x" + }, + { + "size" : "128x128", + "idiom" : "mac", + "filename" : "app_icon_128.png", + "scale" : "1x" + }, + { + "size" : "128x128", + "idiom" : "mac", + "filename" : "app_icon_256.png", + "scale" : "2x" + }, + { + "size" : "256x256", + "idiom" : "mac", + "filename" : "app_icon_256.png", + "scale" : "1x" + }, + { + "size" : "256x256", + "idiom" : "mac", + "filename" : "app_icon_512.png", + "scale" : "2x" + }, + { + "size" : "512x512", + "idiom" : "mac", + "filename" : "app_icon_512.png", + "scale" : "1x" + }, + { + "size" : "512x512", + "idiom" : "mac", + "filename" : "app_icon_1024.png", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/sqfentity/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png b/sqfentity/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png new file mode 100644 index 0000000..82b6f9d Binary files /dev/null and b/sqfentity/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png differ diff --git a/sqfentity/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png b/sqfentity/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png new file mode 100644 index 0000000..13b35eb Binary files /dev/null and b/sqfentity/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png differ diff --git a/sqfentity/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png b/sqfentity/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png new file mode 100644 index 0000000..0a3f5fa Binary files /dev/null and b/sqfentity/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png differ diff --git a/sqfentity/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png b/sqfentity/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png new file mode 100644 index 0000000..bdb5722 Binary files /dev/null and b/sqfentity/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png differ diff --git a/sqfentity/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png b/sqfentity/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png new file mode 100644 index 0000000..f083318 Binary files /dev/null and b/sqfentity/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png differ diff --git a/sqfentity/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png b/sqfentity/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png new file mode 100644 index 0000000..326c0e7 Binary files /dev/null and b/sqfentity/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png differ diff --git a/sqfentity/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png b/sqfentity/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png new file mode 100644 index 0000000..2f1632c Binary files /dev/null and b/sqfentity/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png differ diff --git a/sqfentity/example/macos/Runner/Base.lproj/MainMenu.xib b/sqfentity/example/macos/Runner/Base.lproj/MainMenu.xib new file mode 100644 index 0000000..80e867a --- /dev/null +++ b/sqfentity/example/macos/Runner/Base.lproj/MainMenu.xib @@ -0,0 +1,343 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sqfentity/example/macos/Runner/Configs/AppInfo.xcconfig b/sqfentity/example/macos/Runner/Configs/AppInfo.xcconfig new file mode 100644 index 0000000..dda192b --- /dev/null +++ b/sqfentity/example/macos/Runner/Configs/AppInfo.xcconfig @@ -0,0 +1,14 @@ +// Application-level settings for the Runner target. +// +// This may be replaced with something auto-generated from metadata (e.g., pubspec.yaml) in the +// future. If not, the values below would default to using the project name when this becomes a +// 'flutter create' template. + +// The application's name. By default this is also the title of the Flutter window. +PRODUCT_NAME = example + +// The application's bundle identifier +PRODUCT_BUNDLE_IDENTIFIER = com.example.example + +// The copyright displayed in application information +PRODUCT_COPYRIGHT = Copyright © 2023 com.example. All rights reserved. diff --git a/sqfentity/example/macos/Runner/Configs/Debug.xcconfig b/sqfentity/example/macos/Runner/Configs/Debug.xcconfig new file mode 100644 index 0000000..36b0fd9 --- /dev/null +++ b/sqfentity/example/macos/Runner/Configs/Debug.xcconfig @@ -0,0 +1,2 @@ +#include "../../Flutter/Flutter-Debug.xcconfig" +#include "Warnings.xcconfig" diff --git a/sqfentity/example/macos/Runner/Configs/Release.xcconfig b/sqfentity/example/macos/Runner/Configs/Release.xcconfig new file mode 100644 index 0000000..dff4f49 --- /dev/null +++ b/sqfentity/example/macos/Runner/Configs/Release.xcconfig @@ -0,0 +1,2 @@ +#include "../../Flutter/Flutter-Release.xcconfig" +#include "Warnings.xcconfig" diff --git a/sqfentity/example/macos/Runner/Configs/Warnings.xcconfig b/sqfentity/example/macos/Runner/Configs/Warnings.xcconfig new file mode 100644 index 0000000..42bcbf4 --- /dev/null +++ b/sqfentity/example/macos/Runner/Configs/Warnings.xcconfig @@ -0,0 +1,13 @@ +WARNING_CFLAGS = -Wall -Wconditional-uninitialized -Wnullable-to-nonnull-conversion -Wmissing-method-return-type -Woverlength-strings +GCC_WARN_UNDECLARED_SELECTOR = YES +CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES +CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE +CLANG_WARN__DUPLICATE_METHOD_MATCH = YES +CLANG_WARN_PRAGMA_PACK = YES +CLANG_WARN_STRICT_PROTOTYPES = YES +CLANG_WARN_COMMA = YES +GCC_WARN_STRICT_SELECTOR_MATCH = YES +CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES +CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES +GCC_WARN_SHADOW = YES +CLANG_WARN_UNREACHABLE_CODE = YES diff --git a/sqfentity/example/macos/Runner/DebugProfile.entitlements b/sqfentity/example/macos/Runner/DebugProfile.entitlements new file mode 100644 index 0000000..dddb8a3 --- /dev/null +++ b/sqfentity/example/macos/Runner/DebugProfile.entitlements @@ -0,0 +1,12 @@ + + + + + com.apple.security.app-sandbox + + com.apple.security.cs.allow-jit + + com.apple.security.network.server + + + diff --git a/sqfentity/example/macos/Runner/Info.plist b/sqfentity/example/macos/Runner/Info.plist new file mode 100644 index 0000000..4789daa --- /dev/null +++ b/sqfentity/example/macos/Runner/Info.plist @@ -0,0 +1,32 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIconFile + + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + $(FLUTTER_BUILD_NAME) + CFBundleVersion + $(FLUTTER_BUILD_NUMBER) + LSMinimumSystemVersion + $(MACOSX_DEPLOYMENT_TARGET) + NSHumanReadableCopyright + $(PRODUCT_COPYRIGHT) + NSMainNibFile + MainMenu + NSPrincipalClass + NSApplication + + diff --git a/sqfentity/example/macos/Runner/MainFlutterWindow.swift b/sqfentity/example/macos/Runner/MainFlutterWindow.swift new file mode 100644 index 0000000..3cc05eb --- /dev/null +++ b/sqfentity/example/macos/Runner/MainFlutterWindow.swift @@ -0,0 +1,15 @@ +import Cocoa +import FlutterMacOS + +class MainFlutterWindow: NSWindow { + override func awakeFromNib() { + let flutterViewController = FlutterViewController() + let windowFrame = self.frame + self.contentViewController = flutterViewController + self.setFrame(windowFrame, display: true) + + RegisterGeneratedPlugins(registry: flutterViewController) + + super.awakeFromNib() + } +} diff --git a/sqfentity/example/macos/Runner/Release.entitlements b/sqfentity/example/macos/Runner/Release.entitlements new file mode 100644 index 0000000..852fa1a --- /dev/null +++ b/sqfentity/example/macos/Runner/Release.entitlements @@ -0,0 +1,8 @@ + + + + + com.apple.security.app-sandbox + + + diff --git a/sqfentity/example/macos/RunnerTests/RunnerTests.swift b/sqfentity/example/macos/RunnerTests/RunnerTests.swift new file mode 100644 index 0000000..5418c9f --- /dev/null +++ b/sqfentity/example/macos/RunnerTests/RunnerTests.swift @@ -0,0 +1,12 @@ +import FlutterMacOS +import Cocoa +import XCTest + +class RunnerTests: XCTestCase { + + func testExample() { + // If you add code to the Runner application, consider adding tests here. + // See https://developer.apple.com/documentation/xctest for more information about using XCTest. + } + +} diff --git a/sqfentity/example/main.dart b/sqfentity/example/main.dart index d0fc3e6..f965674 100644 --- a/sqfentity/example/main.dart +++ b/sqfentity/example/main.dart @@ -158,12 +158,13 @@ Future printListDynamic(SqfEntityProvider model, String pSql) async { } void printList(List list, {bool isMap = false, String? title}) { - print('PRINTLIST--------------$title---------------lenght: ${list.length}'); + debugPrint( + 'PRINTLIST--------------$title---------------lenght: ${list.length}'); for (final o in list) { if (isMap) { - print(o.toMap()); + debugPrint(o.toMap().toString()); } else { - print(o.toString()); + debugPrint(o.toString()); } } } @@ -171,13 +172,14 @@ void printList(List list, {bool isMap = false, String? title}) { Future printCategories(bool getIsDeleted) async { final categoryList = await Category().select(getIsDeleted: getIsDeleted).toList(); - print('LISTING CATEGORIES -> Category().select().toList()'); + debugPrint('LISTING CATEGORIES -> Category().select().toList()'); // PRINT RESULTS TO DEBUG CONSOLE - print('${categoryList.length} matches found:'); + debugPrint('${categoryList.length} matches found:'); for (int i = 0; i < categoryList.length; i++) { - print(categoryList[i].toMap()); + debugPrint(categoryList[i].toMap().toString()); } - print('---------------------------------------------------------------\n\n'); + debugPrint( + '---------------------------------------------------------------\n\n'); } class BundledDbModel extends SqfEntityModelProvider {} @@ -211,7 +213,7 @@ flutter: await Clipboard.setData(ClipboardData(text: modelConstString)); /* - Model were created succesfuly and set to the Clipboard. + Model were created successfully and set to the Clipboard. STEP 1: Open model.dart file in lib/model folder and paste (Ctrl+V) models after following line @@ -223,8 +225,8 @@ flutter: Your Entity models will be created in lib/model/model.g.dart */ - print('''Your ${bundledDbModel.databaseName} - were created succesfuly and set to the Clipboard. + debugPrint('''Your ${bundledDbModel.databaseName} + were created successfully and set to the Clipboard. STEP 1: Open model.dart file in lib/model folder and paste models after following line @@ -268,14 +270,15 @@ Future createSqfEntityModelString([bool setClipboard = true]) async { Future printProducts() async { final productList = await Product().select().toList(); - print( + debugPrint( 'EXAMPLE 1.1: SELECT ALL ROWS WITHOUT FILTER ex: SELECT * FROM PRODUCTS \n -> Product().select().toList()'); // PRINT RESULTS TO DEBUG CONSOLE - print('${productList.length} matches found:'); + debugPrint('${productList.length} matches found:'); for (int i = 0; i < productList.length; i++) { - print(productList[i].toMap()); + debugPrint(productList[i].toMap().toString()); } - print('---------------------------------------------------------------\n\n'); + debugPrint( + '---------------------------------------------------------------\n\n'); } Future samples1() async { @@ -289,17 +292,18 @@ Future samples1() async { .orderByDesc('price') .orderBy('id') .toList(); - print( + debugPrint( 'EXAMPLE 1.2: ORDER BY FIELDS ex: SELECT * FROM PRODUCTS ORDER BY name, price DESC, id \n-> Product().select().orderBy(\'name\').orderByDesc(\'price\').orderBy(\'id\').toList()'); // PRINT RESULTS TO DEBUG CONSOLE - print('${productList.length} matches found:'); + debugPrint('${productList.length} matches found:'); for (int i = 0; i < productList.length; i++) { - print(productList[i].toMap()); + debugPrint(productList[i].toMap().toString()); } - print('---------------------------------------------------------------\n\n'); + debugPrint( + '---------------------------------------------------------------\n\n'); // EXAMPLE 1.3: SELECT SPECIFIC FIELDS -> ex: SELECT name,price FROM PRODUCTS ORDER BY price DESC - print( + debugPrint( 'EXAMPLE 1.3: SELECT SPECIFIC FIELDS ex: SELECT name,price FROM PRODUCTS ORDER BY price DESC \n-> Product().select(columnsToSelect: [\'name\',\'price\']).orderByDesc(\'price\').toList()'); productList = await Product() @@ -308,36 +312,38 @@ Future samples1() async { .toList(); // PRINT RESULTS TO DEBUG CONSOLE - print('${productList.length} matches found:'); + debugPrint('${productList.length} matches found:'); for (int i = 0; i < productList.length; i++) { - print(productList[i].toMap()); + debugPrint(productList[i].toMap().toString()); } - print('---------------------------------------------------------------'); + debugPrint('---------------------------------------------------------------'); } Future samples2() async { // EXAMPLE 1.4: SELECT * FROM PRODUCTS WHERE isActive=1 var productList = await Product().select().isActive.equals(true).toList(); - print( + debugPrint( 'EXAMPLE 1.4: EQUALS ex: SELECT * FROM PRODUCTS WHERE isActive=1 \n-> Product().select().isActive.equals(true).toList()'); // PRINT RESULTS TO DEBUG CONSOLE - print('${productList.length} matches found:'); + debugPrint('${productList.length} matches found:'); for (int i = 0; i < productList.length; i++) { - print(productList[i].toMap()); + debugPrint(productList[i].toMap().toString()); } - print('---------------------------------------------------------------\n\n'); + debugPrint( + '---------------------------------------------------------------\n\n'); // EXAMPLE 1.5: SELECT * FROM PRODUCTS WHERE ID IN (3,6,9) productList = await Product().select().id.inValues([3, 6, 9]).toList(); - print( + debugPrint( 'EXAMPLE 1.5: WHERE field IN (VALUES) ex: SELECT * FROM PRODUCTS WHERE ID IN (3,6,9) \n -> Product().select().id.inValues([3,6,9]).toList()'); // PRINT RESULTS TO DEBUG CONSOLE - print('${productList.length} matches found:'); + debugPrint('${productList.length} matches found:'); for (int i = 0; i < productList.length; i++) { - print(productList[i].toMap()); + debugPrint(productList[i].toMap().toString()); } - print('---------------------------------------------------------------\n\n'); + debugPrint( + '---------------------------------------------------------------\n\n'); // Brackets in query, Contains, Endswith, Startswith SAMPLES // EXAMPLE 1.6: SELECT TOP 1 * FROM PRODUCTS WHERE price>10000 AND (description LIKE '%256%' OR description LIKE '512%') @@ -354,13 +360,15 @@ Future samples2() async { .startsWith('512') .endBlock .toSingle(); - print( + debugPrint( 'EXAMPLE 1.6: BRACKETS ex: SELECT TOP 1 * FROM PRODUCTS WHERE price>10000 AND (description LIKE \'%256%\' OR description LIKE \'512%\') \n -> Product().select().price.greaterThan(10000).and.startBlock.description.contains(\'256\').or.description.startsWith(\'512").endBlock.toSingle((product){ // TO DO })'); - print('Toplam ${(singleProduct != null ? '1' : '0')} sonuç listeleniyor:'); + debugPrint( + 'Toplam ${(singleProduct != null ? '1' : '0')} sonuç listeleniyor:'); if (singleProduct != null) { - print(singleProduct.toMap()); + debugPrint(singleProduct.toMap().toString()); } - print('---------------------------------------------------------------\n\n'); + debugPrint( + '---------------------------------------------------------------\n\n'); // EXAMPLE 1.7: SELECT name,price FROM PRODUCTS WHERE price <=10000 AND (description LIKE '%128%' OR description LIKE '%GB') productList = await Product() @@ -379,25 +387,27 @@ Future samples2() async { .startsWith('128') .endBlock .toList(); - print( + debugPrint( 'EXAMPLE 1.7: BRACKETS 2 ex: SELECT name,price FROM PRODUCTS WHERE price <=10000 AND (description LIKE \'%128%\' OR description LIKE \'%GB\') \n -> Product().select(columnsToSelect:[\'name\',\'price\']).price.lessThanOrEquals(10000).and.startBlock.description.contains(\'128\').or.description.endsWith(\'GB\').endBlock.toList();'); // PRINT RESULTS TO DEBUG CONSOLE - print('${productList.length} matches found:'); + debugPrint('${productList.length} matches found:'); for (int i = 0; i < productList.length; i++) { - print(productList[i].toMap()); + debugPrint(productList[i].toMap().toString()); } - print('---------------------------------------------------------------\n\n'); + debugPrint( + '---------------------------------------------------------------\n\n'); // EXAMPLE 1.8: NOT EQUALS productList = await Product().select().id.not.equals(11).toList(); - print( + debugPrint( 'EXAMPLE 1.8: NOT EQUALS ex: SELECT * FROM PRODUCTS WHERE ID <> 11 \n -> Product().select().id.not.equals(11).toList();'); // PRINT RESULTS TO DEBUG CONSOLE - print('${productList.length} matches found:'); + debugPrint('${productList.length} matches found:'); for (int i = 0; i < productList.length; i++) { - print(productList[i].toMap()); + debugPrint(productList[i].toMap().toString()); } - print('---------------------------------------------------------------\n\n'); + debugPrint( + '---------------------------------------------------------------\n\n'); // EXAMPLE 1.9: GREATERTHEN OR EQUALS, LESSTHAN OR EQUALS productList = await Product() @@ -408,14 +418,15 @@ Future samples2() async { .price .lessThanOrEquals(13000) .toList(); - print( + debugPrint( 'EXAMPLE 1.9: GREATERTHEN OR EQUALS, LESSTHAN OR EQUALS ex: SELECT * FROM PRODUCTS WHERE price>=10000 AND price<=13000 \n -> Product().select().price.greaterThanOrEquals(10000).and.price.lessThanOrEquals(13000).toList();'); // PRINT RESULTS TO DEBUG CONSOLE - print('${productList.length} matches found:'); + debugPrint('${productList.length} matches found:'); for (int i = 0; i < productList.length; i++) { - print(productList[i].toMap()); + debugPrint(productList[i].toMap().toString()); } - print('---------------------------------------------------------------\n\n'); + debugPrint( + '---------------------------------------------------------------\n\n'); // EXAMPLE 1.10: BETWEEN KEYWORD productList = await Product() @@ -424,39 +435,42 @@ Future samples2() async { .between(8000, 14000) .orderBy('price') .toList(); - print( + debugPrint( 'EXAMPLE 1.10: BETWEEN ex: SELECT * FROM PRODUCTS WHERE price BETWEEN 8000 AND 14000 \n -> Product().select().price.between(8000,14000).orderBy(\'price\').toList();'); // PRINT RESULTS TO DEBUG CONSOLE - print('${productList.length} matches found:'); + debugPrint('${productList.length} matches found:'); for (int i = 0; i < productList.length; i++) { - print(productList[i].toMap()); + debugPrint(productList[i].toMap().toString()); } - print('---------------------------------------------------------------\n\n'); + debugPrint( + '---------------------------------------------------------------\n\n'); // EXAMPLE 1.11: 'NOT' KEYWORD productList = await Product().select().id.not.greaterThan(5).toList(); - print( + debugPrint( 'EXAMPLE 1.11: \'NOT\' KEYWORD ex: SELECT * FROM PRODUCTS WHERE NOT id>5 \n -> Product().select().id.not.greaterThan(5).toList();'); // PRINT RESULTS TO DEBUG CONSOLE - print('${productList.length} matches found:'); + debugPrint('${productList.length} matches found:'); for (int i = 0; i < productList.length; i++) { - print(productList[i].toMap()); + debugPrint(productList[i].toMap().toString()); } - print('---------------------------------------------------------------\n\n'); + debugPrint( + '---------------------------------------------------------------\n\n'); // EXAMPLE 1.12: WRITING CUSTOM FILTER IN WHERE CLAUSE productList = await Product() .select() .where('id IN (3,6,9) OR price>?', parameterValue: 8000) .toList(); - print( + debugPrint( 'EXAMPLE 1.12: WRITING CUSTOM FILTER IN WHERE CLAUSE ex: SELECT * FROM PRODUCTS WHERE id IN (3,6,9) OR price>8000 \n -> Product().select().where(\'id IN (3,6,9) OR price>8000\').toList()'); // PRINT RESULTS TO DEBUG CONSOLE - print('${productList.length} matches found:'); + debugPrint('${productList.length} matches found:'); for (int i = 0; i < productList.length; i++) { - print(productList[i].toMap()); + debugPrint(productList[i].toMap().toString()); } - print('---------------------------------------------------------------\n\n'); + debugPrint( + '---------------------------------------------------------------\n\n'); // EXAMPLE 1.13: Build filter and query from values from the form // assume that the values come from the form by defining several variables: @@ -485,26 +499,28 @@ Future samples2() async { .description .contains(descriptionContains) .toList(); - print( + debugPrint( 'EXAMPLE 1.13: Product().select().price.between($minPrice, $maxPrice).and.name.contains(\'$nameContains\').and.description.contains(\'$descriptionContains\').toList()'); // PRINT RESULTS TO DEBUG CONSOLE - print('${productList.length} matches found:'); + debugPrint('${productList.length} matches found:'); for (var prod in productList) { - print(prod.toMap()); + debugPrint(prod.toMap().toString()); } - print('---------------------------------------------------------------\n\n'); + debugPrint( + '---------------------------------------------------------------\n\n'); // EXAMPLE 1.14: Select products with deleted items (only softdelete was activated on Model) productList = await Product().select(getIsDeleted: true).toList(); - print( + debugPrint( 'EXAMPLE 1.14: EXAMPLE 1.13: Select products with deleted items\n -> Product().select(getIsDeleted: true).toList()'); // PRINT RESULTS TO DEBUG CONSOLE - print('${productList.length} matches found:'); + debugPrint('${productList.length} matches found:'); for (var prod in productList) { - print(prod.toMap()); + debugPrint(prod.toMap().toString()); } - print('---------------------------------------------------------------\n\n'); + debugPrint( + '---------------------------------------------------------------\n\n'); // EXAMPLE 1.15: Select products only deleted items (only softdelete was activated on Model) productList = await Product() @@ -512,14 +528,15 @@ Future samples2() async { .isDeleted .equals(true) .toList(); - print( + debugPrint( 'EXAMPLE 1.15: Select products only deleted items \n -> Product().select(getIsDeleted: true).isDeleted.equals(true).toList()'); // PRINT RESULTS TO DEBUG CONSOLE - print('${productList.length} matches found:'); + debugPrint('${productList.length} matches found:'); for (var prod in productList) { - print(prod.toMap()); + debugPrint(prod.toMap().toString()); } - print('---------------------------------------------------------------\n\n'); + debugPrint( + '---------------------------------------------------------------\n\n'); // EXAMPLE 1.16: Select products between datetimes productList = await Product() @@ -528,39 +545,42 @@ Future samples2() async { .where( 'datetime BETWEEN \'${DateTime(2020, 1, 1, 14)}\' AND \'${DateTime(2020, 1, 1, 14).millisecondsSinceEpoch}\'') .toList(); - print( + debugPrint( 'EXAMPLE 1.16: Select products between datetimes \n -> Product().select().datetime.between(DateTime(2020,1,1,14), DateTime(2020,1,5,15)).toList()'); // PRINT RESULTS TO DEBUG CONSOLE - print('${productList.length} matches found:'); + debugPrint('${productList.length} matches found:'); for (var prod in productList) { - print(prod.toMap()); + debugPrint(prod.toMap().toString()); } - print('---------------------------------------------------------------\n\n'); + debugPrint( + '---------------------------------------------------------------\n\n'); } Future samples3() async { // EXAMPLE 3.1: SELECT TOP 3 * FROM PRODUCTS ORDER BY price DESC var productList = await Product().select().orderByDesc('price').top(3).toList(); - print( + debugPrint( 'EXAMPLE 3.1: LIMITATION ex: SELECT TOP 3 * FROM PRODUCTS ORDER BY price DESC \n -> Product().select().orderByDesc(\'price\').top(3).toList()'); // PRINT RESULTS TO DEBUG CONSOLE - print('${productList.length} matches found:'); + debugPrint('${productList.length} matches found:'); for (int i = 0; i < productList.length; i++) { - print(productList[i].toMap()); + debugPrint(productList[i].toMap().toString()); } - print('---------------------------------------------------------------\n\n'); + debugPrint( + '---------------------------------------------------------------\n\n'); // EXAMPLE 3.2: SAMPLE PAGING -> PRODUCTS in 3. page (5 items per page) productList = await Product().select().page(3, 5).toList(); - print( + debugPrint( 'EXAMPLE 3.2: SAMPLE PAGING ex: PRODUCTS in 3. page (5 items per page) \n -> Product().select().page(3,5).toList()'); // PRINT RESULTS TO DEBUG CONSOLE - print('${productList.length} matches found:'); + debugPrint('${productList.length} matches found:'); for (int i = 0; i < productList.length; i++) { - print(productList[i].toMap()); + debugPrint(productList[i].toMap().toString()); } - print('---------------------------------------------------------------\n\n'); + debugPrint( + '---------------------------------------------------------------\n\n'); } Future samples4() async { @@ -570,14 +590,15 @@ Future samples4() async { .price .greaterThan(3000) .toList(); - print( + debugPrint( 'EXAMPLE 4.1: DISTINCT ex: SELECT DISTINCT name FROM PRODUCTS WHERE price > 3000 \n -> Product().distinct(columnsToSelect:[\'name\').price.greaterThan(3000).toList();'); // PRINT RESULTS TO DEBUG CONSOLE - print('${productList.length} matches found:'); + debugPrint('${productList.length} matches found:'); for (int i = 0; i < productList.length; i++) { - print(productList[i].toMap()); + debugPrint(productList[i].toMap().toString()); } - print('---------------------------------------------------------------\n\n'); + debugPrint( + '---------------------------------------------------------------\n\n'); // EXAMPLE 4.2: GROUP BY with SCALAR OR AGGREGATE FUNCTIONS ex: SELECT COUNT(id) AS Count, MIN(price) AS minPrice, MAX(price) AS maxPrice, AVG(price) AS avgPrice FROM PRODUCTS GROUP BY name // /* count(),avg(),max(),min() when empty returns columnname as default, count('aliasname') is returns alias columnname */ @@ -594,24 +615,25 @@ Future samples4() async { .groupBy(ProductFields.name .toString() /*also you can use this .groupBy('name')*/) .toListObject(); - print( + debugPrint( 'EXAMPLE 4.2: GROUP BY WITH SCALAR OR AGGREGATE FUNCTIONS ex: SELECT name, COUNT(id) AS Count, MIN(price) AS minPrice, MAX(price) AS maxPrice, AVG(price) AS avgPrice,ProductFields.price.sum(\'sumPrice\') FROM PRODUCTS GROUP BY name \n-> Product().select(columnsToSelect: [ProductFields.name.toString(), ProductFields.id.count(\'Count\'), ProductFields.price.min(\'minPrice\'), ProductFields.price.max(\'maxPrice\'), ProductFields.price.avg(\'avgPrice\')).groupBy(ProductFields.name.toString()).toListObject()'); // PRINT RESULTS TO DEBUG CONSOLE - print('${objectList.length} matches found:'); + debugPrint('${objectList.length} matches found:'); for (int i = 0; i < objectList.length; i++) { - print(objectList[i].toString()); + debugPrint(objectList[i].toString()); } - print('---------------------------------------------------------------'); + debugPrint('---------------------------------------------------------------'); } Future samples5() async { // EXAMPLE 5.1: Update multiple records with query var result = await Product().select().id.greaterThan(10).update({'isActive': 0}); - print( + debugPrint( 'EXAMPLE 5.1: Update multiple records with query \n -> Product().select().id.greaterThan(10).update({\'isActive\': 0});'); - print(result.toString()); - print('---------------------------------------------------------------\n\n'); + debugPrint(result.toString()); + debugPrint( + '---------------------------------------------------------------\n\n'); // UPDATE imageUrl field by CategoryId await Product().select().categoryId.equals(1).update({ @@ -626,10 +648,11 @@ Future samples5() async { // EXAMPLE 5.2: Update multiple records with query result = await Product().select().id.lessThanOrEquals(10).update({'isActive': 1}); - print( + debugPrint( 'EXAMPLE 5.2: uUpdate multiple records with query \n -> Product().select().id.lessThanOrEquals(10).update({\'isActive\': 1});'); - print(result.toString()); - print('---------------------------------------------------------------\n\n'); + debugPrint(result.toString()); + debugPrint( + '---------------------------------------------------------------\n\n'); // EXAMPLE 5.3: select product by id and update final product2 = await Product().getById(15); @@ -638,12 +661,13 @@ Future samples5() async { if (product2 != null) { product2.description = '512GB SSD i7 (updated)'; await product2.save(); - print( + debugPrint( 'EXAMPLE 5.3: id=15 Product item updated: ${product2.toMap().toString()}'); } else { - print('EXAMPLE 5.3: id=15 => product not found'); + debugPrint('EXAMPLE 5.3: id=15 => product not found'); } - print('---------------------------------------------------------------\n\n'); + debugPrint( + '---------------------------------------------------------------\n\n'); // EXAMPLE 5.4: update some filtered products with saveAll method -> Product().saveAll(productList){}); var productList = await Product().select().price.lessThan(1000).toList(); @@ -654,22 +678,22 @@ Future samples5() async { } final results = await Product.saveAll(productList); productList = await Product().select().toList(); - print( + debugPrint( 'EXAMPLE 5.4: update some filtered products with saveAll method \n -> Product().saveAll(productList){});'); - print(' List result of saveAll method is following:'); + debugPrint(' List result of saveAll method is following:'); for (var result in results) { - print(result.toString()); + debugPrint(result.toString()); } - print('---------------------------------------------------------------'); + debugPrint('---------------------------------------------------------------'); - print( + debugPrint( 'EXAMPLE 5.4: listing saved products (set price=i) with saveAll method;'); for (int i = 0; i < productList.length; i++) { - print(productList[i].toMap()); + debugPrint(productList[i].toMap().toString()); } - print('---------------------------------------------------------------'); + debugPrint('---------------------------------------------------------------'); } Future samples6() async { @@ -678,18 +702,19 @@ Future samples6() async { /* Product().select().delete().then((result) { if (result.success) - print('${result.successMessage}'); + debugPrint('${result.successMessage}'); else - print('${result.errorMessage}'); + debugPrint('${result.errorMessage}'); }); */ // EXAMPLE 6.2: get product with query id and delete var result = await Product().select().id.equals(16).delete(); - print( + debugPrint( 'EXAMPLE 6.2: delete product by query filder \n -> Product().select().id.equals(16).delete();'); - print(result.toString()); - print('---------------------------------------------------------------\n\n'); + debugPrint(result.toString()); + debugPrint( + '---------------------------------------------------------------\n\n'); // EXAMPLE 6.3: Get product by id and then delete final product = await Product().getById(17); @@ -697,31 +722,32 @@ Future samples6() async { // delete product object if exist if (product != null) { result = await product.delete(); - print( + debugPrint( 'EXAMPLE 6.3: delete product if exist \n -> if (product != null) Product.delete();'); if (result.success) { - print('${result.successMessage}'); + debugPrint('${result.successMessage}'); } else { - print('${result.errorMessage}'); + debugPrint('${result.errorMessage}'); } - print( + debugPrint( '---------------------------------------------------------------\n\n'); } else { - print('id=15 => product not found'); - print( + debugPrint('id=15 => product not found'); + debugPrint( '---------------------------------------------------------------\n\n'); } // EXAMPLE 6.4: Delete many products by filter result = await Product().select().id.greaterThan(17).delete(); - print( + debugPrint( 'EXAMPLE 6.4: Delete many products by filter \n -> Product().select().id.greaterThan(17).delete()'); if (result.success) { - print('${result.successMessage}'); + debugPrint('${result.successMessage}'); } else { - print('${result.errorMessage}'); + debugPrint('${result.errorMessage}'); } - print('---------------------------------------------------------------\n\n'); + debugPrint( + '---------------------------------------------------------------\n\n'); /*/ EXAMPLE 6.5: Get product by id and then recover Product().getById(17, (product) { @@ -729,18 +755,18 @@ Future samples6() async { // delete product object if exist if (product != null) { product.delete().then((result) { - print( + debugPrint( 'EXAMPLE 6.5: recover product if exist \n -> if (product != null) Product.recover();'); if (result.success) - print('${result.successMessage}'); + debugPrint('${result.successMessage}'); else - print('${result.errorMessage}'); - print( + debugPrint('${result.errorMessage}'); + debugPrint( '---------------------------------------------------------------\n\n'); }); } else { - print('id=15 => product not found'); - print( + debugPrint('id=15 => product not found'); + debugPrint( '---------------------------------------------------------------\n\n'); } return; @@ -748,14 +774,15 @@ Future samples6() async { */ // EXAMPLE 6.6: Recover many products by filter result = await Product().select().id.greaterThan(17).recover(); - print( + debugPrint( 'EXAMPLE 6.6: Recover many products by filter \n -> Product().select().id.greaterThan(17).recover()'); if (result.success) { - print('${result.successMessage}'); + debugPrint('${result.successMessage}'); } else { - print('${result.errorMessage}'); + debugPrint('${result.errorMessage}'); } - print('---------------------------------------------------------------\n\n'); + debugPrint( + '---------------------------------------------------------------\n\n'); } Future samples7() async { @@ -763,24 +790,25 @@ Future samples7() async { final product = await Product().getById(3); if (product != null) { final category = await product.getCategory(); - print( + debugPrint( 'EXAMPLE 7.1: goto Category Object from Product \n-> Product.getCategory(); '); - print( + debugPrint( 'The category of \'${product.name}\' is: ${category == null ? 'null' : category.toMap()}'); } // EXAMPLE 7.2: list Products of Categories \n-> Product.category((_category) {}); final categoryList = await Category().select().toList(); for (var category in categoryList) { final productList = await category.getProducts()!.toList(); - print( + debugPrint( 'EXAMPLE 7.2.${category.id}: Products of \'${category.name}\' listing \n-> category.getProducts((productList) {}); '); // PRINT RESULTS TO DEBUG CONSOLE - print('${productList.length} matches found:'); + debugPrint('${productList.length} matches found:'); for (int i = 0; i < productList.length; i++) { - print(productList[i].toMap()); + debugPrint(productList[i].toMap().toString()); } - print('---------------------------------------------------------------'); + debugPrint( + '---------------------------------------------------------------'); return; } return; @@ -792,81 +820,85 @@ Future samples8() async { await Todo().upsertAll(todosList); todosList = await Todo().select().top(10).toList(); - print( + debugPrint( 'EXAMPLE 8.1: Fill List from web (JSON data) and upsertAll \n -> Todo.fromWeb((todosList) {}'); - print('${todosList.length.toString()} matches found\n'); + debugPrint('${todosList.length.toString()} matches found\n'); for (var todo in todosList) { - print(todo.toMap()); + debugPrint(todo.toMap().toString()); } - print( + debugPrint( '---------------------------------------------------------------\n\n'); } todosList = await Todo.fromWebUrl( Uri.parse('https://jsonplaceholder.typicode.com/todos')); if (todosList != null) { final results = await Todo().upsertAll(todosList); - print( + debugPrint( 'EXAMPLE 8.2: upsertAll result \n -> final results = await Todo().upsertAll(todosList);'); // print upsert Results - for (var res in results.commitResult!) { - res = res; // dummy line for analysis_options (unused_local_variable) - //print(res.toString()); // uncomment this line for print save results + if (results.commitResult != null) { + for (var res in results.commitResult!) { + res = res; // dummy line for analysis_options (unused_local_variable) + //debugPrint(res.toString()); // uncomment this line for print save results + } } } todosList = await Todo().select().top(10).toList(); - print( + debugPrint( 'EXAMPLE 8.2: Fill List from web with Url (JSON data) and upsertAll \n -> Todo.fromWebUrl(\'https://jsonplaceholder.typicode.com/todos\', (todosList) {}'); - print('${todosList.length.toString()} matches found\n'); + debugPrint('${todosList.length.toString()} matches found\n'); for (var todo in todosList) { - print(todo.toMap()); + debugPrint(todo.toMap().toString()); } - print('---------------------------------------------------------------\n\n'); + debugPrint( + '---------------------------------------------------------------\n\n'); } Future samples9() async { // EX.9.1 Execute custom SQL command on database - final sql_91 = 'UPDATE product set isActive=1 where isActive=1'; + const sql_91 = 'UPDATE product set isActive=1 where isActive=1'; final result_91 = await MyDbModel().execSQL(sql_91); - print( + debugPrint( 'EX.9.1 Execute custom SQL command on database\n -> final sql=\'$sql_91\';\n -> MyDbModel().execSQL(sql) \n -> print result = ${result_91.toString()}'); // EX.9.2 Execute custom SQL command List on database - final sqlList = [] - ..add('UPDATE product set isActive=1 where isActive=1') - ..add('UPDATE product set isActive=0 where isActive=0'); + final sqlList = [ + 'UPDATE product set isActive=1 where isActive=1', + 'UPDATE product set isActive=0 where isActive=0' + ]; final result_92 = await MyDbModel().execSQLList(sqlList); - print( + debugPrint( 'EX.9.2 Execute custom SQL command List on database\n -> final sqlList=List();\n -> MyDbModel().execSQLList(sqlList); \n -> print result = ${result_92.toString()}'); // EX.9.3 Execute custom SQL Query and get datatable -> returns List> - final sql_93 = 'SELECT name, price FROM product order by price desc LIMIT 5'; + const sql_93 = 'SELECT name, price FROM product order by price desc LIMIT 5'; final result_93 = await MyDbModel().execDataTable(sql_93); - print( + debugPrint( 'EX.9.3 Execute custom SQL Query and get datatable -> returns List> \n -> MyDbModel().execDataTable(\'$sql_93\');\n -> print result:'); for (var item in result_93) { - print(item.toString()); + debugPrint(item.toString()); } /// EX.9.4 Execute custom SQL Query and get first col of first row - final sql_94 = 'SELECT name FROM product order by price desc'; + const sql_94 = 'SELECT name FROM product order by price desc'; final result_94 = await MyDbModel().execScalar(sql_94); - print( + debugPrint( 'EX.9.4 Execute custom SQL Query and get first col of first row -> returns dynamic \n -> MyDbModel().execScalar(\'$sql_94\');\n -> print result:'); - print(result_94.toString()); + debugPrint(result_94.toString()); } Future samples10() async { - print('EXAMPLE 10 SqfEntity Sequence SAMPLES-----------'); + debugPrint('EXAMPLE 10 SqfEntity Sequence SAMPLES-----------'); final int currentVal = await IdentitySequence().currentVal(); final int nextVal = await IdentitySequence().nextVal(); final int nextVal2 = await IdentitySequence().nextVal(); final int currentVal2 = await IdentitySequence().currentVal(); - print('Sample Code:\n'); - print(''' + debugPrint('Sample Code:\n'); + debugPrint(''' final currentVal= await IdentitySequence().currentVal(); result: currentVal = $currentVal final nextVal = await IdentitySequence().nextVal(); @@ -884,13 +916,13 @@ Future samples11() async { final product = await Product().select().toSingle(); final jsonString = product!.toJson(); - print( + debugPrint( 'EXAMPLE 11.1 single object to Json\n product jsonString is: $jsonString'); //EXAMPLE 11.2 object list with nested objects to Json final jsonStringWithChilds = await Category().select().toJsonWithChilds(); // all categories selected - print( + debugPrint( 'EXAMPLE 11.2 object list with nested objects to Json\n categories jsonStringWithChilds is: $jsonStringWithChilds'); } @@ -902,7 +934,7 @@ Future addSomeProducts() async { if (product == null) { await addProducts(); } else { - print( + debugPrint( 'There is already products in the database.. addProduct will not run'); } return; @@ -916,7 +948,7 @@ Future addCategories() async { await Category(name: 'Notebooks', isActive: true).save(ignoreBatch: false); await Category(name: 'Ultrabooks', isActive: true).save(); } else { - print( + debugPrint( 'There is already categories in the database.. addCategories will not run'); } } @@ -1038,7 +1070,7 @@ Future addProducts() async { price: 14000, categoryId: 2) .save(); - print('added 15 new products'); + debugPrint('added 15 new products'); // add a few dummy products for delete (id:from 16 to 20) await Product(name: 'Product 1').save(); @@ -1046,7 +1078,7 @@ Future addProducts() async { await Product(name: 'Product 3').save(); await Product(name: 'Product 4').save(); await Product(name: 'Product 5').save(); - print('added 5 dummy products'); + debugPrint('added 5 dummy products'); } return true; } @@ -1076,7 +1108,7 @@ void sampleModelConvert() { ]; final modelStr = SqfEntityConverter(model).createEntites(); - print(modelStr); + debugPrint(modelStr); } class MyDb extends SqfEntityModelBase {} diff --git a/sqfentity/example/model/model.dart b/sqfentity/example/model/model.dart index 79cc2f1..79cca3a 100644 --- a/sqfentity/example/model/model.dart +++ b/sqfentity/example/model/model.dart @@ -156,10 +156,10 @@ class TableProduct extends SqfEntityTableBase { defaultValue: DateTime.now(), isNotNull: true, minValue: DateTime.parse('2019-01-01'), - maxValue: DateTime.now().add(Duration(days: 30))), + maxValue: DateTime.now().add(const Duration(days: 30))), SqfEntityFieldBase('date', DbType.date, minValue: DateTime.parse('2015-01-01'), - maxValue: DateTime.now().add(Duration(days: 365))), + maxValue: DateTime.now().add(const Duration(days: 365))), SqfEntityFieldBase('dateCreated', DbType.datetime, defaultValue: DateTime.now(), minValue: DateTime.parse('1900-01-01')), ]; @@ -393,9 +393,9 @@ class Product extends TableBase { /// get Category By CategoryId Future getCategory( {bool loadParents = false, List? loadedFields}) async { - final _obj = await Category().getById(categoryId, + final obj = await Category().getById(categoryId, loadParents: loadParents, loadedFields: loadedFields); - return _obj; + return obj; } // END RELATIONSHIPS (Product) @@ -679,7 +679,6 @@ class Product extends TableBase { loadParents: loadParents /*, loadedFields: _loadedFields*/); } } // END RELATIONSHIPS PRELOAD - } else { obj = null; } @@ -1230,7 +1229,6 @@ class ProductFilterBuilder extends ConjunctionBase { loadParents: loadParents /*, loadedFields: _loadedFields*/); } } // END RELATIONSHIPS PRELOAD - } else { obj = null; } @@ -1351,10 +1349,10 @@ class ProductFilterBuilder extends ConjunctionBase { final data = await productsFuture; final int count = data.length; - final List> items = []..add(DropdownMenuItem( + final List> items = [DropdownMenuItem( value: Product(), - child: Text('Select Product'), - )); + child: const Text('Select Product'), + )]; for (int i = 0; i < count; i++) { items.add( DropdownMenuItem( @@ -1380,10 +1378,10 @@ class ProductFilterBuilder extends ConjunctionBase { final data = await productsFuture; final int count = data.length; - final List> items = []..add(DropdownMenuItem( + final List> items = [const DropdownMenuItem( value: 0, child: Text('Select Product'), - )); + )]; for (int i = 0; i < count; i++) { items.add( DropdownMenuItem( @@ -1405,13 +1403,13 @@ class ProductFilterBuilder extends ConjunctionBase { /// List @override Map toListPrimaryKeySQL([bool buildParams = true]) { - final Map _retVal = {}; + final Map retVal = {}; if (buildParams) { buildParameters(); } - _retVal['sql'] = 'SELECT `id` FROM product WHERE ${qparams.whereString}'; - _retVal['args'] = qparams.whereArguments; - return _retVal; + retVal['sql'] = 'SELECT `id` FROM product WHERE ${qparams.whereString}'; + retVal['args'] = qparams.whereArguments; + return retVal; } /// This method returns Primary Key List. @@ -1822,7 +1820,6 @@ class Category extends TableBase { loadParents: false /*, loadedFields:_loadedFields*/); } } // END RELATIONSHIPS PRELOAD CHILD - } else { obj = null; } @@ -1973,7 +1970,7 @@ class Category extends TableBase { @override Future recover([bool recoverChilds = true]) { // not implemented because: - final msg = + const msg = 'set useSoftDeleting:true in the table definition of [Category] to use this feature'; throw UnimplementedError(msg); } @@ -2323,7 +2320,6 @@ class CategoryFilterBuilder extends ConjunctionBase { loadParents: false /*, loadedFields:_loadedFields*/); } } // END RELATIONSHIPS PRELOAD CHILD - } else { obj = null; } @@ -2444,10 +2440,10 @@ class CategoryFilterBuilder extends ConjunctionBase { final data = await categoriesFuture; final int count = data.length; - final List> items = []..add(DropdownMenuItem( + final List> items = [DropdownMenuItem( value: Category(), - child: Text('Select Category'), - )); + child: const Text('Select Category'), + )]; for (int i = 0; i < count; i++) { items.add( DropdownMenuItem( @@ -2473,10 +2469,10 @@ class CategoryFilterBuilder extends ConjunctionBase { final data = await categoriesFuture; final int count = data.length; - final List> items = []..add(DropdownMenuItem( + final List> items = [const DropdownMenuItem( value: 0, child: Text('Select Category'), - )); + )]; for (int i = 0; i < count; i++) { items.add( DropdownMenuItem( @@ -2498,13 +2494,13 @@ class CategoryFilterBuilder extends ConjunctionBase { /// List @override Map toListPrimaryKeySQL([bool buildParams = true]) { - final Map _retVal = {}; + final Map retVal = {}; if (buildParams) { buildParameters(); } - _retVal['sql'] = 'SELECT `id` FROM category WHERE ${qparams.whereString}'; - _retVal['args'] = qparams.whereArguments; - return _retVal; + retVal['sql'] = 'SELECT `id` FROM category WHERE ${qparams.whereString}'; + retVal['args'] = qparams.whereArguments; + return retVal; } /// This method returns Primary Key List. @@ -2969,7 +2965,7 @@ class Todo extends TableBase { @override Future recover([bool recoverChilds = true]) { // not implemented because: - final msg = + const msg = 'set useSoftDeleting:true in the table definition of [Todo] to use this feature'; throw UnimplementedError(msg); } @@ -3417,10 +3413,10 @@ class TodoFilterBuilder extends ConjunctionBase { final data = await todosFuture; final int count = data.length; - final List> items = []..add(DropdownMenuItem( + final List> items = [DropdownMenuItem( value: Todo(), - child: Text('Select Todo'), - )); + child: const Text('Select Todo'), + )]; for (int i = 0; i < count; i++) { items.add( DropdownMenuItem( @@ -3446,10 +3442,10 @@ class TodoFilterBuilder extends ConjunctionBase { final data = await todosFuture; final int count = data.length; - final List> items = []..add(DropdownMenuItem( + final List> items = [const DropdownMenuItem( value: 0, child: Text('Select Todo'), - )); + )]; for (int i = 0; i < count; i++) { items.add( DropdownMenuItem( @@ -3471,13 +3467,13 @@ class TodoFilterBuilder extends ConjunctionBase { /// List @override Map toListPrimaryKeySQL([bool buildParams = true]) { - final Map _retVal = {}; + final Map retVal = {}; if (buildParams) { buildParameters(); } - _retVal['sql'] = 'SELECT `id` FROM todos WHERE ${qparams.whereString}'; - _retVal['args'] = qparams.whereArguments; - return _retVal; + retVal['sql'] = 'SELECT `id` FROM todos WHERE ${qparams.whereString}'; + retVal['args'] = qparams.whereArguments; + return retVal; } /// This method returns Primary Key List. diff --git a/sqfentity/example/pubspec.lock b/sqfentity/example/pubspec.lock index 4616727..e774776 100644 --- a/sqfentity/example/pubspec.lock +++ b/sqfentity/example/pubspec.lock @@ -5,441 +5,519 @@ packages: dependency: transitive description: name: _fe_analyzer_shared - url: "https://pub.dartlang.org" + sha256: "0816708f5fbcacca324d811297153fe3c8e047beb5c6752e12292d2974c17045" + url: "https://pub.dev" source: hosted - version: "40.0.0" + version: "62.0.0" analyzer: dependency: transitive description: name: analyzer - url: "https://pub.dartlang.org" + sha256: "21862995c9932cd082f89d72ae5f5e2c110d1a0204ad06e4ebaee8307b76b834" + url: "https://pub.dev" source: hosted - version: "4.1.0" + version: "6.0.0" args: dependency: transitive description: name: args - url: "https://pub.dartlang.org" + sha256: eef6c46b622e0494a36c5a12d10d77fb4e855501a91c1b9ef9339326e58f0596 + url: "https://pub.dev" source: hosted - version: "2.3.0" + version: "2.4.2" async: dependency: transitive description: name: async - url: "https://pub.dartlang.org" + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" + url: "https://pub.dev" source: hosted - version: "2.8.2" + version: "2.11.0" boolean_selector: dependency: transitive description: name: boolean_selector - url: "https://pub.dartlang.org" + sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.1" build: dependency: transitive description: name: build - url: "https://pub.dartlang.org" + sha256: "80184af8b6cb3e5c1c4ec6d8544d27711700bc3e6d2efad04238c7b5290889f0" + url: "https://pub.dev" source: hosted - version: "2.3.0" + version: "2.4.1" build_config: dependency: transitive description: name: build_config - url: "https://pub.dartlang.org" + sha256: bf80fcfb46a29945b423bd9aad884590fb1dc69b330a4d4700cac476af1708d1 + url: "https://pub.dev" source: hosted - version: "1.0.0" + version: "1.1.1" build_daemon: dependency: transitive description: name: build_daemon - url: "https://pub.dartlang.org" + sha256: "5f02d73eb2ba16483e693f80bee4f088563a820e47d1027d4cdfe62b5bb43e65" + url: "https://pub.dev" source: hosted - version: "3.1.0" + version: "4.0.0" build_resolvers: dependency: transitive description: name: build_resolvers - url: "https://pub.dartlang.org" + sha256: "6c4dd11d05d056e76320b828a1db0fc01ccd376922526f8e9d6c796a5adbac20" + url: "https://pub.dev" source: hosted - version: "2.0.9" + version: "2.2.1" build_runner: dependency: "direct dev" description: name: build_runner - url: "https://pub.dartlang.org" + sha256: "10c6bcdbf9d049a0b666702cf1cee4ddfdc38f02a19d35ae392863b47519848b" + url: "https://pub.dev" source: hosted - version: "2.1.11" + version: "2.4.6" build_runner_core: dependency: transitive description: name: build_runner_core - url: "https://pub.dartlang.org" + sha256: "6d6ee4276b1c5f34f21fdf39425202712d2be82019983d52f351c94aafbc2c41" + url: "https://pub.dev" source: hosted - version: "7.2.2" + version: "7.2.10" build_verify: dependency: "direct dev" description: name: build_verify - url: "https://pub.dartlang.org" + sha256: b136572561f0b70c2e60c2a1afe5104027af533de65508e5f421922a28d8a74a + url: "https://pub.dev" source: hosted version: "2.0.0" built_collection: dependency: transitive description: name: built_collection - url: "https://pub.dartlang.org" + sha256: "376e3dd27b51ea877c28d525560790aee2e6fbb5f20e2f85d5081027d94e2100" + url: "https://pub.dev" source: hosted version: "5.1.1" built_value: dependency: transitive description: name: built_value - url: "https://pub.dartlang.org" + sha256: "598a2a682e2a7a90f08ba39c0aaa9374c5112340f0a2e275f61b59389543d166" + url: "https://pub.dev" source: hosted - version: "8.1.2" + version: "8.6.1" characters: dependency: transitive description: name: characters - url: "https://pub.dartlang.org" + sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" + url: "https://pub.dev" source: hosted - version: "1.2.0" - charcode: - dependency: transitive - description: - name: charcode - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.1" + version: "1.3.0" checked_yaml: dependency: transitive description: name: checked_yaml - url: "https://pub.dartlang.org" + sha256: feb6bed21949061731a7a75fc5d2aa727cf160b91af9a3e464c5e3a32e28b5ff + url: "https://pub.dev" source: hosted - version: "2.0.1" + version: "2.0.3" clock: dependency: transitive description: name: clock - url: "https://pub.dartlang.org" + sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf + url: "https://pub.dev" source: hosted version: "1.1.1" code_builder: dependency: transitive description: name: code_builder - url: "https://pub.dartlang.org" + sha256: "4ad01d6e56db961d29661561effde45e519939fdaeb46c351275b182eac70189" + url: "https://pub.dev" source: hosted - version: "4.1.0" + version: "4.5.0" collection: dependency: transitive description: name: collection - url: "https://pub.dartlang.org" + sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c" + url: "https://pub.dev" source: hosted - version: "1.16.0" + version: "1.17.1" convert: dependency: transitive description: name: convert - url: "https://pub.dartlang.org" + sha256: "0f08b14755d163f6e2134cb58222dd25ea2a2ee8a195e53983d57c075324d592" + url: "https://pub.dev" source: hosted - version: "3.0.1" + version: "3.1.1" coverage: dependency: transitive description: name: coverage - url: "https://pub.dartlang.org" + sha256: "2fb815080e44a09b85e0f2ca8a820b15053982b2e714b59267719e8a9ff17097" + url: "https://pub.dev" source: hosted - version: "1.0.3" + version: "1.6.3" crypto: dependency: transitive description: name: crypto - url: "https://pub.dartlang.org" + sha256: ff625774173754681d66daaf4a448684fb04b78f902da9cb3d308c19cc5e8bab + url: "https://pub.dev" source: hosted - version: "3.0.1" + version: "3.0.3" cupertino_icons: dependency: "direct dev" description: name: cupertino_icons - url: "https://pub.dartlang.org" + sha256: e35129dc44c9118cee2a5603506d823bab99c68393879edb440e0090d07586be + url: "https://pub.dev" + source: hosted + version: "1.0.5" + dart_internal: + dependency: transitive + description: + name: dart_internal + sha256: dae3976f383beddcfcd07ad5291a422df2c8c0a8a03c52cda63ac7b4f26e0f4e + url: "https://pub.dev" source: hosted - version: "0.1.3" + version: "0.2.8" dart_style: dependency: transitive description: name: dart_style - url: "https://pub.dartlang.org" + sha256: "1efa911ca7086affd35f463ca2fc1799584fb6aa89883cf0af8e3664d6a02d55" + url: "https://pub.dev" source: hosted - version: "2.2.3" + version: "2.3.2" ffi: dependency: transitive description: name: ffi - url: "https://pub.dartlang.org" + sha256: ed5337a5660c506388a9f012be0288fb38b49020ce2b45fe1f8b8323fe429f99 + url: "https://pub.dev" source: hosted - version: "1.1.2" + version: "2.0.2" file: dependency: transitive description: name: file - url: "https://pub.dartlang.org" + sha256: "5fc22d7c25582e38ad9a8515372cd9a93834027aacf1801cf01164dac0ffa08c" + url: "https://pub.dev" source: hosted - version: "6.1.2" + version: "7.0.0" fixnum: dependency: transitive description: name: fixnum - url: "https://pub.dartlang.org" + sha256: "25517a4deb0c03aa0f32fd12db525856438902d9c16536311e76cdc57b31d7d1" + url: "https://pub.dev" source: hosted - version: "1.0.0" + version: "1.1.0" flutter: dependency: "direct main" description: flutter source: sdk version: "0.0.0" + flutter_lints: + dependency: "direct dev" + description: + name: flutter_lints + sha256: "2118df84ef0c3ca93f96123a616ae8540879991b8b57af2f81b76a7ada49b2a4" + url: "https://pub.dev" + source: hosted + version: "2.0.2" frontend_server_client: dependency: transitive description: name: frontend_server_client - url: "https://pub.dartlang.org" + sha256: "408e3ca148b31c20282ad6f37ebfa6f4bdc8fede5b74bc2f08d9d92b55db3612" + url: "https://pub.dev" source: hosted - version: "2.1.2" + version: "3.2.0" glob: dependency: transitive description: name: glob - url: "https://pub.dartlang.org" + sha256: "0e7014b3b7d4dac1ca4d6114f82bf1782ee86745b9b42a92c9289c23d8a0ab63" + url: "https://pub.dev" source: hosted - version: "2.0.2" + version: "2.1.2" graphs: dependency: transitive description: name: graphs - url: "https://pub.dartlang.org" + sha256: aedc5a15e78fc65a6e23bcd927f24c64dd995062bcd1ca6eda65a3cff92a4d19 + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.3.1" http: dependency: "direct main" description: name: http - url: "https://pub.dartlang.org" + sha256: "5895291c13fa8a3bd82e76d5627f69e0d85ca6a30dcac95c4ea19a5d555879c2" + url: "https://pub.dev" source: hosted - version: "0.13.4" + version: "0.13.6" http_multi_server: dependency: transitive description: name: http_multi_server - url: "https://pub.dartlang.org" + sha256: "97486f20f9c2f7be8f514851703d0119c3596d14ea63227af6f7a481ef2b2f8b" + url: "https://pub.dev" source: hosted - version: "3.0.1" + version: "3.2.1" http_parser: dependency: transitive description: name: http_parser - url: "https://pub.dartlang.org" + sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" + url: "https://pub.dev" source: hosted - version: "4.0.0" + version: "4.0.2" intl: dependency: transitive description: name: intl - url: "https://pub.dartlang.org" + sha256: "3bc132a9dbce73a7e4a21a17d06e1878839ffbf975568bc875c60537824b0c4d" + url: "https://pub.dev" source: hosted - version: "0.17.0" + version: "0.18.1" io: dependency: transitive description: name: io - url: "https://pub.dartlang.org" + sha256: "2ec25704aba361659e10e3e5f5d672068d332fc8ac516421d483a11e5cbd061e" + url: "https://pub.dev" source: hosted - version: "1.0.3" + version: "1.0.4" js: dependency: transitive description: name: js - url: "https://pub.dartlang.org" + sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 + url: "https://pub.dev" source: hosted - version: "0.6.3" + version: "0.6.7" json_annotation: dependency: transitive description: name: json_annotation - url: "https://pub.dartlang.org" + sha256: b10a7b2ff83d83c777edba3c6a0f97045ddadd56c944e1a23a3fdf43a1bf4467 + url: "https://pub.dev" source: hosted - version: "4.1.0" + version: "4.8.1" + lints: + dependency: transitive + description: + name: lints + sha256: "0a217c6c989d21039f1498c3ed9f3ed71b354e69873f13a8dfc3c9fe76f1b452" + url: "https://pub.dev" + source: hosted + version: "2.1.1" logging: dependency: transitive description: name: logging - url: "https://pub.dartlang.org" + sha256: "623a88c9594aa774443aa3eb2d41807a48486b5613e67599fb4c41c0ad47c340" + url: "https://pub.dev" source: hosted - version: "1.0.2" + version: "1.2.0" matcher: dependency: transitive description: name: matcher - url: "https://pub.dartlang.org" + sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e" + url: "https://pub.dev" source: hosted - version: "0.12.11" + version: "0.12.16" material_color_utilities: dependency: transitive description: name: material_color_utilities - url: "https://pub.dartlang.org" + sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 + url: "https://pub.dev" source: hosted - version: "0.1.4" + version: "0.2.0" meta: dependency: transitive description: name: meta - url: "https://pub.dartlang.org" + sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" + url: "https://pub.dev" source: hosted - version: "1.7.0" + version: "1.9.1" mime: dependency: transitive description: name: mime - url: "https://pub.dartlang.org" + sha256: e4ff8e8564c03f255408decd16e7899da1733852a9110a58fe6d1b817684a63e + url: "https://pub.dev" source: hosted - version: "1.0.0" + version: "1.0.4" node_preamble: dependency: transitive description: name: node_preamble - url: "https://pub.dartlang.org" + sha256: "6e7eac89047ab8a8d26cf16127b5ed26de65209847630400f9aefd7cd5c730db" + url: "https://pub.dev" source: hosted - version: "2.0.1" + version: "2.0.2" package_config: dependency: transitive description: name: package_config - url: "https://pub.dartlang.org" + sha256: "1c5b77ccc91e4823a5af61ee74e6b972db1ef98c2ff5a18d3161c982a55448bd" + url: "https://pub.dev" source: hosted - version: "2.0.2" + version: "2.1.0" path: dependency: transitive description: name: path - url: "https://pub.dartlang.org" + sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" + url: "https://pub.dev" source: hosted - version: "1.8.2" + version: "1.8.3" path_provider: dependency: "direct main" description: name: path_provider - url: "https://pub.dartlang.org" + sha256: "3087813781ab814e4157b172f1a11c46be20179fcc9bea043e0fba36bc0acaa2" + url: "https://pub.dev" source: hosted - version: "2.0.5" - path_provider_linux: + version: "2.0.15" + path_provider_android: dependency: transitive description: - name: path_provider_linux - url: "https://pub.dartlang.org" + name: path_provider_android + sha256: "2cec049d282c7f13c594b4a73976b0b4f2d7a1838a6dd5aaf7bd9719196bee86" + url: "https://pub.dev" source: hosted - version: "2.1.0" - path_provider_macos: + version: "2.0.27" + path_provider_foundation: dependency: transitive description: - name: path_provider_macos - url: "https://pub.dartlang.org" + name: path_provider_foundation + sha256: "916731ccbdce44d545414dd9961f26ba5fbaa74bcbb55237d8e65a623a8c7297" + url: "https://pub.dev" source: hosted - version: "2.0.2" + version: "2.2.4" + path_provider_linux: + dependency: transitive + description: + name: path_provider_linux + sha256: ffbb8cc9ed2c9ec0e4b7a541e56fd79b138e8f47d2fb86815f15358a349b3b57 + url: "https://pub.dev" + source: hosted + version: "2.1.11" path_provider_platform_interface: dependency: transitive description: name: path_provider_platform_interface - url: "https://pub.dartlang.org" + sha256: "57585299a729335f1298b43245842678cb9f43a6310351b18fb577d6e33165ec" + url: "https://pub.dev" source: hosted - version: "2.0.1" + version: "2.0.6" path_provider_windows: dependency: transitive description: name: path_provider_windows - url: "https://pub.dartlang.org" + sha256: "1cb68ba4cd3a795033de62ba1b7b4564dace301f952de6bfb3cd91b202b6ee96" + url: "https://pub.dev" source: hosted - version: "2.0.3" + version: "2.1.7" pedantic: dependency: "direct main" description: name: pedantic - url: "https://pub.dartlang.org" + sha256: "67fc27ed9639506c856c840ccce7594d0bdcd91bc8d53d6e52359449a1d50602" + url: "https://pub.dev" source: hosted version: "1.11.1" platform: dependency: transitive description: name: platform - url: "https://pub.dartlang.org" + sha256: "4a451831508d7d6ca779f7ac6e212b4023dd5a7d08a27a63da33756410e32b76" + url: "https://pub.dev" source: hosted - version: "3.0.2" + version: "3.1.0" plugin_platform_interface: dependency: transitive description: name: plugin_platform_interface - url: "https://pub.dartlang.org" + sha256: "6a2128648c854906c53fa8e33986fc0247a1116122f9534dd20e3ab9e16a32bc" + url: "https://pub.dev" source: hosted - version: "2.0.2" + version: "2.1.4" pool: dependency: transitive description: name: pool - url: "https://pub.dartlang.org" + sha256: "20fe868b6314b322ea036ba325e6fc0711a22948856475e2c2b6306e8ab39c2a" + url: "https://pub.dev" source: hosted - version: "1.5.0" - process: - dependency: transitive - description: - name: process - url: "https://pub.dartlang.org" - source: hosted - version: "4.2.3" + version: "1.5.1" pub_semver: dependency: transitive description: name: pub_semver - url: "https://pub.dartlang.org" + sha256: "40d3ab1bbd474c4c2328c91e3a7df8c6dd629b79ece4c4bd04bee496a224fb0c" + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.4" pubspec_parse: dependency: transitive description: name: pubspec_parse - url: "https://pub.dartlang.org" + sha256: c63b2876e58e194e4b0828fcb080ad0e06d051cb607a6be51a9e084f47cb9367 + url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.2.3" shelf: dependency: transitive description: name: shelf - url: "https://pub.dartlang.org" + sha256: ad29c505aee705f41a4d8963641f91ac4cee3c8fad5947e033390a7bd8180fa4 + url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "1.4.1" shelf_packages_handler: dependency: transitive description: name: shelf_packages_handler - url: "https://pub.dartlang.org" + sha256: "89f967eca29607c933ba9571d838be31d67f53f6e4ee15147d5dc2934fee1b1e" + url: "https://pub.dev" source: hosted - version: "3.0.0" + version: "3.0.2" shelf_static: dependency: transitive description: name: shelf_static - url: "https://pub.dartlang.org" + sha256: a41d3f53c4adf0f57480578c1d61d90342cd617de7fc8077b1304643c2d85c1e + url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.1.2" shelf_web_socket: dependency: transitive description: name: shelf_web_socket - url: "https://pub.dartlang.org" + sha256: "9ca081be41c60190ebcb4766b2486a7d50261db7bd0f5d9615f2d653637a84c1" + url: "https://pub.dev" source: hosted - version: "1.0.1" + version: "1.0.4" sky_engine: dependency: transitive description: flutter @@ -449,205 +527,232 @@ packages: dependency: transitive description: name: source_gen - url: "https://pub.dartlang.org" + sha256: fc0da689e5302edb6177fdd964efcb7f58912f43c28c2047a808f5bfff643d16 + url: "https://pub.dev" source: hosted - version: "1.2.2" + version: "1.4.0" source_map_stack_trace: dependency: transitive description: name: source_map_stack_trace - url: "https://pub.dartlang.org" + sha256: "84cf769ad83aa6bb61e0aa5a18e53aea683395f196a6f39c4c881fb90ed4f7ae" + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.1" source_maps: dependency: transitive description: name: source_maps - url: "https://pub.dartlang.org" + sha256: "708b3f6b97248e5781f493b765c3337db11c5d2c81c3094f10904bfa8004c703" + url: "https://pub.dev" source: hosted - version: "0.10.10" + version: "0.10.12" source_span: dependency: transitive description: name: source_span - url: "https://pub.dartlang.org" + sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" + url: "https://pub.dev" source: hosted - version: "1.8.1" + version: "1.10.0" sqfentity: dependency: "direct main" description: path: ".." relative: true source: path - version: "2.3.0+4" + version: "2.4.0" sqfentity_gen: dependency: "direct main" description: path: "../../sqfentity_gen" relative: true source: path - version: "2.3.0+4" + version: "2.4.0" sqflite_common: dependency: transitive description: name: sqflite_common - url: "https://pub.dartlang.org" + sha256: "8f7603f3f8f126740bc55c4ca2d1027aab4b74a1267a3e31ce51fe40e3b65b8f" + url: "https://pub.dev" source: hosted - version: "2.2.1+1" + version: "2.4.5+1" sqflite_common_ffi: dependency: transitive description: name: sqflite_common_ffi - url: "https://pub.dartlang.org" + sha256: f86de82d37403af491b21920a696b19f01465b596f545d1acd4d29a0a72418ad + url: "https://pub.dev" source: hosted - version: "2.1.1+1" + version: "2.2.5" sqflite_sqlcipher: dependency: transitive description: name: sqflite_sqlcipher - url: "https://pub.dartlang.org" + sha256: bcc02bfcc549895338558ba9acd0e3c54f808ef7095bb1294973751c521c9ba2 + url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.1.1+1" sqlite3: dependency: transitive description: name: sqlite3 - url: "https://pub.dartlang.org" + sha256: f7511ddd6a2dda8ded9d849f8a925bb6020e0faa59db2443debc18d484e59401 + url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "2.0.0" stack_trace: dependency: transitive description: name: stack_trace - url: "https://pub.dartlang.org" + sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" + url: "https://pub.dev" source: hosted - version: "1.10.0" + version: "1.11.1" stream_channel: dependency: transitive description: name: stream_channel - url: "https://pub.dartlang.org" + sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.2" stream_transform: dependency: transitive description: name: stream_transform - url: "https://pub.dartlang.org" + sha256: "14a00e794c7c11aa145a170587321aedce29769c08d7f58b1d141da75e3b1c6f" + url: "https://pub.dev" source: hosted - version: "2.0.0" + version: "2.1.0" string_scanner: dependency: transitive description: name: string_scanner - url: "https://pub.dartlang.org" + sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.2.0" synchronized: dependency: transitive description: name: synchronized - url: "https://pub.dartlang.org" + sha256: "5fcbd27688af6082f5abd611af56ee575342c30e87541d0245f7ff99faa02c60" + url: "https://pub.dev" source: hosted - version: "3.0.0+2" + version: "3.1.0" term_glyph: dependency: transitive description: name: term_glyph - url: "https://pub.dartlang.org" + sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "1.2.1" test: dependency: transitive description: name: test - url: "https://pub.dartlang.org" + sha256: "67ec5684c7a19b2aba91d2831f3d305a6fd8e1504629c5818f8d64478abf4f38" + url: "https://pub.dev" source: hosted - version: "1.21.3" + version: "1.24.4" test_api: dependency: transitive description: name: test_api - url: "https://pub.dartlang.org" + sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b" + url: "https://pub.dev" source: hosted - version: "0.4.11" + version: "0.6.1" test_core: dependency: transitive description: name: test_core - url: "https://pub.dartlang.org" + sha256: "6b753899253c38ca0523bb0eccff3934ec83d011705dae717c61ecf209e333c9" + url: "https://pub.dev" source: hosted - version: "0.4.15" + version: "0.5.4" timing: dependency: transitive description: name: timing - url: "https://pub.dartlang.org" + sha256: "70a3b636575d4163c477e6de42f247a23b315ae20e86442bebe32d3cabf61c32" + url: "https://pub.dev" source: hosted - version: "1.0.0" + version: "1.0.1" typed_data: dependency: transitive description: name: typed_data - url: "https://pub.dartlang.org" + sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c + url: "https://pub.dev" source: hosted - version: "1.3.0" + version: "1.3.2" vector_math: dependency: transitive description: name: vector_math - url: "https://pub.dartlang.org" + sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + url: "https://pub.dev" source: hosted - version: "2.1.2" + version: "2.1.4" vm_service: dependency: transitive description: name: vm_service - url: "https://pub.dartlang.org" + sha256: b8c67f5fa3897b122cf60fe9ff314f7b0ef71eab25c5f8b771480bc338f48823 + url: "https://pub.dev" source: hosted - version: "7.3.0" + version: "11.7.2" watcher: dependency: transitive description: name: watcher - url: "https://pub.dartlang.org" + sha256: "3d2ad6751b3c16cf07c7fca317a1413b3f26530319181b37e3b9039b84fc01d8" + url: "https://pub.dev" source: hosted - version: "1.0.1" + version: "1.1.0" web_socket_channel: dependency: transitive description: name: web_socket_channel - url: "https://pub.dartlang.org" + sha256: d88238e5eac9a42bb43ca4e721edba3c08c6354d4a53063afaa568516217621b + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.4.0" webkit_inspection_protocol: dependency: transitive description: name: webkit_inspection_protocol - url: "https://pub.dartlang.org" + sha256: "67d3a8b6c79e1987d19d848b0892e582dbb0c66c57cc1fef58a177dd2aa2823d" + url: "https://pub.dev" source: hosted - version: "1.0.0" + version: "1.2.0" win32: dependency: transitive description: name: win32 - url: "https://pub.dartlang.org" + sha256: dfdf0136e0aa7a1b474ea133e67cb0154a0acd2599c4f3ada3b49d38d38793ee + url: "https://pub.dev" source: hosted - version: "2.2.9" + version: "5.0.5" xdg_directories: dependency: transitive description: name: xdg_directories - url: "https://pub.dartlang.org" + sha256: e0b1147eec179d3911f1f19b59206448f78195ca1d20514134e10641b7d7fbff + url: "https://pub.dev" source: hosted - version: "0.2.0" + version: "1.0.1" yaml: dependency: transitive description: name: yaml - url: "https://pub.dartlang.org" + sha256: "75769501ea3489fca56601ff33454fe45507ea3bfb014161abc3b43ae25989d5" + url: "https://pub.dev" source: hosted - version: "3.1.0" + version: "3.1.2" sdks: - dart: ">=2.16.0 <3.0.0" - flutter: ">=2.5.0" + dart: ">=3.0.0 <3.2.0" + flutter: ">=3.3.0" diff --git a/sqfentity/example/pubspec.yaml b/sqfentity/example/pubspec.yaml index bd27fcb..8afed78 100644 --- a/sqfentity/example/pubspec.yaml +++ b/sqfentity/example/pubspec.yaml @@ -19,8 +19,8 @@ environment: dependencies: flutter: sdk: flutter - sqfentity: ^1.3.3+5 - sqfentity_gen: ^1.3.2+6 + sqfentity: ^1.4.0 + sqfentity_gen: ^1.4.0 path_provider: any pedantic: ^1.11.1 http: ^0.13.3 @@ -37,12 +37,13 @@ dependency_overrides: dev_dependencies: build_runner: ^2.1.1 build_verify: ^2.0.0 + flutter_lints: ^2.0.2 # build_runner: ^1.6.5 # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. - cupertino_icons: ^0.1.2 + cupertino_icons: diff --git a/sqfentity/example/windows/.gitignore b/sqfentity/example/windows/.gitignore new file mode 100644 index 0000000..d492d0d --- /dev/null +++ b/sqfentity/example/windows/.gitignore @@ -0,0 +1,17 @@ +flutter/ephemeral/ + +# Visual Studio user-specific files. +*.suo +*.user +*.userosscache +*.sln.docstates + +# Visual Studio build-related files. +x64/ +x86/ + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!*.[Cc]ache/ diff --git a/sqfentity/example/windows/CMakeLists.txt b/sqfentity/example/windows/CMakeLists.txt new file mode 100644 index 0000000..1378672 --- /dev/null +++ b/sqfentity/example/windows/CMakeLists.txt @@ -0,0 +1,102 @@ +# Project-level configuration. +cmake_minimum_required(VERSION 3.14) +project(example LANGUAGES CXX) + +# The name of the executable created for the application. Change this to change +# the on-disk name of your application. +set(BINARY_NAME "example") + +# Explicitly opt in to modern CMake behaviors to avoid warnings with recent +# versions of CMake. +cmake_policy(SET CMP0063 NEW) + +# Define build configuration option. +get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) +if(IS_MULTICONFIG) + set(CMAKE_CONFIGURATION_TYPES "Debug;Profile;Release" + CACHE STRING "" FORCE) +else() + if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) + set(CMAKE_BUILD_TYPE "Debug" CACHE + STRING "Flutter build mode" FORCE) + set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS + "Debug" "Profile" "Release") + endif() +endif() +# Define settings for the Profile build mode. +set(CMAKE_EXE_LINKER_FLAGS_PROFILE "${CMAKE_EXE_LINKER_FLAGS_RELEASE}") +set(CMAKE_SHARED_LINKER_FLAGS_PROFILE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE}") +set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_RELEASE}") +set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_RELEASE}") + +# Use Unicode for all projects. +add_definitions(-DUNICODE -D_UNICODE) + +# Compilation settings that should be applied to most targets. +# +# Be cautious about adding new options here, as plugins use this function by +# default. In most cases, you should add new options to specific targets instead +# of modifying this function. +function(APPLY_STANDARD_SETTINGS TARGET) + target_compile_features(${TARGET} PUBLIC cxx_std_17) + target_compile_options(${TARGET} PRIVATE /W4 /WX /wd"4100") + target_compile_options(${TARGET} PRIVATE /EHsc) + target_compile_definitions(${TARGET} PRIVATE "_HAS_EXCEPTIONS=0") + target_compile_definitions(${TARGET} PRIVATE "$<$:_DEBUG>") +endfunction() + +# Flutter library and tool build rules. +set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") +add_subdirectory(${FLUTTER_MANAGED_DIR}) + +# Application build; see runner/CMakeLists.txt. +add_subdirectory("runner") + + +# Generated plugin build rules, which manage building the plugins and adding +# them to the application. +include(flutter/generated_plugins.cmake) + + +# === Installation === +# Support files are copied into place next to the executable, so that it can +# run in place. This is done instead of making a separate bundle (as on Linux) +# so that building and running from within Visual Studio will work. +set(BUILD_BUNDLE_DIR "$") +# Make the "install" step default, as it's required to run. +set(CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD 1) +if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) + set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) +endif() + +set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") +set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}") + +install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" + COMPONENT Runtime) + +install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" + COMPONENT Runtime) + +install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) + +if(PLUGIN_BUNDLED_LIBRARIES) + install(FILES "${PLUGIN_BUNDLED_LIBRARIES}" + DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) +endif() + +# Fully re-copy the assets directory on each build to avoid having stale files +# from a previous install. +set(FLUTTER_ASSET_DIR_NAME "flutter_assets") +install(CODE " + file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") + " COMPONENT Runtime) +install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" + DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) + +# Install the AOT library on non-Debug builds only. +install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" + CONFIGURATIONS Profile;Release + COMPONENT Runtime) diff --git a/sqfentity/example/windows/flutter/CMakeLists.txt b/sqfentity/example/windows/flutter/CMakeLists.txt new file mode 100644 index 0000000..930d207 --- /dev/null +++ b/sqfentity/example/windows/flutter/CMakeLists.txt @@ -0,0 +1,104 @@ +# This file controls Flutter-level build steps. It should not be edited. +cmake_minimum_required(VERSION 3.14) + +set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") + +# Configuration provided via flutter tool. +include(${EPHEMERAL_DIR}/generated_config.cmake) + +# TODO: Move the rest of this into files in ephemeral. See +# https://github.com/flutter/flutter/issues/57146. +set(WRAPPER_ROOT "${EPHEMERAL_DIR}/cpp_client_wrapper") + +# === Flutter Library === +set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/flutter_windows.dll") + +# Published to parent scope for install step. +set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) +set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) +set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) +set(AOT_LIBRARY "${PROJECT_DIR}/build/windows/app.so" PARENT_SCOPE) + +list(APPEND FLUTTER_LIBRARY_HEADERS + "flutter_export.h" + "flutter_windows.h" + "flutter_messenger.h" + "flutter_plugin_registrar.h" + "flutter_texture_registrar.h" +) +list(TRANSFORM FLUTTER_LIBRARY_HEADERS PREPEND "${EPHEMERAL_DIR}/") +add_library(flutter INTERFACE) +target_include_directories(flutter INTERFACE + "${EPHEMERAL_DIR}" +) +target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}.lib") +add_dependencies(flutter flutter_assemble) + +# === Wrapper === +list(APPEND CPP_WRAPPER_SOURCES_CORE + "core_implementations.cc" + "standard_codec.cc" +) +list(TRANSFORM CPP_WRAPPER_SOURCES_CORE PREPEND "${WRAPPER_ROOT}/") +list(APPEND CPP_WRAPPER_SOURCES_PLUGIN + "plugin_registrar.cc" +) +list(TRANSFORM CPP_WRAPPER_SOURCES_PLUGIN PREPEND "${WRAPPER_ROOT}/") +list(APPEND CPP_WRAPPER_SOURCES_APP + "flutter_engine.cc" + "flutter_view_controller.cc" +) +list(TRANSFORM CPP_WRAPPER_SOURCES_APP PREPEND "${WRAPPER_ROOT}/") + +# Wrapper sources needed for a plugin. +add_library(flutter_wrapper_plugin STATIC + ${CPP_WRAPPER_SOURCES_CORE} + ${CPP_WRAPPER_SOURCES_PLUGIN} +) +apply_standard_settings(flutter_wrapper_plugin) +set_target_properties(flutter_wrapper_plugin PROPERTIES + POSITION_INDEPENDENT_CODE ON) +set_target_properties(flutter_wrapper_plugin PROPERTIES + CXX_VISIBILITY_PRESET hidden) +target_link_libraries(flutter_wrapper_plugin PUBLIC flutter) +target_include_directories(flutter_wrapper_plugin PUBLIC + "${WRAPPER_ROOT}/include" +) +add_dependencies(flutter_wrapper_plugin flutter_assemble) + +# Wrapper sources needed for the runner. +add_library(flutter_wrapper_app STATIC + ${CPP_WRAPPER_SOURCES_CORE} + ${CPP_WRAPPER_SOURCES_APP} +) +apply_standard_settings(flutter_wrapper_app) +target_link_libraries(flutter_wrapper_app PUBLIC flutter) +target_include_directories(flutter_wrapper_app PUBLIC + "${WRAPPER_ROOT}/include" +) +add_dependencies(flutter_wrapper_app flutter_assemble) + +# === Flutter tool backend === +# _phony_ is a non-existent file to force this command to run every time, +# since currently there's no way to get a full input/output list from the +# flutter tool. +set(PHONY_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/_phony_") +set_source_files_properties("${PHONY_OUTPUT}" PROPERTIES SYMBOLIC TRUE) +add_custom_command( + OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} + ${CPP_WRAPPER_SOURCES_CORE} ${CPP_WRAPPER_SOURCES_PLUGIN} + ${CPP_WRAPPER_SOURCES_APP} + ${PHONY_OUTPUT} + COMMAND ${CMAKE_COMMAND} -E env + ${FLUTTER_TOOL_ENVIRONMENT} + "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.bat" + windows-x64 $ + VERBATIM +) +add_custom_target(flutter_assemble DEPENDS + "${FLUTTER_LIBRARY}" + ${FLUTTER_LIBRARY_HEADERS} + ${CPP_WRAPPER_SOURCES_CORE} + ${CPP_WRAPPER_SOURCES_PLUGIN} + ${CPP_WRAPPER_SOURCES_APP} +) diff --git a/sqfentity/example/windows/flutter/generated_plugin_registrant.cc b/sqfentity/example/windows/flutter/generated_plugin_registrant.cc new file mode 100644 index 0000000..8b6d468 --- /dev/null +++ b/sqfentity/example/windows/flutter/generated_plugin_registrant.cc @@ -0,0 +1,11 @@ +// +// Generated file. Do not edit. +// + +// clang-format off + +#include "generated_plugin_registrant.h" + + +void RegisterPlugins(flutter::PluginRegistry* registry) { +} diff --git a/sqfentity/example/windows/flutter/generated_plugin_registrant.h b/sqfentity/example/windows/flutter/generated_plugin_registrant.h new file mode 100644 index 0000000..dc139d8 --- /dev/null +++ b/sqfentity/example/windows/flutter/generated_plugin_registrant.h @@ -0,0 +1,15 @@ +// +// Generated file. Do not edit. +// + +// clang-format off + +#ifndef GENERATED_PLUGIN_REGISTRANT_ +#define GENERATED_PLUGIN_REGISTRANT_ + +#include + +// Registers Flutter plugins. +void RegisterPlugins(flutter::PluginRegistry* registry); + +#endif // GENERATED_PLUGIN_REGISTRANT_ diff --git a/sqfentity/example/windows/flutter/generated_plugins.cmake b/sqfentity/example/windows/flutter/generated_plugins.cmake new file mode 100644 index 0000000..b93c4c3 --- /dev/null +++ b/sqfentity/example/windows/flutter/generated_plugins.cmake @@ -0,0 +1,23 @@ +# +# Generated file, do not edit. +# + +list(APPEND FLUTTER_PLUGIN_LIST +) + +list(APPEND FLUTTER_FFI_PLUGIN_LIST +) + +set(PLUGIN_BUNDLED_LIBRARIES) + +foreach(plugin ${FLUTTER_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin}) + target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) + list(APPEND PLUGIN_BUNDLED_LIBRARIES $) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) +endforeach(plugin) + +foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin}) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) +endforeach(ffi_plugin) diff --git a/sqfentity/example/windows/runner/CMakeLists.txt b/sqfentity/example/windows/runner/CMakeLists.txt new file mode 100644 index 0000000..394917c --- /dev/null +++ b/sqfentity/example/windows/runner/CMakeLists.txt @@ -0,0 +1,40 @@ +cmake_minimum_required(VERSION 3.14) +project(runner LANGUAGES CXX) + +# Define the application target. To change its name, change BINARY_NAME in the +# top-level CMakeLists.txt, not the value here, or `flutter run` will no longer +# work. +# +# Any new source files that you add to the application should be added here. +add_executable(${BINARY_NAME} WIN32 + "flutter_window.cpp" + "main.cpp" + "utils.cpp" + "win32_window.cpp" + "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" + "Runner.rc" + "runner.exe.manifest" +) + +# Apply the standard set of build settings. This can be removed for applications +# that need different build settings. +apply_standard_settings(${BINARY_NAME}) + +# Add preprocessor definitions for the build version. +target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION=\"${FLUTTER_VERSION}\"") +target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MAJOR=${FLUTTER_VERSION_MAJOR}") +target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MINOR=${FLUTTER_VERSION_MINOR}") +target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_PATCH=${FLUTTER_VERSION_PATCH}") +target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_BUILD=${FLUTTER_VERSION_BUILD}") + +# Disable Windows macros that collide with C++ standard library functions. +target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX") + +# Add dependency libraries and include directories. Add any application-specific +# dependencies here. +target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app) +target_link_libraries(${BINARY_NAME} PRIVATE "dwmapi.lib") +target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") + +# Run the Flutter tool portions of the build. This must not be removed. +add_dependencies(${BINARY_NAME} flutter_assemble) diff --git a/sqfentity/example/windows/runner/Runner.rc b/sqfentity/example/windows/runner/Runner.rc new file mode 100644 index 0000000..aecaa2b --- /dev/null +++ b/sqfentity/example/windows/runner/Runner.rc @@ -0,0 +1,121 @@ +// Microsoft Visual C++ generated resource script. +// +#pragma code_page(65001) +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "winres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (United States) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE +BEGIN + "#include ""winres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDI_APP_ICON ICON "resources\\app_icon.ico" + + +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +#if defined(FLUTTER_VERSION_MAJOR) && defined(FLUTTER_VERSION_MINOR) && defined(FLUTTER_VERSION_PATCH) && defined(FLUTTER_VERSION_BUILD) +#define VERSION_AS_NUMBER FLUTTER_VERSION_MAJOR,FLUTTER_VERSION_MINOR,FLUTTER_VERSION_PATCH,FLUTTER_VERSION_BUILD +#else +#define VERSION_AS_NUMBER 1,0,0,0 +#endif + +#if defined(FLUTTER_VERSION) +#define VERSION_AS_STRING FLUTTER_VERSION +#else +#define VERSION_AS_STRING "1.0.0" +#endif + +VS_VERSION_INFO VERSIONINFO + FILEVERSION VERSION_AS_NUMBER + PRODUCTVERSION VERSION_AS_NUMBER + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +#ifdef _DEBUG + FILEFLAGS VS_FF_DEBUG +#else + FILEFLAGS 0x0L +#endif + FILEOS VOS__WINDOWS32 + FILETYPE VFT_APP + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904e4" + BEGIN + VALUE "CompanyName", "com.example" "\0" + VALUE "FileDescription", "example" "\0" + VALUE "FileVersion", VERSION_AS_STRING "\0" + VALUE "InternalName", "example" "\0" + VALUE "LegalCopyright", "Copyright (C) 2023 com.example. All rights reserved." "\0" + VALUE "OriginalFilename", "example.exe" "\0" + VALUE "ProductName", "example" "\0" + VALUE "ProductVersion", VERSION_AS_STRING "\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1252 + END +END + +#endif // English (United States) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED diff --git a/sqfentity/example/windows/runner/flutter_window.cpp b/sqfentity/example/windows/runner/flutter_window.cpp new file mode 100644 index 0000000..b25e363 --- /dev/null +++ b/sqfentity/example/windows/runner/flutter_window.cpp @@ -0,0 +1,66 @@ +#include "flutter_window.h" + +#include + +#include "flutter/generated_plugin_registrant.h" + +FlutterWindow::FlutterWindow(const flutter::DartProject& project) + : project_(project) {} + +FlutterWindow::~FlutterWindow() {} + +bool FlutterWindow::OnCreate() { + if (!Win32Window::OnCreate()) { + return false; + } + + RECT frame = GetClientArea(); + + // The size here must match the window dimensions to avoid unnecessary surface + // creation / destruction in the startup path. + flutter_controller_ = std::make_unique( + frame.right - frame.left, frame.bottom - frame.top, project_); + // Ensure that basic setup of the controller was successful. + if (!flutter_controller_->engine() || !flutter_controller_->view()) { + return false; + } + RegisterPlugins(flutter_controller_->engine()); + SetChildContent(flutter_controller_->view()->GetNativeWindow()); + + flutter_controller_->engine()->SetNextFrameCallback([&]() { + this->Show(); + }); + + return true; +} + +void FlutterWindow::OnDestroy() { + if (flutter_controller_) { + flutter_controller_ = nullptr; + } + + Win32Window::OnDestroy(); +} + +LRESULT +FlutterWindow::MessageHandler(HWND hwnd, UINT const message, + WPARAM const wparam, + LPARAM const lparam) noexcept { + // Give Flutter, including plugins, an opportunity to handle window messages. + if (flutter_controller_) { + std::optional result = + flutter_controller_->HandleTopLevelWindowProc(hwnd, message, wparam, + lparam); + if (result) { + return *result; + } + } + + switch (message) { + case WM_FONTCHANGE: + flutter_controller_->engine()->ReloadSystemFonts(); + break; + } + + return Win32Window::MessageHandler(hwnd, message, wparam, lparam); +} diff --git a/sqfentity/example/windows/runner/flutter_window.h b/sqfentity/example/windows/runner/flutter_window.h new file mode 100644 index 0000000..6da0652 --- /dev/null +++ b/sqfentity/example/windows/runner/flutter_window.h @@ -0,0 +1,33 @@ +#ifndef RUNNER_FLUTTER_WINDOW_H_ +#define RUNNER_FLUTTER_WINDOW_H_ + +#include +#include + +#include + +#include "win32_window.h" + +// A window that does nothing but host a Flutter view. +class FlutterWindow : public Win32Window { + public: + // Creates a new FlutterWindow hosting a Flutter view running |project|. + explicit FlutterWindow(const flutter::DartProject& project); + virtual ~FlutterWindow(); + + protected: + // Win32Window: + bool OnCreate() override; + void OnDestroy() override; + LRESULT MessageHandler(HWND window, UINT const message, WPARAM const wparam, + LPARAM const lparam) noexcept override; + + private: + // The project to run. + flutter::DartProject project_; + + // The Flutter instance hosted by this window. + std::unique_ptr flutter_controller_; +}; + +#endif // RUNNER_FLUTTER_WINDOW_H_ diff --git a/sqfentity/example/windows/runner/main.cpp b/sqfentity/example/windows/runner/main.cpp new file mode 100644 index 0000000..a61bf80 --- /dev/null +++ b/sqfentity/example/windows/runner/main.cpp @@ -0,0 +1,43 @@ +#include +#include +#include + +#include "flutter_window.h" +#include "utils.h" + +int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev, + _In_ wchar_t *command_line, _In_ int show_command) { + // Attach to console when present (e.g., 'flutter run') or create a + // new console when running with a debugger. + if (!::AttachConsole(ATTACH_PARENT_PROCESS) && ::IsDebuggerPresent()) { + CreateAndAttachConsole(); + } + + // Initialize COM, so that it is available for use in the library and/or + // plugins. + ::CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED); + + flutter::DartProject project(L"data"); + + std::vector command_line_arguments = + GetCommandLineArguments(); + + project.set_dart_entrypoint_arguments(std::move(command_line_arguments)); + + FlutterWindow window(project); + Win32Window::Point origin(10, 10); + Win32Window::Size size(1280, 720); + if (!window.Create(L"example", origin, size)) { + return EXIT_FAILURE; + } + window.SetQuitOnClose(true); + + ::MSG msg; + while (::GetMessage(&msg, nullptr, 0, 0)) { + ::TranslateMessage(&msg); + ::DispatchMessage(&msg); + } + + ::CoUninitialize(); + return EXIT_SUCCESS; +} diff --git a/sqfentity/example/windows/runner/resource.h b/sqfentity/example/windows/runner/resource.h new file mode 100644 index 0000000..66a65d1 --- /dev/null +++ b/sqfentity/example/windows/runner/resource.h @@ -0,0 +1,16 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by Runner.rc +// +#define IDI_APP_ICON 101 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 102 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1001 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/sqfentity/example/windows/runner/resources/app_icon.ico b/sqfentity/example/windows/runner/resources/app_icon.ico new file mode 100644 index 0000000..c04e20c Binary files /dev/null and b/sqfentity/example/windows/runner/resources/app_icon.ico differ diff --git a/sqfentity/example/windows/runner/runner.exe.manifest b/sqfentity/example/windows/runner/runner.exe.manifest new file mode 100644 index 0000000..a42ea76 --- /dev/null +++ b/sqfentity/example/windows/runner/runner.exe.manifest @@ -0,0 +1,20 @@ + + + + + PerMonitorV2 + + + + + + + + + + + + + + + diff --git a/sqfentity/example/windows/runner/utils.cpp b/sqfentity/example/windows/runner/utils.cpp new file mode 100644 index 0000000..b2b0873 --- /dev/null +++ b/sqfentity/example/windows/runner/utils.cpp @@ -0,0 +1,65 @@ +#include "utils.h" + +#include +#include +#include +#include + +#include + +void CreateAndAttachConsole() { + if (::AllocConsole()) { + FILE *unused; + if (freopen_s(&unused, "CONOUT$", "w", stdout)) { + _dup2(_fileno(stdout), 1); + } + if (freopen_s(&unused, "CONOUT$", "w", stderr)) { + _dup2(_fileno(stdout), 2); + } + std::ios::sync_with_stdio(); + FlutterDesktopResyncOutputStreams(); + } +} + +std::vector GetCommandLineArguments() { + // Convert the UTF-16 command line arguments to UTF-8 for the Engine to use. + int argc; + wchar_t** argv = ::CommandLineToArgvW(::GetCommandLineW(), &argc); + if (argv == nullptr) { + return std::vector(); + } + + std::vector command_line_arguments; + + // Skip the first argument as it's the binary name. + for (int i = 1; i < argc; i++) { + command_line_arguments.push_back(Utf8FromUtf16(argv[i])); + } + + ::LocalFree(argv); + + return command_line_arguments; +} + +std::string Utf8FromUtf16(const wchar_t* utf16_string) { + if (utf16_string == nullptr) { + return std::string(); + } + int target_length = ::WideCharToMultiByte( + CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, + -1, nullptr, 0, nullptr, nullptr) + -1; // remove the trailing null character + int input_length = (int)wcslen(utf16_string); + std::string utf8_string; + if (target_length <= 0 || target_length > utf8_string.max_size()) { + return utf8_string; + } + utf8_string.resize(target_length); + int converted_length = ::WideCharToMultiByte( + CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, + input_length, utf8_string.data(), target_length, nullptr, nullptr); + if (converted_length == 0) { + return std::string(); + } + return utf8_string; +} diff --git a/sqfentity/example/windows/runner/utils.h b/sqfentity/example/windows/runner/utils.h new file mode 100644 index 0000000..3879d54 --- /dev/null +++ b/sqfentity/example/windows/runner/utils.h @@ -0,0 +1,19 @@ +#ifndef RUNNER_UTILS_H_ +#define RUNNER_UTILS_H_ + +#include +#include + +// Creates a console for the process, and redirects stdout and stderr to +// it for both the runner and the Flutter library. +void CreateAndAttachConsole(); + +// Takes a null-terminated wchar_t* encoded in UTF-16 and returns a std::string +// encoded in UTF-8. Returns an empty std::string on failure. +std::string Utf8FromUtf16(const wchar_t* utf16_string); + +// Gets the command line arguments passed in as a std::vector, +// encoded in UTF-8. Returns an empty std::vector on failure. +std::vector GetCommandLineArguments(); + +#endif // RUNNER_UTILS_H_ diff --git a/sqfentity/example/windows/runner/win32_window.cpp b/sqfentity/example/windows/runner/win32_window.cpp new file mode 100644 index 0000000..60608d0 --- /dev/null +++ b/sqfentity/example/windows/runner/win32_window.cpp @@ -0,0 +1,288 @@ +#include "win32_window.h" + +#include +#include + +#include "resource.h" + +namespace { + +/// Window attribute that enables dark mode window decorations. +/// +/// Redefined in case the developer's machine has a Windows SDK older than +/// version 10.0.22000.0. +/// See: https://docs.microsoft.com/windows/win32/api/dwmapi/ne-dwmapi-dwmwindowattribute +#ifndef DWMWA_USE_IMMERSIVE_DARK_MODE +#define DWMWA_USE_IMMERSIVE_DARK_MODE 20 +#endif + +constexpr const wchar_t kWindowClassName[] = L"FLUTTER_RUNNER_WIN32_WINDOW"; + +/// Registry key for app theme preference. +/// +/// A value of 0 indicates apps should use dark mode. A non-zero or missing +/// value indicates apps should use light mode. +constexpr const wchar_t kGetPreferredBrightnessRegKey[] = + L"Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize"; +constexpr const wchar_t kGetPreferredBrightnessRegValue[] = L"AppsUseLightTheme"; + +// The number of Win32Window objects that currently exist. +static int g_active_window_count = 0; + +using EnableNonClientDpiScaling = BOOL __stdcall(HWND hwnd); + +// Scale helper to convert logical scaler values to physical using passed in +// scale factor +int Scale(int source, double scale_factor) { + return static_cast(source * scale_factor); +} + +// Dynamically loads the |EnableNonClientDpiScaling| from the User32 module. +// This API is only needed for PerMonitor V1 awareness mode. +void EnableFullDpiSupportIfAvailable(HWND hwnd) { + HMODULE user32_module = LoadLibraryA("User32.dll"); + if (!user32_module) { + return; + } + auto enable_non_client_dpi_scaling = + reinterpret_cast( + GetProcAddress(user32_module, "EnableNonClientDpiScaling")); + if (enable_non_client_dpi_scaling != nullptr) { + enable_non_client_dpi_scaling(hwnd); + } + FreeLibrary(user32_module); +} + +} // namespace + +// Manages the Win32Window's window class registration. +class WindowClassRegistrar { + public: + ~WindowClassRegistrar() = default; + + // Returns the singleton registrar instance. + static WindowClassRegistrar* GetInstance() { + if (!instance_) { + instance_ = new WindowClassRegistrar(); + } + return instance_; + } + + // Returns the name of the window class, registering the class if it hasn't + // previously been registered. + const wchar_t* GetWindowClass(); + + // Unregisters the window class. Should only be called if there are no + // instances of the window. + void UnregisterWindowClass(); + + private: + WindowClassRegistrar() = default; + + static WindowClassRegistrar* instance_; + + bool class_registered_ = false; +}; + +WindowClassRegistrar* WindowClassRegistrar::instance_ = nullptr; + +const wchar_t* WindowClassRegistrar::GetWindowClass() { + if (!class_registered_) { + WNDCLASS window_class{}; + window_class.hCursor = LoadCursor(nullptr, IDC_ARROW); + window_class.lpszClassName = kWindowClassName; + window_class.style = CS_HREDRAW | CS_VREDRAW; + window_class.cbClsExtra = 0; + window_class.cbWndExtra = 0; + window_class.hInstance = GetModuleHandle(nullptr); + window_class.hIcon = + LoadIcon(window_class.hInstance, MAKEINTRESOURCE(IDI_APP_ICON)); + window_class.hbrBackground = 0; + window_class.lpszMenuName = nullptr; + window_class.lpfnWndProc = Win32Window::WndProc; + RegisterClass(&window_class); + class_registered_ = true; + } + return kWindowClassName; +} + +void WindowClassRegistrar::UnregisterWindowClass() { + UnregisterClass(kWindowClassName, nullptr); + class_registered_ = false; +} + +Win32Window::Win32Window() { + ++g_active_window_count; +} + +Win32Window::~Win32Window() { + --g_active_window_count; + Destroy(); +} + +bool Win32Window::Create(const std::wstring& title, + const Point& origin, + const Size& size) { + Destroy(); + + const wchar_t* window_class = + WindowClassRegistrar::GetInstance()->GetWindowClass(); + + const POINT target_point = {static_cast(origin.x), + static_cast(origin.y)}; + HMONITOR monitor = MonitorFromPoint(target_point, MONITOR_DEFAULTTONEAREST); + UINT dpi = FlutterDesktopGetDpiForMonitor(monitor); + double scale_factor = dpi / 96.0; + + HWND window = CreateWindow( + window_class, title.c_str(), WS_OVERLAPPEDWINDOW, + Scale(origin.x, scale_factor), Scale(origin.y, scale_factor), + Scale(size.width, scale_factor), Scale(size.height, scale_factor), + nullptr, nullptr, GetModuleHandle(nullptr), this); + + if (!window) { + return false; + } + + UpdateTheme(window); + + return OnCreate(); +} + +bool Win32Window::Show() { + return ShowWindow(window_handle_, SW_SHOWNORMAL); +} + +// static +LRESULT CALLBACK Win32Window::WndProc(HWND const window, + UINT const message, + WPARAM const wparam, + LPARAM const lparam) noexcept { + if (message == WM_NCCREATE) { + auto window_struct = reinterpret_cast(lparam); + SetWindowLongPtr(window, GWLP_USERDATA, + reinterpret_cast(window_struct->lpCreateParams)); + + auto that = static_cast(window_struct->lpCreateParams); + EnableFullDpiSupportIfAvailable(window); + that->window_handle_ = window; + } else if (Win32Window* that = GetThisFromHandle(window)) { + return that->MessageHandler(window, message, wparam, lparam); + } + + return DefWindowProc(window, message, wparam, lparam); +} + +LRESULT +Win32Window::MessageHandler(HWND hwnd, + UINT const message, + WPARAM const wparam, + LPARAM const lparam) noexcept { + switch (message) { + case WM_DESTROY: + window_handle_ = nullptr; + Destroy(); + if (quit_on_close_) { + PostQuitMessage(0); + } + return 0; + + case WM_DPICHANGED: { + auto newRectSize = reinterpret_cast(lparam); + LONG newWidth = newRectSize->right - newRectSize->left; + LONG newHeight = newRectSize->bottom - newRectSize->top; + + SetWindowPos(hwnd, nullptr, newRectSize->left, newRectSize->top, newWidth, + newHeight, SWP_NOZORDER | SWP_NOACTIVATE); + + return 0; + } + case WM_SIZE: { + RECT rect = GetClientArea(); + if (child_content_ != nullptr) { + // Size and position the child window. + MoveWindow(child_content_, rect.left, rect.top, rect.right - rect.left, + rect.bottom - rect.top, TRUE); + } + return 0; + } + + case WM_ACTIVATE: + if (child_content_ != nullptr) { + SetFocus(child_content_); + } + return 0; + + case WM_DWMCOLORIZATIONCOLORCHANGED: + UpdateTheme(hwnd); + return 0; + } + + return DefWindowProc(window_handle_, message, wparam, lparam); +} + +void Win32Window::Destroy() { + OnDestroy(); + + if (window_handle_) { + DestroyWindow(window_handle_); + window_handle_ = nullptr; + } + if (g_active_window_count == 0) { + WindowClassRegistrar::GetInstance()->UnregisterWindowClass(); + } +} + +Win32Window* Win32Window::GetThisFromHandle(HWND const window) noexcept { + return reinterpret_cast( + GetWindowLongPtr(window, GWLP_USERDATA)); +} + +void Win32Window::SetChildContent(HWND content) { + child_content_ = content; + SetParent(content, window_handle_); + RECT frame = GetClientArea(); + + MoveWindow(content, frame.left, frame.top, frame.right - frame.left, + frame.bottom - frame.top, true); + + SetFocus(child_content_); +} + +RECT Win32Window::GetClientArea() { + RECT frame; + GetClientRect(window_handle_, &frame); + return frame; +} + +HWND Win32Window::GetHandle() { + return window_handle_; +} + +void Win32Window::SetQuitOnClose(bool quit_on_close) { + quit_on_close_ = quit_on_close; +} + +bool Win32Window::OnCreate() { + // No-op; provided for subclasses. + return true; +} + +void Win32Window::OnDestroy() { + // No-op; provided for subclasses. +} + +void Win32Window::UpdateTheme(HWND const window) { + DWORD light_mode; + DWORD light_mode_size = sizeof(light_mode); + LSTATUS result = RegGetValue(HKEY_CURRENT_USER, kGetPreferredBrightnessRegKey, + kGetPreferredBrightnessRegValue, + RRF_RT_REG_DWORD, nullptr, &light_mode, + &light_mode_size); + + if (result == ERROR_SUCCESS) { + BOOL enable_dark_mode = light_mode == 0; + DwmSetWindowAttribute(window, DWMWA_USE_IMMERSIVE_DARK_MODE, + &enable_dark_mode, sizeof(enable_dark_mode)); + } +} diff --git a/sqfentity/example/windows/runner/win32_window.h b/sqfentity/example/windows/runner/win32_window.h new file mode 100644 index 0000000..e901dde --- /dev/null +++ b/sqfentity/example/windows/runner/win32_window.h @@ -0,0 +1,102 @@ +#ifndef RUNNER_WIN32_WINDOW_H_ +#define RUNNER_WIN32_WINDOW_H_ + +#include + +#include +#include +#include + +// A class abstraction for a high DPI-aware Win32 Window. Intended to be +// inherited from by classes that wish to specialize with custom +// rendering and input handling +class Win32Window { + public: + struct Point { + unsigned int x; + unsigned int y; + Point(unsigned int x, unsigned int y) : x(x), y(y) {} + }; + + struct Size { + unsigned int width; + unsigned int height; + Size(unsigned int width, unsigned int height) + : width(width), height(height) {} + }; + + Win32Window(); + virtual ~Win32Window(); + + // Creates a win32 window with |title| that is positioned and sized using + // |origin| and |size|. New windows are created on the default monitor. Window + // sizes are specified to the OS in physical pixels, hence to ensure a + // consistent size this function will scale the inputted width and height as + // as appropriate for the default monitor. The window is invisible until + // |Show| is called. Returns true if the window was created successfully. + bool Create(const std::wstring& title, const Point& origin, const Size& size); + + // Show the current window. Returns true if the window was successfully shown. + bool Show(); + + // Release OS resources associated with window. + void Destroy(); + + // Inserts |content| into the window tree. + void SetChildContent(HWND content); + + // Returns the backing Window handle to enable clients to set icon and other + // window properties. Returns nullptr if the window has been destroyed. + HWND GetHandle(); + + // If true, closing this window will quit the application. + void SetQuitOnClose(bool quit_on_close); + + // Return a RECT representing the bounds of the current client area. + RECT GetClientArea(); + + protected: + // Processes and route salient window messages for mouse handling, + // size change and DPI. Delegates handling of these to member overloads that + // inheriting classes can handle. + virtual LRESULT MessageHandler(HWND window, + UINT const message, + WPARAM const wparam, + LPARAM const lparam) noexcept; + + // Called when CreateAndShow is called, allowing subclass window-related + // setup. Subclasses should return false if setup fails. + virtual bool OnCreate(); + + // Called when Destroy is called. + virtual void OnDestroy(); + + private: + friend class WindowClassRegistrar; + + // OS callback called by message pump. Handles the WM_NCCREATE message which + // is passed when the non-client area is being created and enables automatic + // non-client DPI scaling so that the non-client area automatically + // responds to changes in DPI. All other messages are handled by + // MessageHandler. + static LRESULT CALLBACK WndProc(HWND const window, + UINT const message, + WPARAM const wparam, + LPARAM const lparam) noexcept; + + // Retrieves a class instance pointer for |window| + static Win32Window* GetThisFromHandle(HWND const window) noexcept; + + // Update the window frame's theme to match the system theme. + static void UpdateTheme(HWND const window); + + bool quit_on_close_ = false; + + // window handle for top level window. + HWND window_handle_ = nullptr; + + // window handle for hosted content. + HWND child_content_ = nullptr; +}; + +#endif // RUNNER_WIN32_WINDOW_H_ diff --git a/sqfentity/lib/main.dart b/sqfentity/lib/main.dart new file mode 100644 index 0000000..dda5554 --- /dev/null +++ b/sqfentity/lib/main.dart @@ -0,0 +1,125 @@ +import 'package:flutter/material.dart'; + +void main() { + runApp(const MyApp()); +} + +class MyApp extends StatelessWidget { + const MyApp({super.key}); + + // This widget is the root of your application. + @override + Widget build(BuildContext context) { + return MaterialApp( + title: 'Flutter Demo', + theme: ThemeData( + // This is the theme of your application. + // + // TRY THIS: Try running your application with "flutter run". You'll see + // the application has a blue toolbar. Then, without quitting the app, + // try changing the seedColor in the colorScheme below to Colors.green + // and then invoke "hot reload" (save your changes or press the "hot + // reload" button in a Flutter-supported IDE, or press "r" if you used + // the command line to start the app). + // + // Notice that the counter didn't reset back to zero; the application + // state is not lost during the reload. To reset the state, use hot + // restart instead. + // + // This works for code too, not just values: Most code changes can be + // tested with just a hot reload. + colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple), + useMaterial3: true, + ), + home: const MyHomePage(title: 'Flutter Demo Home Page'), + ); + } +} + +class MyHomePage extends StatefulWidget { + const MyHomePage({super.key, required this.title}); + + // This widget is the home page of your application. It is stateful, meaning + // that it has a State object (defined below) that contains fields that affect + // how it looks. + + // This class is the configuration for the state. It holds the values (in this + // case the title) provided by the parent (in this case the App widget) and + // used by the build method of the State. Fields in a Widget subclass are + // always marked "final". + + final String title; + + @override + State createState() => _MyHomePageState(); +} + +class _MyHomePageState extends State { + int _counter = 0; + + void _incrementCounter() { + setState(() { + // This call to setState tells the Flutter framework that something has + // changed in this State, which causes it to rerun the build method below + // so that the display can reflect the updated values. If we changed + // _counter without calling setState(), then the build method would not be + // called again, and so nothing would appear to happen. + _counter++; + }); + } + + @override + Widget build(BuildContext context) { + // This method is rerun every time setState is called, for instance as done + // by the _incrementCounter method above. + // + // The Flutter framework has been optimized to make rerunning build methods + // fast, so that you can just rebuild anything that needs updating rather + // than having to individually change instances of widgets. + return Scaffold( + appBar: AppBar( + // TRY THIS: Try changing the color here to a specific color (to + // Colors.amber, perhaps?) and trigger a hot reload to see the AppBar + // change color while the other colors stay the same. + backgroundColor: Theme.of(context).colorScheme.inversePrimary, + // Here we take the value from the MyHomePage object that was created by + // the App.build method, and use it to set our appbar title. + title: Text(widget.title), + ), + body: Center( + // Center is a layout widget. It takes a single child and positions it + // in the middle of the parent. + child: Column( + // Column is also a layout widget. It takes a list of children and + // arranges them vertically. By default, it sizes itself to fit its + // children horizontally, and tries to be as tall as its parent. + // + // Column has various properties to control how it sizes itself and + // how it positions its children. Here we use mainAxisAlignment to + // center the children vertically; the main axis here is the vertical + // axis because Columns are vertical (the cross axis would be + // horizontal). + // + // TRY THIS: Invoke "debug painting" (choose the "Toggle Debug Paint" + // action in the IDE, or press "p" in the console), to see the + // wireframe for each widget. + mainAxisAlignment: MainAxisAlignment.center, + children: [ + const Text( + 'You have pushed the button this many times:', + ), + Text( + '$_counter', + style: Theme.of(context).textTheme.headlineMedium, + ), + ], + ), + ), + floatingActionButton: FloatingActionButton( + onPressed: _incrementCounter, + tooltip: 'Increment', + child: const Icon(Icons.add), + ), // This trailing comma makes auto-formatting nicer for build methods. + ); + } +} diff --git a/sqfentity/lib/sqfentity.dart b/sqfentity/lib/sqfentity.dart index 15d1f98..c394571 100644 --- a/sqfentity/lib/sqfentity.dart +++ b/sqfentity/lib/sqfentity.dart @@ -381,6 +381,7 @@ class SqfEntityProvider extends SqfEntityModelBase { } } catch (e) { print(e.toString()); + rethrow; } return result; } @@ -408,6 +409,7 @@ class SqfEntityProvider extends SqfEntityModelBase { result.errorMessage = e.toString(); print('SQFENTITY ERROR while run execSQLList:'); print(result.toString()); + rethrow; } openedBatch[_dbModel!.databaseName!] = null; } else { diff --git a/sqfentity/lib/sqfentity_connection.dart b/sqfentity/lib/sqfentity_connection.dart index 1adf314..a13e41c 100644 --- a/sqfentity/lib/sqfentity_connection.dart +++ b/sqfentity/lib/sqfentity_connection.dart @@ -28,12 +28,15 @@ import 'sqfentity_connection_base.dart'; // BEGIN DATABASE CONNECTION class SqfEntityConnectionMobile extends SqfEntityConnectionBase { - SqfEntityConnectionMobile(SqfEntityConnection? connection) : super(connection); + SqfEntityConnectionMobile(SqfEntityConnection? connection) + : super(connection); @override Future writeDatabase(ByteData data) async { - final List bytes = data.buffer.asUint8List(data.offsetInBytes, data.lengthInBytes); + final List bytes = + data.buffer.asUint8List(data.offsetInBytes, data.lengthInBytes); try { - final path = join(getFinalDatabasePath(await getDatabasesPath()), connection!.databaseName); + final path = join(getFinalDatabasePath(await getDatabasesPath()), + connection!.databaseName); if (File(path).existsSync()) { await databaseFactory.deleteDatabase(path); if (File('$path-wal').existsSync()) { @@ -53,20 +56,27 @@ class SqfEntityConnectionMobile extends SqfEntityConnectionBase { final lock = Lock(); Database? _db; await lock.synchronized(() async { - final path = join(getFinalDatabasePath(await getDatabasesPath()), connection!.databaseName); + final path = join(getFinalDatabasePath(await getDatabasesPath()), + connection!.databaseName); final file = File(path); // check if file exists if (!file.existsSync()) { // Copy from asset if MyDbModel.bundledDatabasePath is not empty - if (connection!.bundledDatabasePath != null && connection!.bundledDatabasePath != '' && connection!.bundledDatabasePath != 'null') { - final ByteData data = await rootBundle.load(connection!.bundledDatabasePath!); + if (connection!.bundledDatabasePath != null && + connection!.bundledDatabasePath != '' && + connection!.bundledDatabasePath != 'null') { + final ByteData data = + await rootBundle.load(connection!.bundledDatabasePath!); await writeDatabase(data); } } // uncomment line below if you want to use sqlchiper - _db = await openDatabase(path, version: connection!.dbVersion, onCreate: createDb, password: connection!.password); // SQLChipher + _db = await openDatabase(path, + version: connection!.dbVersion, + onCreate: createDb, + password: connection!.password); // SQLChipher // uncomment line below if you want to use sqflite // _db = await openDatabase(path, version: connection!.dbVersion, onCreate: createDb); // SQFLite @@ -78,8 +88,11 @@ class SqfEntityConnectionMobile extends SqfEntityConnectionBase { /// Creates db if not exist @override void createDb(Database db, int version) async { - await db.execute('Create table sqfentitytables (id integer primary key, tablename text, version int, properties text)'); - await db.execute('Create table sqfentitysequences (id text UNIQUE, value integer)'); - print('Your database ${connection!.databaseName} v:$version created successfully'); + await db.execute( + 'Create table sqfentitytables (id integer primary key, tablename text, version int, properties text)'); + await db.execute( + 'Create table sqfentitysequences (id text UNIQUE, value integer)'); + print( + 'Your database ${connection!.databaseName} v:$version created successfully'); } } diff --git a/sqfentity/lib/sqfentity_connection_ffi.dart b/sqfentity/lib/sqfentity_connection_ffi.dart index 9daaba8..88d96d8 100644 --- a/sqfentity/lib/sqfentity_connection_ffi.dart +++ b/sqfentity/lib/sqfentity_connection_ffi.dart @@ -21,7 +21,6 @@ import 'dart:io'; import 'package:flutter/services.dart'; import 'package:path/path.dart'; import 'package:sqfentity/sqfentity_connection_base.dart'; -import 'package:sqflite_common/sqlite_api.dart'; import 'package:sqflite_common_ffi/sqflite_ffi.dart'; import 'package:synchronized/synchronized.dart'; diff --git a/sqfentity/pubspec.lock b/sqfentity/pubspec.lock index 9593d3a..9942891 100644 --- a/sqfentity/pubspec.lock +++ b/sqfentity/pubspec.lock @@ -5,93 +5,114 @@ packages: dependency: transitive description: name: _fe_analyzer_shared - url: "https://pub.dartlang.org" + sha256: "0816708f5fbcacca324d811297153fe3c8e047beb5c6752e12292d2974c17045" + url: "https://pub.dev" source: hosted - version: "46.0.0" + version: "62.0.0" analyzer: dependency: transitive description: name: analyzer - url: "https://pub.dartlang.org" + sha256: "21862995c9932cd082f89d72ae5f5e2c110d1a0204ad06e4ebaee8307b76b834" + url: "https://pub.dev" source: hosted - version: "4.6.0" + version: "6.0.0" args: dependency: transitive description: name: args - url: "https://pub.dartlang.org" + sha256: eef6c46b622e0494a36c5a12d10d77fb4e855501a91c1b9ef9339326e58f0596 + url: "https://pub.dev" source: hosted - version: "2.3.1" + version: "2.4.2" async: dependency: transitive description: name: async - url: "https://pub.dartlang.org" + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" + url: "https://pub.dev" source: hosted - version: "2.9.0" + version: "2.11.0" build: dependency: transitive description: name: build - url: "https://pub.dartlang.org" + sha256: "80184af8b6cb3e5c1c4ec6d8544d27711700bc3e6d2efad04238c7b5290889f0" + url: "https://pub.dev" source: hosted - version: "2.3.0" + version: "2.4.1" characters: dependency: transitive description: name: characters - url: "https://pub.dartlang.org" + sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" + url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "1.3.0" clock: dependency: transitive description: name: clock - url: "https://pub.dartlang.org" + sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf + url: "https://pub.dev" source: hosted version: "1.1.1" collection: dependency: transitive description: name: collection - url: "https://pub.dartlang.org" + sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c" + url: "https://pub.dev" source: hosted - version: "1.16.0" + version: "1.17.1" convert: dependency: transitive description: name: convert - url: "https://pub.dartlang.org" + sha256: "0f08b14755d163f6e2134cb58222dd25ea2a2ee8a195e53983d57c075324d592" + url: "https://pub.dev" source: hosted - version: "3.0.2" + version: "3.1.1" crypto: dependency: transitive description: name: crypto - url: "https://pub.dartlang.org" + sha256: ff625774173754681d66daaf4a448684fb04b78f902da9cb3d308c19cc5e8bab + url: "https://pub.dev" + source: hosted + version: "3.0.3" + dart_internal: + dependency: transitive + description: + name: dart_internal + sha256: dae3976f383beddcfcd07ad5291a422df2c8c0a8a03c52cda63ac7b4f26e0f4e + url: "https://pub.dev" source: hosted - version: "3.0.2" + version: "0.2.8" dart_style: dependency: transitive description: name: dart_style - url: "https://pub.dartlang.org" + sha256: "1efa911ca7086affd35f463ca2fc1799584fb6aa89883cf0af8e3664d6a02d55" + url: "https://pub.dev" source: hosted - version: "2.2.3" + version: "2.3.2" ffi: dependency: transitive description: name: ffi - url: "https://pub.dartlang.org" + sha256: ed5337a5660c506388a9f012be0288fb38b49020ce2b45fe1f8b8323fe429f99 + url: "https://pub.dev" source: hosted - version: "2.0.1" + version: "2.0.2" file: dependency: transitive description: name: file - url: "https://pub.dartlang.org" + sha256: "5fc22d7c25582e38ad9a8515372cd9a93834027aacf1801cf01164dac0ffa08c" + url: "https://pub.dev" source: hosted - version: "6.1.2" + version: "7.0.0" flutter: dependency: "direct main" description: flutter @@ -101,65 +122,74 @@ packages: dependency: transitive description: name: glob - url: "https://pub.dartlang.org" + sha256: "0e7014b3b7d4dac1ca4d6114f82bf1782ee86745b9b42a92c9289c23d8a0ab63" + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.2" intl: dependency: transitive description: name: intl - url: "https://pub.dartlang.org" + sha256: "3bc132a9dbce73a7e4a21a17d06e1878839ffbf975568bc875c60537824b0c4d" + url: "https://pub.dev" source: hosted - version: "0.17.0" + version: "0.18.1" js: dependency: transitive description: name: js - url: "https://pub.dartlang.org" + sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 + url: "https://pub.dev" source: hosted - version: "0.6.4" + version: "0.6.7" logging: dependency: transitive description: name: logging - url: "https://pub.dartlang.org" + sha256: "623a88c9594aa774443aa3eb2d41807a48486b5613e67599fb4c41c0ad47c340" + url: "https://pub.dev" source: hosted - version: "1.0.2" + version: "1.2.0" material_color_utilities: dependency: transitive description: name: material_color_utilities - url: "https://pub.dartlang.org" + sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 + url: "https://pub.dev" source: hosted - version: "0.1.4" + version: "0.2.0" meta: dependency: "direct main" description: name: meta - url: "https://pub.dartlang.org" + sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" + url: "https://pub.dev" source: hosted - version: "1.7.0" + version: "1.9.1" package_config: dependency: transitive description: name: package_config - url: "https://pub.dartlang.org" + sha256: "1c5b77ccc91e4823a5af61ee74e6b972db1ef98c2ff5a18d3161c982a55448bd" + url: "https://pub.dev" source: hosted version: "2.1.0" path: dependency: "direct main" description: name: path - url: "https://pub.dartlang.org" + sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" + url: "https://pub.dev" source: hosted - version: "1.8.2" + version: "1.8.3" pub_semver: dependency: transitive description: name: pub_semver - url: "https://pub.dartlang.org" + sha256: "40d3ab1bbd474c4c2328c91e3a7df8c6dd629b79ece4c4bd04bee496a224fb0c" + url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.1.4" sky_engine: dependency: transitive description: flutter @@ -169,100 +199,113 @@ packages: dependency: transitive description: name: source_gen - url: "https://pub.dartlang.org" + sha256: fc0da689e5302edb6177fdd964efcb7f58912f43c28c2047a808f5bfff643d16 + url: "https://pub.dev" source: hosted - version: "1.2.2" + version: "1.4.0" source_span: dependency: transitive description: name: source_span - url: "https://pub.dartlang.org" + sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" + url: "https://pub.dev" source: hosted - version: "1.9.1" + version: "1.10.0" sqfentity_gen: dependency: "direct main" description: path: "../sqfentity_gen" relative: true source: path - version: "2.3.0+4" + version: "2.4.0" sqflite_common: dependency: "direct main" description: name: sqflite_common - url: "https://pub.dartlang.org" + sha256: "8f7603f3f8f126740bc55c4ca2d1027aab4b74a1267a3e31ce51fe40e3b65b8f" + url: "https://pub.dev" source: hosted - version: "2.2.1+1" + version: "2.4.5+1" sqflite_common_ffi: dependency: "direct main" description: name: sqflite_common_ffi - url: "https://pub.dartlang.org" + sha256: f86de82d37403af491b21920a696b19f01465b596f545d1acd4d29a0a72418ad + url: "https://pub.dev" source: hosted - version: "2.1.1+1" + version: "2.2.5" sqflite_sqlcipher: dependency: "direct main" description: name: sqflite_sqlcipher - url: "https://pub.dartlang.org" + sha256: bcc02bfcc549895338558ba9acd0e3c54f808ef7095bb1294973751c521c9ba2 + url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.1.1+1" sqlite3: dependency: transitive description: name: sqlite3 - url: "https://pub.dartlang.org" + sha256: f7511ddd6a2dda8ded9d849f8a925bb6020e0faa59db2443debc18d484e59401 + url: "https://pub.dev" source: hosted - version: "1.8.0" + version: "2.0.0" string_scanner: dependency: transitive description: name: string_scanner - url: "https://pub.dartlang.org" + sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + url: "https://pub.dev" source: hosted - version: "1.1.1" + version: "1.2.0" synchronized: dependency: "direct main" description: name: synchronized - url: "https://pub.dartlang.org" + sha256: "5fcbd27688af6082f5abd611af56ee575342c30e87541d0245f7ff99faa02c60" + url: "https://pub.dev" source: hosted - version: "3.0.0+2" + version: "3.1.0" term_glyph: dependency: transitive description: name: term_glyph - url: "https://pub.dartlang.org" + sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + url: "https://pub.dev" source: hosted version: "1.2.1" typed_data: dependency: transitive description: name: typed_data - url: "https://pub.dartlang.org" + sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c + url: "https://pub.dev" source: hosted - version: "1.3.1" + version: "1.3.2" vector_math: dependency: transitive description: name: vector_math - url: "https://pub.dartlang.org" + sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + url: "https://pub.dev" source: hosted - version: "2.1.2" + version: "2.1.4" watcher: dependency: transitive description: name: watcher - url: "https://pub.dartlang.org" + sha256: "3d2ad6751b3c16cf07c7fca317a1413b3f26530319181b37e3b9039b84fc01d8" + url: "https://pub.dev" source: hosted - version: "1.0.1" + version: "1.1.0" yaml: dependency: transitive description: name: yaml - url: "https://pub.dartlang.org" + sha256: "75769501ea3489fca56601ff33454fe45507ea3bfb014161abc3b43ae25989d5" + url: "https://pub.dev" source: hosted - version: "3.1.1" + version: "3.1.2" sdks: - dart: ">=2.17.0 <3.0.0" + dart: ">=3.0.0 <3.2.0" flutter: ">=1.24.0-10" diff --git a/sqfentity/pubspec.yaml b/sqfentity/pubspec.yaml index b9403fc..89bb710 100644 --- a/sqfentity/pubspec.yaml +++ b/sqfentity/pubspec.yaml @@ -2,10 +2,10 @@ name: sqfentity homepage: https://github.com/hhtokpinar/sqfEntity description: SqfEntity ORM for Flutter/Dart lets you build and execute SQL commands easily and quickly with the help of fluent methods similar to .Net Entity Framework. -version: 2.3.0+4 +version: 2.4.0 environment: - sdk: ">=2.12.0 <3.0.0" + sdk: ">=2.17.0 <4.0.0" dependencies: flutter: diff --git a/sqfentity_gen/CHANGELOG.md b/sqfentity_gen/CHANGELOG.md index 3fc7ce6..7c287ed 100644 --- a/sqfentity_gen/CHANGELOG.md +++ b/sqfentity_gen/CHANGELOG.md @@ -1,3 +1,6 @@ +## 2.4.0 +- Add Dart SDK 3.0 support + ## 2.3.0+4 - fixed issue [281](https://github.com/hhtokpinar/sqfEntity/issues/281) and removed customizing datetime formats. diff --git a/sqfentity_gen/LICENSE b/sqfentity_gen/LICENSE index 31e5300..2b9972f 100644 --- a/sqfentity_gen/LICENSE +++ b/sqfentity_gen/LICENSE @@ -1,4 +1,4 @@ -Copyright [2019] [HUSEYIN TOKPUNAR http://huseyintokpinar.com/] +Copyright 2019 HUSEYIN TOKPUNAR Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/sqfentity_gen/analysis_options.yaml b/sqfentity_gen/analysis_options.yaml index 4a2b186..e7f0a0e 100644 --- a/sqfentity_gen/analysis_options.yaml +++ b/sqfentity_gen/analysis_options.yaml @@ -1,6 +1,5 @@ analyzer: strong-mode: - implicit-casts: false #implicit-dynamic: false errors: diff --git a/sqfentity_gen/example/.flutter-plugins-dependencies b/sqfentity_gen/example/.flutter-plugins-dependencies index f9b5f50..4e00cc5 100644 --- a/sqfentity_gen/example/.flutter-plugins-dependencies +++ b/sqfentity_gen/example/.flutter-plugins-dependencies @@ -1 +1 @@ -{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"path_provider","path":"/Users/huseyintokpinar/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-1.6.10/","native_build":true,"dependencies":[]},{"name":"sqflite_sqlcipher","path":"/Users/huseyintokpinar/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/sqflite_sqlcipher-2.1.1/","native_build":true,"dependencies":[]}],"android":[{"name":"path_provider","path":"/Users/huseyintokpinar/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-1.6.10/","native_build":true,"dependencies":[]},{"name":"sqflite_sqlcipher","path":"/Users/huseyintokpinar/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/sqflite_sqlcipher-2.1.1/","native_build":true,"dependencies":[]}],"macos":[{"name":"path_provider_macos","path":"/Users/huseyintokpinar/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_macos-0.0.4+3/","native_build":true,"dependencies":[]},{"name":"sqflite_sqlcipher","path":"/Users/huseyintokpinar/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/sqflite_sqlcipher-2.1.1/","native_build":true,"dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"/Users/huseyintokpinar/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_linux-0.0.1+1/","native_build":false,"dependencies":[]}],"windows":[],"web":[]},"dependencyGraph":[{"name":"path_provider","dependencies":["path_provider_macos","path_provider_linux"]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_macos","dependencies":[]},{"name":"sqflite_sqlcipher","dependencies":[]}],"date_created":"2022-08-16 14:13:19.199415","version":"3.0.5"} \ No newline at end of file +{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"path_provider_foundation","path":"/Users/huseyintokpinar/.pub-cache/hosted/pub.dev/path_provider_foundation-2.2.4/","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"sqflite_sqlcipher","path":"/Users/huseyintokpinar/.pub-cache/hosted/pub.dev/sqflite_sqlcipher-2.1.1+1/","native_build":true,"dependencies":[]}],"android":[{"name":"path_provider_android","path":"/Users/huseyintokpinar/.pub-cache/hosted/pub.dev/path_provider_android-2.0.27/","native_build":true,"dependencies":[]},{"name":"sqflite_sqlcipher","path":"/Users/huseyintokpinar/.pub-cache/hosted/pub.dev/sqflite_sqlcipher-2.1.1+1/","native_build":true,"dependencies":[]}],"macos":[{"name":"path_provider_foundation","path":"/Users/huseyintokpinar/.pub-cache/hosted/pub.dev/path_provider_foundation-2.2.4/","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"sqflite_sqlcipher","path":"/Users/huseyintokpinar/.pub-cache/hosted/pub.dev/sqflite_sqlcipher-2.1.1+1/","native_build":true,"dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"/Users/huseyintokpinar/.pub-cache/hosted/pub.dev/path_provider_linux-2.1.11/","native_build":false,"dependencies":[]}],"windows":[{"name":"path_provider_windows","path":"/Users/huseyintokpinar/.pub-cache/hosted/pub.dev/path_provider_windows-2.1.7/","native_build":false,"dependencies":[]}],"web":[]},"dependencyGraph":[{"name":"path_provider","dependencies":["path_provider_android","path_provider_foundation","path_provider_linux","path_provider_windows"]},{"name":"path_provider_android","dependencies":[]},{"name":"path_provider_foundation","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"sqflite_sqlcipher","dependencies":[]}],"date_created":"2023-07-15 18:30:41.250494","version":"3.10.4"} \ No newline at end of file diff --git a/sqfentity_gen/example/main.dart b/sqfentity_gen/example/main.dart index d0fc3e6..5eb9c6e 100644 --- a/sqfentity_gen/example/main.dart +++ b/sqfentity_gen/example/main.dart @@ -211,7 +211,7 @@ flutter: await Clipboard.setData(ClipboardData(text: modelConstString)); /* - Model were created succesfuly and set to the Clipboard. + Model were created successfully and set to the Clipboard. STEP 1: Open model.dart file in lib/model folder and paste (Ctrl+V) models after following line @@ -224,7 +224,7 @@ flutter: */ print('''Your ${bundledDbModel.databaseName} - were created succesfuly and set to the Clipboard. + were created successfully and set to the Clipboard. STEP 1: Open model.dart file in lib/model folder and paste models after following line diff --git a/sqfentity_gen/example/model/model.dart b/sqfentity_gen/example/model/model.dart index 3f93043..890016e 100644 --- a/sqfentity_gen/example/model/model.dart +++ b/sqfentity_gen/example/model/model.dart @@ -679,7 +679,6 @@ class Product extends TableBase { loadParents: loadParents /*, loadedFields: _loadedFields*/); } } // END RELATIONSHIPS PRELOAD - } else { obj = null; } @@ -1230,7 +1229,6 @@ class ProductFilterBuilder extends ConjunctionBase { loadParents: loadParents /*, loadedFields: _loadedFields*/); } } // END RELATIONSHIPS PRELOAD - } else { obj = null; } @@ -1821,7 +1819,6 @@ class Category extends TableBase { loadParents: false /*, loadedFields:_loadedFields*/); } } // END RELATIONSHIPS PRELOAD CHILD - } else { obj = null; } @@ -2322,7 +2319,6 @@ class CategoryFilterBuilder extends ConjunctionBase { loadParents: false /*, loadedFields:_loadedFields*/); } } // END RELATIONSHIPS PRELOAD CHILD - } else { obj = null; } diff --git a/sqfentity_gen/example/pubspec.lock b/sqfentity_gen/example/pubspec.lock index 627c5f7..36e485d 100644 --- a/sqfentity_gen/example/pubspec.lock +++ b/sqfentity_gen/example/pubspec.lock @@ -5,198 +5,226 @@ packages: dependency: transitive description: name: _fe_analyzer_shared - url: "https://pub.dartlang.org" + sha256: "0816708f5fbcacca324d811297153fe3c8e047beb5c6752e12292d2974c17045" + url: "https://pub.dev" source: hosted - version: "40.0.0" + version: "62.0.0" analyzer: dependency: transitive description: name: analyzer - url: "https://pub.dartlang.org" + sha256: "21862995c9932cd082f89d72ae5f5e2c110d1a0204ad06e4ebaee8307b76b834" + url: "https://pub.dev" source: hosted - version: "4.1.0" + version: "6.0.0" args: dependency: transitive description: name: args - url: "https://pub.dartlang.org" + sha256: eef6c46b622e0494a36c5a12d10d77fb4e855501a91c1b9ef9339326e58f0596 + url: "https://pub.dev" source: hosted - version: "2.3.0" + version: "2.4.2" async: dependency: transitive description: name: async - url: "https://pub.dartlang.org" + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" + url: "https://pub.dev" source: hosted - version: "2.5.0" + version: "2.11.0" boolean_selector: dependency: transitive description: name: boolean_selector - url: "https://pub.dartlang.org" + sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.1" build: dependency: transitive description: name: build - url: "https://pub.dartlang.org" + sha256: "80184af8b6cb3e5c1c4ec6d8544d27711700bc3e6d2efad04238c7b5290889f0" + url: "https://pub.dev" source: hosted - version: "2.3.0" + version: "2.4.1" build_config: dependency: transitive description: name: build_config - url: "https://pub.dartlang.org" + sha256: bf80fcfb46a29945b423bd9aad884590fb1dc69b330a4d4700cac476af1708d1 + url: "https://pub.dev" source: hosted - version: "1.0.0" + version: "1.1.1" build_daemon: dependency: transitive description: name: build_daemon - url: "https://pub.dartlang.org" + sha256: "5f02d73eb2ba16483e693f80bee4f088563a820e47d1027d4cdfe62b5bb43e65" + url: "https://pub.dev" source: hosted - version: "3.1.0" + version: "4.0.0" build_resolvers: dependency: transitive description: name: build_resolvers - url: "https://pub.dartlang.org" + sha256: "6c4dd11d05d056e76320b828a1db0fc01ccd376922526f8e9d6c796a5adbac20" + url: "https://pub.dev" source: hosted - version: "2.0.9" + version: "2.2.1" build_runner: dependency: "direct dev" description: name: build_runner - url: "https://pub.dartlang.org" + sha256: "10c6bcdbf9d049a0b666702cf1cee4ddfdc38f02a19d35ae392863b47519848b" + url: "https://pub.dev" source: hosted - version: "2.1.11" + version: "2.4.6" build_runner_core: dependency: transitive description: name: build_runner_core - url: "https://pub.dartlang.org" + sha256: "6d6ee4276b1c5f34f21fdf39425202712d2be82019983d52f351c94aafbc2c41" + url: "https://pub.dev" source: hosted - version: "7.2.2" + version: "7.2.10" build_verify: dependency: "direct dev" description: name: build_verify - url: "https://pub.dartlang.org" + sha256: abbb9b9eda076854ac1678d284c053a5ec608e64da741d0801f56d4bbea27e23 + url: "https://pub.dev" source: hosted - version: "3.0.0" + version: "3.1.0" built_collection: dependency: transitive description: name: built_collection - url: "https://pub.dartlang.org" + sha256: "376e3dd27b51ea877c28d525560790aee2e6fbb5f20e2f85d5081027d94e2100" + url: "https://pub.dev" source: hosted version: "5.1.1" built_value: dependency: transitive description: name: built_value - url: "https://pub.dartlang.org" + sha256: "598a2a682e2a7a90f08ba39c0aaa9374c5112340f0a2e275f61b59389543d166" + url: "https://pub.dev" source: hosted - version: "8.1.2" + version: "8.6.1" characters: dependency: transitive description: name: characters - url: "https://pub.dartlang.org" + sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" + url: "https://pub.dev" source: hosted - version: "1.2.0" - charcode: - dependency: transitive - description: - name: charcode - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0" + version: "1.3.0" checked_yaml: dependency: transitive description: name: checked_yaml - url: "https://pub.dartlang.org" + sha256: feb6bed21949061731a7a75fc5d2aa727cf160b91af9a3e464c5e3a32e28b5ff + url: "https://pub.dev" source: hosted - version: "2.0.1" + version: "2.0.3" clock: dependency: transitive description: name: clock - url: "https://pub.dartlang.org" + sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf + url: "https://pub.dev" source: hosted version: "1.1.1" code_builder: dependency: transitive description: name: code_builder - url: "https://pub.dartlang.org" + sha256: "4ad01d6e56db961d29661561effde45e519939fdaeb46c351275b182eac70189" + url: "https://pub.dev" source: hosted - version: "4.1.0" + version: "4.5.0" collection: dependency: transitive description: name: collection - url: "https://pub.dartlang.org" + sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c" + url: "https://pub.dev" source: hosted - version: "1.16.0" + version: "1.17.1" convert: dependency: transitive description: name: convert - url: "https://pub.dartlang.org" + sha256: "0f08b14755d163f6e2134cb58222dd25ea2a2ee8a195e53983d57c075324d592" + url: "https://pub.dev" source: hosted - version: "3.0.0" + version: "3.1.1" coverage: dependency: transitive description: name: coverage - url: "https://pub.dartlang.org" + sha256: "2fb815080e44a09b85e0f2ca8a820b15053982b2e714b59267719e8a9ff17097" + url: "https://pub.dev" source: hosted - version: "1.0.3" + version: "1.6.3" crypto: dependency: transitive description: name: crypto - url: "https://pub.dartlang.org" + sha256: ff625774173754681d66daaf4a448684fb04b78f902da9cb3d308c19cc5e8bab + url: "https://pub.dev" source: hosted - version: "3.0.1" + version: "3.0.3" cupertino_icons: dependency: "direct dev" description: name: cupertino_icons - url: "https://pub.dartlang.org" + sha256: e35129dc44c9118cee2a5603506d823bab99c68393879edb440e0090d07586be + url: "https://pub.dev" source: hosted version: "1.0.5" + dart_internal: + dependency: transitive + description: + name: dart_internal + sha256: dae3976f383beddcfcd07ad5291a422df2c8c0a8a03c52cda63ac7b4f26e0f4e + url: "https://pub.dev" + source: hosted + version: "0.2.8" dart_style: dependency: transitive description: name: dart_style - url: "https://pub.dartlang.org" + sha256: "1efa911ca7086affd35f463ca2fc1799584fb6aa89883cf0af8e3664d6a02d55" + url: "https://pub.dev" source: hosted - version: "2.2.3" + version: "2.3.2" ffi: dependency: transitive description: name: ffi - url: "https://pub.dartlang.org" + sha256: ed5337a5660c506388a9f012be0288fb38b49020ce2b45fe1f8b8323fe429f99 + url: "https://pub.dev" source: hosted - version: "1.0.0" + version: "2.0.2" file: dependency: transitive description: name: file - url: "https://pub.dartlang.org" + sha256: "5fc22d7c25582e38ad9a8515372cd9a93834027aacf1801cf01164dac0ffa08c" + url: "https://pub.dev" source: hosted - version: "6.1.0" + version: "7.0.0" fixnum: dependency: transitive description: name: fixnum - url: "https://pub.dartlang.org" + sha256: "25517a4deb0c03aa0f32fd12db525856438902d9c16536311e76cdc57b31d7d1" + url: "https://pub.dev" source: hosted - version: "1.0.0" + version: "1.1.0" flutter: dependency: "direct main" description: flutter @@ -206,233 +234,274 @@ packages: dependency: transitive description: name: frontend_server_client - url: "https://pub.dartlang.org" + sha256: "408e3ca148b31c20282ad6f37ebfa6f4bdc8fede5b74bc2f08d9d92b55db3612" + url: "https://pub.dev" source: hosted - version: "2.1.2" + version: "3.2.0" glob: dependency: transitive description: name: glob - url: "https://pub.dartlang.org" + sha256: "0e7014b3b7d4dac1ca4d6114f82bf1782ee86745b9b42a92c9289c23d8a0ab63" + url: "https://pub.dev" source: hosted - version: "2.0.1" + version: "2.1.2" graphs: dependency: transitive description: name: graphs - url: "https://pub.dartlang.org" + sha256: aedc5a15e78fc65a6e23bcd927f24c64dd995062bcd1ca6eda65a3cff92a4d19 + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.3.1" http: dependency: "direct main" description: name: http - url: "https://pub.dartlang.org" + sha256: "5895291c13fa8a3bd82e76d5627f69e0d85ca6a30dcac95c4ea19a5d555879c2" + url: "https://pub.dev" source: hosted - version: "0.13.4" + version: "0.13.6" http_multi_server: dependency: transitive description: name: http_multi_server - url: "https://pub.dartlang.org" + sha256: "97486f20f9c2f7be8f514851703d0119c3596d14ea63227af6f7a481ef2b2f8b" + url: "https://pub.dev" source: hosted - version: "3.0.1" + version: "3.2.1" http_parser: dependency: transitive description: name: http_parser - url: "https://pub.dartlang.org" + sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" + url: "https://pub.dev" source: hosted - version: "4.0.0" + version: "4.0.2" intl: dependency: transitive description: name: intl - url: "https://pub.dartlang.org" + sha256: "3bc132a9dbce73a7e4a21a17d06e1878839ffbf975568bc875c60537824b0c4d" + url: "https://pub.dev" source: hosted - version: "0.17.0" + version: "0.18.1" io: dependency: transitive description: name: io - url: "https://pub.dartlang.org" + sha256: "2ec25704aba361659e10e3e5f5d672068d332fc8ac516421d483a11e5cbd061e" + url: "https://pub.dev" source: hosted - version: "1.0.3" + version: "1.0.4" js: dependency: transitive description: name: js - url: "https://pub.dartlang.org" + sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 + url: "https://pub.dev" source: hosted - version: "0.6.3" + version: "0.6.7" json_annotation: dependency: transitive description: name: json_annotation - url: "https://pub.dartlang.org" + sha256: b10a7b2ff83d83c777edba3c6a0f97045ddadd56c944e1a23a3fdf43a1bf4467 + url: "https://pub.dev" source: hosted - version: "4.0.1" + version: "4.8.1" logging: dependency: transitive description: name: logging - url: "https://pub.dartlang.org" + sha256: "623a88c9594aa774443aa3eb2d41807a48486b5613e67599fb4c41c0ad47c340" + url: "https://pub.dev" source: hosted - version: "1.0.1" + version: "1.2.0" matcher: dependency: transitive description: name: matcher - url: "https://pub.dartlang.org" + sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e" + url: "https://pub.dev" source: hosted - version: "0.12.12" + version: "0.12.16" material_color_utilities: dependency: transitive description: name: material_color_utilities - url: "https://pub.dartlang.org" + sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 + url: "https://pub.dev" source: hosted - version: "0.1.4" + version: "0.2.0" meta: dependency: transitive description: name: meta - url: "https://pub.dartlang.org" + sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" + url: "https://pub.dev" source: hosted - version: "1.7.0" + version: "1.9.1" mime: dependency: transitive description: name: mime - url: "https://pub.dartlang.org" + sha256: e4ff8e8564c03f255408decd16e7899da1733852a9110a58fe6d1b817684a63e + url: "https://pub.dev" source: hosted - version: "1.0.0" + version: "1.0.4" node_preamble: dependency: transitive description: name: node_preamble - url: "https://pub.dartlang.org" + sha256: "6e7eac89047ab8a8d26cf16127b5ed26de65209847630400f9aefd7cd5c730db" + url: "https://pub.dev" source: hosted - version: "2.0.1" + version: "2.0.2" package_config: dependency: transitive description: name: package_config - url: "https://pub.dartlang.org" + sha256: "1c5b77ccc91e4823a5af61ee74e6b972db1ef98c2ff5a18d3161c982a55448bd" + url: "https://pub.dev" source: hosted - version: "2.0.0" + version: "2.1.0" path: dependency: transitive description: name: path - url: "https://pub.dartlang.org" + sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" + url: "https://pub.dev" source: hosted - version: "1.8.2" + version: "1.8.3" path_provider: dependency: "direct main" description: name: path_provider - url: "https://pub.dartlang.org" + sha256: "3087813781ab814e4157b172f1a11c46be20179fcc9bea043e0fba36bc0acaa2" + url: "https://pub.dev" source: hosted - version: "1.6.10" - path_provider_linux: + version: "2.0.15" + path_provider_android: dependency: transitive description: - name: path_provider_linux - url: "https://pub.dartlang.org" + name: path_provider_android + sha256: "2cec049d282c7f13c594b4a73976b0b4f2d7a1838a6dd5aaf7bd9719196bee86" + url: "https://pub.dev" source: hosted - version: "0.0.1+1" - path_provider_macos: + version: "2.0.27" + path_provider_foundation: dependency: transitive description: - name: path_provider_macos - url: "https://pub.dartlang.org" + name: path_provider_foundation + sha256: "916731ccbdce44d545414dd9961f26ba5fbaa74bcbb55237d8e65a623a8c7297" + url: "https://pub.dev" source: hosted - version: "0.0.4+3" + version: "2.2.4" + path_provider_linux: + dependency: transitive + description: + name: path_provider_linux + sha256: ffbb8cc9ed2c9ec0e4b7a541e56fd79b138e8f47d2fb86815f15358a349b3b57 + url: "https://pub.dev" + source: hosted + version: "2.1.11" path_provider_platform_interface: dependency: transitive description: name: path_provider_platform_interface - url: "https://pub.dartlang.org" + sha256: "57585299a729335f1298b43245842678cb9f43a6310351b18fb577d6e33165ec" + url: "https://pub.dev" source: hosted - version: "1.0.4" + version: "2.0.6" + path_provider_windows: + dependency: transitive + description: + name: path_provider_windows + sha256: "1cb68ba4cd3a795033de62ba1b7b4564dace301f952de6bfb3cd91b202b6ee96" + url: "https://pub.dev" + source: hosted + version: "2.1.7" pedantic: dependency: "direct main" description: name: pedantic - url: "https://pub.dartlang.org" + sha256: "67fc27ed9639506c856c840ccce7594d0bdcd91bc8d53d6e52359449a1d50602" + url: "https://pub.dev" source: hosted version: "1.11.1" platform: dependency: transitive description: name: platform - url: "https://pub.dartlang.org" + sha256: "4a451831508d7d6ca779f7ac6e212b4023dd5a7d08a27a63da33756410e32b76" + url: "https://pub.dev" source: hosted - version: "3.0.0" + version: "3.1.0" plugin_platform_interface: dependency: transitive description: name: plugin_platform_interface - url: "https://pub.dartlang.org" + sha256: "6a2128648c854906c53fa8e33986fc0247a1116122f9534dd20e3ab9e16a32bc" + url: "https://pub.dev" source: hosted - version: "1.0.2" + version: "2.1.4" pool: dependency: transitive description: name: pool - url: "https://pub.dartlang.org" - source: hosted - version: "1.5.0" - process: - dependency: transitive - description: - name: process - url: "https://pub.dartlang.org" + sha256: "20fe868b6314b322ea036ba325e6fc0711a22948856475e2c2b6306e8ab39c2a" + url: "https://pub.dev" source: hosted - version: "4.2.1" + version: "1.5.1" pub_semver: dependency: transitive description: name: pub_semver - url: "https://pub.dartlang.org" + sha256: "40d3ab1bbd474c4c2328c91e3a7df8c6dd629b79ece4c4bd04bee496a224fb0c" + url: "https://pub.dev" source: hosted - version: "2.0.0" + version: "2.1.4" pubspec_parse: dependency: transitive description: name: pubspec_parse - url: "https://pub.dartlang.org" + sha256: c63b2876e58e194e4b0828fcb080ad0e06d051cb607a6be51a9e084f47cb9367 + url: "https://pub.dev" source: hosted - version: "1.0.0" + version: "1.2.3" shelf: dependency: transitive description: name: shelf - url: "https://pub.dartlang.org" + sha256: ad29c505aee705f41a4d8963641f91ac4cee3c8fad5947e033390a7bd8180fa4 + url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "1.4.1" shelf_packages_handler: dependency: transitive description: name: shelf_packages_handler - url: "https://pub.dartlang.org" + sha256: "89f967eca29607c933ba9571d838be31d67f53f6e4ee15147d5dc2934fee1b1e" + url: "https://pub.dev" source: hosted - version: "3.0.0" + version: "3.0.2" shelf_static: dependency: transitive description: name: shelf_static - url: "https://pub.dartlang.org" + sha256: a41d3f53c4adf0f57480578c1d61d90342cd617de7fc8077b1304643c2d85c1e + url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.1.2" shelf_web_socket: dependency: transitive description: name: shelf_web_socket - url: "https://pub.dartlang.org" + sha256: "9ca081be41c60190ebcb4766b2486a7d50261db7bd0f5d9615f2d653637a84c1" + url: "https://pub.dev" source: hosted - version: "1.0.1" + version: "1.0.4" sky_engine: dependency: transitive description: flutter @@ -442,198 +511,232 @@ packages: dependency: transitive description: name: source_gen - url: "https://pub.dartlang.org" + sha256: fc0da689e5302edb6177fdd964efcb7f58912f43c28c2047a808f5bfff643d16 + url: "https://pub.dev" source: hosted - version: "1.2.2" + version: "1.4.0" source_map_stack_trace: dependency: transitive description: name: source_map_stack_trace - url: "https://pub.dartlang.org" + sha256: "84cf769ad83aa6bb61e0aa5a18e53aea683395f196a6f39c4c881fb90ed4f7ae" + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.1" source_maps: dependency: transitive description: name: source_maps - url: "https://pub.dartlang.org" + sha256: "708b3f6b97248e5781f493b765c3337db11c5d2c81c3094f10904bfa8004c703" + url: "https://pub.dev" source: hosted - version: "0.10.10" + version: "0.10.12" source_span: dependency: transitive description: name: source_span - url: "https://pub.dartlang.org" + sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" + url: "https://pub.dev" source: hosted - version: "1.8.1" + version: "1.10.0" sqfentity: dependency: "direct main" description: path: "../../sqfentity" relative: true source: path - version: "2.2.0+6" + version: "2.4.0" sqfentity_gen: dependency: "direct main" description: path: ".." relative: true source: path - version: "2.2.0+12" + version: "2.4.0" sqflite_common: dependency: transitive description: name: sqflite_common - url: "https://pub.dartlang.org" + sha256: "8f7603f3f8f126740bc55c4ca2d1027aab4b74a1267a3e31ce51fe40e3b65b8f" + url: "https://pub.dev" source: hosted - version: "2.2.1+1" + version: "2.4.5+1" sqflite_common_ffi: dependency: transitive description: name: sqflite_common_ffi - url: "https://pub.dartlang.org" + sha256: f86de82d37403af491b21920a696b19f01465b596f545d1acd4d29a0a72418ad + url: "https://pub.dev" source: hosted - version: "2.1.1+1" + version: "2.2.5" sqflite_sqlcipher: dependency: transitive description: name: sqflite_sqlcipher - url: "https://pub.dartlang.org" + sha256: bcc02bfcc549895338558ba9acd0e3c54f808ef7095bb1294973751c521c9ba2 + url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.1.1+1" sqlite3: dependency: transitive description: name: sqlite3 - url: "https://pub.dartlang.org" + sha256: f7511ddd6a2dda8ded9d849f8a925bb6020e0faa59db2443debc18d484e59401 + url: "https://pub.dev" source: hosted - version: "1.0.0" + version: "2.0.0" stack_trace: dependency: transitive description: name: stack_trace - url: "https://pub.dartlang.org" + sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" + url: "https://pub.dev" source: hosted - version: "1.10.0" + version: "1.11.1" stream_channel: dependency: transitive description: name: stream_channel - url: "https://pub.dartlang.org" + sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.2" stream_transform: dependency: transitive description: name: stream_transform - url: "https://pub.dartlang.org" + sha256: "14a00e794c7c11aa145a170587321aedce29769c08d7f58b1d141da75e3b1c6f" + url: "https://pub.dev" source: hosted - version: "2.0.0" + version: "2.1.0" string_scanner: dependency: transitive description: name: string_scanner - url: "https://pub.dartlang.org" + sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.2.0" synchronized: dependency: transitive description: name: synchronized - url: "https://pub.dartlang.org" + sha256: "5fcbd27688af6082f5abd611af56ee575342c30e87541d0245f7ff99faa02c60" + url: "https://pub.dev" source: hosted - version: "3.0.0+2" + version: "3.1.0" term_glyph: dependency: transitive description: name: term_glyph - url: "https://pub.dartlang.org" + sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "1.2.1" test: dependency: transitive description: name: test - url: "https://pub.dartlang.org" + sha256: "67ec5684c7a19b2aba91d2831f3d305a6fd8e1504629c5818f8d64478abf4f38" + url: "https://pub.dev" source: hosted - version: "1.21.3" + version: "1.24.4" test_api: dependency: transitive description: name: test_api - url: "https://pub.dartlang.org" + sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b" + url: "https://pub.dev" source: hosted - version: "0.4.11" + version: "0.6.1" test_core: dependency: transitive description: name: test_core - url: "https://pub.dartlang.org" + sha256: "6b753899253c38ca0523bb0eccff3934ec83d011705dae717c61ecf209e333c9" + url: "https://pub.dev" source: hosted - version: "0.4.15" + version: "0.5.4" timing: dependency: transitive description: name: timing - url: "https://pub.dartlang.org" + sha256: "70a3b636575d4163c477e6de42f247a23b315ae20e86442bebe32d3cabf61c32" + url: "https://pub.dev" source: hosted - version: "1.0.0" + version: "1.0.1" typed_data: dependency: transitive description: name: typed_data - url: "https://pub.dartlang.org" + sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c + url: "https://pub.dev" source: hosted - version: "1.3.0" + version: "1.3.2" vector_math: dependency: transitive description: name: vector_math - url: "https://pub.dartlang.org" + sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + url: "https://pub.dev" source: hosted - version: "2.1.2" + version: "2.1.4" vm_service: dependency: transitive description: name: vm_service - url: "https://pub.dartlang.org" + sha256: b8c67f5fa3897b122cf60fe9ff314f7b0ef71eab25c5f8b771480bc338f48823 + url: "https://pub.dev" source: hosted - version: "7.3.0" + version: "11.7.2" watcher: dependency: transitive description: name: watcher - url: "https://pub.dartlang.org" + sha256: "3d2ad6751b3c16cf07c7fca317a1413b3f26530319181b37e3b9039b84fc01d8" + url: "https://pub.dev" source: hosted - version: "1.0.0" + version: "1.1.0" web_socket_channel: dependency: transitive description: name: web_socket_channel - url: "https://pub.dartlang.org" + sha256: d88238e5eac9a42bb43ca4e721edba3c08c6354d4a53063afaa568516217621b + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.4.0" webkit_inspection_protocol: dependency: transitive description: name: webkit_inspection_protocol - url: "https://pub.dartlang.org" + sha256: "67d3a8b6c79e1987d19d848b0892e582dbb0c66c57cc1fef58a177dd2aa2823d" + url: "https://pub.dev" source: hosted - version: "1.0.0" + version: "1.2.0" + win32: + dependency: transitive + description: + name: win32 + sha256: dfdf0136e0aa7a1b474ea133e67cb0154a0acd2599c4f3ada3b49d38d38793ee + url: "https://pub.dev" + source: hosted + version: "5.0.5" xdg_directories: dependency: transitive description: name: xdg_directories - url: "https://pub.dartlang.org" + sha256: e0b1147eec179d3911f1f19b59206448f78195ca1d20514134e10641b7d7fbff + url: "https://pub.dev" source: hosted - version: "0.1.2" + version: "1.0.1" yaml: dependency: transitive description: name: yaml - url: "https://pub.dartlang.org" + sha256: "75769501ea3489fca56601ff33454fe45507ea3bfb014161abc3b43ae25989d5" + url: "https://pub.dev" source: hosted - version: "3.1.0" + version: "3.1.2" sdks: - dart: ">=2.16.0 <3.0.0" - flutter: ">=1.24.0-10" + dart: ">=3.0.0 <3.2.0" + flutter: ">=3.3.0" diff --git a/sqfentity_gen/lib/builder.dart b/sqfentity_gen/lib/builder.dart index 7298189..43760b8 100644 --- a/sqfentity_gen/lib/builder.dart +++ b/sqfentity_gen/lib/builder.dart @@ -17,9 +17,12 @@ import 'package:source_gen/source_gen.dart'; import 'package:sqfentity_gen/src/sqfentity_formgenerator.dart'; import 'package:sqfentity_gen/src/sqfentity_generator.dart'; -Builder sqfentityBuilder(BuilderOptions options) => SharedPartBuilder([SqfEntityGenerator()], 'sqfentity'); +Builder sqfentityBuilder(BuilderOptions options) => + SharedPartBuilder([SqfEntityGenerator()], 'sqfentity'); -Builder sqfentityFormBuilder(BuilderOptions options) => LibraryBuilder(SqfEntityFormGenerator(), generatedExtension: '.g.view.dart'); +Builder sqfentityFormBuilder(BuilderOptions options) => + LibraryBuilder(SqfEntityFormGenerator(), + generatedExtension: '.g.view.dart'); Builder sqfentityFormBuilderTest(BuilderOptions options) => LibraryBuilder( // change extension to refresh changes (Testing) diff --git a/sqfentity_gen/lib/sqfentity_base.dart b/sqfentity_gen/lib/sqfentity_base.dart index 85fd238..3b76b7b 100644 --- a/sqfentity_gen/lib/sqfentity_base.dart +++ b/sqfentity_gen/lib/sqfentity_base.dart @@ -35,7 +35,21 @@ class SqfEntityTable { /// SqfEntityField('isActive', DbType.bool, defaultValue: true), /// ]); /// ``` - const SqfEntityTable({this.tableName, this.primaryKeyName, this.fields, this.useSoftDeleting, this.primaryKeyType, this.defaultJsonUrl, this.modelName, this.customCode, this.relationType, this.formListTitleField, this.formListSubTitleField, this.objectType, this.sqlStatement, this.abstractModelName}); + const SqfEntityTable( + {this.tableName, + this.primaryKeyName, + this.fields, + this.useSoftDeleting, + this.primaryKeyType, + this.defaultJsonUrl, + this.modelName, + this.customCode, + this.relationType, + this.formListTitleField, + this.formListSubTitleField, + this.objectType, + this.sqlStatement, + this.abstractModelName}); final String? tableName; final String? primaryKeyName; final List? fields; @@ -74,7 +88,14 @@ class SqfEntitySequence { /// // startWith = 0; /* optional. default is 0 */ /// ); /// ``` - const SqfEntitySequence({this.sequenceName, this.startWith, this.incrementBy, this.minValue, this.maxValue, this.cycle, this.modelName}); + const SqfEntitySequence( + {this.sequenceName, + this.startWith, + this.incrementBy, + this.minValue, + this.maxValue, + this.cycle, + this.modelName}); /// Name of the sequence. final String? sequenceName; @@ -104,7 +125,19 @@ class SqfEntityField { /// ``` /// SqfEntityField('name', DbType.text, isNotNull: true), /// ``` - const SqfEntityField(this.fieldName, this.dbType, {this.defaultValue, this.minValue, this.maxValue, this.sequencedBy, this.isPrimaryKeyField, this.isNotNull, this.isUnique, this.isIndex, this.isIndexGroup, this.checkCondition, this.formLabelText, this.collate}); + const SqfEntityField(this.fieldName, this.dbType, + {this.defaultValue, + this.minValue, + this.maxValue, + this.sequencedBy, + this.isPrimaryKeyField, + this.isNotNull, + this.isUnique, + this.isIndex, + this.isIndexGroup, + this.checkCondition, + this.formLabelText, + this.collate}); final String? fieldName; final DbType? dbType; final dynamic defaultValue; @@ -338,7 +371,20 @@ class SqfEntityModel { /// defaultValue: 'DateTime.now()'), /// ]); /// ``` - const SqfEntityModel({this.databaseName, this.databaseTables, this.bundledDatabasePath, this.modelName, this.sequences, this.formTables, this.password, this.ignoreForFile, this.dbVersion, this.defaultColumns, this.preSaveAction, this.logFunction, this.databasePath}); + const SqfEntityModel( + {this.databaseName, + this.databaseTables, + this.bundledDatabasePath, + this.modelName, + this.sequences, + this.formTables, + this.password, + this.ignoreForFile, + this.dbVersion, + this.defaultColumns, + this.preSaveAction, + this.logFunction, + this.databasePath}); /// Declare your sqlite database name final String? databaseName; @@ -460,8 +506,12 @@ class SqfEntityModelConverter { for (final field in table.fields!) { SqfEntityFieldType _field; if (field is SqfEntityFieldRelationship) { - _field = SqfEntityFieldRelationshipBase(field.parentTable == null ? null : toTable(field.parentTable!), field.deleteRule!) - ..relationType = field.relationType == null ? RelationType.ONE_TO_MANY : field.relationType! + _field = SqfEntityFieldRelationshipBase( + field.parentTable == null ? null : toTable(field.parentTable!), + field.deleteRule!) + ..relationType = field.relationType == null + ? RelationType.ONE_TO_MANY + : field.relationType! ..manyToManyTableName = field.manyToManyTableName ..fieldName = field.fieldName ..init(); @@ -476,7 +526,8 @@ class SqfEntityModelConverter { } /// Assign field properties from defined constant field - SqfEntityFieldType getFieldProperties(SqfEntityField field, SqfEntityFieldType toField) { + SqfEntityFieldType getFieldProperties( + SqfEntityField field, SqfEntityFieldType toField) { return toField ..defaultValue = field.defaultValue ..isPrimaryKeyField = field.isPrimaryKeyField @@ -487,7 +538,8 @@ class SqfEntityModelConverter { ..checkCondition = field.checkCondition ..collate = field.collate ..formLabelText = field.formLabelText - ..sequencedBy = field.sequencedBy == null ? null : toSequence(field.sequencedBy!); + ..sequencedBy = + field.sequencedBy == null ? null : toSequence(field.sequencedBy!); } /// Convert defined constant sequences into List @@ -551,18 +603,26 @@ $_createObjectField String __createObjectField() { final retVal = StringBuffer(); - if (_table.primaryKeyName != null && _table.primaryKeyName!.isNotEmpty && !_table.primaryKeyName!.startsWith('_')) { - retVal.writeln('''static TableField? _f${toCamelCase(_table.primaryKeyNames[0])}; + if (_table.primaryKeyName != null && + _table.primaryKeyName!.isNotEmpty && + !_table.primaryKeyName!.startsWith('_')) { + retVal.writeln( + '''static TableField? _f${toCamelCase(_table.primaryKeyNames[0])}; static TableField get ${_table.primaryKeyNames[0]} { return _f${toCamelCase(_table.primaryKeyNames[0])} = _f${toCamelCase(_table.primaryKeyNames[0])} ?? SqlSyntax.setField(_f${toCamelCase(_table.primaryKeyNames[0])}, '${_table.primaryKeyNames[0].toLowerCase()}', ${DbType.integer.toString()}); } '''); } - for (SqfEntityFieldType field in _table.fields!.where((f) => !f.fieldName!.startsWith('_'))) { - if (field is SqfEntityFieldVirtualBase || (field is SqfEntityFieldRelationshipBase && field.relationType == RelationType.MANY_TO_MANY && _table.relationType != RelationType.MANY_TO_MANY)) { + for (SqfEntityFieldType field + in _table.fields!.where((f) => !f.fieldName!.startsWith('_'))) { + if (field is SqfEntityFieldVirtualBase || + (field is SqfEntityFieldRelationshipBase && + field.relationType == RelationType.MANY_TO_MANY && + _table.relationType != RelationType.MANY_TO_MANY)) { continue; } - retVal.writeln('''static TableField? _f${field.fieldName!.substring(0, 1).toUpperCase() + field.fieldName!.substring(1)}; + retVal.writeln( + '''static TableField? _f${field.fieldName!.substring(0, 1).toUpperCase() + field.fieldName!.substring(1)}; static TableField get ${field.fieldName} { return _f${field.fieldName!.substring(0, 1).toUpperCase() + field.fieldName!.substring(1)} = _f${field.fieldName!.substring(0, 1).toUpperCase() + field.fieldName!.substring(1)} ?? SqlSyntax.setField(_f${field.fieldName!.substring(0, 1).toUpperCase() + field.fieldName!.substring(1)}, '${field.fieldName}', ${field.dbType.toString()}); } @@ -598,8 +658,10 @@ class SqfEntityControllerBuilder { String objName = table.modelName!; objName += 'To${collection.childTable.modelName}'; //print('subControllers: ${table.tableName} -> ${collection.childTableField.fieldName} -> objName:$objName'); - if (!Controllers.controllersub.contains(objName) && formTables.contains(collection.childTable)) { - retVal.writeln('''class ${objName}ControllerSub extends ${collection.childTable.modelName}Controller { + if (!Controllers.controllersub.contains(objName) && + formTables.contains(collection.childTable)) { + retVal.writeln( + '''class ${objName}ControllerSub extends ${collection.childTable.modelName}Controller { static String relationshipFieldName='${collection.childTableField.fieldName}'; static String primaryKeyName= '${collection.childTable.primaryKeyNames[0]}'; static bool useSoftDeleting = ${collection.childTable.useSoftDeleting.toString()}; @@ -608,7 +670,10 @@ class SqfEntityControllerBuilder { }'''); Controllers.controllersub.add(objName); // PlaylistId IN (SELECT PlaylistId FROM PlaylistTrack WHERE TrackId=$id) - final filterExpression = collection.relationType == RelationType.MANY_TO_MANY ? '${collection.childTable.primaryKeyNames[0]} IN (SELECT ${collection.childTable.primaryKeyNames[0]} FROM ${collection.childTableField.manyToManyTableName} WHERE ${table.primaryKeyNames[0]}=?)' : '\${${objName}ControllerSub.relationshipFieldName}=?'; + final filterExpression = collection.relationType == + RelationType.MANY_TO_MANY + ? '${collection.childTable.primaryKeyNames[0]} IN (SELECT ${collection.childTable.primaryKeyNames[0]} FROM ${collection.childTableField.manyToManyTableName} WHERE ${table.primaryKeyNames[0]}=?)' + : '\${${objName}ControllerSub.relationshipFieldName}=?'; subItemsCodeList.writeln(''' case '$objName': @@ -669,7 +734,8 @@ class SqfEntityControllerBuilder { //'${(withTypes ? _table.primaryKeyTypes[0] : '')} ${_table.primaryKeyNames[0]}' 'obj[\'${_table.primaryKeyNames[0]}\']${table.primaryKeyTypes[0].toLowerCase() == 'string' ? '.toString()' : ' as ${table.primaryKeyTypes[0]}'}'); for (int i = 1; i < _table.primaryKeyNames.length; i++) { - retVal.write(', obj[\'${_table.primaryKeyNames[i]}\']${table.primaryKeyTypes[i].toLowerCase() == 'string' ? '.toString()' : ' as ${table.primaryKeyTypes[i]}'}'); + retVal.write( + ', obj[\'${_table.primaryKeyNames[i]}\']${table.primaryKeyTypes[i].toLowerCase() == 'string' ? '.toString()' : ' as ${table.primaryKeyTypes[i]}'}'); } return retVal.toString(); @@ -705,10 +771,12 @@ class SqfEntityObjectBuilder { //String get _getUpdateStr => __getUpdateStr(_table); String get _getByIdParametersWithTypes => __getByIdParameters(_table, true); String get _toOnetoManyCollections => __toOnetoManyCollections(_table); - String get _createObjectRelationsPreLoad => __createObjectRelationsPreLoad(_table); + String get _createObjectRelationsPreLoad => + __createObjectRelationsPreLoad(_table); String get _toOnetoOneSaveCode => __toOnetoOneSaveCode(_table); String get _toOnetoOneSaveAsCode => __toOnetoOneSaveAsCode(_table); - String get _hiddenMethod => _table.relationType == RelationType.ONE_TO_ONE ? '_' : ''; + String get _hiddenMethod => + _table.relationType == RelationType.ONE_TO_ONE ? '_' : ''; @override String toString() { @@ -928,11 +996,13 @@ class SqfEntityObjectBuilder { //print('__createProperties for ${_table.tableName} primaryKeyName=${_table.primaryKeyName}'); final _retVal = StringBuffer(); if (_table.primaryKeyName != null && _table.primaryKeyName!.isNotEmpty) { - _retVal.writeln('${_table.primaryKeyType == PrimaryKeyType.text ? 'String' : 'int'}? ${_table.primaryKeyNames[0]};'); + _retVal.writeln( + '${_table.primaryKeyType == PrimaryKeyType.text ? 'String' : 'int'}? ${_table.primaryKeyNames[0]};'); } for (final field in _table.fields!) { if (field is SqfEntityFieldRelationshipBase) { - if (field.relationType == RelationType.MANY_TO_MANY && _table.relationType != RelationType.MANY_TO_MANY) { + if (field.relationType == RelationType.MANY_TO_MANY && + _table.relationType != RelationType.MANY_TO_MANY) { continue; } } @@ -942,21 +1012,33 @@ class SqfEntityObjectBuilder { _retVal.writeln(' bool? isDeleted;'); } - _retVal..writeln(_table.primaryKeyType != PrimaryKeyType.integer_auto_incremental || _table.primaryKeyName == null || _table.primaryKeyName!.isEmpty ? 'bool? isSaved;' : ''); + _retVal + ..writeln( + _table.primaryKeyType != PrimaryKeyType.integer_auto_incremental || + _table.primaryKeyName == null || + _table.primaryKeyName!.isEmpty + ? 'bool? isSaved;' + : ''); return _retVal.toString(); } String __createBaseConstructure() { final _retVal = StringBuffer(); //print('__createBaseConstructure for ${_table.tableName}'); - if (_table.primaryKeyName != null && _table.primaryKeyName!.isNotEmpty && _table.relationType != RelationType.ONE_TO_ONE) { + if (_table.primaryKeyName != null && + _table.primaryKeyName!.isNotEmpty && + _table.relationType != RelationType.ONE_TO_ONE) { _retVal ..write(', this.') ..write(_table.primaryKeyName); } - for (final field in _table.fields!.where((f) => f.fieldName != null && !f.fieldName!.startsWith('_'))) { - if (field is SqfEntityFieldVirtualBase || (field is SqfEntityFieldRelationshipBase && field.relationType == RelationType.MANY_TO_MANY && _table.relationType != RelationType.MANY_TO_MANY)) { + for (final field in _table.fields! + .where((f) => f.fieldName != null && !f.fieldName!.startsWith('_'))) { + if (field is SqfEntityFieldVirtualBase || + (field is SqfEntityFieldRelationshipBase && + field.relationType == RelationType.MANY_TO_MANY && + _table.relationType != RelationType.MANY_TO_MANY)) { continue; } final consStr = field.toConstructureString(); @@ -982,7 +1064,8 @@ class SqfEntityObjectBuilder { _table.primaryKeyName!.isNotEmpty && _table.relationType != RelationType.ONE_TO_ONE && // _table.relationType != RelationType.MANY_TO_MANY && /xch1 - (withId || _table.primaryKeyType != PrimaryKeyType.integer_auto_incremental)) { + (withId || + _table.primaryKeyType != PrimaryKeyType.integer_auto_incremental)) { _retVal.write(',?'); //print('__createConstructureArgs line:1 yes'); } @@ -1005,8 +1088,10 @@ class SqfEntityObjectBuilder { continue; } if (_table.fields![i] is SqfEntityFieldRelationshipBase) { - final SqfEntityFieldRelationshipBase field = _table.fields![i] as SqfEntityFieldRelationshipBase; - if ((field.relationType == RelationType.MANY_TO_MANY && _table.relationType != RelationType.MANY_TO_MANY) + final SqfEntityFieldRelationshipBase field = + _table.fields![i] as SqfEntityFieldRelationshipBase; + if ((field.relationType == RelationType.MANY_TO_MANY && + _table.relationType != RelationType.MANY_TO_MANY) // && (field.isPrimaryKeyField ?? false) ) { continue; @@ -1014,31 +1099,44 @@ class SqfEntityObjectBuilder { } _retVal.write(',?'); } - if (_table.useSoftDeleting != null && _table.useSoftDeleting! && _table.relationType != RelationType.MANY_TO_MANY) { + if (_table.useSoftDeleting != null && + _table.useSoftDeleting! && + _table.relationType != RelationType.MANY_TO_MANY) { _retVal.write(',?'); } - return _retVal.toString().length > 2 ? _retVal.toString().substring(1) : _retVal.toString(); + return _retVal.toString().length > 2 + ? _retVal.toString().substring(1) + : _retVal.toString(); } String __toMapString() { final _retVal = StringBuffer(); - if (_table.relationType != RelationType.ONE_TO_ONE && _table.primaryKeyName != null && _table.primaryKeyName!.isNotEmpty) { - _retVal.writeln('map[\'${_table.primaryKeyNames[0]}\'] = ${_table.primaryKeyNames[0]};'); + if (_table.relationType != RelationType.ONE_TO_ONE && + _table.primaryKeyName != null && + _table.primaryKeyName!.isNotEmpty) { + _retVal.writeln( + 'map[\'${_table.primaryKeyNames[0]}\'] = ${_table.primaryKeyNames[0]};'); } for (var field in _table.fields!) { - if (field is SqfEntityFieldVirtualBase || (field is SqfEntityFieldRelationshipBase && field.relationType == RelationType.MANY_TO_MANY && _table.relationType != RelationType.MANY_TO_MANY)) { + if (field is SqfEntityFieldVirtualBase || + (field is SqfEntityFieldRelationshipBase && + field.relationType == RelationType.MANY_TO_MANY && + _table.relationType != RelationType.MANY_TO_MANY)) { continue; } - if (field is SqfEntityFieldRelationshipBase && field.relationType == RelationType.ONE_TO_MANY) { - _retVal.writeln('if (${field.fieldName} != null) {map[\'${field.fieldName}\'] = forView ? pl${field.relationshipName} == null ? ${field.fieldName} : pl${field.relationshipName}!.${field.formDropDownTextField} : ${field.fieldName};} else if (${field.fieldName} != null || !forView){map[\'${field.fieldName}\'] = null;}'); + if (field is SqfEntityFieldRelationshipBase && + field.relationType == RelationType.ONE_TO_MANY) { + _retVal.writeln( + 'if (${field.fieldName} != null) {map[\'${field.fieldName}\'] = forView ? pl${field.relationshipName} == null ? ${field.fieldName} : pl${field.relationshipName}!.${field.formDropDownTextField} : ${field.fieldName};} else if (${field.fieldName} != null || !forView){map[\'${field.fieldName}\'] = null;}'); } else { _retVal.writeln(' ${field.toMapString()}'); } } if (_table.useSoftDeleting != null && _table.useSoftDeleting!) { - _retVal.writeln(' if (isDeleted != null) {map[\'isDeleted\'] = forQuery ? (isDeleted! ? 1 : 0):isDeleted;}'); + _retVal.writeln( + ' if (isDeleted != null) {map[\'isDeleted\'] = forQuery ? (isDeleted! ? 1 : 0):isDeleted;}'); } return _retVal.toString(); } @@ -1048,24 +1146,32 @@ class SqfEntityObjectBuilder { //print('__toFromMapString for ${_table.tableName} primaryKeyName=${_table.primaryKeyName}'); if (_table.primaryKeyName != null && _table.primaryKeyName!.isNotEmpty) { if (_table.primaryKeyType == PrimaryKeyType.text) { - _retVal.writeln('${_table.primaryKeyNames[0]} = o[\'${_table.primaryKeyNames[0]}\'].toString();'); + _retVal.writeln( + '${_table.primaryKeyNames[0]} = o[\'${_table.primaryKeyNames[0]}\'].toString();'); } else { - _retVal.writeln('${_table.primaryKeyNames[0]} = int.tryParse(o[\'${_table.primaryKeyNames[0]}\'].toString());'); + _retVal.writeln( + '${_table.primaryKeyNames[0]} = int.tryParse(o[\'${_table.primaryKeyNames[0]}\'].toString());'); } } for (final field in _table.fields!) { - if (field is SqfEntityFieldVirtualBase || (field is SqfEntityFieldRelationshipBase && field.relationType == RelationType.MANY_TO_MANY && _table.relationType != RelationType.MANY_TO_MANY)) { + if (field is SqfEntityFieldVirtualBase || + (field is SqfEntityFieldRelationshipBase && + field.relationType == RelationType.MANY_TO_MANY && + _table.relationType != RelationType.MANY_TO_MANY)) { continue; } _retVal.writeln(' ${field.toFromMapString()}'); } if (_table.useSoftDeleting != null && _table.useSoftDeleting!) { - _retVal.writeln(' isDeleted = o[\'isDeleted\'] != null ? o[\'isDeleted\'] == 1 || o[\'isDeleted\'] == true : null;'); + _retVal.writeln( + ' isDeleted = o[\'isDeleted\'] != null ? o[\'isDeleted\'] == 1 || o[\'isDeleted\'] == true : null;'); } _retVal //..writeln(__createObjectCollectionsFromMap().toString()) // Not tested yet ..writeln(__createObjectRelationsFromMap().toString()); - if (_table.primaryKeyType != PrimaryKeyType.integer_auto_incremental || _table.primaryKeyName == null || _table.primaryKeyName!.isEmpty) { + if (_table.primaryKeyType != PrimaryKeyType.integer_auto_incremental || + _table.primaryKeyName == null || + _table.primaryKeyName!.isEmpty) { _retVal.writeln('isSaved=true;'); } return _retVal.toString(); @@ -1073,25 +1179,34 @@ class SqfEntityObjectBuilder { String __createDefaultValues() { //print('__createDefaultValues for ${_table.tableName}'); - final _retVal = StringBuffer(_table.primaryKeyType != PrimaryKeyType.integer_auto_incremental || _table.primaryKeyName == null || _table.primaryKeyName!.isEmpty ? 'isSaved=false;' : ''); + final _retVal = StringBuffer( + _table.primaryKeyType != PrimaryKeyType.integer_auto_incremental || + _table.primaryKeyName == null || + _table.primaryKeyName!.isEmpty + ? 'isSaved=false;' + : ''); for (final field in _table.fields!.where((f) => f.defaultValue != null)) { switch (field.dbType) { case DbType.time: - field.defaultValue = 'tryParseTime(${field.defaultValue.replaceAll('\'', '\\\'').toString()})'; + field.defaultValue = + 'tryParseTime(${field.defaultValue.replaceAll('\'', '\\\'').toString()})'; // "TimeOfDay.fromDateTime(intl.DateFormat(${_model.defaultTimeFormat}).parse(${field.defaultValue.replaceAll('\'', '\\\'').toString()})))"; // DateFormat(_model.defaultTimeFormat) // .parse(field.defaultValue.replaceAll('\'', '\\\'').toString()); // "TimeOfDay(hour: int.parse('${field.defaultValue.replaceAll('\'', '\\\'')}'.split(':')[0]), minute: int.parse('${field.defaultValue.replaceAll('\'', '\\\'')}'.split(':')[1]))"; break; case DbType.text: - field.defaultValue = "'${field.defaultValue.replaceAll('\'', '\\\'')}'"; + field.defaultValue = + "'${field.defaultValue.replaceAll('\'', '\\\'')}'"; break; case DbType.bool: - field.defaultValue = '${field.defaultValue.toString() == '1' || field.defaultValue.toString() == 'true' ? 'true' : 'false'}'; + field.defaultValue = + '${field.defaultValue.toString() == '1' || field.defaultValue.toString() == 'true' ? 'true' : 'false'}'; break; default: } - _retVal.writeln(' ${field.fieldName}=${field.fieldName} ?? ${field.defaultValue};'); + _retVal.writeln( + ' ${field.fieldName}=${field.fieldName} ?? ${field.defaultValue};'); } if (_table.useSoftDeleting != null && _table.useSoftDeleting!) { _retVal.writeln(' isDeleted= isDeleted ?? false;'); @@ -1105,7 +1220,8 @@ class SqfEntityObjectBuilder { // iterable.whereType() var retVal = ''; final relations = []; - for (final field in _table.fields!.whereType()) { + for (final field + in _table.fields!.whereType()) { //print('- Recognizing RelationShip named ${field.fieldName}'); if (field.relationType == RelationType.ONE_TO_MANY) { // final objName = field.relationshipName == null @@ -1122,10 +1238,12 @@ class SqfEntityObjectBuilder { } } if (field.relationshipFields.isEmpty) { - print('field.relationshipFields = null funcName:$funcName, field.fieldName: ${field.fieldName}'); + print( + 'field.relationshipFields = null funcName:$funcName, field.fieldName: ${field.fieldName}'); } //print('funcName: $funcName'); - retVal += '''/// to load parent of items to this field, use preload parameter ex: toList(preload:true) or toSingle(preload:true) or getById(preload:true) + retVal += + '''/// to load parent of items to this field, use preload parameter ex: toList(preload:true) or toSingle(preload:true) or getById(preload:true) /// You can also specify this object into certain preload fields!. Ex: toList(preload:true, preloadFields:['pl$funcName', 'plField2'..]) or so on.. $modelName? pl$funcName; /// get $modelName By ${toCamelCase(field.fieldName!)} @@ -1138,7 +1256,8 @@ class SqfEntityObjectBuilder { } } if (retVal.isNotEmpty) { - retVal = '\n// RELATIONSHIPS (${_table.modelName})\n$retVal// END RELATIONSHIPS (${_table.modelName})\n'; + retVal = + '\n// RELATIONSHIPS (${_table.modelName})\n$retVal// END RELATIONSHIPS (${_table.modelName})\n'; } return retVal; } @@ -1152,7 +1271,9 @@ class SqfEntityObjectBuilder { final collections = []; for (var tableCollection in _table.collections!) { //print('__createObjectCollections for ${_table.tableName} / ${tableCollection.childTable.tableName}'); - if (_table.relationType == RelationType.MANY_TO_MANY && tableCollection.childTable.relationType == RelationType.MANY_TO_MANY) { + if (_table.relationType == RelationType.MANY_TO_MANY && + tableCollection.childTable.relationType == + RelationType.MANY_TO_MANY) { continue; } String funcName = getFuncName(tableCollection, false, _table); @@ -1163,7 +1284,8 @@ class SqfEntityObjectBuilder { continue; } } - if (tableCollection.childTableField.relationType == RelationType.ONE_TO_ONE) { + if (tableCollection.childTableField.relationType == + RelationType.ONE_TO_ONE) { final o2oName = tableCollection.childTable.modelName!; final o2oNameLower = o2oName.toLowerCase(); retVal.writeln('''$o2oName? _$o2oNameLower; @@ -1176,17 +1298,33 @@ class SqfEntityObjectBuilder { } //print('before buildFilterExpression'); //print('tableCollection.childTableField.table!.primaryKeyNames[0]:${tableCollection.childTableField.table!.primaryKeyNames[0]}'); - final StringBuffer filterExpression = buildFilterExpression(tableCollection); + final StringBuffer filterExpression = + buildFilterExpression(tableCollection); //print('after buildFilterExpression'); - String childTableFieldTablePrimaryKeyName = tableCollection.childTableField.table == null ? _table.primaryKeyNames[0] : tableCollection.childTableField.table!.primaryKeyNames[0]; + String childTableFieldTablePrimaryKeyName = + tableCollection.childTableField.table == null + ? _table.primaryKeyNames[0] + : tableCollection.childTableField.table!.primaryKeyNames[0]; if (tableCollection.relationType == RelationType.MANY_TO_MANY) { //print(' before set childTablePrimaryKeyName'); - final String? childTablePrimaryKeyName = tableCollection.childTableField.manyToManyTable!.fields!.whereType().firstWhere((f) => f.table!.tableName == tableCollection.childTable.tableName!).fieldName; + final String? childTablePrimaryKeyName = tableCollection + .childTableField.manyToManyTable!.fields! + .whereType() + .firstWhere((f) => + f.table!.tableName == tableCollection.childTable.tableName!) + .fieldName; //print(' before set childTableFieldTablePrimaryKeyName '); - childTableFieldTablePrimaryKeyName = tableCollection.childTableField.manyToManyTable!.fields!.whereType().firstWhere((f) => f.table!.tableName == tableCollection.childTableField.table!.tableName!).fieldName!; - - retVal.writeln('''///(RelationType.MANY_TO_MANY) (${tableCollection.childTableField.manyToManyTable!.tableName}) to load children of items to this field, use preload parameter. Ex: toList(preload:true) or toSingle(preload:true) or getById(preload:true) + childTableFieldTablePrimaryKeyName = tableCollection + .childTableField.manyToManyTable!.fields! + .whereType() + .firstWhere((f) => + f.table!.tableName == + tableCollection.childTableField.table!.tableName!) + .fieldName!; + + retVal.writeln( + '''///(RelationType.MANY_TO_MANY) (${tableCollection.childTableField.manyToManyTable!.tableName}) to load children of items to this field, use preload parameter. Ex: toList(preload:true) or toSingle(preload:true) or getById(preload:true) /// You can also specify this object into certain preload fields!. Ex: toList(preload:true, preloadFields:['pl$funcName', 'plField2'..]) or so on.. List<${tableCollection.childTable.modelName}>? pl$funcName; /// get ${tableCollection.childTable.modelName}(s) filtered by $childTablePrimaryKeyName IN ${tableCollection.childTableField.manyToManyTableName} @@ -1208,7 +1346,8 @@ class SqfEntityObjectBuilder { return ${_table.modelName}().select(columnsToSelect: columnsToSelect,getIsDeleted: getIsDeleted)${filterExpression.toString()}; }'''); } else { - retVal.writeln('''/// to load children of items to this field, use preload parameter. Ex: toList(preload:true) or toSingle(preload:true) or getById(preload:true) + retVal.writeln( + '''/// to load children of items to this field, use preload parameter. Ex: toList(preload:true) or toSingle(preload:true) or getById(preload:true) /// You can also specify this object into certain preload fields!. Ex: toList(preload:true, preloadFields:['pl$funcName', 'plField2'..]) or so on.. List<${tableCollection.childTable.modelName}>? pl$funcName; /// get ${tableCollection.childTable.modelName}(s) filtered by ${tableCollection.childTableField.table!.primaryKeyNames.join(',')}=${tableCollection.childTableField.relationshipFields.map((e) => e.fieldName!).join(',')} @@ -1219,22 +1358,31 @@ class SqfEntityObjectBuilder { collections.add(funcName); } - return retVal.length > 0 ? '\n// COLLECTIONS & VIRTUALS (${_table.modelName})\n${retVal.toString()}\n// END COLLECTIONS & VIRTUALS (${_table.modelName})\n' : ''; + return retVal.length > 0 + ? '\n// COLLECTIONS & VIRTUALS (${_table.modelName})\n${retVal.toString()}\n// END COLLECTIONS & VIRTUALS (${_table.modelName})\n' + : ''; } StringBuffer buildFilterExpression(TableCollectionBase tableCollection) { final filterExpression = StringBuffer(); - if (tableCollection.childTableField.table == null || tableCollection.childTableField.table == _table) { + if (tableCollection.childTableField.table == null || + tableCollection.childTableField.table == _table) { //print('buildFilterExpression: tableCollection.childTableField.relationshipFields=${tableCollection.childTableField.relationshipFields.map((e) => e.fieldName!).toList().join(',')} , _table.primaryKeyNames=${_table.primaryKeyNames.join(',')} '); - for (int i = 0; i < tableCollection.childTableField.relationshipFields.length; i++) { + for (int i = 0; + i < tableCollection.childTableField.relationshipFields.length; + i++) { // filterExpression.write('.where(\'${tableCollection.childTableField.relationshipFields[i].fieldName}=?\', parameterValue: ${_table.primaryKeyNames[i]}).and'); - filterExpression.write('.${tableCollection.childTableField.relationshipFields[i].fieldName}.equals(${_table.primaryKeyNames[i]}).and'); + filterExpression.write( + '.${tableCollection.childTableField.relationshipFields[i].fieldName}.equals(${_table.primaryKeyNames[i]}).and'); } } else { //print('buildFilterExpression: tableCollection.childTableField.relationshipFields=${tableCollection.childTableField.relationshipFields.map((e) => e.fieldName!).toList().join(',')} , tableCollection.childTableField.table!.primaryKeyNames=${tableCollection.childTableField.table!.primaryKeyNames.join(',')} '); - for (int i = 0; i < tableCollection.childTableField.relationshipFields.length; i++) { + for (int i = 0; + i < tableCollection.childTableField.relationshipFields.length; + i++) { // filterExpression.write('.where(\'${tableCollection.childTableField.relationshipFields[i].fieldName}=?\', parameterValue: ${tableCollection.childTableField.table!.primaryKeyNames[i]}).and'); - filterExpression.write('.${tableCollection.childTableField.relationshipFields[i].fieldName}.equals(${tableCollection.childTableField.table!.primaryKeyNames[i]}).and'); + filterExpression.write( + '.${tableCollection.childTableField.relationshipFields[i].fieldName}.equals(${tableCollection.childTableField.table!.primaryKeyNames[i]}).and'); } } return filterExpression; @@ -1249,7 +1397,9 @@ class SqfEntityObjectBuilder { final collections = []; for (var tableCollection in _table.collections!) { - if (_table.relationType == RelationType.MANY_TO_MANY && tableCollection.childTable.relationType == RelationType.MANY_TO_MANY) { + if (_table.relationType == RelationType.MANY_TO_MANY && + tableCollection.childTable.relationType == + RelationType.MANY_TO_MANY) { continue; } String funcName = getFuncName(tableCollection, false, _table); @@ -1260,26 +1410,36 @@ class SqfEntityObjectBuilder { } } if (tableCollection.childTableField.table != null) { - if (tableCollection.childTableField.relationType == RelationType.ONE_TO_ONE) { - final relationName = tableCollection.childTable.modelName!.toLowerCase(); - retVal.writeln('''if (!forQuery) {map['$relationName'] = await $relationName.toMapWithChildren();}'''); + if (tableCollection.childTableField.relationType == + RelationType.ONE_TO_ONE) { + final relationName = + tableCollection.childTable.modelName!.toLowerCase(); + retVal.writeln( + '''if (!forQuery) {map['$relationName'] = await $relationName.toMapWithChildren();}'''); } else { - retVal.writeln('''if (!forQuery) {map['$funcName'] = await get$funcName()!.toMapList();}'''); + retVal.writeln( + '''if (!forQuery) {map['$funcName'] = await get$funcName()!.toMapList();}'''); } } } - return retVal.length > 0 ? '\n// COLLECTIONS (${_table.modelName})\n${retVal.toString()}// END COLLECTIONS (${_table.modelName})\n' : ''; + return retVal.length > 0 + ? '\n// COLLECTIONS (${_table.modelName})\n${retVal.toString()}// END COLLECTIONS (${_table.modelName})\n' + : ''; } String __createObjectRelationsFromMap() { //print('__createObjectRelationsFromMap for ${_table.tableName}'); final retVal = StringBuffer(); final relations = []; - for (final field in _table.fields!.whereType()) { + for (final field + in _table.fields!.whereType()) { if (field.relationType == RelationType.ONE_TO_MANY) { final modelName = field.relationshipName ?? _table.modelName!; //print('relations for: ${field.fieldName}, modelname:$modelName'); - final String mapName = field.fieldName!.toLowerCase() == modelName.toLowerCase() ? 'pl$modelName' : tocamelCase(modelName); + final String mapName = + field.fieldName!.toLowerCase() == modelName.toLowerCase() + ? 'pl$modelName' + : tocamelCase(modelName); String funcName = modelName; if (relations.contains(funcName)) { funcName += 'By${toCamelCase(field.fieldName!)}'; @@ -1288,7 +1448,8 @@ class SqfEntityObjectBuilder { } } //retVal.writeln('if (preloadFields == null || preloadfields!.contains(\'pl$funcName\')) {obj.pl$funcName = await obj.get$funcName();}'); - retVal.writeln('pl$funcName = o[\'$mapName\'] != null ? $modelName.fromMap(o[\'$mapName\'] as Map) : null;'); + retVal.writeln( + 'pl$funcName = o[\'$mapName\'] != null ? $modelName.fromMap(o[\'$mapName\'] as Map) : null;'); relations.add(funcName); } } @@ -1324,11 +1485,13 @@ class SqfEntityObjectBuilder { for (var tableCollection in _table.collections!) { // if (tableCollection.childTable._hasManyToMany == true) { - if (tableCollection.childTableField.relationType == RelationType.MANY_TO_MANY) { + if (tableCollection.childTableField.relationType == + RelationType.MANY_TO_MANY) { continue; } - final StringBuffer filterExpression = buildFilterExpression(tableCollection); + final StringBuffer filterExpression = + buildFilterExpression(tableCollection); switch (tableCollection.childTableField.deleteRule) { case DeleteRule.SET_NULL: retVal += ''' @@ -1381,7 +1544,8 @@ class SqfEntityObjectBuilder { final varResult = 'var result= BoolResult(success: false);'; for (var tableCollection in _table.collections!) { - final StringBuffer filterExpression = buildFilterExpression(tableCollection); + final StringBuffer filterExpression = + buildFilterExpression(tableCollection); switch (tableCollection.childTableField.deleteRule) { case DeleteRule.SET_NULL: // IN THIS CASE YOU CAN NOT RECOVER CHILD ROWS @@ -1462,11 +1626,14 @@ class SqfEntityObjectBuilder { String __saveMethod() { final seq = StringBuffer(); - for (var sequencedField in _table.fields!.where((i) => i.sequencedBy != null)) { - seq.writeln('${sequencedField.fieldName} = await ${sequencedField.sequencedBy!.modelName}().nextVal();'); + for (var sequencedField + in _table.fields!.where((i) => i.sequencedBy != null)) { + seq.writeln( + '${sequencedField.fieldName} = await ${sequencedField.sequencedBy!.modelName}().nextVal();'); } final retVal = StringBuffer(); - if (_table.primaryKeyTypes[0].startsWith('int') && _table.primaryKeyNames.length == 1) { + if (_table.primaryKeyTypes[0].startsWith('int') && + _table.primaryKeyNames.length == 1) { retVal ..write(''' @@ -1507,8 +1674,12 @@ class SqfEntityObjectBuilder { return ${_table.primaryKeyNames[0]}; }'''); - if (_table.relationType != RelationType.ONE_TO_ONE && _table.primaryKeyName != null && _table.primaryKeyName!.isNotEmpty && _table.primaryKeyType == PrimaryKeyType.integer_auto_incremental) { - retVal.writeln('''/// saveAs ${_table.modelName}. Returns a new Primary Key value of ${_table.modelName} + if (_table.relationType != RelationType.ONE_TO_ONE && + _table.primaryKeyName != null && + _table.primaryKeyName!.isNotEmpty && + _table.primaryKeyType == PrimaryKeyType.integer_auto_incremental) { + retVal.writeln( + '''/// saveAs ${_table.modelName}. Returns a new Primary Key value of ${_table.modelName} /// Returns a new Primary Key value of ${_table.modelName} @override @@ -1544,7 +1715,10 @@ class SqfEntityObjectBuilder { } '''); - if (_table.relationType != RelationType.ONE_TO_ONE && _table.primaryKeyName != null && _table.primaryKeyName!.isNotEmpty && _table.primaryKeyType == PrimaryKeyType.integer_auto_incremental) { + if (_table.relationType != RelationType.ONE_TO_ONE && + _table.primaryKeyName != null && + _table.primaryKeyName!.isNotEmpty && + _table.primaryKeyType == PrimaryKeyType.integer_auto_incremental) { retVal.write(''' /// saveAs ${_table.modelName} /// Use this method if you do not want to update existing row when conflicts another row that have the same ${_table.primaryKeyNames[0]} @@ -1572,16 +1746,21 @@ class SqfEntityObjectBuilder { } } -String getFuncName(TableCollectionBase tableCollection, bool ifExist, SqfEntityTableBase _table) { - String funcName = _table.tableName == tableCollection.childTable.tableName ? toPluralName(tableCollection.childTableField.fieldName!) : toPluralName(tableCollection.childTable.modelName!); - return funcName += ifExist ? 'By${tableCollection.childTableField.fieldName}' : ''; +String getFuncName(TableCollectionBase tableCollection, bool ifExist, + SqfEntityTableBase _table) { + String funcName = _table.tableName == tableCollection.childTable.tableName + ? toPluralName(tableCollection.childTableField.fieldName!) + : toPluralName(tableCollection.childTable.modelName!); + return funcName += + ifExist ? 'By${tableCollection.childTableField.fieldName}' : ''; } String __createObjectRelationsPreLoad(SqfEntityTableBase _table) { //print('__createObjectRelationsPreload for ${_table.tableName} primaryKeyName=${_table.primaryKeyName}'); final retVal = StringBuffer(); final relations = []; - for (final field in _table.fields!.whereType()) { + for (final field + in _table.fields!.whereType()) { if (field.relationType == RelationType.ONE_TO_MANY) { final modelName = field.relationshipName ?? _table.modelName!; String funcName = modelName; @@ -1591,7 +1770,8 @@ String __createObjectRelationsPreLoad(SqfEntityTableBase _table) { continue; } } - retVal.writeln('if ((preloadFields == null || loadParents || preloadFields.contains(\'pl$funcName\'))) {obj.pl$funcName = obj.pl$funcName ?? await obj.get$funcName(loadParents: loadParents);}'); + retVal.writeln( + 'if ((preloadFields == null || loadParents || preloadFields.contains(\'pl$funcName\'))) {obj.pl$funcName = obj.pl$funcName ?? await obj.get$funcName(loadParents: loadParents);}'); relations.add(funcName); } } @@ -1606,9 +1786,12 @@ String __getByIdParameters(SqfEntityTableBase _table, bool withTypes) { if (_table.primaryKeyNames.isEmpty) { return ''; } - final retVal = StringBuffer()..write('${(withTypes ? '${_table.primaryKeyTypes[0]}?' : '')} ${_table.primaryKeyNames[0]}'); + final retVal = StringBuffer() + ..write( + '${(withTypes ? '${_table.primaryKeyTypes[0]}?' : '')} ${_table.primaryKeyNames[0]}'); for (int i = 1; i < _table.primaryKeyNames.length; i++) { - retVal.write(', ${(withTypes ? '${_table.primaryKeyTypes[i]}?' : '')} ${_table.primaryKeyNames[i]}'); + retVal.write( + ', ${(withTypes ? '${_table.primaryKeyTypes[i]}?' : '')} ${_table.primaryKeyNames[i]}'); } return retVal.toString(); } @@ -1647,8 +1830,12 @@ String __toOnetoOneCollections(SqfEntityTableBase _table) { continue; } - final childTableFieldTablePrimaryKeyName = tableCollection.childTableField.table == null ? _table.primaryKeyNames[0] : tableCollection.childTableField.table!.primaryKeyNames[0]; - if (tableCollection.childTableField.relationType == RelationType.ONE_TO_ONE) { + final childTableFieldTablePrimaryKeyName = + tableCollection.childTableField.table == null + ? _table.primaryKeyNames[0] + : tableCollection.childTableField.table!.primaryKeyNames[0]; + if (tableCollection.childTableField.relationType == + RelationType.ONE_TO_ONE) { /* obj.property = await Property() .select() ._productProductId @@ -1668,7 +1855,9 @@ String __toOnetoOneCollections(SqfEntityTableBase _table) { } } - return retVal.length > 0 ? '\n// RELATIONS OneToOne (${_table.modelName})\n obj ${retVal.toString()};// END RELATIONS OneToOne (${_table.modelName})\n' : ''; + return retVal.length > 0 + ? '\n// RELATIONS OneToOne (${_table.modelName})\n obj ${retVal.toString()};// END RELATIONS OneToOne (${_table.modelName})\n' + : ''; } String __toOnetoManyCollections(SqfEntityTableBase _table) { @@ -1686,15 +1875,20 @@ String __toOnetoManyCollections(SqfEntityTableBase _table) { continue; } } - if (tableCollection.childTableField.relationType == RelationType.ONE_TO_ONE || tableCollection.childTable.relationType == RelationType.MANY_TO_MANY) { + if (tableCollection.childTableField.relationType == + RelationType.ONE_TO_ONE || + tableCollection.childTable.relationType == RelationType.MANY_TO_MANY) { continue; } - retVal.writeln('if (/*!_loadedfields!.contains(\'${_table.tableName}.pl$funcName\') && */(preloadFields == null || preloadFields.contains(\'pl$funcName\'))) {/*_loadedfields!.add(\'${_table.tableName}.pl$funcName\'); */ obj.pl$funcName = obj.pl$funcName ?? await obj.get$funcName()!.toList(preload: preload, preloadFields: preloadFields, loadParents: false /*, loadedFields:_loadedFields*/);}'); + retVal.writeln( + 'if (/*!_loadedfields!.contains(\'${_table.tableName}.pl$funcName\') && */(preloadFields == null || preloadFields.contains(\'pl$funcName\'))) {/*_loadedfields!.add(\'${_table.tableName}.pl$funcName\'); */ obj.pl$funcName = obj.pl$funcName ?? await obj.get$funcName()!.toList(preload: preload, preloadFields: preloadFields, loadParents: false /*, loadedFields:_loadedFields*/);}'); collections.add(funcName); } - return retVal.length > 0 ? '\n // RELATIONSHIPS PRELOAD CHILD\nif (preload) {\nloadedFields = loadedFields ?? [];\n${retVal.toString()}\n}// END RELATIONSHIPS PRELOAD CHILD\n' : ''; + return retVal.length > 0 + ? '\n // RELATIONSHIPS PRELOAD CHILD\nif (preload) {\nloadedFields = loadedFields ?? [];\n${retVal.toString()}\n}// END RELATIONSHIPS PRELOAD CHILD\n' + : ''; } String __toOnetoOneSaveCode(SqfEntityTableBase _table) { @@ -1704,14 +1898,21 @@ String __toOnetoOneSaveCode(SqfEntityTableBase _table) { final retVal = StringBuffer(); for (var tableCollection in _table.collections!) { - if (tableCollection.childTableField.relationType == RelationType.ONE_TO_ONE) { - final childTableFieldTablePrimaryKeyName = tableCollection.childTableField.table == null ? _table.primaryKeyNames[0] : tableCollection.childTableField.table!.primaryKeyNames[0]; + if (tableCollection.childTableField.relationType == + RelationType.ONE_TO_ONE) { + final childTableFieldTablePrimaryKeyName = + tableCollection.childTableField.table == null + ? _table.primaryKeyNames[0] + : tableCollection.childTableField.table!.primaryKeyNames[0]; final objName = tableCollection.childTable.modelName!.toLowerCase(); - retVal.writeln('''_$objName?.${tableCollection.childTableField.fieldName} = $childTableFieldTablePrimaryKeyName; + retVal.writeln( + '''_$objName?.${tableCollection.childTableField.fieldName} = $childTableFieldTablePrimaryKeyName; await _$objName?.${tableCollection.childTable.relationType == RelationType.ONE_TO_ONE ? '_' : ''}save();'''); } } - return retVal.length > 0 ? '\n// save() OneToOne relations (${_table.modelName})\n${retVal.toString()}// END save() OneToOne relations (${_table.modelName})\n' : ''; + return retVal.length > 0 + ? '\n// save() OneToOne relations (${_table.modelName})\n${retVal.toString()}// END save() OneToOne relations (${_table.modelName})\n' + : ''; } String __toOnetoOneSaveAsCode(SqfEntityTableBase _table) { @@ -1722,12 +1923,16 @@ String __toOnetoOneSaveAsCode(SqfEntityTableBase _table) { // property._propertyId = null; for (var tableCollection in _table.collections!) { - if (tableCollection.childTableField.relationType == RelationType.ONE_TO_ONE) { + if (tableCollection.childTableField.relationType == + RelationType.ONE_TO_ONE) { final objName = tableCollection.childTable.modelName!.toLowerCase(); - retVal.writeln('$objName.${tableCollection.childTable.primaryKeyNames[0]} = null;'); + retVal.writeln( + '$objName.${tableCollection.childTable.primaryKeyNames[0]} = null;'); } } - return retVal.length > 0 ? '\n// saveAs() OneToOne relations (${_table.modelName})\n${retVal.toString()}// END saveAs() OneToOne relations (${_table.modelName})\n' : ''; + return retVal.length > 0 + ? '\n// saveAs() OneToOne relations (${_table.modelName})\n${retVal.toString()}// END saveAs() OneToOne relations (${_table.modelName})\n' + : ''; } class SqfEntityObjectManagerBuilder { @@ -1871,7 +2076,8 @@ class SqfEntityObjectFilterBuilder { String get _deleteMethodList => __deleteMethodList(); String get _toOnetoOneCollections => __toOnetoOneCollections(_table); String get _toOnetoManyCollections => __toOnetoManyCollections(_table); - String get _createObjectRelationsPreLoad => __createObjectRelationsPreLoad(_table); + String get _createObjectRelationsPreLoad => + __createObjectRelationsPreLoad(_table); @override String toString() { final String toString = ''' @@ -2240,14 +2446,19 @@ Future> toListString([VoidCallback Function(List o)? listSt String __createObjectFieldProperty() { //print('__createObjectFieldProperty for ${_table.tableName} primaryKeyName=${_table.primaryKeyName}'); final retVal = StringBuffer(); - if (_table.primaryKeyName != null && _table.primaryKeyName!.isNotEmpty && !_table.primaryKeyName!.startsWith('_')) { + if (_table.primaryKeyName != null && + _table.primaryKeyName!.isNotEmpty && + !_table.primaryKeyName!.startsWith('_')) { retVal.writeln('''${_table.modelName}Field? _${_table.primaryKeyNames[0]}; ${_table.modelName}Field get ${_table.primaryKeyNames[0]} { return _${_table.primaryKeyNames[0]} = _setField(_${_table.primaryKeyNames[0]}, '${_table.primaryKeyNames[0]}', ${DbType.integer.toString()}); }'''); } for (SqfEntityFieldType field in _table.fields!) { - if (field is SqfEntityFieldVirtualBase || (field is SqfEntityFieldRelationshipBase && field.relationType == RelationType.MANY_TO_MANY && _table.relationType != RelationType.MANY_TO_MANY)) { + if (field is SqfEntityFieldVirtualBase || + (field is SqfEntityFieldRelationshipBase && + field.relationType == RelationType.MANY_TO_MANY && + _table.relationType != RelationType.MANY_TO_MANY)) { continue; } retVal.writeln('''${_table.modelName}Field? _${field.fieldName}; @@ -2282,10 +2493,12 @@ return _isDeleted = _setField(_isDeleted, 'isDeleted', DbType.bool); case DeleteRule.CASCADE: if (tableCollection.childTable.useSoftDeleting!) { retVal - ..writeln('// Recover sub records where in (${tableCollection.childTable.modelName}) according to ${tableCollection.childTableField.deleteRule.toString()}') + ..writeln( + '// Recover sub records where in (${tableCollection.childTable.modelName}) according to ${tableCollection.childTableField.deleteRule.toString()}') ..writeln(_buildWhereStrForList(tableCollection)) ..writeln('.update({\'isDeleted\': 0}); ') - ..writeln('if (!res${tableCollection.childTable.modelName}BY${tableCollection.childTableField.fieldName}.success) {return res${tableCollection.childTable.modelName}BY${tableCollection.childTableField.fieldName};}'); + ..writeln( + 'if (!res${tableCollection.childTable.modelName}BY${tableCollection.childTableField.fieldName}.success) {return res${tableCollection.childTable.modelName}BY${tableCollection.childTableField.fieldName};}'); } break; case DeleteRule.SET_DEFAULT_VALUE: @@ -2313,20 +2526,25 @@ return _isDeleted = _setField(_isDeleted, 'isDeleted', DbType.bool); } final StringBuffer retVal = StringBuffer(); for (var tableCollection in _table.collections!) { - if (tableCollection.childTableField.relationType == RelationType.MANY_TO_MANY) { + if (tableCollection.childTableField.relationType == + RelationType.MANY_TO_MANY) { continue; } switch (tableCollection.childTableField.deleteRule) { case DeleteRule.SET_NULL: // IN THIS CASE YOU CAN NOT RECOVER CHILD ROWS retVal - ..writeln('// UPDATE sub records where in (${tableCollection.childTable.modelName}) according to ${tableCollection.childTableField.deleteRule.toString()}') + ..writeln( + '// UPDATE sub records where in (${tableCollection.childTable.modelName}) according to ${tableCollection.childTableField.deleteRule.toString()}') ..writeln(_buildWhereStrForList(tableCollection)) - ..writeln('.update({${_buildUpdateParamForList(tableCollection, DeleteRule.SET_NULL)}}); ') - ..writeln('if (!res${tableCollection.childTable.modelName}BY${tableCollection.childTableField.fieldName}.success) {return res${tableCollection.childTable.modelName}BY${tableCollection.childTableField.fieldName};}'); + ..writeln( + '.update({${_buildUpdateParamForList(tableCollection, DeleteRule.SET_NULL)}}); ') + ..writeln( + 'if (!res${tableCollection.childTable.modelName}BY${tableCollection.childTableField.fieldName}.success) {return res${tableCollection.childTable.modelName}BY${tableCollection.childTableField.fieldName};}'); break; case DeleteRule.NO_ACTION: - retVal.writeln('''// Check sub records where in (${tableCollection.childTable.modelName}) according to ${tableCollection.childTableField.deleteRule.toString()} + retVal.writeln( + '''// Check sub records where in (${tableCollection.childTable.modelName}) according to ${tableCollection.childTableField.deleteRule.toString()} ${_buildWhereStrForList(tableCollection)}.toCount(); if (res${tableCollection.childTable.modelName}BY${tableCollection.childTableField.fieldName}>0) { @@ -2339,19 +2557,24 @@ return _isDeleted = _setField(_isDeleted, 'isDeleted', DbType.bool); break; case DeleteRule.CASCADE: retVal - ..writeln('// Delete sub records where in (${tableCollection.childTable.modelName}) according to ${tableCollection.childTableField.deleteRule.toString()}') + ..writeln( + '// Delete sub records where in (${tableCollection.childTable.modelName}) according to ${tableCollection.childTableField.deleteRule.toString()}') ..writeln(_buildWhereStrForList(tableCollection)) ..writeln('.delete(hardDelete);') - ..writeln('if (!res${tableCollection.childTable.modelName}BY${tableCollection.childTableField.fieldName}.success) {return res${tableCollection.childTable.modelName}BY${tableCollection.childTableField.fieldName};}'); + ..writeln( + 'if (!res${tableCollection.childTable.modelName}BY${tableCollection.childTableField.fieldName}.success) {return res${tableCollection.childTable.modelName}BY${tableCollection.childTableField.fieldName};}'); break; case DeleteRule.SET_DEFAULT_VALUE: //IN THIS CASE YOU CAN NOT RECOVER CHILD ROWS retVal - ..writeln('// UPDATE sub records where in (${tableCollection.childTable.modelName}) according to ${tableCollection.childTableField.deleteRule.toString()}') + ..writeln( + '// UPDATE sub records where in (${tableCollection.childTable.modelName}) according to ${tableCollection.childTableField.deleteRule.toString()}') ..writeln(_buildWhereStrForList(tableCollection)) - ..writeln('.update({${_buildUpdateParamForList(tableCollection, DeleteRule.SET_DEFAULT_VALUE)}}); ') - ..writeln('if (!res${tableCollection.childTable.modelName}BY${tableCollection.childTableField.fieldName}.success) {return res${tableCollection.childTable.modelName}BY${tableCollection.childTableField.fieldName};}'); + ..writeln( + '.update({${_buildUpdateParamForList(tableCollection, DeleteRule.SET_DEFAULT_VALUE)}}); ') + ..writeln( + 'if (!res${tableCollection.childTable.modelName}BY${tableCollection.childTableField.fieldName}.success) {return res${tableCollection.childTable.modelName}BY${tableCollection.childTableField.fieldName};}'); break; default: @@ -2364,11 +2587,17 @@ return _isDeleted = _setField(_isDeleted, 'isDeleted', DbType.bool); String _buildWhereStrForList(TableCollectionBase tableCollection) { final StringBuffer _retVal = StringBuffer(); if (tableCollection.childTableField.table!.primaryKeyNames.length > 1) { - final idList = '${tocamelCase(tableCollection.childTable.tableName!)}By${tableCollection.childTableField.fieldName}idList'.replaceAll('_', ''); + final idList = + '${tocamelCase(tableCollection.childTable.tableName!)}By${tableCollection.childTableField.fieldName}idList' + .replaceAll('_', ''); _retVal.writeln('final $idList = await toListPrimaryKey(false);'); - String queryIn = '${tableCollection.childTableField.relationshipFields[0].fieldName}=\${e.${tableCollection.childTableField.table!.primaryKeyNames[0]}}'; - for (int i = 1; i < tableCollection.childTableField.table!.primaryKeyNames.length; i++) { - queryIn += ' AND ${tableCollection.childTableField.relationshipFields[i].fieldName}=\${e.${tableCollection.childTableField.table!.primaryKeyNames[i]}}'; + String queryIn = + '${tableCollection.childTableField.relationshipFields[0].fieldName}=\${e.${tableCollection.childTableField.table!.primaryKeyNames[0]}}'; + for (int i = 1; + i < tableCollection.childTableField.table!.primaryKeyNames.length; + i++) { + queryIn += + ' AND ${tableCollection.childTableField.relationshipFields[i].fieldName}=\${e.${tableCollection.childTableField.table!.primaryKeyNames[i]}}'; } _retVal.writeln(''' final whereStr = $idList.map((e) => '($queryIn)').join(' OR '); @@ -2376,7 +2605,8 @@ return _isDeleted = _setField(_isDeleted, 'isDeleted', DbType.bool); .select() .where(whereStr)'''); } else { - final idListName = 'idList${tableCollection.childTable.modelName}BY${tableCollection.childTableField.fieldName}'; + final idListName = + 'idList${tableCollection.childTable.modelName}BY${tableCollection.childTableField.fieldName}'; _retVal.writeln(''' final $idListName = toListPrimaryKeySQL(false); final res${tableCollection.childTable.modelName}BY${tableCollection.childTableField.fieldName} = await ${tableCollection.childTable.modelName}().select().where('${tableCollection.childTableField.fieldName} IN (\${$idListName['sql']})', parameterValue: $idListName['args']) @@ -2386,12 +2616,18 @@ return _isDeleted = _setField(_isDeleted, 'isDeleted', DbType.bool); } } -String _buildUpdateParamForList(TableCollectionBase tableCollection, DeleteRule rule) { - final StringBuffer _retVal = StringBuffer()..write('\'${tableCollection.childTableField.relationshipFields[0].fieldName}\':${getUpdateValue(tableCollection.childTableField.relationshipFields[0], rule)}'); - for (int i = 1; i < tableCollection.childTableField.table!.primaryKeyNames.length; i++) { +String _buildUpdateParamForList( + TableCollectionBase tableCollection, DeleteRule rule) { + final StringBuffer _retVal = StringBuffer() + ..write( + '\'${tableCollection.childTableField.relationshipFields[0].fieldName}\':${getUpdateValue(tableCollection.childTableField.relationshipFields[0], rule)}'); + for (int i = 1; + i < tableCollection.childTableField.table!.primaryKeyNames.length; + i++) { _retVal ..write(',') - ..write('\'${tableCollection.childTableField.relationshipFields[i].fieldName}\':${getUpdateValue(tableCollection.childTableField.relationshipFields[i], rule)}'); + ..write( + '\'${tableCollection.childTableField.relationshipFields[i].fieldName}\':${getUpdateValue(tableCollection.childTableField.relationshipFields[i], rule)}'); } return _retVal.toString(); } @@ -2430,10 +2666,14 @@ String getDefaultValue(SqfEntityFieldType newField) { case DbType.bool: return newField.defaultValue == true ? '1' : '0'; case DbType.date: - return newField.defaultValue.toString().contains('DateTime.now()') ? 'date(\'now\')' : "'${newField.defaultValue}'"; + return newField.defaultValue.toString().contains('DateTime.now()') + ? 'date(\'now\')' + : "'${newField.defaultValue}'"; case DbType.datetime: case DbType.datetimeUtc: - return newField.defaultValue.toString().contains('DateTime.now()') ? 'datetime(\'now\')' : "'${newField.defaultValue}'"; + return newField.defaultValue.toString().contains('DateTime.now()') + ? 'datetime(\'now\')' + : "'${newField.defaultValue}'"; default: return "'${newField.defaultValue}'"; // return its value @@ -2452,9 +2692,14 @@ String toSqliteAddColumnString(SqfEntityFieldType field) { final StringBuffer retVal = StringBuffer('${field.fieldName} $_dbType') ..write(field.isNotNull ?? false ? ' NOT NULL' : '') ..write(field.isUnique ?? false ? ' UNIQUE' : '') - ..write(field.collate != null ? ' COLLATE ${field.collate.toString().replaceAll('Collate.', '')}' : '') - ..write(field.checkCondition != null && field.checkCondition!.isNotEmpty ? ' CHECK(${field.checkCondition!.replaceAll('(this)', field.fieldName!)})' : '') - ..write(field.defaultValue != null ? ' DEFAULT ${getDefaultValue(field)}' : ''); + ..write(field.collate != null + ? ' COLLATE ${field.collate.toString().replaceAll('Collate.', '')}' + : '') + ..write(field.checkCondition != null && field.checkCondition!.isNotEmpty + ? ' CHECK(${field.checkCondition!.replaceAll('(this)', field.fieldName!)})' + : '') + ..write( + field.defaultValue != null ? ' DEFAULT ${getDefaultValue(field)}' : ''); return retVal.toString(); } @@ -2530,7 +2775,8 @@ class TableField { } class SqlSyntax { - static TableField setField(TableField? field, String? fName, [DbType? fType]) { + static TableField setField(TableField? field, String? fName, + [DbType? fType]) { if (field == null) { field = TableField()..fieldName = fName; if (fType != null) { @@ -2560,7 +2806,16 @@ class SqlSyntax { } class QueryParams { - QueryParams({this.selectColumns, this.whereString, this.whereArguments, this.orderBy, this.groupBy, this.having, this.distinct, this.limit, this.offset}); + QueryParams( + {this.selectColumns, + this.whereString, + this.whereArguments, + this.orderBy, + this.groupBy, + this.having, + this.distinct, + this.limit, + this.offset}); List? selectColumns; String? whereString; List? whereArguments; @@ -2600,112 +2855,200 @@ class FilterBase extends FluentBase { ConjunctionBase equals(dynamic pValue) { param.expression = '='; - filterBuilder._addedBlocks = _waitingNot == '' ? setCriteria(pValue, filterBuilder.parameters, param, SqlSyntax.EQuals, filterBuilder._addedBlocks) : setCriteria(pValue, filterBuilder.parameters, param, SqlSyntax.NotEQuals, filterBuilder._addedBlocks); + filterBuilder._addedBlocks = _waitingNot == '' + ? setCriteria(pValue, filterBuilder.parameters, param, SqlSyntax.EQuals, + filterBuilder._addedBlocks) + : setCriteria(pValue, filterBuilder.parameters, param, + SqlSyntax.NotEQuals, filterBuilder._addedBlocks); _waitingNot = ''; - filterBuilder._addedBlocks.needEndBlock![filterBuilder._blockIndex] = filterBuilder._addedBlocks.retVal; + filterBuilder._addedBlocks.needEndBlock![filterBuilder._blockIndex] = + filterBuilder._addedBlocks.retVal; return filterBuilder; } ConjunctionBase equalsOrNull(dynamic pValue) { param.expression = '='; - filterBuilder._addedBlocks = _waitingNot == '' ? setCriteria(pValue, filterBuilder.parameters, param, SqlSyntax.EQualsOrNull, filterBuilder._addedBlocks) : setCriteria(pValue, filterBuilder.parameters, param, SqlSyntax.NotEQualsOrNull, filterBuilder._addedBlocks); + filterBuilder._addedBlocks = _waitingNot == '' + ? setCriteria(pValue, filterBuilder.parameters, param, + SqlSyntax.EQualsOrNull, filterBuilder._addedBlocks) + : setCriteria(pValue, filterBuilder.parameters, param, + SqlSyntax.NotEQualsOrNull, filterBuilder._addedBlocks); _waitingNot = ''; - filterBuilder._addedBlocks.needEndBlock![filterBuilder._blockIndex] = filterBuilder._addedBlocks.retVal; + filterBuilder._addedBlocks.needEndBlock![filterBuilder._blockIndex] = + filterBuilder._addedBlocks.retVal; return filterBuilder; } ConjunctionBase isNull() { - filterBuilder._addedBlocks = setCriteria(0, filterBuilder.parameters, param, SqlSyntax.IsNULL.replaceAll(SqlSyntax.notKeyword, _waitingNot), filterBuilder._addedBlocks); + filterBuilder._addedBlocks = setCriteria( + 0, + filterBuilder.parameters, + param, + SqlSyntax.IsNULL.replaceAll(SqlSyntax.notKeyword, _waitingNot), + filterBuilder._addedBlocks); _waitingNot = ''; - filterBuilder._addedBlocks.needEndBlock![filterBuilder._blockIndex] = filterBuilder._addedBlocks.retVal; + filterBuilder._addedBlocks.needEndBlock![filterBuilder._blockIndex] = + filterBuilder._addedBlocks.retVal; return filterBuilder; } ConjunctionBase contains(dynamic pValue) { if (pValue != null) { - filterBuilder._addedBlocks = setCriteria('%${pValue.toString()}%', filterBuilder.parameters, param, SqlSyntax.Contains.replaceAll(SqlSyntax.notKeyword, _waitingNot), filterBuilder._addedBlocks); + filterBuilder._addedBlocks = setCriteria( + '%${pValue.toString()}%', + filterBuilder.parameters, + param, + SqlSyntax.Contains.replaceAll(SqlSyntax.notKeyword, _waitingNot), + filterBuilder._addedBlocks); _waitingNot = ''; - filterBuilder._addedBlocks.needEndBlock![filterBuilder._blockIndex] = filterBuilder._addedBlocks.retVal; + filterBuilder._addedBlocks.needEndBlock![filterBuilder._blockIndex] = + filterBuilder._addedBlocks.retVal; } return filterBuilder; } ConjunctionBase startsWith(dynamic pValue) { if (pValue != null) { - filterBuilder._addedBlocks = setCriteria('${pValue.toString()}%', filterBuilder.parameters, param, SqlSyntax.Contains.replaceAll(SqlSyntax.notKeyword, _waitingNot), filterBuilder._addedBlocks); + filterBuilder._addedBlocks = setCriteria( + '${pValue.toString()}%', + filterBuilder.parameters, + param, + SqlSyntax.Contains.replaceAll(SqlSyntax.notKeyword, _waitingNot), + filterBuilder._addedBlocks); _waitingNot = ''; - filterBuilder._addedBlocks.needEndBlock![filterBuilder._blockIndex] = filterBuilder._addedBlocks.retVal; - filterBuilder._addedBlocks.needEndBlock![filterBuilder._blockIndex] = filterBuilder._addedBlocks.retVal; + filterBuilder._addedBlocks.needEndBlock![filterBuilder._blockIndex] = + filterBuilder._addedBlocks.retVal; + filterBuilder._addedBlocks.needEndBlock![filterBuilder._blockIndex] = + filterBuilder._addedBlocks.retVal; } return filterBuilder; } ConjunctionBase endsWith(dynamic pValue) { if (pValue != null) { - filterBuilder._addedBlocks = setCriteria('%${pValue.toString()}', filterBuilder.parameters, param, SqlSyntax.Contains.replaceAll(SqlSyntax.notKeyword, _waitingNot), filterBuilder._addedBlocks); + filterBuilder._addedBlocks = setCriteria( + '%${pValue.toString()}', + filterBuilder.parameters, + param, + SqlSyntax.Contains.replaceAll(SqlSyntax.notKeyword, _waitingNot), + filterBuilder._addedBlocks); _waitingNot = ''; - filterBuilder._addedBlocks.needEndBlock![filterBuilder._blockIndex] = filterBuilder._addedBlocks.retVal; + filterBuilder._addedBlocks.needEndBlock![filterBuilder._blockIndex] = + filterBuilder._addedBlocks.retVal; } return filterBuilder; } ConjunctionBase between(dynamic pFirst, dynamic pLast) { if (pFirst != null && pLast != null) { - filterBuilder._addedBlocks = setCriteria(pFirst, filterBuilder.parameters, param, SqlSyntax.Between.replaceAll(SqlSyntax.notKeyword, _waitingNot), filterBuilder._addedBlocks, pLast); + filterBuilder._addedBlocks = setCriteria( + pFirst, + filterBuilder.parameters, + param, + SqlSyntax.Between.replaceAll(SqlSyntax.notKeyword, _waitingNot), + filterBuilder._addedBlocks, + pLast); } else if (pFirst != null) { if (_waitingNot != '') { - filterBuilder._addedBlocks = setCriteria(pFirst, filterBuilder.parameters, param, SqlSyntax.LessThan, filterBuilder._addedBlocks); + filterBuilder._addedBlocks = setCriteria( + pFirst, + filterBuilder.parameters, + param, + SqlSyntax.LessThan, + filterBuilder._addedBlocks); } else { - filterBuilder._addedBlocks = setCriteria(pFirst, filterBuilder.parameters, param, SqlSyntax.GreaterThanOrEquals, filterBuilder._addedBlocks); + filterBuilder._addedBlocks = setCriteria( + pFirst, + filterBuilder.parameters, + param, + SqlSyntax.GreaterThanOrEquals, + filterBuilder._addedBlocks); } } else if (pLast != null) { if (_waitingNot != '') { - filterBuilder._addedBlocks = setCriteria(pLast, filterBuilder.parameters, param, SqlSyntax.GreaterThan, filterBuilder._addedBlocks); + filterBuilder._addedBlocks = setCriteria( + pLast, + filterBuilder.parameters, + param, + SqlSyntax.GreaterThan, + filterBuilder._addedBlocks); } else { - filterBuilder._addedBlocks = setCriteria(pLast, filterBuilder.parameters, param, SqlSyntax.LessThanOrEquals, filterBuilder._addedBlocks); + filterBuilder._addedBlocks = setCriteria( + pLast, + filterBuilder.parameters, + param, + SqlSyntax.LessThanOrEquals, + filterBuilder._addedBlocks); } } _waitingNot = ''; - filterBuilder._addedBlocks.needEndBlock![filterBuilder._blockIndex] = filterBuilder._addedBlocks.retVal; + filterBuilder._addedBlocks.needEndBlock![filterBuilder._blockIndex] = + filterBuilder._addedBlocks.retVal; return filterBuilder; } ConjunctionBase greaterThan(dynamic pValue) { param.expression = '>'; - filterBuilder._addedBlocks = _waitingNot == '' ? setCriteria(pValue, filterBuilder.parameters, param, SqlSyntax.GreaterThan, filterBuilder._addedBlocks) : setCriteria(pValue, filterBuilder.parameters, param, SqlSyntax.LessThanOrEquals, filterBuilder._addedBlocks); + filterBuilder._addedBlocks = _waitingNot == '' + ? setCriteria(pValue, filterBuilder.parameters, param, + SqlSyntax.GreaterThan, filterBuilder._addedBlocks) + : setCriteria(pValue, filterBuilder.parameters, param, + SqlSyntax.LessThanOrEquals, filterBuilder._addedBlocks); _waitingNot = ''; - filterBuilder._addedBlocks.needEndBlock![filterBuilder._blockIndex] = filterBuilder._addedBlocks.retVal; + filterBuilder._addedBlocks.needEndBlock![filterBuilder._blockIndex] = + filterBuilder._addedBlocks.retVal; return filterBuilder; } ConjunctionBase lessThan(dynamic pValue) { param.expression = '<'; - filterBuilder._addedBlocks = _waitingNot == '' ? setCriteria(pValue, filterBuilder.parameters, param, SqlSyntax.LessThan, filterBuilder._addedBlocks) : setCriteria(pValue, filterBuilder.parameters, param, SqlSyntax.GreaterThanOrEquals, filterBuilder._addedBlocks); + filterBuilder._addedBlocks = _waitingNot == '' + ? setCriteria(pValue, filterBuilder.parameters, param, + SqlSyntax.LessThan, filterBuilder._addedBlocks) + : setCriteria(pValue, filterBuilder.parameters, param, + SqlSyntax.GreaterThanOrEquals, filterBuilder._addedBlocks); _waitingNot = ''; - filterBuilder._addedBlocks.needEndBlock![filterBuilder._blockIndex] = filterBuilder._addedBlocks.retVal; + filterBuilder._addedBlocks.needEndBlock![filterBuilder._blockIndex] = + filterBuilder._addedBlocks.retVal; return filterBuilder; } ConjunctionBase greaterThanOrEquals(dynamic pValue) { param.expression = '>='; - filterBuilder._addedBlocks = _waitingNot == '' ? setCriteria(pValue, filterBuilder.parameters, param, SqlSyntax.GreaterThanOrEquals, filterBuilder._addedBlocks) : setCriteria(pValue, filterBuilder.parameters, param, SqlSyntax.LessThan, filterBuilder._addedBlocks); + filterBuilder._addedBlocks = _waitingNot == '' + ? setCriteria(pValue, filterBuilder.parameters, param, + SqlSyntax.GreaterThanOrEquals, filterBuilder._addedBlocks) + : setCriteria(pValue, filterBuilder.parameters, param, + SqlSyntax.LessThan, filterBuilder._addedBlocks); _waitingNot = ''; - filterBuilder._addedBlocks.needEndBlock![filterBuilder._blockIndex] = filterBuilder._addedBlocks.retVal; + filterBuilder._addedBlocks.needEndBlock![filterBuilder._blockIndex] = + filterBuilder._addedBlocks.retVal; return filterBuilder; } ConjunctionBase lessThanOrEquals(dynamic pValue) { param.expression = '<='; - filterBuilder._addedBlocks = _waitingNot == '' ? setCriteria(pValue, filterBuilder.parameters, param, SqlSyntax.LessThanOrEquals, filterBuilder._addedBlocks) : setCriteria(pValue, filterBuilder.parameters, param, SqlSyntax.GreaterThan, filterBuilder._addedBlocks); + filterBuilder._addedBlocks = _waitingNot == '' + ? setCriteria(pValue, filterBuilder.parameters, param, + SqlSyntax.LessThanOrEquals, filterBuilder._addedBlocks) + : setCriteria(pValue, filterBuilder.parameters, param, + SqlSyntax.GreaterThan, filterBuilder._addedBlocks); _waitingNot = ''; - filterBuilder._addedBlocks.needEndBlock![filterBuilder._blockIndex] = filterBuilder._addedBlocks.retVal; + filterBuilder._addedBlocks.needEndBlock![filterBuilder._blockIndex] = + filterBuilder._addedBlocks.retVal; return filterBuilder; } ConjunctionBase inValues(dynamic pValue) { - filterBuilder._addedBlocks = setCriteria(pValue, filterBuilder.parameters, param, SqlSyntax.IN.replaceAll(SqlSyntax.notKeyword, _waitingNot), filterBuilder._addedBlocks); + filterBuilder._addedBlocks = setCriteria( + pValue, + filterBuilder.parameters, + param, + SqlSyntax.IN.replaceAll(SqlSyntax.notKeyword, _waitingNot), + filterBuilder._addedBlocks); _waitingNot = ''; - filterBuilder._addedBlocks.needEndBlock![filterBuilder._blockIndex] = filterBuilder._addedBlocks.retVal; + filterBuilder._addedBlocks.needEndBlock![filterBuilder._blockIndex] = + filterBuilder._addedBlocks.retVal; return filterBuilder; } } @@ -2796,8 +3139,11 @@ abstract class ConjunctionBase extends FluentBase { /// String whereCriteria, write raw query without 'where' keyword. Like this: 'field1 like 'test%' and field2 = 3' ConjunctionBase where(String? whereCriteria, {dynamic parameterValue}) { if (whereCriteria != null && whereCriteria != '') { - final DbParameter param = DbParameter(columnName: parameterValue == null ? null : '', hasParameter: parameterValue != null); - _addedBlocks = setCriteria(parameterValue ?? 0, parameters, param, '($whereCriteria)', _addedBlocks); + final DbParameter param = DbParameter( + columnName: parameterValue == null ? null : '', + hasParameter: parameterValue != null); + _addedBlocks = setCriteria(parameterValue ?? 0, parameters, param, + '($whereCriteria)', _addedBlocks); _addedBlocks.needEndBlock![_blockIndex] = _addedBlocks.retVal; } return this; @@ -2930,7 +3276,11 @@ abstract class ConjunctionBase extends FluentBase { Future toSingle(); Future toSingleOrDefault(); Future toCount(); - Future> toList({bool preload = false, List? preloadFields, bool loadParents = false, List? loadedFields}); + Future> toList( + {bool preload = false, + List? preloadFields, + bool loadParents = false, + List? loadedFields}); Future toJson(); Future toJsonWithChilds(); Future> toMapList(); @@ -2943,7 +3293,8 @@ abstract class ConjunctionBase extends FluentBase { /// This method returns Primary Key List. /// List Future> toListPrimaryKey([bool buildParams = true]) { - final msg = 'toListPrimaryKey method can be implemented in tables not view objects'; + final msg = + 'toListPrimaryKey method can be implemented in tables not view objects'; throw UnimplementedError(msg); } @@ -2971,17 +3322,24 @@ abstract class ConjunctionBase extends FluentBase { for (DbParameter param in parameters) { if (param.columnName != null) { if (param.value is List && !param.hasParameter) { - param.value = param.dbType == DbType.text || param.value[0] is String ? '\'${param.value.join('\',\'')}\'' : param.value.join(','); - whereString += param.whereString.replaceAll('{field}', param.columnName!).replaceAll('?', param.value.toString()); + param.value = param.dbType == DbType.text || param.value[0] is String + ? '\'${param.value.join('\',\'')}\'' + : param.value.join(','); + whereString += param.whereString + .replaceAll('{field}', param.columnName!) + .replaceAll('?', param.value.toString()); param.value = null; } else { - if (param.value is Map && param.value['sql'] != null) { + if (param.value is Map && + param.value['sql'] != null) { param - ..whereString = param.whereString.replaceAll('?', param.value['sql'].toString()) + ..whereString = param.whereString + .replaceAll('?', param.value['sql'].toString()) ..dbType = DbType.integer ..value = param.value['args']; } - whereString += param.whereString.replaceAll('{field}', param.columnName!); + whereString += + param.whereString.replaceAll('{field}', param.columnName!); } if (!param.whereString.contains('?')) { } else { @@ -3001,8 +3359,12 @@ abstract class ConjunctionBase extends FluentBase { case DbType.date: case DbType.datetime: case DbType.datetimeUtc: - param.value = param.value == null ? null : (param.value as DateTime).millisecondsSinceEpoch; - param.value2 = param.value2 == null ? null : (param.value2 as DateTime).millisecondsSinceEpoch; + param.value = param.value == null + ? null + : (param.value as DateTime).millisecondsSinceEpoch; + param.value2 = param.value2 == null + ? null + : (param.value2 as DateTime).millisecondsSinceEpoch; break; default: } @@ -3025,7 +3387,8 @@ abstract class ConjunctionBase extends FluentBase { } if (_tableObj!.softDeleteActivated) { if (whereString != '') { - whereString = '${!_getIsDeleted ? 'ifnull(isDeleted,0)=0 AND' : ''} ($whereString)'; + whereString = + '${!_getIsDeleted ? 'ifnull(isDeleted,0)=0 AND' : ''} ($whereString)'; } else if (!_getIsDeleted) { whereString = 'ifnull(isDeleted,0)=0'; } @@ -3049,10 +3412,14 @@ abstract class FluentBase { List whereArguments = []; String whereString = ''; - AddedBlocks setCriteria(dynamic pValue, List? parameters, DbParameter? param, String? sqlSyntax, AddedBlocks? addedBlocks, [dynamic pValue2]) { + AddedBlocks setCriteria(dynamic pValue, List? parameters, + DbParameter? param, String? sqlSyntax, AddedBlocks? addedBlocks, + [dynamic pValue2]) { bool sp = addedBlocks!.needEndBlock![addedBlocks.needEndBlock!.length - 1]; if (pValue != null) { - param!.whereString += parameters!.isNotEmpty ? parameters[parameters.length - 1].wOperator : ''; + param!.whereString += parameters!.isNotEmpty + ? parameters[parameters.length - 1].wOperator + : ''; for (int i = 1; i < addedBlocks.waitingStartBlock!.length; i++) { if (addedBlocks.waitingStartBlock![i]) { @@ -3091,15 +3458,23 @@ class BoolResult { @override String toString() { if (success) { - return successMessage != null && successMessage != '' ? successMessage! : 'Result: OK! Successful'; + return successMessage != null && successMessage != '' + ? successMessage! + : 'Result: OK! Successful'; } else { - return errorMessage != null && errorMessage != '' ? errorMessage! : 'Result: ERROR!'; + return errorMessage != null && errorMessage != '' + ? errorMessage! + : 'Result: ERROR!'; } } } class BoolCommitResult { - BoolCommitResult({required this.success, this.successMessage, this.errorMessage, this.commitResult}); + BoolCommitResult( + {required this.success, + this.successMessage, + this.errorMessage, + this.commitResult}); String? successMessage; String? errorMessage; List? commitResult; @@ -3108,15 +3483,28 @@ class BoolCommitResult { @override String toString() { if (success) { - return successMessage != null && successMessage != '' ? successMessage! : 'Result: OK! Successful'; + return successMessage != null && successMessage != '' + ? successMessage! + : 'Result: OK! Successful'; } else { - return errorMessage != null && errorMessage != '' ? errorMessage! : 'Result: ERROR!'; + return errorMessage != null && errorMessage != '' + ? errorMessage! + : 'Result: ERROR!'; } } } class DbParameter { - DbParameter({this.columnName, this.dbType, this.expression = '', this.value, this.value2, this.whereString = '', this.wOperator = '', this.wStartBlock = false, this.hasParameter = false}); + DbParameter( + {this.columnName, + this.dbType, + this.expression = '', + this.value, + this.value2, + this.whereString = '', + this.wOperator = '', + this.wStartBlock = false, + this.hasParameter = false}); String? columnName; DbType? dbType; dynamic value; @@ -3151,18 +3539,21 @@ class SqfEntityTableBase { void init() { objectType = objectType ?? ObjectType.table; - print('init() -> ${modelName == null ? '' : 'modelname: $modelName,'}tableName:$tableName'); + print( + 'init() -> ${modelName == null ? '' : 'modelname: $modelName,'}tableName:$tableName'); modelName = toModelName(modelName, tableName!); if (relationType != RelationType.MANY_TO_MANY) { - primaryKeyType = primaryKeyType ?? PrimaryKeyType.integer_auto_incremental; + primaryKeyType = + primaryKeyType ?? PrimaryKeyType.integer_auto_incremental; } useSoftDeleting = useSoftDeleting ?? false; initialized = false; if (primaryKeyName != null && primaryKeyName!.isNotEmpty) { if (!primaryKeyNames.contains(primaryKeyName)) { primaryKeyNames.add(primaryKeyName!); - primaryKeyTypes.add(primaryKeyType == PrimaryKeyType.text ? 'String' : 'int'); + primaryKeyTypes + .add(primaryKeyType == PrimaryKeyType.text ? 'String' : 'int'); } } final List _addRelatedFields = []; @@ -3173,7 +3564,8 @@ class SqfEntityTableBase { if (field is SqfEntityFieldRelationshipBase) { field ..relationshipName = field.relationshipName ?? modelName - ..formDropDownTextField = field.formDropDownTextField ?? getformListTitleField(field.table!) + ..formDropDownTextField = + field.formDropDownTextField ?? getformListTitleField(field.table!) ..dbType = field.table == null ? primaryKeyType != PrimaryKeyType.text ? DbType.integer @@ -3186,14 +3578,19 @@ class SqfEntityTableBase { if (field.relationType != RelationType.MANY_TO_MANY) { relationType = relationType ?? field.relationType; } - if (field.relationType == RelationType.ONE_TO_ONE && field.table != this) { + if (field.relationType == RelationType.ONE_TO_ONE && + field.table != this) { // primaryKeyName = primaryKeyName != null && primaryKeyName.isNotEmpty // ? '_$primaryKeyName' // : ''; - if ((primaryKeyName == null || primaryKeyName!.isEmpty) && field.isPrimaryKeyField!) { + if ((primaryKeyName == null || primaryKeyName!.isEmpty) && + field.isPrimaryKeyField!) { primaryKeyType = field.table!.primaryKeyType; } - field.fieldName = field.fieldName == null || field.fieldName!.startsWith('_') ? field.fieldName : '_${field.fieldName}'; + field.fieldName = + field.fieldName == null || field.fieldName!.startsWith('_') + ? field.fieldName + : '_${field.fieldName}'; } field.primaryKeyIndex = 0; if (!field.relationshipFields.contains(field)) { @@ -3201,11 +3598,16 @@ class SqfEntityTableBase { } int _primaryKeyIndex = 0; - field.table!.fields!.where((f) => f.isPrimaryKeyField == true && f.fieldName != field.fieldName!).forEach((f) { + field.table!.fields! + .where((f) => + f.isPrimaryKeyField == true && f.fieldName != field.fieldName!) + .forEach((f) { _primaryKeyIndex++; final newField = SqfEntityFieldBase( //'${tocamelCase(field.table!.tableName!)}${toCamelCase(f.fieldName!)}', - (tableName == field.table!.tableName ? f.fieldName : '${tocamelCase(field.table!.tableName!)}${toCamelCase(f.fieldName!)}')!, + (tableName == field.table!.tableName + ? f.fieldName + : '${tocamelCase(field.table!.tableName!)}${toCamelCase(f.fieldName!)}')!, f.dbType!, defaultValue: f.defaultValue, primaryKeyIndex: _primaryKeyIndex, @@ -3213,7 +3615,9 @@ class SqfEntityTableBase { maxValue: f.maxValue); //print('before field.relationshipFields.add. newField=${newField.fieldName} field.relationshipFields=${field.relationshipFields.map((e) => e.fieldName!).join(',')} '); field.relationshipFields.add(newField); - if (fields!.where((fi) => fi.fieldName == newField.fieldName).isEmpty) { + if (fields! + .where((fi) => fi.fieldName == newField.fieldName) + .isEmpty) { _addRelatedFields.add(newField); } }); @@ -3224,7 +3628,9 @@ class SqfEntityTableBase { primaryKeyTypes.add(dartType[field.dbType!.index].toString()); } } - if (field.dbType == DbType.date || field.dbType == DbType.datetime || field.dbType == DbType.datetimeUtc) { + if (field.dbType == DbType.date || + field.dbType == DbType.datetime || + field.dbType == DbType.datetimeUtc) { field.minValue = field.minValue ?? '1900-01-01'; } } @@ -3239,9 +3645,11 @@ class SqfEntityTableBase { String get createTableSQL => _createTableSQL(); String get createConstructure => __createConstructure(false, false); String get createConstructureWithId => __createConstructure(false, true); - String get createListParameterForQueryWithId => __createConstructure(true, true); + String get createListParameterForQueryWithId => + __createConstructure(true, true); String get createListParameterForQuery => __createConstructure(true, false); - String get createTableSQLnoForeignKeys => _createTableSQL(createForeignKeys: false); + String get createTableSQLnoForeignKeys => + _createTableSQL(createForeignKeys: false); String _createTableSQL({bool createForeignKeys = true}) { final _createTableSQL = StringBuffer(''); @@ -3275,7 +3683,8 @@ class SqfEntityTableBase { } if (field is SqfEntityFieldRelationshipBase && createForeignKeys) { // FOREIGN KEY(column_name) REFERENCES parent_table_name(reference_to) ON DELETE CASCADE - _createTableSQL.write(', FOREIGN KEY(${field.fieldName}) REFERENCES ${field.table!.tableName}(${field.table!.primaryKeyNames[0]}) ON DELETE ${field.deleteRule.toString().replaceAll('_', ' ').replaceAll('DeleteRule.', '')}'); + _createTableSQL.write( + ', FOREIGN KEY(${field.fieldName}) REFERENCES ${field.table!.tableName}(${field.table!.primaryKeyNames[0]}) ON DELETE ${field.deleteRule.toString().replaceAll('_', ' ').replaceAll('DeleteRule.', '')}'); } } String createTableSQL = _createTableSQL.toString(); @@ -3290,7 +3699,8 @@ class SqfEntityTableBase { createTableSQL = createTableSQL.substring(1); createTableSQL = 'Create table $tableName ($createTableSQL)'; } else { - createTableSQL = 'Create table $tableName ($primaryKeyName $createTableSQL)'; + createTableSQL = + 'Create table $tableName ($primaryKeyName $createTableSQL)'; } return createTableSQL; } @@ -3298,7 +3708,10 @@ class SqfEntityTableBase { String __createConstructure(bool isQuery, bool withId) { final _retVal = StringBuffer(); //print('__createConstructure for $tableName'); - if (primaryKeyName != null && primaryKeyName!.isNotEmpty && relationType != RelationType.ONE_TO_ONE && (withId || primaryKeyType != PrimaryKeyType.integer_auto_incremental)) { + if (primaryKeyName != null && + primaryKeyName!.isNotEmpty && + relationType != RelationType.ONE_TO_ONE && + (withId || primaryKeyType != PrimaryKeyType.integer_auto_incremental)) { _retVal ..write(',') ..write('this.$primaryKeyName'); @@ -3322,8 +3735,10 @@ class SqfEntityTableBase { continue; } if (fields![i] is SqfEntityFieldRelationshipBase) { - final SqfEntityFieldRelationshipBase field = fields![i] as SqfEntityFieldRelationshipBase; - if (field.relationType == RelationType.MANY_TO_MANY && relationType != RelationType.MANY_TO_MANY) { + final SqfEntityFieldRelationshipBase field = + fields![i] as SqfEntityFieldRelationshipBase; + if (field.relationType == RelationType.MANY_TO_MANY && + relationType != RelationType.MANY_TO_MANY) { continue; } } @@ -3332,8 +3747,11 @@ class SqfEntityTableBase { _retVal.write(', $consStr'); if (isQuery) { if (fields![i].dbType == DbType.time) { - _retVal.write(' != null ? defaultTimeFormat.format(toDateTime(${fields![i].fieldName}!)) : null'); - } else if (fields![i].dbType == DbType.date || fields![i].dbType == DbType.datetime || fields![i].dbType == DbType.datetimeUtc) { + _retVal.write( + ' != null ? defaultTimeFormat.format(toDateTime(${fields![i].fieldName}!)) : null'); + } else if (fields![i].dbType == DbType.date || + fields![i].dbType == DbType.datetime || + fields![i].dbType == DbType.datetimeUtc) { _retVal.write(' != null ? $consStr !.millisecondsSinceEpoch: null'); } } @@ -3375,12 +3793,15 @@ class SqfEntitySequenceBase { SqfEntitySequenceBase init() { cycle = cycle ?? false; if (minValue >= maxValue) { - throw Exception('SQFENTITIY: SEQUENCE ($sequenceName) INITIALIZE ERROR! The maxValue must be greater than minValue'); + throw Exception( + 'SQFENTITIY: SEQUENCE ($sequenceName) INITIALIZE ERROR! The maxValue must be greater than minValue'); } else if (!(minValue <= startWith && startWith < maxValue)) { - throw Exception('SQFENTITIY: SEQUENCE ($sequenceName) INITIALIZE ERROR! The startWith value must between minValue and maxValue'); + throw Exception( + 'SQFENTITIY: SEQUENCE ($sequenceName) INITIALIZE ERROR! The startWith value must between minValue and maxValue'); } - modelName = modelName ?? '${sequenceName!.substring(0, 1).toUpperCase() + sequenceName!.substring(1).toLowerCase()}Sequence'; + modelName = modelName ?? + '${sequenceName!.substring(0, 1).toUpperCase() + sequenceName!.substring(1).toLowerCase()}Sequence'; //print('>>>>>>>>>>>>>>>>>>>>>>>>>>>> SqfEntitySequenceBase of [$sequenceName] initialized successfully'); return this; @@ -3393,7 +3814,21 @@ class SqfEntitySequenceBase { } abstract class SqfEntityFieldType { - SqfEntityFieldType(this.fieldName, this.dbType, {this.defaultValue, this.minValue, this.maxValue, this.table, this.sequencedBy, this.primaryKeyIndex, this.isPrimaryKeyField, this.isNotNull, this.isUnique, this.checkCondition, this.isIndex, this.isIndexGroup, this.collate, this.formLabelText}); + SqfEntityFieldType(this.fieldName, this.dbType, + {this.defaultValue, + this.minValue, + this.maxValue, + this.table, + this.sequencedBy, + this.primaryKeyIndex, + this.isPrimaryKeyField, + this.isNotNull, + this.isUnique, + this.checkCondition, + this.isIndex, + this.isIndexGroup, + this.collate, + this.formLabelText}); String? fieldName; DbType? dbType; dynamic defaultValue; @@ -3423,7 +3858,21 @@ abstract class SqfEntityFieldType { class SqfEntityFieldBase implements SqfEntityFieldType { @override - SqfEntityFieldBase(this.fieldName, this.dbType, {this.defaultValue, this.minValue, this.maxValue, this.table, this.sequencedBy, this.isPrimaryKeyField, this.primaryKeyIndex, this.isNotNull, this.isUnique, this.isIndex, this.isIndexGroup, this.checkCondition, this.collate, this.formLabelText}); + SqfEntityFieldBase(this.fieldName, this.dbType, + {this.defaultValue, + this.minValue, + this.maxValue, + this.table, + this.sequencedBy, + this.isPrimaryKeyField, + this.primaryKeyIndex, + this.isNotNull, + this.isUnique, + this.isIndex, + this.isIndexGroup, + this.checkCondition, + this.collate, + this.formLabelText}); @override String? fieldName; @override @@ -3683,15 +4132,37 @@ class SqfEntityFieldPrivateClassBase implements SqfEntityFieldType { } class SqfEntityFieldRelationshipBase implements SqfEntityFieldType { - SqfEntityFieldRelationshipBase(this.table, this.deleteRule, {this.fieldName, this.defaultValue, this.isPrimaryKeyField, this.minValue, this.maxValue, this.formDropDownTextField, this.formLabelText, this.relationshipName, this.relationType, this.manyToManyTableName, this.manyToManyTable, this.primaryKeyIndex, this.isNotNull, this.isUnique, this.isIndex, this.isIndexGroup, this.checkCondition, this.collate}) { + SqfEntityFieldRelationshipBase(this.table, this.deleteRule, + {this.fieldName, + this.defaultValue, + this.isPrimaryKeyField, + this.minValue, + this.maxValue, + this.formDropDownTextField, + this.formLabelText, + this.relationshipName, + this.relationType, + this.manyToManyTableName, + this.manyToManyTable, + this.primaryKeyIndex, + this.isNotNull, + this.isUnique, + this.isIndex, + this.isIndexGroup, + this.checkCondition, + this.collate}) { init(); } SqfEntityFieldRelationshipBase init() { if (table != null) { relationshipName = table!.modelName!; - dbType = table!.primaryKeyType == PrimaryKeyType.text ? DbType.text : DbType.integer; - table!.relationType = relationType == RelationType.ONE_TO_MANY ? relationType : null; - fieldName = fieldName ?? table!.tableName! + toCamelCase(table!.primaryKeyNames[0]); + dbType = table!.primaryKeyType == PrimaryKeyType.text + ? DbType.text + : DbType.integer; + table!.relationType = + relationType == RelationType.ONE_TO_MANY ? relationType : null; + fieldName = fieldName ?? + table!.tableName! + toCamelCase(table!.primaryKeyNames[0]); } else { //print('SqfEntityFieldRelationshipBase constructor: table = null: fieldName=$fieldName'); } @@ -3767,7 +4238,8 @@ class SqfEntityFieldRelationshipBase implements SqfEntityFieldType { } } catch (e) { print('ERROR when calling toFromMapString: dbType=${dbType.toString()}'); - throw Exception('ERROR when calling toFromMapString: fieldName:$fieldName dbType=${dbType.toString()}'); + throw Exception( + 'ERROR when calling toFromMapString: fieldName:$fieldName dbType=${dbType.toString()}'); } } @@ -3830,7 +4302,8 @@ abstract class SqfEntityModelBase { } //print('CHECK AND CONFIGURE MANY_TO_MANY RELATIONS'); // CHECK AND CONFIGURE MANY_TO_MANY RELATIONS - for (final field in table.fields!.whereType()) { + for (final field + in table.fields!.whereType()) { // if (field.relationType == RelationType.ONE_TO_MANY_VICEVERSA) { // field.relationType = RelationType.ONE_TO_MANY; // databaseTables! @@ -3842,12 +4315,22 @@ abstract class SqfEntityModelBase { // } else if (field.relationType == RelationType.MANY_TO_MANY) { print('found RelationShip ManyToMany'); - final many2ManyTableName = field.manyToManyTableName ?? '${table.tableName}${toCamelCase(field.table!.tableName!)}'; - table.relationType = table.relationType != RelationType.ONE_TO_ONE ? null : table.relationType; - field.table!.relationType = field.table!.relationType != RelationType.ONE_TO_ONE ? null : field.table!.relationType; + final many2ManyTableName = field.manyToManyTableName ?? + '${table.tableName}${toCamelCase(field.table!.tableName!)}'; + table.relationType = table.relationType != RelationType.ONE_TO_ONE + ? null + : table.relationType; + field.table!.relationType = + field.table!.relationType != RelationType.ONE_TO_ONE + ? null + : field.table!.relationType; field.manyToManyTableName = many2ManyTableName; - final many2manyTableExist = databaseTables!.where((t) => t.tableName!.toLowerCase() == many2ManyTableName.toLowerCase()).toList(); + final many2manyTableExist = databaseTables! + .where((t) => + t.tableName!.toLowerCase() == + many2ManyTableName.toLowerCase()) + .toList(); SqfEntityTableBase many2manyTable; if (many2manyTableExist.isNotEmpty) { many2manyTable = many2manyTableExist[0]; @@ -3859,26 +4342,58 @@ abstract class SqfEntityModelBase { ..primaryKeyType = null ..relationType = RelationType.MANY_TO_MANY ..useSoftDeleting = table.useSoftDeleting - ..fields = [SqfEntityFieldRelationshipBase(table, field.deleteRule, fieldName: table.primaryKeyNames[0] == field.table!.primaryKeyNames[0] ? '${table.tableName}${toCamelCase(table.primaryKeyNames[0])}' : table.primaryKeyNames[0], isPrimaryKeyField: true, relationType: RelationType.ONE_TO_MANY), SqfEntityFieldRelationshipBase(field.table, field.deleteRule, fieldName: table.primaryKeyNames[0] == field.table!.primaryKeyNames[0] ? '${field.table!.tableName}${toCamelCase(field.table!.primaryKeyNames[0])}' : field.table!.primaryKeyNames[0], isPrimaryKeyField: true, relationType: RelationType.ONE_TO_MANY)] + ..fields = [ + SqfEntityFieldRelationshipBase(table, field.deleteRule, + fieldName: table.primaryKeyNames[0] == + field.table!.primaryKeyNames[0] + ? '${table.tableName}${toCamelCase(table.primaryKeyNames[0])}' + : table.primaryKeyNames[0], + isPrimaryKeyField: true, + relationType: RelationType.ONE_TO_MANY), + SqfEntityFieldRelationshipBase(field.table, field.deleteRule, + fieldName: table.primaryKeyNames[0] == + field.table!.primaryKeyNames[0] + ? '${field.table!.tableName}${toCamelCase(field.table!.primaryKeyNames[0])}' + : field.table!.primaryKeyNames[0], + isPrimaryKeyField: true, + relationType: RelationType.ONE_TO_MANY) + ] ..init(); manyToManyTables.add(many2manyTable); } if (databaseTables!.length > 1) { - if (field.table!.fields!.where((f) => f is SqfEntityFieldRelationshipBase && f.relationType == RelationType.MANY_TO_MANY && f.table == table).isEmpty) { - databaseTables!.singleWhere((t) => t.tableName == field.table!.tableName!)..fields!.add(SqfEntityFieldRelationshipBase(table, field.deleteRule, manyToManyTableName: many2ManyTableName, manyToManyTable: many2manyTable, relationType: RelationType.MANY_TO_MANY)); + if (field.table!.fields! + .where((f) => + f is SqfEntityFieldRelationshipBase && + f.relationType == RelationType.MANY_TO_MANY && + f.table == table) + .isEmpty) { + databaseTables! + .singleWhere((t) => t.tableName == field.table!.tableName!) + ..fields!.add(SqfEntityFieldRelationshipBase( + table, field.deleteRule, + manyToManyTableName: many2ManyTableName, + manyToManyTable: many2manyTable, + relationType: RelationType.MANY_TO_MANY)); field.table!.init(); } } field.manyToManyTable = many2manyTable; - final rFieldList = field.table!.fields!.whereType().toList(); + final rFieldList = field.table!.fields! + .whereType() + .toList(); if (rFieldList.isNotEmpty) { for (final f in rFieldList) { - if (f.relationType != null && f.relationType == RelationType.MANY_TO_MANY && f.table != null && f.table == table) { + if (f.relationType != null && + f.relationType == RelationType.MANY_TO_MANY && + f.table != null && + f.table == table) { f.manyToManyTable = many2manyTable; } } } - } else if (field.relationType == RelationType.ONE_TO_ONE && (field.table != null && field.table != table)) { + } else if (field.relationType == RelationType.ONE_TO_ONE && + (field.table != null && field.table != table)) { table.relationType = RelationType.ONE_TO_ONE; } } @@ -3896,14 +4411,20 @@ abstract class SqfEntityModelBase { //region Helpers Functions /// SQFENTITY recognise tables that related to each other -List _getCollections(SqfEntityTableBase table, SqfEntityModelBase _m) { +List _getCollections( + SqfEntityTableBase table, SqfEntityModelBase _m) { final collectionList = []; - for (var _table in _m.databaseTables!.where((t) => t.relationType != RelationType.MANY_TO_MANY)) { - for (var field in _table.fields!.whereType()) { + for (var _table in _m.databaseTables! + .where((t) => t.relationType != RelationType.MANY_TO_MANY)) { + for (var field + in _table.fields!.whereType()) { if (field.table == null && _table.tableName == table.tableName!) { - collectionList.add(TableCollectionBase(table, field, relationType: field.relationType)); - } else if (field.table != null && field.table!.tableName == table.tableName!) { - collectionList.add(TableCollectionBase(_table, field, relationType: field.relationType)); + collectionList.add(TableCollectionBase(table, field, + relationType: field.relationType)); + } else if (field.table != null && + field.table!.tableName == table.tableName!) { + collectionList.add(TableCollectionBase(_table, field, + relationType: field.relationType)); } } } @@ -3951,10 +4472,14 @@ String toSingularName(String s) => s.endsWith('ies') String toSingularLowerName(String s) => toSingularName(s).toLowerCase(); /// Set model name by defined if the model name set null -String toModelName(String? modelName, String definedName) => modelName == null || modelName.isEmpty ? toCamelCase(toSingularName(definedName)) : toCamelCase(modelName); +String toModelName(String? modelName, String definedName) => + modelName == null || modelName.isEmpty + ? toCamelCase(toSingularName(definedName)) + : toCamelCase(modelName); /// Add preload comment -const String commentPreload = '''/// bool preload: if true, loads all related child objects (Set preload to true if you want to load all fields related to child or parent) +const String commentPreload = + '''/// bool preload: if true, loads all related child objects (Set preload to true if you want to load all fields related to child or parent) /// ex: methodname(preload:true) -> Loads all related objects /// List preloadFields: specify the fields you want to preload (preload parameter's value should also be "true") /// ex: methodname(preload:true, preloadFields:['plField1','plField2'... etc]) -> Loads only certain fields what you specified @@ -4134,7 +4659,9 @@ DbType parseDbType(String val) { val = 'text'; } else if (val.contains('int')) { val = 'integer'; - } else if (val.contains('double') || val.contains('float') || val.contains('numeric(')) { + } else if (val.contains('double') || + val.contains('float') || + val.contains('numeric(')) { val = 'real'; } else if (val.contains('decimal')) { val = 'numeric'; @@ -4145,7 +4672,8 @@ DbType parseDbType(String val) { } for (var o in DbType.values) { - if (sqLiteType[o.index].toLowerCase() == val || dartType[o.index].toLowerCase() == val) { + if (sqLiteType[o.index].toLowerCase() == val || + dartType[o.index].toLowerCase() == val) { return o; } } @@ -4169,13 +4697,15 @@ abstract class CrudOperationsBase { } Future saveOrThrow({bool ignoreBatch = true}) { - final msg = 'saveOrThrow method requires a table which has an auto incremented primaryKey'; + final msg = + 'saveOrThrow method requires a table which has an auto incremented primaryKey'; throw UnimplementedError(msg); } Future saveAs({bool ignoreBatch = true}) { // implementation saveAs() - final msg = 'saveAs method requires a table which has an auto incremented primaryKey'; + final msg = + 'saveAs method requires a table which has an auto incremented primaryKey'; throw UnimplementedError(msg); } @@ -4190,7 +4720,8 @@ abstract class CrudOperationsBase { /// upsertAll() method is faster then saveAll() method. upsertAll() should be used when you are sure that the primary key is greater than zero /// Returns a BoolCommitResult Future upsertAll(covariant List objList) { - final msg = 'upsertAll method can be implemented in tables not view objects'; + final msg = + 'upsertAll method can be implemented in tables not view objects'; throw UnimplementedError(msg); } @@ -4224,8 +4755,10 @@ abstract class TableBase extends CrudOperationsBase { bool isInsert = false; bool softDeleteActivated = false; BoolResult? saveResult; - Map toMap({bool forQuery = false, bool forJson = false, bool forView = false}); - Future> toMapWithChildren([bool forQuery = false, bool forJson = false, bool forView = false]); + Map toMap( + {bool forQuery = false, bool forJson = false, bool forView = false}); + Future> toMapWithChildren( + [bool forQuery = false, bool forJson = false, bool forView = false]); /// This method returns Json String String toJson(); diff --git a/sqfentity_gen/lib/sqfentity_form_gen.dart b/sqfentity_gen/lib/sqfentity_form_gen.dart index 1de426c..f8ddcbc 100644 --- a/sqfentity_gen/lib/sqfentity_form_gen.dart +++ b/sqfentity_gen/lib/sqfentity_form_gen.dart @@ -452,8 +452,7 @@ class ${modelName}AddState extends State { return retVal.toString(); case DbType.date: retVal.writeln('return TextFormField('); - retVal.writeln( - '''onTap: () => UITools.showDateTimePicker(context + retVal.writeln('''onTap: () => UITools.showDateTimePicker(context ${_getNullableValueField(field.minValue, 'minTime')} ${_getNullableValueField(field.maxValue, 'maxTime')} , onConfirm: (sqfSelectedDate) { diff --git a/sqfentity_gen/lib/sqfentity_gen.dart b/sqfentity_gen/lib/sqfentity_gen.dart index 4887b7e..34e9c82 100644 --- a/sqfentity_gen/lib/sqfentity_gen.dart +++ b/sqfentity_gen/lib/sqfentity_gen.dart @@ -21,6 +21,10 @@ import 'package:meta/meta.dart'; part 'sqfentity_base.dart'; part 'sqfentity_form_gen.dart'; +/// Creates basic forms based on tables and column definitions +/// String fields create Text Input +/// Relationships provides to create DropDown List that contains related fields +/// Also Valid Expressions are created automatically. Date Time Picker, Checkboxes, check non-nullable validators. etc. class SqfEntityFormCreator { SqfEntityFormCreator(this.tableModel, this.instancename); final DartObject tableModel; @@ -40,6 +44,7 @@ class SqfEntityFormCreator { } } +/// This class provides to build ORM models by converting dartObject class SqfEntityModelBuilder extends SqfEntityModelBase { SqfEntityModelBuilder(this.model, this.instancename); final DartObject model; diff --git a/sqfentity_gen/lib/src/sqfentity_formgenerator.dart b/sqfentity_gen/lib/src/sqfentity_formgenerator.dart index 3afce3b..6d5ab5a 100644 --- a/sqfentity_gen/lib/src/sqfentity_formgenerator.dart +++ b/sqfentity_gen/lib/src/sqfentity_formgenerator.dart @@ -44,7 +44,7 @@ class SqfEntityFormGenerator extends GeneratorForAnnotation { modelStr .writeln('// ignore_for_file: ${dbModel.ignoreForFile!.join(', ')}'); } - // print('${tables[0].modelName} Model recognized succesfuly'); + // print('${tables[0].modelName} Model recognized successfully'); modelStr.writeln('part of \'$path\';'); // print('before for (final table in tables), tables.length=${dbModel.formTables.length}'); diff --git a/sqfentity_gen/lib/src/sqfentity_generator.dart b/sqfentity_gen/lib/src/sqfentity_generator.dart index 2e4d7b0..150a205 100644 --- a/sqfentity_gen/lib/src/sqfentity_generator.dart +++ b/sqfentity_gen/lib/src/sqfentity_generator.dart @@ -33,7 +33,7 @@ class SqfEntityGenerator extends GeneratorForAnnotation { 'SQFENTITY GENERATOR: builder initialized (${builder.instancename})...'); final dbModel = builder.toModel(); - print('${dbModel.modelName} Model recognized succesfuly'); + print('${dbModel.modelName} Model recognized successfully'); final modelStr = MyStringBuffer() //..writeln('/*') // write output as commented to see what is wrong ..writeln(SqfEntityConverter(dbModel).createModelDatabase()) diff --git a/sqfentity_gen/pubspec.lock b/sqfentity_gen/pubspec.lock index f97d22b..85137af 100644 --- a/sqfentity_gen/pubspec.lock +++ b/sqfentity_gen/pubspec.lock @@ -5,176 +5,209 @@ packages: dependency: transitive description: name: _fe_analyzer_shared - url: "https://pub.dartlang.org" + sha256: "0816708f5fbcacca324d811297153fe3c8e047beb5c6752e12292d2974c17045" + url: "https://pub.dev" source: hosted - version: "46.0.0" + version: "62.0.0" analyzer: dependency: "direct main" description: name: analyzer - url: "https://pub.dartlang.org" + sha256: "21862995c9932cd082f89d72ae5f5e2c110d1a0204ad06e4ebaee8307b76b834" + url: "https://pub.dev" source: hosted - version: "4.6.0" + version: "6.0.0" args: dependency: transitive description: name: args - url: "https://pub.dartlang.org" + sha256: eef6c46b622e0494a36c5a12d10d77fb4e855501a91c1b9ef9339326e58f0596 + url: "https://pub.dev" source: hosted - version: "2.3.1" + version: "2.4.2" async: dependency: transitive description: name: async - url: "https://pub.dartlang.org" + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" + url: "https://pub.dev" source: hosted - version: "2.9.0" + version: "2.11.0" build: dependency: "direct main" description: name: build - url: "https://pub.dartlang.org" + sha256: "80184af8b6cb3e5c1c4ec6d8544d27711700bc3e6d2efad04238c7b5290889f0" + url: "https://pub.dev" source: hosted - version: "2.3.0" + version: "2.4.1" clock: dependency: transitive description: name: clock - url: "https://pub.dartlang.org" + sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf + url: "https://pub.dev" source: hosted version: "1.1.1" collection: dependency: transitive description: name: collection - url: "https://pub.dartlang.org" + sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687 + url: "https://pub.dev" source: hosted - version: "1.16.0" + version: "1.17.2" convert: dependency: transitive description: name: convert - url: "https://pub.dartlang.org" + sha256: "0f08b14755d163f6e2134cb58222dd25ea2a2ee8a195e53983d57c075324d592" + url: "https://pub.dev" source: hosted - version: "3.0.2" + version: "3.1.1" crypto: dependency: transitive description: name: crypto - url: "https://pub.dartlang.org" + sha256: ff625774173754681d66daaf4a448684fb04b78f902da9cb3d308c19cc5e8bab + url: "https://pub.dev" source: hosted - version: "3.0.2" + version: "3.0.3" + dart_internal: + dependency: transitive + description: + name: dart_internal + sha256: dae3976f383beddcfcd07ad5291a422df2c8c0a8a03c52cda63ac7b4f26e0f4e + url: "https://pub.dev" + source: hosted + version: "0.2.8" dart_style: dependency: transitive description: name: dart_style - url: "https://pub.dartlang.org" + sha256: "1efa911ca7086affd35f463ca2fc1799584fb6aa89883cf0af8e3664d6a02d55" + url: "https://pub.dev" source: hosted - version: "2.2.3" + version: "2.3.2" file: dependency: transitive description: name: file - url: "https://pub.dartlang.org" + sha256: "5fc22d7c25582e38ad9a8515372cd9a93834027aacf1801cf01164dac0ffa08c" + url: "https://pub.dev" source: hosted - version: "6.1.2" + version: "7.0.0" glob: dependency: transitive description: name: glob - url: "https://pub.dartlang.org" + sha256: "0e7014b3b7d4dac1ca4d6114f82bf1782ee86745b9b42a92c9289c23d8a0ab63" + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.2" intl: dependency: "direct main" description: name: intl - url: "https://pub.dartlang.org" + sha256: "3bc132a9dbce73a7e4a21a17d06e1878839ffbf975568bc875c60537824b0c4d" + url: "https://pub.dev" source: hosted - version: "0.17.0" + version: "0.18.1" logging: dependency: transitive description: name: logging - url: "https://pub.dartlang.org" + sha256: "623a88c9594aa774443aa3eb2d41807a48486b5613e67599fb4c41c0ad47c340" + url: "https://pub.dev" source: hosted - version: "1.0.2" + version: "1.2.0" meta: dependency: "direct main" description: name: meta - url: "https://pub.dartlang.org" + sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" + url: "https://pub.dev" source: hosted - version: "1.8.0" + version: "1.9.1" package_config: dependency: transitive description: name: package_config - url: "https://pub.dartlang.org" + sha256: "1c5b77ccc91e4823a5af61ee74e6b972db1ef98c2ff5a18d3161c982a55448bd" + url: "https://pub.dev" source: hosted version: "2.1.0" path: dependency: transitive description: name: path - url: "https://pub.dartlang.org" + sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" + url: "https://pub.dev" source: hosted - version: "1.8.2" + version: "1.8.3" pub_semver: dependency: transitive description: name: pub_semver - url: "https://pub.dartlang.org" + sha256: "40d3ab1bbd474c4c2328c91e3a7df8c6dd629b79ece4c4bd04bee496a224fb0c" + url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.1.4" source_gen: dependency: "direct main" description: name: source_gen - url: "https://pub.dartlang.org" + sha256: fc0da689e5302edb6177fdd964efcb7f58912f43c28c2047a808f5bfff643d16 + url: "https://pub.dev" source: hosted - version: "1.2.2" + version: "1.4.0" source_span: dependency: transitive description: name: source_span - url: "https://pub.dartlang.org" + sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" + url: "https://pub.dev" source: hosted - version: "1.9.1" + version: "1.10.0" string_scanner: dependency: transitive description: name: string_scanner - url: "https://pub.dartlang.org" + sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + url: "https://pub.dev" source: hosted - version: "1.1.1" + version: "1.2.0" term_glyph: dependency: transitive description: name: term_glyph - url: "https://pub.dartlang.org" + sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + url: "https://pub.dev" source: hosted version: "1.2.1" typed_data: dependency: transitive description: name: typed_data - url: "https://pub.dartlang.org" + sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c + url: "https://pub.dev" source: hosted - version: "1.3.1" + version: "1.3.2" watcher: dependency: transitive description: name: watcher - url: "https://pub.dartlang.org" + sha256: "3d2ad6751b3c16cf07c7fca317a1413b3f26530319181b37e3b9039b84fc01d8" + url: "https://pub.dev" source: hosted - version: "1.0.1" + version: "1.1.0" yaml: dependency: transitive description: name: yaml - url: "https://pub.dartlang.org" + sha256: "75769501ea3489fca56601ff33454fe45507ea3bfb014161abc3b43ae25989d5" + url: "https://pub.dev" source: hosted - version: "3.1.1" + version: "3.1.2" sdks: - dart: ">=2.17.0 <3.0.0" + dart: ">=3.0.0 <3.2.0" diff --git a/sqfentity_gen/pubspec.yaml b/sqfentity_gen/pubspec.yaml index 23e3b81..cfe107d 100644 --- a/sqfentity_gen/pubspec.yaml +++ b/sqfentity_gen/pubspec.yaml @@ -2,13 +2,13 @@ name: sqfentity_gen homepage: https://github.com/hhtokpinar/sqfEntity description: SqfnEntity Model Generator. SQLite ORM for Flutter lets you build and execute SQL commands easily and quickly with the help of fluent methods similar to .Net Entity Framework. -version: 2.3.0+4 +version: 2.4.0 environment: - sdk: ">=2.12.0 <3.0.0" + sdk: ">=2.17.0 <4.0.0" dependencies: build: ^2.3.0 source_gen: ^1.2.2 meta: ^1.7.0 - analyzer: ^4.1.0 - intl: ^0.17.0 \ No newline at end of file + analyzer: ^6.0.0 + intl: ^0.18.0 \ No newline at end of file