### Project Setup and Mason Usage Source: https://github.com/pckimlong/kimapp/blob/master/README.md Guides users through setting up the Kimapp monorepo, including cloning the repository, installing Melos and Mason CLIs, and using Mason bricks to generate new features. ```bash git clone https://github.com/pckimlong/kimapp.git cd kimapp dart pub global activate melos melos bootstrap dart pub global activate mason_cli cd mason mason get # Example: Generate a new feature mason make kimapp_feature --name user_management --table users ``` -------------------------------- ### Running the autoverpod_generator Example Source: https://github.com/pckimlong/kimapp/blob/master/pubs/autoverpod_generator/example/README.md Commands to install dependencies, build generated code, and run the Flutter application. ```bash flutter pub get flutter pub run build_runner build --delete-conflicting-outputs flutter run ``` -------------------------------- ### Dart Application Startup Task Source: https://github.com/pckimlong/kimapp/blob/master/mason/kimapp/__brick__/flutter_project_structure_guide.md Demonstrates how to define custom initialization tasks for an application using a `StartUpTask` abstract class. This example shows adding a system initialization task to the application's startup sequence. ```dart class InitMySystemTask extends StartUpTask { const InitMySystemTask(); @override Future initialize(LaunchContext context) async { await context.container.read(mySystemProvider.future); } } // Add to startup.dart const tasks = [ InitCacheManagerTask(), InitMySystemTask(), // Your new task ]; ``` -------------------------------- ### Installation Rules for Application Bundle Source: https://github.com/pckimlong/kimapp/blob/master/pubs/numpad_input/example/linux/CMakeLists.txt Defines the installation process for creating a relocatable application bundle. It cleans the bundle directory, installs the executable, ICU data, Flutter library, bundled plugin libraries, native assets, and Flutter assets. ```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) # Copy the native assets provided by the build.dart from all packages. set(NATIVE_ASSETS_DIR "${PROJECT_BUILD_DIR}native_assets/linux/") install(DIRECTORY "${NATIVE_ASSETS_DIR}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) # 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() ``` -------------------------------- ### Creating Relationships Source: https://github.com/pckimlong/kimapp/blob/master/packages/kimapp_generator/SCHEMA_GUIDE.md Illustrates how to define relationships between models using Kimapp's `Field.join` method. Examples cover one-to-one and one-to-many relationships with foreign and candidate keys. ```dart // One-to-one final profile = Field.join() .withForeignKey('profile_id') .withCandidateKey('id'); // One-to-many final posts = Field.join>() .withForeignKey('user_id') .withCandidateKey('author_id'); ``` -------------------------------- ### Supabase Integration Example Source: https://github.com/pckimlong/kimapp/blob/master/packages/kimapp_generator/SCHEMA_GUIDE.md Demonstrates how to integrate Kimapp-generated models with Supabase for data fetching. It shows using generated table name constants, select statements, field constants, and model deserialization. ```dart // Fetching a user by ID with Supabase Future> getUserById(UserId id) { return await errorHandler(() async { final query = _ref.supabaseClient .from(UserModel.table.tableName) .select(UserModel.table.selectStatement) .eq(UserModel.idKey, id.value); final result = await query.single(); return right(UserModel.fromJson(result)); }); } ``` -------------------------------- ### Basic Riverpod Provider Example Source: https://github.com/pckimlong/kimapp/blob/master/packages/kimapp_generator/README.md A simple Riverpod provider example demonstrating state management for an integer counter with an increment method. ```dart @stateWidget @riverpod class Counter extends _$Counter { @override int build() => 0; void increment() => state++; } ``` -------------------------------- ### Installation Rules Source: https://github.com/pckimlong/kimapp/blob/master/pubs/numpad_input/example/windows/CMakeLists.txt This section defines the installation procedures for the C++ project, focusing on Windows deployment. It specifies how the executable, support files, libraries, and assets are copied to the installation directory, ensuring the application can run correctly from its installed location. ```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() # Copy the native assets provided by the build.dart from all packages. set(NATIVE_ASSETS_DIR "${PROJECT_BUILD_DIR}native_assets/windows/") install(DIRECTORY "${NATIVE_ASSETS_DIR}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) # 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) ``` -------------------------------- ### Kimapp Package Installation Source: https://github.com/pckimlong/kimapp/blob/master/packages/kimapp/README.md Instructions for adding the Kimapp packages to your `pubspec.yaml` file, including the core library, the generator, and necessary development dependencies for code generation. ```yaml dependencies: kimapp: ^0.0.3 # When published kimapp_generator: ^0.0.2 # When published dev_dependencies: build_runner: ^2.4.7 freezed: ^2.4.6 ``` -------------------------------- ### Riverpod Family Provider Example Source: https://github.com/pckimlong/kimapp/blob/master/packages/kimapp_generator/README.md An example of a Riverpod family provider that fetches product details based on a productId string. ```dart @stateWidget @riverpod class ProductDetail extends _$ProductDetail { @override Future build(String productId) { return repository.fetchProduct(productId); } } ``` -------------------------------- ### Sample Dart Usage Source: https://github.com/pckimlong/kimapp/blob/master/packages/bootstraper/README.md A basic Dart code snippet demonstrating variable declaration. This serves as an example for package usage. ```dart const like = 'sample'; ``` -------------------------------- ### Sample Dart Usage Source: https://github.com/pckimlong/kimapp/blob/master/pubs/numpad_input/README.md A basic Dart code snippet demonstrating variable declaration. This serves as an example for package usage. ```dart const like = 'sample'; ``` -------------------------------- ### Dart UI Widget for Feature Creation Form Source: https://github.com/pckimlong/kimapp/blob/master/mason/kimapp/__brick__/flutter_project_structure_guide.md An example of implementing a UI form using generated widgets. It shows how to integrate form fields, manage state, display loading or error states, and trigger submission actions within a Flutter application. ```dart FeatureCreateFormWidget( child: (ref, formKey, status, isProgressing, failure, submit) { return Column( children: [ FeatureCreateFormNameWidget( builder: (ref, controller, name, changeName, showValidation) { return TextFormField( controller: controller, decoration: InputDecoration( labelText: 'Name', errorText: showValidation && name.isBlank ? 'Required' : null, ), ); }, ), AsyncValueWidget( value: status, onData: (_) => ElevatedButton( onPressed: submit, child: Text('Create'), ), ), ], ); }, ) ``` -------------------------------- ### Project Setup and Basic Configuration Source: https://github.com/pckimlong/kimapp/blob/master/pubs/numpad_input/example/linux/CMakeLists.txt Initializes the CMake build system, defines project name and languages, sets executable and application identifiers, and configures runtime paths. It also includes policies for modern CMake behavior. ```cmake cmake_minimum_required(VERSION 3.13) 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") ``` -------------------------------- ### Install KimappStateWidgetGenerator Dependencies Source: https://github.com/pckimlong/kimapp/blob/master/packages/kimapp_generator/README.md Lists the necessary dependencies to add to your pubspec.yaml file for using KimappStateWidgetGenerator and Riverpod. ```yaml dependencies: kimapp: ^1.0.0 riverpod_annotation: ^2.0.0 flutter_riverpod: ^2.0.0 dev_dependencies: build_runner: ^2.0.0 kimapp_generator: ^1.0.0 riverpod_generator: ^2.0.0 ``` -------------------------------- ### Define User Schema Source: https://github.com/pckimlong/kimapp/blob/master/packages/kimapp_generator/SCHEMA_GUIDE.md An example of defining a User schema using Kimapp annotations and fields. It includes basic fields, an ID field with a generated type, and defines a custom model variation 'UserDetailModel' inheriting from the base schema. ```dart @Schema(tableName: 'users', className: 'User') class UserSchema extends KimappSchema { final id = Field.id('id').generateAs('UserId'); final name = Field('name'); final email = Field('email'); @override List get models => [ Model('UserDetailModel') ..table() ..inheritAllFromBase(excepts: [name]) // name is not inherited from base model ..addFields({ 'createdAt': Field('created_at'), }), ]; } ``` -------------------------------- ### Import Kimapp Package Source: https://github.com/pckimlong/kimapp/blob/master/packages/kimapp_generator/SCHEMA_GUIDE.md Demonstrates how to import the Kimapp package into your Dart schema definition files. This is the first step to using the schema generation capabilities. ```dart import 'package:kimapp/kimapp.dart'; ``` -------------------------------- ### Bootstrap Task Implementation Source: https://github.com/pckimlong/kimapp/blob/master/packages/bootstraper/CLAUDE.md Examples of implementing custom bootstrap tasks for the bootstraper package. Demonstrates how to create lightweight pre-UI tasks and splash screen tasks with different execution behaviors. ```dart // Bootstrap task (runs once before UI) class MyBootstrapTask extends BootstrapTask { @override Future execute(BootstrapContext context) async { // Access environment: context.env // Access container: context.container // Access logger: context.logger } } ``` ```dart // One-time splash task (runs once per app lifetime) class MyOneTimeTask extends OneTimeSplashTask { @override Future execute(SplashContext context) async { // Use context.ref to access providers return null; } } ``` ```dart // Reactive splash task (precise splash control) class MyReactiveTask extends ReactiveSplashTask { @override Future watch(Ref ref) async { // Only providers watched here trigger splash re-display return ref.watch(someProvider); } @override Future execute(SplashContext context, String? data) async { // Can access any providers without triggering splash return null; } } ``` -------------------------------- ### Code Generation Commands Source: https://github.com/pckimlong/kimapp/blob/master/packages/kimapp_generator/SCHEMA_GUIDE.md Provides the necessary bash commands to run the code generation process using Dart's build runner. It includes commands for a one-time build and for watching files for automatic regeneration. ```bash dart run build_runner build # One-time build dart run build_runner watch # Watch mode ``` -------------------------------- ### State Widget Examples with Autoverpod Source: https://github.com/pckimlong/kimapp/blob/master/pubs/autoverpod/README.md Illustrates using the @stateWidget annotation to create widgets that consume Riverpod state. It shows examples of class-based providers with parameters, function-based providers, and providers with optional parameters or streams. ```dart import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:autoverpod/autoverpod.dart'; import 'package:riverpod_annotation/riverpod_annotation.dart'; part 'example.g.dart'; // Class-based provider with parameters @stateWidget @riverpod class ProductDetail extends _$ProductDetail { @override FutureOr build(int productId) { return 'Product Detail $productId'; } } // Function-based provider @riverpod @stateWidget int counter(Ref ref) { return 1; } // Class-based provider with multiple parameters @riverpod @stateWidget class StringFuture extends _$StringFuture { @override Future build({ required String family, required String second, }) async { return 'string'; } } // Provider with optional parameters @riverpod @stateWidget class StringFutureOptional extends _$StringFutureOptional { @override Future build( int a, { required String family, String? second, }) async { return 'string'; } } // Async provider with Stream @riverpod @stateWidget Stream counterStream(Ref ref, {required int initialValue}) async* { yield initialValue; } ``` -------------------------------- ### Dart Sample Variable Declaration Source: https://github.com/pckimlong/kimapp/blob/master/packages/kimapp_supabase_helper/README.md A basic Dart code snippet demonstrating the declaration of a constant string variable. This serves as a simple example for package users. ```dart const like = 'sample'; ``` -------------------------------- ### Installation Dependencies Source: https://github.com/pckimlong/kimapp/blob/master/pubs/autoverpod/README.md Dependencies required for using autoverpod, including the annotation package, Riverpod generation dependencies, and build_runner for code generation. ```yaml dependencies: autoverpod: ^0.0.3 # riverpod generation dependancies dev_dependencies: autoverpod_generator: ^0.0.1 build_runner: ^2.4.0 # Required for code generation ``` -------------------------------- ### Using Generated Widgets in a Flutter Page Source: https://github.com/pckimlong/kimapp/blob/master/packages/kimapp_generator/README.md An example Flutter page demonstrating the usage of generated widgets like ProviderScope, StateWidget, and SelectWidget for a ProductDetail provider. ```dart class ProductPage extends StatelessWidget { @override Widget build(BuildContext context) { return ProductDetailProviderScope( productId: "123", child: Column( children: [ // Direct state access ProductDetailStateWidget( builder: (context, ref, params, product, _) { return Text(product.name); }, ), // Optimized rebuild ProductDetailSelectWidget( selector: (product) => product.price, builder: (context, ref, params, price, _) { return Text('\$$price'); }, ), ], ), ); } } ``` -------------------------------- ### Riverpod Integration with Generated Models Source: https://github.com/pckimlong/kimapp/blob/master/packages/kimapp/README.md Illustrates integrating Kimapp's generated `UserModel` with Riverpod for state management. This example defines a `FutureProvider.family` that fetches user data from Supabase using generated table constants and deserializes it into a `UserModel`. ```dart final userProvider = FutureProvider.family((ref, id) async { final response = await supabase .from(UserTable.tableName) .select('*') .eq(UserTable.id, id.value) .single(); return UserModel.fromJson(response); }); ``` -------------------------------- ### Dart Form Provider for Feature Creation Source: https://github.com/pckimlong/kimapp/blob/master/mason/kimapp/__brick__/flutter_project_structure_guide.md Manages the state and submission logic for a feature creation form. It utilizes Riverpod and Freezed for state management, including validation and asynchronous submission of form data via the repository pattern. ```dart @freezed class FeatureCreateState with _$FeatureCreateState, ProviderStatusClassMixin { const factory FeatureCreateState({ required String name, @Default(ProviderStatus.initial()) ProviderStatus status, }) = _FeatureCreateState; FeatureCreateParam toParam() { if (name.isBlank) throw 'Name is required'; return FeatureCreateParam(name: name); } } @kimappForm @riverpod class FeatureCreate extends _$FeatureCreate with _$FeatureCreateForm { Future> call() async { return await perform((state) async { final result = await ref.read(featureRepoProvider).create(state.toParam()); return result.getOrThrow(); }); } } ``` -------------------------------- ### Application Initialization Pattern Source: https://github.com/pckimlong/kimapp/blob/master/packages/bootstraper/CLAUDE.md Illustrates the core initialization pattern for the bootstraper package. Shows how to configure and run the application with bootstrap tasks, splash screen configuration, and provider overrides. ```dart await Bootstraper.initialize( application: MyApp(), environment: IntegrationMode.development, logger: MyLogger(), initialTasks: [/* bootstrap tasks */], splashConfig: SplashConfig( tasks: [/* splash tasks */], pageBuilder: (error, retry) => MySplashPage(error, retry), ), providerOverrides: [/* provider overrides */], ); ``` -------------------------------- ### Autoverpod Annotations Example Source: https://github.com/pckimlong/kimapp/blob/master/pubs/autoverpod/example/README.md Demonstrates the usage of `autoverpod` annotations like `@formWidget` and `@stateWidget` in Dart. These annotations are intended to be processed by a code generator to create Riverpod boilerplate code for widgets. ```dart import 'package:autoverpod/autoverpod.dart'; // Using the form widget annotation @formWidget class UserForm { // Implementation } // Using the state widget annotation @stateWidget class UserProfile { // Implementation } ``` -------------------------------- ### Kimapp Identity Object Example Source: https://github.com/pckimlong/kimapp/blob/master/packages/kimapp/README.md Provides an example of a generated type-safe identity object, 'UserId', which extends Kimapp's Identity class. It includes automatic validation logic to ensure data integrity upon access. ```dart // Generated from Field.id('id').generateAs('UserId') class UserId extends Identity { const UserId(String value) : super(value); // Automatic validation @override String call() { if (value.isEmpty) throw ArgumentError('User ID cannot be empty'); return value; } } // Usage final userId = UserId('user_123'); final userIdValue = userId(); // Validated access ``` -------------------------------- ### Melos Commands for Monorepo Management Source: https://github.com/pckimlong/kimapp/blob/master/README.md Lists essential Melos commands for managing the Kimapp monorepo, covering bootstrapping, dependency updates, code formatting, analysis, building, testing, cleaning, and publishing. ```bash # Setup the project melos bootstrap # Update dependencies in all packages melos run update_deps # Format Dart code in all packages melos run format # Run static analysis melos run analyze # Run build_runner in all packages melos run build_all # Run tests in all packages melos run test # Clean all packages melos run clean # Dry-run publishing all packages melos run publish_dry # Publish all packages to pub.dev melos run publish ``` -------------------------------- ### Application Build and Dependencies Source: https://github.com/pckimlong/kimapp/blob/master/pubs/numpad_input/example/linux/CMakeLists.txt Includes the runner subdirectory for application-specific build rules and establishes a dependency on the 'flutter_assemble' target, ensuring Flutter assets are built before the main executable. ```cmake # Application build; see runner/CMakeLists.txt. add_subdirectory("runner") # Run the Flutter tool portions of the build. This must not be removed. add_dependencies(${BINARY_NAME} flutter_assemble) ``` -------------------------------- ### AsyncValue Handling with Generated Widgets Source: https://github.com/pckimlong/kimapp/blob/master/packages/kimapp_generator/README.md Example of using the generated ProviderScope widget to handle asynchronous states (loading, error, data) using the .when method. ```dart ProductDetailProviderScope( productId: 123, builder: (context, ref, asyncValue, child) { return asyncValue.when( data: (data) => Text(data), loading: () => const CircularProgressIndicator(), error: (error, stack) => Text('Error: $error'), ); }, ) ``` -------------------------------- ### Using Generated Kimapp Code Source: https://github.com/pckimlong/kimapp/blob/master/packages/kimapp/README.md Illustrates how to utilize the code generated by Kimapp, including creating model instances like `UserModel` and performing type-safe database queries using generated `UserTable` constants. ```dart // Generated code provides: // - UserModel class (with Freezed integration) // - UserLiteModel class // - UserId identity class // - UserTable constants class final user = UserModel( id: UserId('user_123'), name: 'John Doe', email: 'john@example.com', ); // Type-safe database queries final query = supabase .from(UserTable.tableName) .select('${UserTable.id}, ${UserTable.name}'); ``` -------------------------------- ### Build and Package Extension Source: https://github.com/pckimlong/kimapp/blob/master/tools/extensions/kimapp-snippets/README.md Commands for building and packaging the Kimapp VS Code extension. It involves ensuring the template generators are up-to-date and running the npm package script. ```bash npm run package ``` -------------------------------- ### Monorepo Structure Overview Source: https://github.com/pckimlong/kimapp/blob/master/README.md Details the directory structure of the Kimapp monorepo, outlining the purpose of core packages, additional published packages, Mason bricks, tools, and template generators. ```text kimapp/ ├── packages/ # Core packages │ ├── kimapp/ # Main package with core utilities │ ├── kimapp_generator/ # Code generation package │ ├── kimapp_utils/ # Utility functions and extensions │ └── kimapp_supabase_helper/ # Supabase integration helpers ├── pubs/ # Additional published packages │ ├── autoverpod/ # Auto-generated Riverpod providers │ └── autoverpod_generator/ # Generator for autoverpod ├── mason/ # Mason bricks for code generation │ ├── kimapp/ # Core Kimapp brick │ ├── kimapp_feature/ # Feature generation brick │ ├── kimapp_simple_feature/ # Simplified feature brick │ ├── kimapp_feature_ui/ # UI components brick │ └── kimapp_package/ # Package template brick ├── tools/ # Development tools and scripts └── template_generators/ # Custom code generators ``` -------------------------------- ### Run Build Runner for Code Generation Source: https://github.com/pckimlong/kimapp/blob/master/packages/kimapp_generator/README.md Command to execute the build_runner to generate widgets based on annotations. ```bash dart run build_runner build ``` -------------------------------- ### Trigger Workflow with Commit Message Source: https://github.com/pckimlong/kimapp/blob/master/tools/extensions/kimapp-snippets/GITHUB_ACTIONS.md Example of a Git commit message that triggers the GitHub Actions workflow for publishing VS Code extensions and creating releases. ```bash git commit -m "Updated snippets [publish-snippets]" ``` -------------------------------- ### Run Kimapp Code Generation Source: https://github.com/pckimlong/kimapp/blob/master/packages/kimapp/README.md Command to execute the `build_runner` tool, which processes schema definitions annotated with `@Schema` to generate Dart code, including model classes and table constants. ```bash dart run build_runner build ``` -------------------------------- ### Flutter Linux GTK Dependency Setup Source: https://github.com/pckimlong/kimapp/blob/master/pubs/numpad_input/example/linux/flutter/CMakeLists.txt Configures system-level dependencies for Flutter on Linux using PkgConfig. It checks for GTK+ 3.0, GLib, and GIO, making them available for linking. ```cmake # 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) ``` -------------------------------- ### Flutter Integration and System Dependencies Source: https://github.com/pckimlong/kimapp/blob/master/pubs/numpad_input/example/linux/CMakeLists.txt Integrates Flutter managed libraries and tools by adding the Flutter directory as a subdirectory. It also finds and checks for required system packages like GTK+ 3.0 using PkgConfig. ```cmake # 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) ``` -------------------------------- ### Dart Simple Action Provider Source: https://github.com/pckimlong/kimapp/blob/master/mason/kimapp/__brick__/flutter_project_structure_guide.md A Riverpod provider designed for executing single, atomic actions such as deletion or toggling. It manages the state of the operation using a `ProviderStatus` enum and handles asynchronous execution. ```dart @riverpod class FeatureDelete extends _$FeatureDelete { @override ProviderStatus build(FeatureId id) => const ProviderStatus.initial(); Future> call() async { return await perform((state) async { final result = await ref.read(featureRepoProvider).delete(id); return result.getOrThrow(); }); } } ``` -------------------------------- ### Multiple Model Variations Source: https://github.com/pckimlong/kimapp/blob/master/packages/kimapp_generator/SCHEMA_GUIDE.md Shows how to define multiple model variations from a single schema definition. This allows for different views or subsets of data to be generated, such as detailed or lite models. ```dart @override List get models => [ Model('UserDetailModel') ..addFields({ 'id': id, 'fullName': name, }), Model('UserLiteModel') ..inheritAllFromBase() ..addFields({ 'displayName': name, }), ]; ``` -------------------------------- ### Dart Table Constants for Type-Safe Queries Source: https://github.com/pckimlong/kimapp/blob/master/packages/kimapp/README.md Generated table classes provide compile-time safety for database queries. This example shows the `UserTable` class and its usage in Supabase queries to ensure field names are correct. ```dart // Generated from UserSchema class UserTable { static const String tableName = 'users'; static const String id = 'id'; static const String name = 'name'; static const String email = 'email'; static const String createdAt = 'created_at'; static const String profileId = 'profile_id'; // From join field } // Usage in Supabase queries final users = await supabase .from(UserTable.tableName) .select('${UserTable.id}, ${UserTable.name}') .eq(UserTable.email, 'user@example.com'); ```