### Install Dependencies Source: https://github.com/codifyiq/codifyiq-core-components/blob/dev/example/README.md Run this command to install the necessary Flutter dependencies for the example. ```bash flutter pub get ``` -------------------------------- ### Run Example Application Source: https://github.com/codifyiq/codifyiq-core-components/blob/dev/example/README.md Execute this command to run the example Dart file on Chrome. ```bash flutter run -t ./example/main.dart -d chrome ``` -------------------------------- ### Run Example Catalog App Source: https://github.com/codifyiq/codifyiq-core-components/blob/dev/claude.md Command to run the shared example application, which serves as a catalog for all widgets. This is useful for testing and demonstrating widget functionality. ```bash flutter run -t example/lib/main.dart -d chrome ``` -------------------------------- ### Install codifyiq_pdf_viewer Package Source: https://github.com/codifyiq/codifyiq-core-components/blob/dev/packages/codifyiq_pdf_viewer/README.md Add the codifyiq_pdf_viewer package to your project's dependencies in pubspec.yaml. ```yaml dependencies: codifyiq_pdf_viewer: ^1.0.0 ``` -------------------------------- ### Install codifyiq_group_manager Source: https://github.com/codifyiq/codifyiq-core-components/blob/dev/packages/codifyiq_group_manager/README.md Add the package to your pubspec.yaml file to include it in your project dependencies. ```yaml dependencies: codifyiq_group_manager: ^1.0.0 ``` -------------------------------- ### Install Melos Source: https://github.com/codifyiq/codifyiq-core-components/blob/dev/claude.md One-time command to install the Melos package globally for managing the monorepo. ```bash dart pub global activate melos ``` -------------------------------- ### AudioMessage Widget with Custom Controller Source: https://github.com/codifyiq/codifyiq-core-components/blob/dev/packages/codifyiq_audio_message/example/README.md This example shows how to manually manage the AudioMessage playback using an AudioMessageController for more control over the audio lifecycle and state. ```dart import 'package:codifyiq_audio_message/codifyiq_audio_message.dart'; import 'package:flutter/material.dart'; // Drive it yourself for finer control or a custom playback backend. Widget buildDrivenPlayer() { final controller = AudioMessageController('https://example.com/clip.m4a'); return AudioMessage(url: controller.url, controller: controller); } ``` -------------------------------- ### Manage Background Tasks with Notification Center Source: https://github.com/codifyiq/codifyiq-core-components/blob/dev/packages/codifyiq_notification_center/example/README.md Initialize the NotificationCenterController and use its methods to manage background tasks. Start tasks with an ID and title, update their progress, and mark them as complete with a description. ```dart import 'package:codifyiq_notification_center/codifyiq_notification_center.dart'; import 'package:flutter/material.dart'; final controller = NotificationCenterController(); // Drive the controller from your own task layer. void uploadInvoice() { controller.start(id: 'job-1', title: 'Uploading invoice.pdf', progress: 0); controller.updateProgress('job-1', progress: 0.42); controller.complete('job-1', description: 'Saved to Documents/invoice.pdf'); } ``` -------------------------------- ### Initialize and Use NotificationCenterController Source: https://github.com/codifyiq/codifyiq-core-components/blob/dev/packages/codifyiq_notification_center/README.md Instantiate the NotificationCenterController and use its methods to manage task notifications. This includes starting tasks, updating progress, and marking them as complete or failed. The controller can also be used to dismiss or clear notifications. ```dart import 'package:codifyiq_notification_center/codifyiq_notification_center.dart'; final controller = NotificationCenterController(); controller.start(id: 'job-1', title: 'Uploading invoice.pdf', progress: 0); controller.updateProgress('job-1', progress: 0.42); controller.complete( 'job-1', description: 'Saved to Documents/invoice.pdf', action: NotificationItemAction(label: 'Open', onPressed: openFile), ); AppBar(actions: [NotificationBellButton(controller: controller)]); ``` -------------------------------- ### Basic PDF Viewer Widget Source: https://github.com/codifyiq/codifyiq-core-components/blob/dev/packages/codifyiq_pdf_viewer/example/README.md Demonstrates how to create a basic PdfViewerWidget instance. Load a PDF from a URI and enable search functionality. Handles document loaded events by printing the page count. ```dart import 'package:codifyiq_pdf_viewer/codifyiq_pdf_viewer.dart'; import 'package:flutter/material.dart'; Widget buildViewer() { return PdfViewerWidget( source: PdfSource.uri(Uri.parse('https://example.com/file.pdf')), enableSearch: true, onDocumentLoaded: (pageCount) => debugPrint('Loaded $pageCount pages'), ); } ``` -------------------------------- ### Analyze and Test Packages Source: https://github.com/codifyiq/codifyiq-core-components/blob/dev/claude.md Commands to run static analysis and tests across all packages in the monorepo. Ensures code quality and correctness. ```bash melos run analyze melos run test ``` -------------------------------- ### Basic PDF Viewer Widget Source: https://github.com/codifyiq/codifyiq-core-components/blob/dev/packages/codifyiq_pdf_viewer/README.md Renders a PDF document from a network URI. Includes basic search and a callback for document loading. ```dart import 'package:codifyiq_pdf_viewer/codifyiq_pdf_viewer.dart'; PdfViewerWidget( source: PdfSource.uri(Uri.parse('https://example.com/file.pdf')), enableSearch: true, onDocumentLoaded: (pageCount) => debugPrint('Loaded $pageCount pages'), ); ``` -------------------------------- ### Initialize GroupManagerController and use GroupManagerView Source: https://github.com/codifyiq/codifyiq-core-components/blob/dev/packages/codifyiq_group_manager/README.md Instantiate the GroupManagerController with initial groups and use GroupManagerView to display the full management interface within your Scaffold. ```dart final controller = GroupManagerController( groups: const [ Group(id: 'admins', name: 'Administrators', icon: Icons.admin_panel_settings), Group(id: 'editors', name: 'Editors'), ], ); // Drop the full management surface into a Scaffold body: Scaffold(body: GroupManagerView(controller: controller)); ``` -------------------------------- ### Build Social Sign-In Widget Source: https://github.com/codifyiq/codifyiq-core-components/blob/dev/packages/codifyiq_social_sign_in/example/README.md This snippet shows how to construct a `SocialSignInScreen` with a custom logo, tagline, and a Google sign-in button. Ensure you provide your own Google logo asset. ```dart import 'package:codifyiq_social_sign_in/codifyiq_social_sign_in.dart'; import 'package:flutter/material.dart'; Widget buildSignIn(Widget googleLogo, VoidCallback onGoogle) { return SocialSignInScreen( logo: Image.asset('assets/logo.png'), tagline: 'Welcome back', signInButtons: [ SocialSignInButton( icon: googleLogo, label: 'Continue with Google', onPressed: onGoogle, ), ], ); } ``` -------------------------------- ### Melos Development Commands Source: https://github.com/codifyiq/codifyiq-core-components/blob/dev/README.md Commands for setting up and running development tasks within the Melos workspace. Use 'melos bootstrap' to resolve all package dependencies. ```bash dart pub global activate melos # once melos bootstrap # resolve all packages melos run analyze # analyze every package melos run test # test every package with a test/ dir flutter run -t example/lib/main.dart -d chrome # run the demo catalog ``` -------------------------------- ### Add Dependency to pubspec.yaml Source: https://github.com/codifyiq/codifyiq-core-components/blob/dev/packages/codifyiq_brightness_button/README.md Add the codifyiq_brightness_button package to your project's dependencies in pubspec.yaml. ```yaml dependencies: codifyiq_brightness_button: ^1.0.0 ``` -------------------------------- ### Simple AudioMessage Widget Usage Source: https://github.com/codifyiq/codifyiq-core-components/blob/dev/packages/codifyiq_audio_message/example/README.md Use this snippet for the most straightforward audio playback. The widget automatically handles the audio controller based on the provided URL. ```dart import 'package:codifyiq_audio_message/codifyiq_audio_message.dart'; import 'package:flutter/material.dart'; // Simplest form — the widget manages its own controller from the URL. Widget buildPlayer() { return const AudioMessage(url: 'https://example.com/clip.m4a'); } ``` -------------------------------- ### Build Terms and Conditions Widget Source: https://github.com/codifyiq/codifyiq-core-components/blob/dev/packages/codifyiq_terms_and_conditions/example/README.md Use this function to build the TermsAndConditionsWidget. It requires a BuildContext and provides a callback for when terms are accepted. ```dart import 'package:codifyiq_terms_and_conditions/codifyiq_terms_and_conditions.dart'; import 'package:flutter/material.dart'; Widget buildTerms(BuildContext context) { return TermsAndConditionsWidget( headerText: 'Terms of Service', onAccepted: () => Navigator.of(context).pop(true), ); } ``` -------------------------------- ### Add Dependency to pubspec.yaml Source: https://github.com/codifyiq/codifyiq-core-components/blob/dev/packages/codifyiq_image_viewer/README.md Add the codifyiq_image_viewer package to your project's dependencies in the pubspec.yaml file. ```yaml dependencies: codifyiq_image_viewer: ^1.0.0 ``` -------------------------------- ### Basic ImageViewerWidget Usage Source: https://github.com/codifyiq/codifyiq-core-components/blob/dev/packages/codifyiq_image_viewer/README.md Instantiate the ImageViewerWidget with a list of ImageViewerItem objects. Supports network and asset images. ```dart import 'package:codifyiq_image_viewer/codifyiq_image_viewer.dart'; ImageViewerWidget( items: [ ImageViewerItem.network('https://example.com/a.jpg'), ImageViewerItem.asset('assets/b.png'), ], ); ``` -------------------------------- ### Add Dependency to pubspec.yaml Source: https://github.com/codifyiq/codifyiq-core-components/blob/dev/packages/codifyiq_audio_message/README.md Include the codifyiq_audio_message package in your project's dependencies. ```yaml dependencies: codifyiq_audio_message: ^1.0.0 ``` -------------------------------- ### Add Dependency to pubspec.yaml Source: https://github.com/codifyiq/codifyiq-core-components/blob/dev/packages/codifyiq_notification_center/README.md Add the codifyiq_notification_center package to your project's dependencies in pubspec.yaml. ```yaml dependencies: codifyiq_notification_center: ^1.0.0 ``` -------------------------------- ### Initialize and Use GroupManagerController Source: https://github.com/codifyiq/codifyiq-core-components/blob/dev/packages/codifyiq_group_manager/example/README.md Initialize the GroupManagerController with a list of groups and use it to build catalog and assignment widgets. The controller manages group data and user assignments. ```dart import 'package:codifyiq_group_manager/codifyiq_group_manager.dart'; import 'package:flutter/material.dart'; final controller = GroupManagerController( groups: const [ Group(id: 'admins', name: 'Administrators', icon: Icons.admin_panel_settings), Group(id: 'editors', name: 'Editors'), ], ); // Catalog management: Widget buildCatalog() => GroupManagerView(controller: controller); // Assign groups to a user: Widget buildAssignment(String userId) => ListenableBuilder( listenable: controller, builder: (context, _) => GroupAssignmentField( label: 'Groups', groups: controller.groups, selected: controller.groupsFor(userId), onChanged: (ids) => controller.setAssignments(userId, ids), ), ); ``` -------------------------------- ### Add Dependency to pubspec.yaml Source: https://github.com/codifyiq/codifyiq-core-components/blob/dev/packages/codifyiq_user_avatar/README.md Add the codifyiq_user_avatar package to your project's dependencies in pubspec.yaml. ```yaml dependencies: codifyiq_user_avatar: ^1.0.0 ``` -------------------------------- ### Basic Audio Message Usage Source: https://github.com/codifyiq/codifyiq-core-components/blob/dev/packages/codifyiq_audio_message/README.md Use the AudioMessage widget with a URL for simple playback management. ```dart import 'package:codifyiq_audio_message/codifyiq_audio_message.dart'; // The simplest form manages its own controller from a URL. AudioMessage(url: 'https://example.com/clip.m4a'); ``` -------------------------------- ### Add Dependency to pubspec.yaml Source: https://github.com/codifyiq/codifyiq-core-components/blob/dev/packages/codifyiq_social_sign_in/README.md Add the codifyiq_social_sign_in package to your project's dependencies in pubspec.yaml. ```yaml dependencies: codifyiq_social_sign_in: ^1.0.0 ``` -------------------------------- ### Add codifyiq_ai_progress_indicator to pubspec.yaml Source: https://github.com/codifyiq/codifyiq-core-components/blob/dev/packages/codifyiq_ai_progress_indicator/README.md Include the package as a dependency in your Flutter project's pubspec.yaml file to use the AI progress indicator. ```yaml dependencies: codifyiq_ai_progress_indicator: ^1.0.0 ``` -------------------------------- ### Bootstrap Monorepo Packages Source: https://github.com/codifyiq/codifyiq-core-components/blob/dev/claude.md Resolves all package dependencies within the Melos monorepo. This command should be run after cloning the repository or making changes to package dependencies. ```bash melos bootstrap ``` -------------------------------- ### Add Dependency to pubspec.yaml Source: https://github.com/codifyiq/codifyiq-core-components/blob/dev/packages/codifyiq_terms_and_conditions/README.md Include the codifyiq_terms_and_conditions package in your project's dependencies. ```yaml dependencies: codifyiq_terms_and_conditions: ^1.0.0 ``` -------------------------------- ### Provide Controller via GroupManagerScope Source: https://github.com/codifyiq/codifyiq-core-components/blob/dev/packages/codifyiq_group_manager/README.md Wrap your application or a subtree with GroupManagerScope to provide the controller ambiently. Access the controller using GroupManagerScope.of(context). ```dart GroupManagerScope( controller: controller, child: MyApp(), ); // Anywhere below: GroupManagerScope.of(context).assign(userId, 'admins'); ``` -------------------------------- ### Standard StatelessWidget Pattern Source: https://github.com/codifyiq/codifyiq-core-components/blob/dev/claude.md A common pattern for defining stateless widgets in Flutter, including documentation comments for the class, constructor, and fields. Adheres to the project's documentation and code style guidelines. ```dart /// Brief description of widget purpose. /// /// Detailed explanation with usage context. class MyWidget extends StatelessWidget { /// Creates a [MyWidget]. /// /// [paramName] description of parameter. const MyWidget({ super.key, required this.paramName, }); /// Documentation for field. final String paramName; @override Widget build(BuildContext context) { // Implementation } } ``` -------------------------------- ### Basic AiProgressIndicator Usage Source: https://github.com/codifyiq/codifyiq-core-components/blob/dev/packages/codifyiq_ai_progress_indicator/example/README.md Shows how to display the AiProgressIndicator with custom text and shimmer intensity. This widget is useful for indicating ongoing AI processes. ```dart import 'package:codifyiq_ai_progress_indicator/codifyiq_ai_progress_indicator.dart'; import 'package:flutter/material.dart'; class GeneratingView extends StatelessWidget { const GeneratingView({super.key}); @override Widget build(BuildContext context) { return const Center( child: AiProgressIndicator( text: 'Generating summary…', shimmerIntensity: 0.4, ), ); } } ``` -------------------------------- ### Basic Usage of TermsAndConditionsWidget Source: https://github.com/codifyiq/codifyiq-core-components/blob/dev/packages/codifyiq_terms_and_conditions/README.md Integrate the TermsAndConditionsWidget into your Flutter application. The onAccepted callback is triggered upon user acceptance, typically used to close a dialog or navigate. ```dart import 'package:codifyiq_terms_and_conditions/codifyiq_terms_and_conditions.dart'; TermsAndConditionsWidget( onAccepted: () => Navigator.of(context).pop(true), ); ``` -------------------------------- ### Brightness Button in AppBar Source: https://github.com/codifyiq/codifyiq-core-components/blob/dev/packages/codifyiq_brightness_button/example/README.md Integrates the BrightnessButton into the AppBar. Ensure the app is wrapped with AdaptiveTheme for the toggle to function correctly. ```dart import 'package:codifyiq_brightness_button/codifyiq_brightness_button.dart'; import 'package:flutter/material.dart'; AppBar buildAppBar() { return AppBar( title: const Text('Settings'), actions: const [BrightnessButton()], ); } ``` -------------------------------- ### Display AI Progress Indicator in Flutter Source: https://github.com/codifyiq/codifyiq-core-components/blob/dev/packages/codifyiq_ai_progress_indicator/README.md Import the package and use the AiProgressIndicator widget, providing the required text message. This is the basic implementation for showing the AI progress. ```dart import 'package:codifyiq_ai_progress_indicator/codifyiq_ai_progress_indicator.dart'; const AiProgressIndicator(text: 'Generating summary…'); ``` -------------------------------- ### SocialSignInScreen with Error Handling Source: https://github.com/codifyiq/codifyiq-core-components/blob/dev/packages/codifyiq_social_sign_in/README.md Configure the SocialSignInScreen to display user-safe error messages while logging detailed diagnostics. The `onError` callback is crucial for capturing technical details for debugging. ```dart SocialSignInScreen( // ... error: _error, // SocialSignInError? held in your state onError: (error) => logger.error('Sign-in failed', error.detail), signInButtons: [...], ); // In your sign-in catch block: try { await signInWithMicrosoft(); } catch (e, stack) { setState(() => _error = SocialSignInError( message: "We couldn't sign you in. Please try again.", detail: '$e\n$stack', )); } ``` -------------------------------- ### Build Image Gallery with ImageViewerWidget Source: https://github.com/codifyiq/codifyiq-core-components/blob/dev/packages/codifyiq_image_viewer/example/README.md Use ImageViewerWidget to display a list of images from network or asset paths. Note that ImageViewerItem.file is not supported on Flutter web. ```dart import 'package:codifyiq_image_viewer/codifyiq_image_viewer.dart'; import 'package:flutter/material.dart'; Widget buildGallery() { return ImageViewerWidget( items: [ ImageViewerItem.network('https://example.com/a.jpg'), ImageViewerItem.asset('assets/b.png'), ], ); } ``` -------------------------------- ### Loading Authenticated PDFs Source: https://github.com/codifyiq/codifyiq-core-components/blob/dev/packages/codifyiq_pdf_viewer/README.md Loads a PDF from an authenticated endpoint by passing custom HTTP headers, such as an Authorization token, via PdfSource.uri. ```dart PdfViewerWidget( source: PdfSource.uri( Uri.parse('https://api.example.com/documents/42.pdf'), headers: {'Authorization': 'Bearer $jwt'}, ), ); ``` -------------------------------- ### Basic UserAvatar Widget Usage Source: https://github.com/codifyiq/codifyiq-core-components/blob/dev/packages/codifyiq_user_avatar/example/README.md Use this snippet to display a user avatar with a photo URL, display name, and a specified radius. Ensure the necessary imports are included. ```dart import 'package:codifyiq_user_avatar/codifyiq_user_avatar.dart'; import 'package:flutter/material.dart'; Widget buildAvatar() { return const UserAvatar( photoUrl: 'https://example.com/jane.jpg', displayName: 'Jane Doe', radius: 24, ); } ``` -------------------------------- ### Basic User Avatar Usage Source: https://github.com/codifyiq/codifyiq-core-components/blob/dev/packages/codifyiq_user_avatar/README.md Display a user avatar using the photo URL and display name. Adjust the radius for size. ```dart import 'package:codifyiq_user_avatar/codifyiq_user_avatar.dart'; UserAvatar( photoUrl: user.photoUrl, displayName: user.displayName, radius: 24, ); ``` -------------------------------- ### User Avatar with MemoryImage Source: https://github.com/codifyiq/codifyiq-core-components/blob/dev/packages/codifyiq_user_avatar/README.md Use a MemoryImage for displaying images already in memory. This takes precedence over photoUrl. ```dart UserAvatar(imageProvider: MemoryImage(bytes), displayName: user.displayName); ``` -------------------------------- ### Advanced Audio Message Usage with Controller Source: https://github.com/codifyiq/codifyiq-core-components/blob/dev/packages/codifyiq_audio_message/README.md Manually manage the AudioMessage controller for finer control over playback and to provide a custom backend. ```dart import 'package:codifyiq_audio_message/codifyiq_audio_message.dart'; // Or drive it yourself for finer control (and a custom playback backend): final controller = AudioMessageController('https://example.com/clip.m4a'); AudioMessage(url: controller.url, controller: controller); ``` -------------------------------- ### Basic SocialSignInScreen Usage Source: https://github.com/codifyiq/codifyiq-core-components/blob/dev/packages/codifyiq_social_sign_in/README.md Integrate the SocialSignInScreen widget into your Flutter app. Provide a logo, enable reviewer login if desired, and define your social sign-in buttons and their actions. ```dart import 'package:codifyiq_social_sign_in/codifyiq_social_sign_in.dart'; SocialSignInScreen( logo: Image.asset('assets/logo.png'), reviewerLoginEnabled: true, onReviewerSignIn: (email, password) => _signIn(email, password), signInButtons: [ SocialSignInButton(icon: googleLogo, label: 'Continue with Google', onPressed: _google), ], ); ``` -------------------------------- ### Assign Groups to an Object with GroupAssignmentField Source: https://github.com/codifyiq/codifyiq-core-components/blob/dev/packages/codifyiq_group_manager/README.md Assign groups to any target object by keying assignments with the object's ID. Use resolvedGroupsFor to offer a scoped subset of groups. ```dart GroupAssignmentField( label: folder.name, groups: controller.resolvedGroupsFor(currentUserId), // only what I can grant selected: controller.groupsFor('folder:${folder.id}'), onChanged: (ids) => controller.setAssignments('folder:${folder.id}', ids), pickerTitle: 'Share "${folder.name}" with your groups', ); ``` -------------------------------- ### Display Notification Bell in AppBar Source: https://github.com/codifyiq/codifyiq-core-components/blob/dev/packages/codifyiq_notification_center/example/README.md Integrate the NotificationBellButton into your application's AppBar to provide a UI element for users to view ongoing and completed notifications. ```dart // Surface the stoplight bell in your AppBar. AppBar buildAppBar() { return AppBar(actions: [NotificationBellButton(controller: controller)]); } ``` -------------------------------- ### Define Group Colors Source: https://github.com/codifyiq/codifyiq-core-components/blob/dev/packages/codifyiq_group_manager/README.md Assign a GroupColor role to a Group for theme-derived accent colors. Leaving color null auto-assigns a stable role. ```dart const Group(id: 'admins', name: 'Administrators', color: GroupColor.primary); const Group(id: 'editors', name: 'Editors'); // auto-derived, stable per id ``` -------------------------------- ### Assign Groups to a User with GroupAssignmentField Source: https://github.com/codifyiq/codifyiq-core-components/blob/dev/packages/codifyiq_group_manager/README.md Use GroupAssignmentField to manage group assignments for a specific user. This field is value-driven and should be wired to the controller's state. ```dart ListenableBuilder( listenable: controller, builder: (context, _) => GroupAssignmentField( label: 'Groups', groups: controller.groups, selected: controller.groupsFor(userId), onChanged: (ids) => controller.setAssignments(userId, ids), ), ); ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.