Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI components 0.2.0 #227

Merged
merged 636 commits into from
Feb 20, 2025
Merged

UI components 0.2.0 #227

merged 636 commits into from
Feb 20, 2025

Conversation

rachana-egov
Copy link
Contributor

No description provided.

Swathi-eGov and others added 30 commits July 31, 2024 16:01
…omponent (#108)

* added tag component

* updated versions

* updated with review changes

* added iconRender logic
* updated tooltip

* review changes
* added switch and bottomsheet components

* updated versions

* added review changes
* added accordion

* updated sidebar

* updated svgs

* updated versions
fixing toast issue and typography issue
Copy link
Contributor

coderabbitai bot commented Feb 19, 2025

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (2)
  • .github/workflows/publishComponents.yml is excluded by !**/*.yml
  • .github/workflows/publishUICSS.yml is excluded by !**/*.yml

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

This pull request encompasses widespread refactoring and feature additions across the Digit UI Components project. Changes include updates to versioning and documentation (README and CHANGELOG), plugin and dependency modifications, renaming of public entities (e.g. Button → DigitButton, ButtonType → DigitButtonType), removal or replacement of obsolete blocs and models, extensive updates to theming classes and constants, new exports for enums and models, and the introduction of numerous new widgets and utility classes. Overall, these changes standardize naming conventions and improve maintainability across the project.

Changes

File(s) Change Summaries
.gitignore Added entry to ignore yarn-error.log.
flutter/digit-ui-components/README.md Rebranded button components: renamed “Button” to “DigitButton” and updated terminology across documentation.
flutter/digit-ui-components/digit_components/.flutter-plugins
flutter/digit-ui-components/digit_components/.flutter-plugins-dependencies
Removed several keyboard visibility plugins; added new plugins (e.g. camera, file_picker, url_launcher); updated versions for dependencies.
flutter/digit-ui-components/digit_components/CHANGELOG.md Updated version from 0.0.1-beta to 0.2.1 and documented UI component fixes and dependency upgrades.
flutter/digit-ui-components/digit_components/README.md Restructured documentation with a new Table of Contents, added sections (Screenshot, Quick Start, Component Overview, Marketplace), and revised introduction.
flutter/digit-ui-components/digit_components/assets/text_area_icons.dart Removed the custom icon definition for the "TextArea" font.
flutter/digit-ui-components/digit_components/coverage/lcov.info Renamed and removed several widget and bloc files (e.g. DigitButton, RadioDigitButton, LocationBloc, DateSelectionBloc); overall cleanup and consolidation.
.../lib/blocs/DateSelection.dart
.../lib/blocs/LocationBloc.dart
.../lib/blocs/TimeSelectionBloc.dart
Removed obsolete bloc classes (DateSelectionBloc, LocationBloc, TimeSelectionBloc).
.../lib/constants/AppView.dart Changed view determination logic from fixed widths to aspect ratio–based methods.
.../lib/constants/app_constants.dart Renamed classes (Default → Base); introduced new constants classes (DigitButtonConstants, ToastConstant, PopUpCardConstant).
.../lib/constants/constant.dart Added new export statements for app constants and view components.
.../lib/digit_components.dart Expanded public API by adding exports for enums, models, and constants.
.../lib/enum/app_enums.dart Renamed ButtonType to DigitButtonType; added new enums (DigitButtonSize, InfoDigitButtonType, ToastType, etc.); redefined dropdown enum.
.../lib/models/*privacy_notice*.dart Introduced privacy notice models (PrivacyNoticeModel, ContentNoticeModel, DescriptionNoticeModel, SubDescriptionNoticeModel) using Freezed for immutability.
.../lib/models/chipModel.dart Removed ChipConfig class.
.../lib/models/models.dart Added exports for DropdownModels.dart and TreeModel.dart.
.../lib/services/ Added new classes for component localization, date selection (DateSelectionBloc), time selection (TimeSelectionBloc), and location fetching (LocationFetchBloc, LocationBloc free, LocationFetchBloc vs LocationBloc rework). Also added a localization delegate.
.../lib/theme/ Introduced a comprehensive set of theming classes and extensions (DigitColorTheme, DigitDarkColorTheme, DigitLightColorTheme, ComponentTheme classes for buttons, back button, bread crumbs, chip, accordion, tab bar, tag, divider, info card, panel, popup, radio list, switch, toast, spacer, text themes, extended theme, typography, and theme notifier) and updated DigitTheme definitions.
.../lib/utils/ Added utilities including AppLogger, fileService classes (FileDownloaderService, FileService, MobileFileDownloader, MobileFileWriter, WebFileDownloader, WebFileWriter), date utility updates (DigitDOBAgeConvertor), i18n key constants, and various string/format converters.
.../lib/utils/validators/ Added file and image validators (file_validator.dart and image_validator.dart).
.../lib/widgets/atoms/ Added many new widgets and updated existing ones, including: DigitAccordion, DigitActionCard, DigitBackButton, DigitBaseFormInput, DigitBreadCrumb, DigitButton (renamed and enhanced), DigitCheckbox (+ DigitCheckboxIcon updated for theming), DigitChip, DigitDateFormInput, DigitDivider, DigitDobPicker, DigitInfoCard, DigitLoaders, DigitLocationFormInput, DigitMultiselectDropdown, DigitNumericFormInput, DigitOTPInput (with controller API), DigitPasswordFormInput, DigitRadioList (with renamed radioDigitButtons, added error handling and readOnly), DigitSearchBar, DigitSearchFormInput, DigitStepper, and DigitTabBar.

Suggested reviewers

  • naveen-egov

Poem

I’m a little rabbit in a code-filled glen,
Hopping through updates again and again,
With DigitButtons and themes reborn,
I nibble on refactors from dusk till dawn,
A playful hop in every line—
Celebrating changes that shine!
🐇💻


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 45

🔭 Outside diff range comments (3)
flutter/digit-ui-components/digit_components/lib/widgets/atoms/digit_numeric_form_input.dart (2)

108-125: 🛠️ Refactor suggestion

Apply the same refactor to onSuffixIconClick.

The onSuffixIconClick method has the same issues as onPrefixIconClick.

Apply this refactor:

   @override
   void onSuffixIconClick({void Function()? customFunction}) {
     setState(() {
-      /// Add step to the input value when the suffix icon is clicked
       int currentValue = int.tryParse(controller.text) ?? 0;
-      if ((currentValue + widget.step) <= widget.maxValue) {
-        setState(() {
-          controller.text = (currentValue + widget.step).toString();
-        });
-
-        /// Remove the text selection
-        controller.selection = const TextSelection.collapsed(offset: 0);
-      }
-      if (widget.onChange != null) {
-        widget.onChange!(controller.text);
-      }
+      _updateValue(currentValue + widget.step);
     });
   }

88-132: 🛠️ Refactor suggestion

Add input validation for numeric values.

The widget should validate that the input is a valid number within the specified range.

Add input validation by overriding the onChanged method:

+  @override
+  void onChanged(String value) {
+    if (value.isEmpty) {
+      _updateValue(widget.minValue);
+      return;
+    }
+
+    final number = int.tryParse(value);
+    if (number == null) {
+      controller.text = widget.minValue.toString();
+    } else if (number < widget.minValue) {
+      _updateValue(widget.minValue);
+    } else if (number > widget.maxValue) {
+      _updateValue(widget.maxValue);
+    } else {
+      _updateValue(number);
+    }
+  }
flutter/digit-ui-components/digit_components/lib/theme/typography.dart (1)

424-437: 🛠️ Refactor suggestion

Improve type safety of getTypography function.

The isDigitButtonTypography parameter lacks type annotation and documentation.

Add type annotation and documentation:

-DigitTypography getTypography(BuildContext context, isDigitButtonTypography) {
+/// Returns the appropriate typography based on screen size and context
+/// 
+/// [isDigitButtonTypography] determines if button-specific typography should be used
+DigitTypography getTypography(BuildContext context, {bool isDigitButtonTypography = false}) {

Also, the parameter isn't being used in the implementation. Consider either using it or removing it if it's not needed.

🧹 Nitpick comments (160)
flutter/digit-ui-components/digit_components/lib/utils/i18_key_constants.dart (2)

3-17: Add documentation for better maintainability.

The class structure is well-organized with logically grouped keys following i18n naming conventions.

Consider adding documentation to describe the purpose of each key and provide example usage:

 class Common {
   const Common();
+  /// Key for camera access text
+  /// Example: "Access Camera"
   String get camera => 'CAMERA';

Also applies to: 26-29


18-24: Simplify block getters to arrow syntax.

The block getters can be simplified to match the style of other getters in the class.

Apply this diff to maintain consistency:

-  String get acceptText {
-    return 'PRIVACY_POLICY_ACCEPT_TEXT';
-  }
+  String get acceptText => 'PRIVACY_POLICY_ACCEPT_TEXT';

-  String get declineText {
-    return 'PRIVACY_POLICY_DECLINE_TEXT';
-  }
+  String get declineText => 'PRIVACY_POLICY_DECLINE_TEXT';
flutter/digit-ui-components/digit_components/lib/models/privacy_notice/privacy_notice_model.freezed.dart (1)

402-404: Consider documenting the type field in the source file.

The type field in both DescriptionNoticeModel and SubDescriptionNoticeModel would benefit from documentation in the source file to clarify its expected values and usage.

Also applies to: 620-622

flutter/digit-ui-components/digit_components/lib/utils/app_logger.dart (3)

1-10: LGTM! Consider adding documentation.

The singleton implementation and imports are well-structured. Consider adding documentation comments to describe the class purpose and usage.

Add class-level documentation:

+/// A singleton logger utility for standardized application logging.
+/// 
+/// Usage:
+/// ```dart
+/// AppLogger.instance.debug('Debug message');
+/// AppLogger.instance.info('Info message', title: 'Custom Title');
+/// AppLogger.instance.error(title: 'Error Title', message: 'Error details');
+/// ```
 class AppLogger {

11-27: LGTM! Add parameter documentation.

The public API is well-designed with appropriate logging levels. Consider adding parameter documentation for better IDE support.

Add parameter documentation:

+  /// Logs a debug message at CONFIG level.
+  /// 
+  /// [input] The message or object to log.
+  /// [title] Optional custom title for the log entry.
   void debug(dynamic input, {String? title}) =>
       _printMessage(input, title: title, level: Level.CONFIG);

+  /// Logs an informational message at INFO level.
+  /// 
+  /// [input] The message or object to log.
+  /// [title] Optional custom title for the log entry.
   void info(dynamic input, {String? title}) =>
       _printMessage(input, title: title, level: Level.INFO);

+  /// Logs an error with optional stack trace at SEVERE level.
+  /// 
+  /// [title] The error title or category.
+  /// [message] Optional detailed error message.
+  /// [stackTrace] Optional stack trace for the error.
   void error({
     required String title,
     String? message,
     StackTrace? stackTrace,
   }) =>

28-60: Consider some improvements to the logging format.

The implementation is solid, but there are a few potential improvements:

  1. Make the wrap width configurable:
+  /// The width at which to wrap log messages.
+  static const int defaultWrapWidth = 120;
+
   void _printMessage(
       dynamic input, {
         String? title,
         required Level level,
+        int? wrapWidth,
       }) =>
       debugPrint(
         [
           '[${level.name.padRight(4, ' ').substring(0, 4)}] ',
           '${(title ?? runtimeType.toString())}\n',
           '${input.toString()}\n',
         ].join(''),
-        wrapWidth: 120,
+        wrapWidth: wrapWidth ?? defaultWrapWidth,
       );
  1. Optimize level name formatting:
-          '[${level.name.padRight(4, ' ').substring(0, 4)}] ',
+          '[${level.name.length > 4 ? level.name.substring(0, 4) : level.name.padRight(4)}] ',
  1. Use a more meaningful default for missing titles:
-          '${(title ?? runtimeType.toString())}\n',
+          '${(title ?? 'AppLogger')}\n',
flutter/digit-ui-components/digit_components/lib/theme/ComponentTheme/action_card_theme.dart (2)

7-7: Consider renaming the class to remove redundant "Digit" prefix.

The class name DigitDigitActionCardTheme contains a redundant "Digit" prefix. Consider renaming it to DigitActionCardTheme to maintain consistency while avoiding redundancy.

-class DigitDigitActionCardTheme extends ThemeExtension<DigitDigitActionCardTheme> {
+class DigitActionCardTheme extends ThemeExtension<DigitActionCardTheme> {

62-63: Remove unnecessary empty lines.

These consecutive empty lines can be removed to maintain consistent code formatting.

    final defaultTheme = context != null ? DigitDigitActionCardTheme.defaultTheme(context) : null;

-

-

    return DigitDigitActionCardTheme(
flutter/digit-ui-components/digit_components/lib/theme/ComponentTheme/panel_theme.dart (2)

33-60: Consider extracting magic numbers and asset paths to constants.

While the default theme implementation is solid, consider these improvements for better maintainability:

  1. Extract animation sizes to named constants:
const double _kMobileSuccessAnimationSize = 80.0;
const double _kTabletSuccessAnimationSize = 100.0;
const double _kDesktopSuccessAnimationSize = 120.0;
  1. Move asset paths to a centralized constants file:
class AnimationAssets {
  static const String success = 'assets/animated_json/success.json';
  static const String error = 'assets/animated_json/error.json';
}

95-112: Consider improving string interpolation logic.

The current implementation uses a hard threshold (0.5) for switching string values. Consider using a more gradual transition or documenting why the 0.5 threshold was chosen.

Also, there's a spacing issue in line 109:

-      successJson: t< 0.5 ? successJson : other.successJson,
+      successJson: t < 0.5 ? successJson : other.successJson,
flutter/digit-ui-components/digit_components/lib/widgets/atoms/digit_back_button.dart (2)

25-32: Consider adding visual feedback for better accessibility.

While using transparent colors for hover/highlight/splash states keeps the design clean, it might affect accessibility by removing visual feedback for interactive elements. Consider using subtle colors from the theme for these states.

       child: InkWell(
         onTap: handleBack,
-        hoverColor: theme.colorTheme.generic.transparent,
-        highlightColor: theme.colorTheme.generic.transparent,
-        splashColor: theme.colorTheme.generic.transparent,
+        hoverColor: theme.colorTheme.generic.primary.withOpacity(0.1),
+        highlightColor: theme.colorTheme.generic.primary.withOpacity(0.2),
+        splashColor: theme.colorTheme.generic.primary.withOpacity(0.3),

36-51: Simplify conditional rendering logic.

The current implementation has complex nested conditions that could be simplified for better readability and maintainability.

Consider refactoring to:

-            if(backDigitButtonTheme.backDigitButtonIcon != null && backDigitButtonTheme.disabledBackDigitButtonIcon != null)
-              handleBack!=null ? backDigitButtonTheme.backDigitButtonIcon! : backDigitButtonTheme.disabledBackDigitButtonIcon!,
-            if(label != null && backDigitButtonTheme.backDigitButtonIcon != null && backDigitButtonTheme.disabledBackDigitButtonIcon != null)
-            SizedBox(
-              width: theme.spacerTheme.spacer1,
-            ),
-            if(label != null)
-            Text(
+            if (backDigitButtonTheme.backDigitButtonIcon != null && 
+                backDigitButtonTheme.disabledBackDigitButtonIcon != null) ...[
+              handleBack != null 
+                  ? backDigitButtonTheme.backDigitButtonIcon! 
+                  : backDigitButtonTheme.disabledBackDigitButtonIcon!,
+              if (label != null) 
+                SizedBox(width: theme.spacerTheme.spacer1),
+            ],
+            if (label != null) Text(

Also consider moving the spacing logic to the theme:

// In DigitBackButtonThemeData
final double? iconLabelSpacing;
flutter/digit-ui-components/digit_components/lib/theme/ComponentTheme/digit_tag_theme.dart (2)

26-43: Consider adding parameter validation.

While the constructor is well-structured, consider adding validation for critical parameters like borderWidth (should be positive), maxLine (should be positive), and tagWidth (should be positive if provided).

Example validation:

const TagThemeData({
  this.successBackgroundColor,
  // ... other parameters ...
  this.borderWidth,
  this.tagWidth,
  this.maxLine,
}) : assert(borderWidth == null || borderWidth > 0, 'borderWidth must be positive'),
     assert(tagWidth == null || tagWidth > 0, 'tagWidth must be positive'),
     assert(maxLine == null || maxLine > 0, 'maxLine must be positive');

45-78: Consider extracting fixed dimensions as constants.

The method uses hardcoded values for padding, border radius, and icon sizes. Consider extracting these as private static constants for better maintainability.

Example:

class TagThemeData extends ThemeExtension<TagThemeData> {
  static const double _kDefaultIconSize = 16.0;
  static const double _kDefaultBorderRadius = 4.0;
  static const double _kDefaultBorderWidth = 0.5;
  static const EdgeInsets _kDefaultPadding = EdgeInsets.symmetric(horizontal: 12, vertical: 4);

  // ... rest of the class ...

  static TagThemeData defaultTheme(BuildContext context) {
    // ... existing code ...
    return TagThemeData(
      // ... other properties ...
      padding: _kDefaultPadding,
      borderRadius: BorderRadius.circular(_kDefaultBorderRadius),
      borderWidth: _kDefaultBorderWidth,
      successIcon: Icon(
        Icons.check_circle,
        color: theme.colorTheme.alert.success,
        size: _kDefaultIconSize,
      ),
      // ... rest of the properties ...
    );
  }
}
flutter/digit-ui-components/digit_components/lib/constants/app_constants.dart (2)

5-37: LGTM! Well-organized constants with clear documentation.

The renaming to Base and the addition of border width constants improve clarity. The asset paths follow a consistent naming convention.

Consider grouping related constants (e.g., SVG assets, JSON animations) using region comments for better organization:

 class Base {
   // Basic layout constants
   static const double height = 40;
   ...
+  // SVG asset paths
   static const String textAreaSvg = 'assets/icons/svg/text_area_expand.svg';
   ...
+  // JSON animation paths
   static const String errorJson = 'assets/animated_json/error.json';
   ...
 }

128-134: Consider making toastDuration a static constant.

The toast constants are well-defined, but the toastDuration getter could be simplified.

Consider this change for consistency with other constants:

-  Duration get toastDuration => const Duration(seconds: 5);
+  static const Duration toastDuration = Duration(seconds: 5);
flutter/digit-ui-components/digit_components/lib/theme/ComponentTheme/switch_theme.dart (3)

8-28: Add documentation comments for properties.

While the property names are clear, adding documentation comments would improve code maintainability by explaining:

  • The purpose of each property
  • Expected value ranges
  • Default behaviors when null

Example documentation:

/// The color of the switch when it is in the on state.
final Color? activeColor;

/// The color of the switch when it is in the off state.
final Color? inactiveColor;

/// The color of any symbols or icons within the switch thumb.
final Color? symbolColor;

30-47: Consider making dimensions responsive and accessibility-aware.

The fixed dimensions for thumbSize, trackHeight, and trackWidth might not scale well across different screen sizes or respect accessibility settings.

Consider:

  1. Using relative dimensions based on MediaQuery or text scale factor
  2. Respecting platform-specific guidelines for minimum touch targets
 return DigitSwitchThemeData(
   activeColor: theme.colorTheme.primary.primary1,
   inactiveColor: theme.colorTheme.text.disabled,
   symbolColor: theme.colorTheme.paper.primary,
   labelTextStyle: textTheme.bodyS.copyWith(
     color: theme.colorTheme.text.primary,
   ),
-  thumbSize: 18.0,
-  trackHeight: 22.0,
-  trackWidth: 44,
+  thumbSize: 18.0 * MediaQuery.of(context).textScaleFactor,
+  trackHeight: 22.0 * MediaQuery.of(context).textScaleFactor,
+  trackWidth: 44.0 * MediaQuery.of(context).textScaleFactor,
   padding: const EdgeInsets.all(2),
   animationValue: 21,
 );

74-90: Improve animation value interpolation.

The current implementation of animationValue lerping using a 0.5 threshold might cause abrupt transitions.

Consider implementing smoother interpolation:

-      animationValue:t < 0.5 ? animationValue : other.animationValue,
+      animationValue: (lerpDouble(animationValue?.toDouble(), 
+          other.animationValue?.toDouble(), t))?.round(),

This will provide a smoother transition between animation values during theme changes.

flutter/digit-ui-components/digit_components/lib/theme/ComponentTheme/digit_tab_bar_theme.dart (4)

7-31: Add documentation for properties and constructor.

Consider adding documentation comments to describe:

  • The purpose and expected values of each property
  • The constructor's usage and parameter requirements

Example documentation:

/// Theme data for Digit Tab Bar component.
class DigitTabBarThemeData extends ThemeExtension<DigitTabBarThemeData> {
  /// Color of the selected tab.
  final Color? selectedTabColor;
  
  /// Color of unselected tabs.
  final Color? unselectedTabColor;
  
  // ... (continue for other properties)
  
  /// Creates a [DigitTabBarThemeData] with customizable properties.
  /// 
  /// All parameters are optional. When null, they will use values from the default theme.
  const DigitTabBarThemeData({...});

33-53: Consider improvements to the default theme factory method.

  1. Add documentation for the factory method.
  2. Consider extracting hard-coded dimensions to constants or making them configurable.

Example improvements:

/// Default dimensions for tab bar
const double kDefaultSelectedTabHeight = 56.0;
const double kDefaultTabHeight = 52.0;

/// Creates a default theme instance using the current theme context.
/// 
/// Uses the app's color scheme and text styles to create a cohesive look.
static DigitTabBarThemeData defaultTheme(BuildContext context) {
  final theme = Theme.of(context);
  final textTheme = theme.digitTextTheme(context);

  return DigitTabBarThemeData(
    // ... other properties ...
    selectedTabHeight: kDefaultSelectedTabHeight,
    tabHeight: kDefaultTabHeight,
    // ... remaining properties ...
  );
}

55-82: Add documentation for the copyWith method.

Consider adding documentation to explain the method's purpose and usage.

Example documentation:

/// Creates a copy of this theme but with the given fields replaced with the new values.
@override
DigitTabBarThemeData copyWith({
  Color? selectedTabColor,
  // ... other parameters ...
})

84-101: Improve lerp method implementation and documentation.

  1. Add documentation for the lerp method.
  2. Consider improving the maxLine interpolation logic.

Example improvements:

/// Linearly interpolate between two [DigitTabBarThemeData] themes.
/// 
/// The arguments may be null, indicating that the corresponding theme should be
/// treated as having null values for all properties.
@override
DigitTabBarThemeData lerp(covariant ThemeExtension<DigitTabBarThemeData>? other, double t) {
  if (other is! DigitTabBarThemeData) return this;

  return DigitTabBarThemeData(
    // ... other properties ...
    // Consider using a more gradual transition for maxLine
    maxLine: (lerpDouble(maxLine?.toDouble(), other.maxLine?.toDouble(), t))?.round(),
    // ... remaining properties ...
  );
}
flutter/digit-ui-components/digit_components/lib/theme/ComponentTheme/toast_theme_data.dart (2)

53-57: Simplify the width calculation logic.

The nested ternary expressions can be simplified for better readability.

-    double width = AppView.isMobileView(MediaQuery.of(context).size)
-        ? MediaQuery.of(context).size.width
-        : AppView.isTabletView(MediaQuery.of(context).size)
-        ? 480
-        : 800;
+    double width;
+    final size = MediaQuery.of(context).size;
+    if (AppView.isMobileView(size)) {
+      width = size.width;
+    } else if (AppView.isTabletView(size)) {
+      width = 480;
+    } else {
+      width = 800;
+    }

72-75: Format icon declarations consistently.

The icon declarations have inconsistent formatting. Some are on multiple lines while others are on a single line.

-      errorIcon: Icon(Icons.error, color: theme.colorTheme.paper.primary, size: theme.spacerTheme.spacer6,),
-      warningIcon: Icon(Icons.warning, color: theme.colorTheme.paper.primary, size: theme.spacerTheme.spacer6,),
-      infoIcon: Icon(Icons.info, color: theme.colorTheme.paper.primary, size: theme.spacerTheme.spacer6,),
-      cancelIcon: Icon(Icons.close, color: theme.colorTheme.paper.primary, size: theme.spacerTheme.spacer6,),
+      errorIcon: Icon(
+        Icons.error,
+        color: theme.colorTheme.paper.primary,
+        size: theme.spacerTheme.spacer6,
+      ),
+      warningIcon: Icon(
+        Icons.warning,
+        color: theme.colorTheme.paper.primary,
+        size: theme.spacerTheme.spacer6,
+      ),
+      infoIcon: Icon(
+        Icons.info,
+        color: theme.colorTheme.paper.primary,
+        size: theme.spacerTheme.spacer6,
+      ),
+      cancelIcon: Icon(
+        Icons.close,
+        color: theme.colorTheme.paper.primary,
+        size: theme.spacerTheme.spacer6,
+      ),
flutter/digit-ui-components/digit_components/lib/theme/ComponentTheme/pop_up_card_theme.dart (3)

7-29: Add documentation for better maintainability.

The properties and constructor are well-structured. Consider adding documentation comments to describe the purpose and expected values of each property.

Add documentation like this:

+/// Theme extension for popup cards in the Digit UI Components library.
 class DigitPopupTheme extends ThemeExtension<DigitPopupTheme> {
+  /// The width of the popup card.
   final double? width;
+  /// The height of the popup card.
   final double? height;
   // ... add similar documentation for other properties

31-63: Extract hardcoded values to theme constants.

The default theme implementation contains several hardcoded values for margins, paddings, and sizes. Consider extracting these to theme constants for better maintainability and consistency.

Create a constants file and refactor like this:

+class DigitPopupConstants {
+  static const mobileMargin = 16.0;
+  static const tabletMargin = 100.0;
+  static const desktopMargin = 400.0;
+
+  static const mobilePadding = 16.0;
+  static const tabletPadding = 20.0;
+  static const desktopPadding = 24.0;
+
+  static const mobileIconSize = 24.0;
+  static const tabletIconSize = 28.0;
+  static const desktopIconSize = 32.0;
+
+  static const shadowOpacity = 0.16;
+  static const shadowOffset = Offset(0, 1);
+}

Then use these constants in the theme:

-      margin: isMobile ? const EdgeInsets.symmetric(horizontal: 16) : isTab ? const EdgeInsets.symmetric(horizontal: 100) : const EdgeInsets.symmetric(horizontal: 400),
+      margin: isMobile ? const EdgeInsets.symmetric(horizontal: DigitPopupConstants.mobileMargin) 
+              : isTab ? const EdgeInsets.symmetric(horizontal: DigitPopupConstants.tabletMargin) 
+              : const EdgeInsets.symmetric(horizontal: DigitPopupConstants.desktopMargin),

95-111: Consider improving alertAnimation lerping.

While the lerp implementation is generally good, the alertAnimation transition is abrupt (switching at t=0.5). Consider implementing a smoother transition or documenting why the abrupt switch is necessary.

If a smoother transition isn't needed, add a comment explaining why:

-      alertAnimation: t<0.5 ? alertAnimation : other.alertAnimation,
+      // Animation assets can't be smoothly interpolated, so we switch at the midpoint
+      alertAnimation: t < 0.5 ? alertAnimation : other.alertAnimation,
flutter/digit-ui-components/digit_components/lib/theme/SpacerTheme/spacer_theme.dart (2)

4-16: Add documentation to explain the purpose of each spacer size.

Consider adding documentation to explain:

  • The purpose and intended use of each spacer size
  • Any design system guidelines or principles behind the spacing scale
  • Examples of where each spacer size should be used

Add this documentation above the class:

+/// A theme extension that defines a set of standardized spacing values.
+/// 
+/// The spacing scale follows a 4-point grid system where each subsequent
+/// spacer is 4 logical pixels larger than the previous one:
+/// - spacer1 (4.0): Used for minimal spacing, such as between icons and text
+/// - spacer2 (8.0): Used for related elements within a component
+/// - spacer3 (12.0): Used for spacing between different elements
+/// ...etc
class DigitSpacerTheme extends ThemeExtension<DigitSpacerTheme> {

64-82: Handle potential null values from lerpDouble safely.

The current implementation force unwraps the result of lerpDouble with the ! operator. While lerpDouble should never return null in this case (since all values are non-null), it's better to be explicit about null handling to prevent potential runtime errors.

Consider this safer implementation:

-      spacer1: lerpDouble(spacer1, other.spacer1, t)!,
-      spacer2: lerpDouble(spacer2, other.spacer2, t)!,
-      spacer3: lerpDouble(spacer3, other.spacer3, t)!,
-      spacer4: lerpDouble(spacer4, other.spacer4, t)!,
-      spacer5: lerpDouble(spacer5, other.spacer5, t)!,
-      spacer6: lerpDouble(spacer6, other.spacer6, t)!,
-      spacer7: lerpDouble(spacer7, other.spacer7, t)!,
-      spacer8: lerpDouble(spacer8, other.spacer8, t)!,
-      spacer9: lerpDouble(spacer9, other.spacer9, t)!,
-      spacer10: lerpDouble(spacer10, other.spacer10, t)!,
-      spacer11: lerpDouble(spacer11, other.spacer11, t)!,
-      spacer12: lerpDouble(spacer12, other.spacer12, t)!,
+      spacer1: lerpDouble(spacer1, other.spacer1, t) ?? spacer1,
+      spacer2: lerpDouble(spacer2, other.spacer2, t) ?? spacer2,
+      spacer3: lerpDouble(spacer3, other.spacer3, t) ?? spacer3,
+      spacer4: lerpDouble(spacer4, other.spacer4, t) ?? spacer4,
+      spacer5: lerpDouble(spacer5, other.spacer5, t) ?? spacer5,
+      spacer6: lerpDouble(spacer6, other.spacer6, t) ?? spacer6,
+      spacer7: lerpDouble(spacer7, other.spacer7, t) ?? spacer7,
+      spacer8: lerpDouble(spacer8, other.spacer8, t) ?? spacer8,
+      spacer9: lerpDouble(spacer9, other.spacer9, t) ?? spacer9,
+      spacer10: lerpDouble(spacer10, other.spacer10, t) ?? spacer10,
+      spacer11: lerpDouble(spacer11, other.spacer11, t) ?? spacer11,
+      spacer12: lerpDouble(spacer12, other.spacer12, t) ?? spacer12,
flutter/digit-ui-components/digit_components/lib/theme/TextTheme/mobile_text_theme.dart (1)

31-36: Review font sizes for accessibility.

Some text styles use a font size of 12px (headingXS, bodyXS, linkS), which might be too small for comfortable reading on mobile devices. Consider increasing the minimum font size to 14px for better accessibility.

Apply this diff to increase the minimum font size:

          headingXS: const TextStyle(
-            fontSize: 12,
+            fontSize: 14,
             fontWeight: FontWeight.w700,
             fontFamily: 'Roboto',
             height: 1.14,
          ),

          bodyXS: const TextStyle(
-            fontSize: 12,
+            fontSize: 14,
             fontWeight: FontWeight.w400,
             fontFamily: 'Roboto',
             height: 1.37,
          ),

          linkS: const TextStyle(
-            fontSize: 12,
+            fontSize: 14,
             fontWeight: FontWeight.w400,
             fontFamily: 'Roboto',
             height: 1.37,
             decoration: TextDecoration.underline,
          ),

Also applies to: 67-72, 87-93

flutter/digit-ui-components/digit_components/lib/theme/ColorTheme/color_theme.dart (2)

4-51: Add documentation for better maintainability.

Consider adding documentation comments to describe:

  • The purpose of the theme class
  • Usage examples
  • Parameters and their expected values
+/// A color theme extension that provides consistent theming across the application.
+///
+/// Example usage:
+/// ```dart
+/// Theme(
+///   data: ThemeData.light().copyWith(
+///     extensions: [
+///       const DigitLightColorTheme(),
+///     ],
+///   ),
+///   child: MyApp(),
+/// )
+/// ```
 class DigitColorTheme extends ThemeExtension<DigitColorTheme> {

110-140: Consider using more semantic names for primary colors.

The current names (primary1, primary2) don't convey their intended usage. Consider using more descriptive names.

 class Primary {
   const Primary({
-    required this.primary1,
-    required this.primary2,
+    required this.main,
+    required this.accent,
     required this.primaryBg,
   });

-  final Color primary1;
-  final Color primary2;
+  final Color main;
+  final Color accent;
   final Color primaryBg;
flutter/digit-ui-components/digit_components/lib/theme/colors.dart (2)

6-6: LGTM! Consider standardizing color value format.

The changes look good, particularly the singleton pattern for the light getter. However, there's an inconsistency in how color values are defined:

  • Some use Color.fromRGBO()
  • Others use Color()

Consider standardizing to one format for better maintainability:

-  Color get darkprimary1 => const Color.fromRGBO(234, 99, 31, 1);
-  Color get background => const Color(0xFF6F6F6F);
-  Color get overLayColor => const Color(0xFF0B0C0C);
+  Color get darkprimary1 => const Color(0xFFEA631F);
+  Color get background => const Color(0xFF6F6F6F);
+  Color get overLayColor => const Color(0xFF0B0C0C);

Also applies to: 10-12


47-50: Remove empty header section or add TODO comment.

The header section is empty. Either remove it or add a TODO comment explaining what's planned.

-/// Header
-
-
-
flutter/digit-ui-components/digit_components/lib/widgets/atoms/digit_divider.dart (2)

6-17: Add documentation for the widget and its properties.

Consider adding documentation comments to describe:

  • The widget's purpose and usage
  • Each property's purpose and valid values
  • Examples of common use cases

Add this documentation above the class:

/// A customizable divider widget that adapts its appearance based on theme and orientation.
///
/// The divider can be configured with different types (small, medium, large) and
/// orientations (horizontal, vertical). Its appearance can be further customized
/// through [DigitDividerThemeData].
///
/// Example:
/// ```dart
/// DigitDivider(
///   dividerType: DividerType.medium,
///   dividerOrientation: DividerOrientation.horizontal,
/// )
/// ```

31-44: Consider performance optimization.

The Container could be made const when possible by extracting the build logic into a separate method.

Consider this refactoring:

-    return Container(
+    return _buildDivider(
+      thickness: thickness,
+      themeData: themeData,
+      theme: theme,
+    );
+  }
+
+  Widget _buildDivider({
+    required double thickness,
+    required DigitDividerThemeData themeData,
+    required ThemeData theme,
+  }) {
+    return Container(
       width: dividerOrientation == DividerOrientation.horizontal
           ? themeData.width
           : thickness,
       height: dividerOrientation == DividerOrientation.horizontal
           ? thickness
           : themeData.height,
       color: themeData.color ?? theme.colorTheme.generic.divider,
       margin: EdgeInsets.only(
         left: themeData.indent,
         right: themeData.endIndent,
       ),
     );
flutter/digit-ui-components/digit_components/lib/theme/ComponentTheme/divider_theme.dart (1)

6-15: Add documentation for the theme class and its properties.

Consider adding documentation comments to describe:

  • The theme class's purpose
  • Each property's purpose and valid values
  • The relationship between properties

Add this documentation:

/// Theme data for customizing the appearance of [DigitDivider] widgets.
///
/// This class is used to define the visual properties of dividers, including:
/// * [smallDividerThickness] - Thickness for small dividers (default: 1)
/// * [mediumDividerThickness] - Thickness for medium dividers (default: 2)
/// * [largeDividerThickness] - Thickness for large dividers (default: 4)
/// * [color] - The color of the divider (optional)
/// * [indent] - The starting padding before the divider (default: 0.0)
/// * [endIndent] - The ending padding after the divider (default: 0.0)
/// * [width] - The width of the divider (optional)
/// * [height] - The height of the divider (optional)
flutter/digit-ui-components/digit_components/lib/widgets/atoms/digit_search_bar.dart (2)

2-2: Remove unused import.

The import of digit_card.dart is not used in this file.

-import 'package:digit_ui_components/widgets/molecules/digit_card.dart';

44-50: Consider moving BoxShadow configuration to theme constants.

The BoxShadow configuration could be moved to theme constants for consistency and reusability across the application.

Consider creating a theme constant for the shadow:

class DigitShadows {
  static const searchBar = BoxShadow(
    color: Color(0xFF000000).withOpacity(.16),
    offset: Offset(0, 1),
    spreadRadius: 0,
    blurRadius: 2,
  );
}
flutter/digit-ui-components/digit_components/lib/widgets/atoms/digit_search_form_input.dart (1)

93-97: Document the empty build method.

The empty build method with a comment about customization could be confusing to other developers. Either remove the override if no customization is needed, or document why the method needs to be kept for future customization.

-  @override
-  Widget build(BuildContext context) {
-    /// You can customize the appearance or behavior specific to the TextFormInput here
-    return super.build(context);
-  }
flutter/digit-ui-components/digit_components/lib/digit_components.dart (1)

9-18: Add more detailed documentation for theme initialization.

While the singleton implementation is correct, the initThemeComponents method could benefit from more detailed documentation explaining:

  • When this method should be called
  • What types of theme components can be added
  • Example usage

Consider adding this documentation:

 class DigitUi {
   static const DigitUi _instance = DigitUi._internal();
   static DigitUi get instance => _instance;

   const DigitUi._internal();

+  /// Initializes custom theme components for the Digit UI library.
+  /// 
+  /// This method should be called during app initialization, before any UI components
+  /// are rendered. It allows for customization of theme components such as:
+  /// - Custom colors
+  /// - Custom text styles
+  /// - Custom dimensions
+  /// 
+  /// Example usage:
+  /// ```dart
+  /// await DigitUi.instance.initThemeComponents();
+  /// ```
   Future<void> initThemeComponents() async {
     /// can be used to add custom theme components
   }
 }
flutter/digit-ui-components/digit_components/lib/theme/TextTheme/desktop_text_theme.dart (1)

37-54: Consider adjusting caption styles for better hierarchy.

The current caption styles have relatively large font sizes (28px, 24px, 20px) and use the same line height as headings (1.14). Consider:

  • Reducing font sizes to better differentiate from headings
  • Increasing line height for better readability of caption text
           captionL: const TextStyle(
-            fontSize: 28,
+            fontSize: 20,
             fontWeight: FontWeight.w500,
             fontFamily: 'Roboto',
-            height: 1.14,
+            height: 1.2,
           ),
           captionM: const TextStyle(
-            fontSize: 24,
+            fontSize: 18,
             fontWeight: FontWeight.w500,
             fontFamily: 'Roboto',
-            height: 1.14,
+            height: 1.2,
           ),
           captionS: const TextStyle(
-            fontSize: 20,
+            fontSize: 16,
             fontWeight: FontWeight.w500,
             fontFamily: 'Roboto',
-            height: 1.14,
+            height: 1.2,
           ),
flutter/digit-ui-components/digit_components/lib/widgets/atoms/digit_checkbox.dart (1)

151-153: Fix potential null safety issue.

The processedLabel is force-unwrapped with ! operator, but it's derived from the optional widget.label. While the null check in the if condition (line 148) prevents this from being an issue, it's better to be explicit about null safety.

-              processedLabel!,
+              processedLabel ?? '',  // Provide a default empty string
flutter/digit-ui-components/digit_components/lib/utils/component_utils.dart (5)

5-23: Add documentation and consider method improvements.

The utility methods would benefit from:

  1. Documentation explaining the behavior and usage
  2. Optional parameters for actions in showDialog
  3. A more selective approach in hideDialog to avoid unintentionally closing other dialogs

Add documentation and improve the methods:

 class DigitComponentsUtils {
+  /// Dismisses all dialogs in the navigation stack until a non-popup route is found.
+  /// Note: This may unintentionally close other dialogs in the stack.
   static void hideDialog(BuildContext context) {
     Navigator.of(
       context,
       rootNavigator: true,
     ).popUntil(
       (route) => route is! PopupRoute,
     );
   }

+  /// Shows a dialog with the specified label and type.
+  /// 
+  /// Parameters:
+  /// - [context]: The build context
+  /// - [label]: Optional text to display in the dialog
+  /// - [dialogType]: The type of dialog to show (inProgress, complete, failed)
+  /// - [primaryAction]: Optional primary action for the dialog
+  /// - [secondaryAction]: Optional secondary action for the dialog
   static void showDialog(
     BuildContext context,
     String? label,
     DialogType dialogType,
+    {DigitDialogActions? primaryAction, DigitDialogActions? secondaryAction}
   ) {
     DigitSyncDialog.show(
       context,
       type: dialogType,
       label: label,
+      primaryAction: primaryAction,
+      secondaryAction: secondaryAction,
     );
   }
 }

25-46: Add documentation and improve configurability.

The dialog implementation would benefit from:

  1. Class and method documentation
  2. Configurable barrier opacity
  3. Error handling for edge cases

Add documentation and improve configurability:

+/// A dialog that shows sync status with customizable actions.
 class DigitSyncDialog {
+  /// Shows a sync dialog with the specified type and optional actions.
+  /// 
+  /// Parameters:
+  /// - [context]: The build context
+  /// - [key]: Optional key for the dialog
+  /// - [barrierDismissible]: Whether clicking outside dismisses the dialog
+  /// - [type]: The type of dialog to show
+  /// - [label]: Optional text to display
+  /// - [primaryAction]: Optional primary action
+  /// - [secondaryAction]: Optional secondary action
+  /// - [barrierOpacity]: Optional barrier opacity (defaults to 0.70)
   static Future<T?> show<T>(
     BuildContext context, {
     Key? key,
     bool barrierDismissible = false,
     required DialogType type,
     String? label,
     DigitDialogActions? primaryAction,
     DigitDialogActions? secondaryAction,
+    double barrierOpacity = 0.70,
   }) async {
+    assert(barrierOpacity >= 0 && barrierOpacity <= 1.0, 'Barrier opacity must be between 0.0 and 1.0');
     return showDialog<T>(
       context: context,
       barrierDismissible: barrierDismissible,
-      barrierColor: const DigitColors().overLayColor.withOpacity(.70),
+      barrierColor: const DigitColors().overLayColor.withOpacity(barrierOpacity),
       builder: (context) => DigitSyncDialogContent(
         type: type,
         label: label,
         primaryAction: primaryAction,
         secondaryAction: secondaryAction,
       ),
     );
   }
 }

48-156: Improve documentation, constants, and code organization.

The dialog content implementation would benefit from:

  1. Class and parameter documentation
  2. Extracted constants for magic numbers
  3. Improved null safety in label check
  4. Reduced code duplication in switch case

Improve the implementation:

+/// A widget that displays the content of a sync dialog.
 class DigitSyncDialogContent extends StatelessWidget {
+  /// Optional text to display in the dialog.
   final String? label;
+  /// The type of dialog to show (determines icon and color).
   final DialogType type;
+  /// Optional primary action for the dialog.
   final DigitDialogActions? primaryAction;
+  /// Optional secondary action for the dialog.
   final DigitDialogActions? secondaryAction;

+  static const double _dialogWidth = 300.0;
+  static const double _minHeight = 100.0;
+  static const double _iconSize = 32.0;
+  static const double _borderRadius = 4.0;
+  static const double _shadowOpacity = 0.16;
+  static const double _shadowOffset = 1.0;
+  static const double _shadowBlur = 2.0;

   // ... rest of the implementation ...

   @override
   Widget build(BuildContext context) {
     final theme = Theme.of(context);
     final textTheme = theme.digitTextTheme(context);
     IconData icon;
     Color color;
-    TextStyle? labelStyle;
+    final labelStyle = textTheme.headingM;

     switch (type) {
       case DialogType.inProgress:
         icon = Icons.autorenew;
         color = theme.colorTheme.primary.primary1;
-        labelStyle = textTheme.headingM;
         break;
       case DialogType.complete:
         icon = Icons.check_circle_outline;
         color = theme.colorTheme.alert.success;
-        labelStyle = textTheme.headingM;
         break;
       case DialogType.failed:
         icon = Icons.error_outline;
         color = theme.colorTheme.alert.error;
-        labelStyle = textTheme.headingM;
         break;
     }

     return Dialog.fullscreen(
       backgroundColor: const DigitColors().transparent,
       child: Center(
         child: Container(
           padding: const EdgeInsets.all(spacer4),
           decoration: BoxDecoration(
-            borderRadius: BorderRadius.circular(4),
+            borderRadius: BorderRadius.circular(_borderRadius),
             color: theme.colorTheme.paper.primary,
             boxShadow: [
               BoxShadow(
-                color: const Color(0xFF000000).withOpacity(.16),
-                offset: const Offset(0, 1),
+                color: const Color(0xFF000000).withOpacity(_shadowOpacity),
+                offset: const Offset(0, _shadowOffset),
                 spreadRadius: 0,
-                blurRadius: 2,
+                blurRadius: _shadowBlur,
               ),
             ],
           ),
-          width: 300,
-          constraints: const BoxConstraints(minHeight: 100),
+          width: _dialogWidth,
+          constraints: const BoxConstraints(minHeight: _minHeight),
           child: Column(
             mainAxisSize: MainAxisSize.min,
             crossAxisAlignment: CrossAxisAlignment.center,
             mainAxisAlignment: MainAxisAlignment.center,
             children: [
-              Icon(icon, size: 32, color: color),
-              if (label != null && label !="") ...[
+              Icon(icon, size: _iconSize, color: color),
+              if (label?.isNotEmpty ?? false) ...[
                 const SizedBox(height: spacer4),
                 Text(label!, style: labelStyle.copyWith(color: color)),
               ],
               // ... rest of the implementation ...

158-158: Add documentation for the DialogType enum.

Add documentation to explain the enum values:

+/// The type of sync dialog to display.
+/// 
+/// - [inProgress]: Shows a loading/progress state
+/// - [complete]: Shows a success/completion state
+/// - [failed]: Shows an error/failure state
 enum DialogType { inProgress, complete, failed }

160-168: Add documentation and improve type safety.

The action class would benefit from:

  1. Class and parameter documentation
  2. Constrained generic type

Improve the implementation:

+/// Represents an action that can be performed from a dialog.
+/// 
+/// The generic type [T] represents the return type of the action.
+/// If no action is provided, the dialog will be dismissed when clicked.
 class DigitDialogActions<T> {
+  /// The label to display on the action button.
   final String label;
+  /// Optional callback to execute when the action is triggered.
+  /// If null, the dialog will be dismissed.
   final T Function(BuildContext context)? action;

   const DigitDialogActions({
     required this.label,
     this.action,
   });
 }
flutter/digit-ui-components/digit_components/lib/widgets/atoms/digit_tab.dart (3)

8-24: LGTM! Consider adding documentation.

The class declaration follows Flutter's best practices with proper use of final properties and const constructor. Consider adding documentation comments to describe the widget's purpose and parameters.

Add documentation comments:

+/// A customizable tab bar widget that supports theming.
+///
+/// The [DigitTabBar] creates a row of tabs with customizable appearance and behavior.
+/// It maintains the selected tab state and provides callbacks for tab selection.
 class DigitTabBar extends StatefulWidget {
+  /// The list of tab labels to display.
   final List<String> tabs;
+  /// The initially selected tab index. Defaults to 0.
   final int initialIndex;
+  /// Callback function invoked when a tab is selected.
   final ValueChanged<int> onTabSelected;
+  /// Optional theme data to customize the appearance of the tab bar.
   final DigitTabBarThemeData? tabBarThemeData;

35-49: Optimize tab width calculation performance.

The _calculateMaxTabWidth method creates a new TextPainter for each tab on every build. Consider caching the result if the tabs list hasn't changed.

Cache the calculated width:

+  double? _cachedMaxWidth;
+
   double _calculateMaxTabWidth(BuildContext context) {
+    if (_cachedMaxWidth != null) return _cachedMaxWidth!;
+
     final textTheme = Theme.of(context).digitTextTheme(context);
     final maxWidth = widget.tabs.map((tab) {
       final textPainter = TextPainter(
         text: TextSpan(
           text: tab,
           style: textTheme.headingM,
         ),
         textDirection: TextDirection.ltr,
       )..layout();
       return textPainter.size.width;
     }).reduce((a, b) => a > b ? a : b);

-    return maxWidth + 40;
+    _cachedMaxWidth = maxWidth + 40;
+    return _cachedMaxWidth!;
   }
+
+  @override
+  void didUpdateWidget(DigitTabBar oldWidget) {
+    super.didUpdateWidget(oldWidget);
+    if (oldWidget.tabs != widget.tabs) {
+      _cachedMaxWidth = null;
+    }
+  }

93-125: Simplify border styling using BorderSide.copyWith.

The border styling code is verbose. Consider simplifying it using BorderSide.copyWith.

Simplify the border styling:

-              border: Border(
-                bottom: BorderSide(
-                  color: _selectedIndex == index
-                      ? const DigitColors().light.primary1
-                      : const DigitColors().light.genericInputBorder,
-                  width: _selectedIndex == index ? 4 : 1,
-                ),
-                left: BorderSide(
-                  color: _selectedIndex == index
-                      ? const DigitColors().light.primary1
-                      : const DigitColors().light.genericInputBorder,
-                  width: _selectedIndex == index ? 2 : 1,
-                ),
-                right: BorderSide(
-                  color: _selectedIndex == index
-                      ? const DigitColors().light.primary1
-                      : const DigitColors().light.genericInputBorder,
-                  width: _selectedIndex == index ? 2 : 1,
-                ),
-                top: BorderSide(
-                  color: _selectedIndex == index
-                      ? const DigitColors().light.primary1
-                      : const DigitColors().light.genericInputBorder,
-                  width: _selectedIndex == index ? 2 : 1,
-                ),
-              ),
+              border: Border.fromBorderSide(
+                BorderSide(
+                  color: const DigitColors().light.genericInputBorder,
+                  width: 1,
+                ).copyWith(
+                  color: _selectedIndex == index
+                      ? const DigitColors().light.primary1
+                      : null,
+                  width: _selectedIndex == index
+                      ? 2
+                      : null,
+                ),
+              ).copyWith(
+                bottom: BorderSide(
+                  color: _selectedIndex == index
+                      ? const DigitColors().light.primary1
+                      : const DigitColors().light.genericInputBorder,
+                  width: _selectedIndex == index ? 4 : 1,
+                ),
+              ),
flutter/digit-ui-components/digit_components/lib/services/AppLocalization.dart (1)

39-50: Optimize string translation and add input validation.

The current implementation lacks input validation and uses linear search.

Consider this optimized implementation:

  String translate(String localizedValues) {
+   if (localizedValues.isEmpty) return '';
    
-   if (_localizedStrings.isEmpty) {
+   final localeKey = '${locale.languageCode}_${locale.countryCode}';
+   final strings = _localizedStrings[localeKey];
+   if (strings == null || strings.isEmpty) {
      return localizedValues;
    } else {
-     final index = _localizedStrings.indexWhere(
-           (medium) => medium.code == localizedValues,
-     );
-
-     return index != -1 ? _localizedStrings[index].message : localizedValues;
+     // Use Map for O(1) lookup instead of O(n) search
+     final translations = Map.fromEntries(
+       strings.map((e) => MapEntry(e.code, e.message))
+     );
+     return translations[localizedValues] ?? localizedValues;
    }
  }
flutter/digit-ui-components/digit_components/lib/theme/ComponentTheme/bread_crumb_theme.dart (2)

17-36: Consider adding documentation for the default theme method.

The default theme implementation looks good, but adding documentation would help developers understand the default styling choices.

Add documentation above the method:

+  /// Creates a default theme instance with predefined styles based on the current theme context.
+  /// 
+  /// Uses the primary color for active items and secondary text color for inactive items
+  /// and separators. All text styles are based on the body small (bodyS) text style.
   static DigitBreadCrumbThemeData defaultTheme(BuildContext context) {

53-64: Add null safety check for lerp parameters.

The lerp method should handle null parameters gracefully.

Add null check:

   @override
   DigitBreadCrumbThemeData lerp(covariant ThemeExtension<DigitBreadCrumbThemeData>? other, double t) {
     if (other is! DigitBreadCrumbThemeData) return this;
+    if (t == 0) return this;
+    if (t == 1) return other;
 
     return DigitBreadCrumbThemeData(
flutter/digit-ui-components/digit_components/lib/widgets/atoms/digit_bread_crumbs.dart (2)

6-30: Add parameter validation in constructor.

The constructor should validate that required parameters are properly configured.

Add assertions:

   const DigitBreadCrumb({
     Key? key,
     required this.crumbs,
     this.maxItems,
     this.itemsBeforeCollapse,
     this.itemsAfterCollapse,
     this.expandText = '...',
     this.customSeparator,
     this.themeData,
     this.onClick,
-  }) : super(key: key);
+  }) : assert(maxItems == null || maxItems > 0, 'maxItems must be positive'),
+       assert(itemsBeforeCollapse == null || itemsBeforeCollapse > 0, 'itemsBeforeCollapse must be positive'),
+       assert(itemsAfterCollapse == null || itemsAfterCollapse > 0, 'itemsAfterCollapse must be positive'),
+       assert(crumbs.isNotEmpty, 'crumbs list cannot be empty'),
+       super(key: key);

163-173: Make DigitBreadCrumbItem immutable.

Consider making the class immutable for better predictability and thread safety.

-  final String content;
-  final bool show;
-  final IconData? icon;
+  const final String content;
+  const final bool show;
+  const final IconData? icon;

-  DigitBreadCrumbItem({
+  const DigitBreadCrumbItem({
flutter/digit-ui-components/digit_components/lib/widgets/atoms/digit_loader.dart (4)

11-59: Add documentation and improve code clarity.

The method implementation looks good, but could benefit from the following improvements:

  1. Add documentation explaining the method's purpose and parameters.
  2. Remove redundant onPopInvoked: null as it's not needed when using canPop.
  3. Consider extracting magic numbers (spacer5*5) into named constants for better maintainability.

Apply this diff to improve the code:

+  /// Displays a full-page loader dialog with optional label and customization options.
+  /// 
+  /// Parameters:
+  /// - context: The build context
+  /// - label: Optional text to display below the loader
+  /// - animationPath: Custom Lottie animation path
+  /// - backgroundColor: Custom background color
+  /// - textStyle: Custom text style for the label
+  /// - size: Custom size for the loader
+  /// - barrierDismissible: Whether the loader can be dismissed by tapping outside
   static Widget showFullPageLoader({
     required BuildContext context,
     String? label,
     String? animationPath,
     Color? backgroundColor,
     TextStyle? textStyle,
     double? size,
     bool barrierDismissible = false,
   })  {
     final theme = Theme.of(context);
     final textTheme = theme.digitTextTheme(context);
+    const loaderSize = spacer5 * 5;

     return PopScope(
-      onPopInvoked: null,
       canPop: barrierDismissible,
       child: SizedBox(
         height: MediaQuery.of(context).size.height,
         width: MediaQuery.of(context).size.width,
         child: SimpleDialog(
           elevation: 0.0,
           backgroundColor: Colors.transparent,
           children: <Widget>[
             Center(
               child: Column(
                 mainAxisAlignment: MainAxisAlignment.center,
                 children: [
                   Lottie.asset(
                     animationPath ?? Base.fullPageLoaderAnimation,
-                    width: size ?? spacer5*5,
-                    height: size ?? spacer5*5,
+                    width: size ?? loaderSize,
+                    height: size ?? loaderSize,
                   ),

110-119: Add documentation and align size constants.

The inline loader is simple but could use documentation and consistent size constant usage.

Apply this diff to improve the code:

+  /// Returns an inline loader widget.
+  /// 
+  /// Parameters:
+  /// - animationPath: Custom Lottie animation path
+  /// - size: Custom size for the loader
   static Widget inlineLoader({
     String? animationPath,
     double? size,
   }) {
+    const defaultSize = spacer12;
     return Lottie.asset(
       animationPath ?? Base.inlineLoaderAnimation,
-      width: size ?? spacer12,
-      height: size ?? spacer12,
+      width: size ?? defaultSize,
+      height: size ?? defaultSize,
     );
   }

122-129: Add documentation and consider safety checks.

The method could benefit from documentation and might need safety checks to ensure it only hides loader dialogs.

Apply this diff to improve the code:

+  /// Hides any active loader dialog.
+  /// 
+  /// Note: This method will hide any popup route, not just loader dialogs.
+  /// Use with caution in complex navigation scenarios.
   static void hideLoaderDialog(BuildContext context) {
     Navigator.of(
       context,
       rootNavigator: true,
     ).popUntil(
           (route) => route is! PopupRoute,
     );
   }

62-108:

❓ Verification inconclusive

Add documentation and consider performance implications.

The overlay loader implementation looks good but has similar improvement opportunities as showFullPageLoader. Additionally, consider the performance implications of the blur effect.

Apply this diff to improve the code:

+  /// Displays an overlay loader with blur effect and optional label.
+  /// 
+  /// Parameters:
+  /// - context: The build context
+  /// - label: Optional text to display below the loader
+  /// - animationPath: Custom Lottie animation path
+  /// - backgroundColor: Custom background color
+  /// - textStyle: Custom text style for the label
+  /// - size: Custom size for the loader
+  /// - barrierDismissible: Whether the loader can be dismissed by tapping outside
+  /// 
+  /// Note: Be cautious with frequent showing/hiding of this loader as the blur
+  /// effect can be performance-intensive on some devices.
   static Future<void> overlayLoader({
     required BuildContext context,
     String? label,
     String? animationPath,
     Color? backgroundColor,
     TextStyle? textStyle,
     double? size,
     bool barrierDismissible = false,
   }) async {
     final theme = Theme.of(context);
     final textTheme = theme.digitTextTheme(context);
+    const loaderSize = spacer5 * 5;

     return showDialog<void>(
       context: context,
       barrierDismissible: barrierDismissible,
       builder: (BuildContext context) {
         return BackdropFilter(
           filter: ImageFilter.blur(sigmaX: 2.0, sigmaY: 2.0),
           child: Container(
             color: backgroundColor?.withOpacity(0.7) ??
                 theme.colorTheme.text.primary.withOpacity(.7),
             child: Center(
               child: Column(
                 mainAxisAlignment: MainAxisAlignment.center,
                 children: [
                   Lottie.asset(
                     animationPath ?? Base.overlayLoaderAnimation,
-                    width: size ?? spacer5*5,
-                    height: size ?? spacer5*5,
+                    width: size ?? loaderSize,
+                    height: size ?? loaderSize,
                   ),

Please verify the performance impact of the blur effect on low-end devices:


🏁 Script executed:

#!/bin/bash
# Search for other uses of BackdropFilter to assess overall blur effect usage
rg -l 'BackdropFilter'

# Search for any performance-related comments or issues
rg -i 'performance|slow|lag'

Length of output: 65916


Ensure proper documentation and validate overlay blur performance

  • Add detailed documentation to the overlayLoader method as illustrated in the diff snippet.
  • Define a constant (e.g., loaderSize) to standardize spacing, similar to improvements made in showFullPageLoader.
  • Note that the BackdropFilter is also used in other components (e.g., in show_pop_up.dart, upload_image.dart, and filter_card.dart), which indicates a consistent design choice. However, please verify through performance testing on low-end devices that the blur effect does not introduce any memory or responsiveness issues when the loader is shown frequently.
flutter/digit-ui-components/digit_components/lib/theme/ComponentTheme/chip_theme.dart (1)

41-86: Consider improvements to default theme configuration.

  1. The padding calculation could be simplified to avoid null checks:
  2. Consider making the error box shadow opacity configurable through the theme.

Apply this diff to improve the code:

-      padding: EdgeInsets.symmetric(horizontal: theme.spacerTheme.spacer2 ?? 0, vertical: theme.spacerTheme.spacer2 ?? 0),
+      padding: EdgeInsets.symmetric(
+        horizontal: theme.spacerTheme.spacer2,
+        vertical: theme.spacerTheme.spacer2,
+      ).copyWith(horizontal: 0, vertical: 0),

Consider adding a theme property for error box shadow opacity:

+  final double errorBoxShadowOpacity;
   
   const DigitChipThemeData({
     // ... existing parameters ...
+    this.errorBoxShadowOpacity = 0.15,
   });

   // In defaultTheme:
-        color: theme.colorTheme.alert.error.withOpacity(.15),
+        color: theme.colorTheme.alert.error.withOpacity(errorBoxShadowOpacity),
flutter/digit-ui-components/digit_components/lib/widgets/atoms/digit_dob_picker.dart (2)

128-128: Rename parameter for clarity.

The initialDate parameter is used as firstDate in the date picker, which might be confusing. Consider renaming for consistency.

-  final DateTime? initialDate;
+  final DateTime? firstDate;

And update the usage:

-    firstDate: widget.initialDate,
+    firstDate: widget.firstDate,

224-247: Extract spacing constants.

The code uses magic numbers (spacer1, spacer4) for spacing. Consider extracting these into named constants for better maintainability.

+  // Add to a constants file
+  const double kSpacerExtraSmall = 8.0; // spacer1
+  const double kSpacerLarge = 32.0; // spacer4

   // Update usage
-  const SizedBox(height: spacer1),
+  const SizedBox(height: kSpacerExtraSmall),
   
-  height: spacer1 / 2,
+  height: kSpacerExtraSmall / 2,

-  height: spacer4,
-  width: spacer4,
+  height: kSpacerLarge,
+  width: kSpacerLarge,

-  size: spacer4,
+  size: kSpacerLarge,
flutter/digit-ui-components/digit_components/lib/theme/text_theme_extension.dart (2)

73-82: Remove redundant responsive logic for headingS.

The fontSize is set to 16 for all screen sizes, making the responsive logic unnecessary.

   headingS: TextStyle(
-    fontSize: isMobile
-        ? 16
-        : isTab
-            ? 16
-            : 16,
+    fontSize: 16,
     fontWeight: FontWeight.w700,
     fontFamily: 'Roboto',
     height: 1.14,
   ),

36-184: Improve maintainability of the default theme.

Consider the following improvements:

  1. Extract the hardcoded font family to a constant or theme setting for easier customization.
  2. Move breakpoint values to constants for better maintainability.
  3. Cache MediaQuery.of(context) to avoid multiple calls.
+ const double _kMobileBreakpoint = 600;
+ const double _kTabletBreakpoint = 1200;
+ const String _kDefaultFontFamily = 'Roboto';

  static DigitTextThemeExtension defaultTheme(BuildContext context) {
+   final mediaQuery = MediaQuery.of(context);
+   final width = mediaQuery.size.width;
-   final bool isMobile = MediaQuery.of(context).size.width < 600;
-   final bool isTab = MediaQuery.of(context).size.width >= 600 &&
-       MediaQuery.of(context).size.width < 1200;
+   final bool isMobile = width < _kMobileBreakpoint;
+   final bool isTab = width >= _kMobileBreakpoint && width < _kTabletBreakpoint;
flutter/digit-ui-components/digit_components/CHANGELOG.md (10)

1-3: Version Update 0.2.1 Entry
The changelog entry for version 0.2.1 only mentions "updated readme documentation." Consider expanding the description with additional context if there are any further changes (bug fixes, improvements, etc.) relevant to this version.


12-14: Development Release 0.0.2-dev.14 Entry
The changelog now indicates an update that supports a heading style change in the summary card. Consider adding details if there are specific design-related implications, as improved clarity here can aid future maintainers in understanding the change.


26-30: Development Release 0.0.2-dev.10 Entry
This section groups several updates—a new description style prop for labels, hamburger style updates, and a revision for a radio button property. For enhanced clarity, consider splitting or further detailing the enhancements if they involve significant UI or UX changes.


45-50: Development Release 0.0.2-dev.5 Entry
Multiple items are covered here including fixes for dialog spacing, footer content addition for the hamburger, toast updates, and adjustments to default theme colors. For future changelogs, consider grouping functional fixes separately from purely stylistic updates for enhanced clarity.


51-53: Development Release 0.0.2-dev.4 Entry
A fix for the date format issue in the dob picker is noted. It may be beneficial to specify the former incorrect format versus the new correct format if this change could affect user data entry or display consistency.


73-78: Release 0.0.1+7 Entry
This version update includes changes to the color and typography library, a new location fetch bloc, and several utility enhancements. The mix of updates is clear; however, consider consistency in how version suffixes (like +7) relate to the overall release strategy.


79-82: Release 0.0.1+6 Entry
The changelog here mentions an enhanced multiselect dropdown that supports search functionality as well as further updates to the color and typography library. It may be beneficial to elaborate on what enhancements were made to support searchability if this is a key differentiator.


87-90: Release 0.0.1+4 Entry
Fixes regarding padding for text areas and code refactors for text fields are captured here. If these changes have a significant visual impact, additional documentation or before/after visuals could enhance clarity for end users.


94-96: Release 0.0.1+2 Entry
The bullet point mentions "miner bug fixes." If "miner" is a domain-specific term, consider clarifying further details so that future readers can understand the context without ambiguity.


109-111: Test Release 0.0.1-beta Entry
Another test release is noted with minimal commentary. For clarity and to prevent confusion, consider adding a brief note on the intended testing scope or any limitations of these beta releases.

flutter/digit-ui-components/digit_components/lib/widgets/atoms/digit_stepper.dart (3)

173-173: Remove commented code.

Remove commented code to improve code readability.

-         // margin: const EdgeInsets.only(left: 20),
+
-              // maxWidth: max(MediaQuery.of(context).size.width / (widget.totalLength *3 ), (MediaQuery.of(context).size.width / (widget.totalLength)) - (widget.totalLength*4)),
+

Also applies to: 207-207


474-477: Use responsive constraints for title container.

The title container has hard-coded dimensions that might not work well across different screen sizes.

 Container(
   padding: const EdgeInsets.symmetric(vertical: 10),
-  constraints: const BoxConstraints(maxHeight: 200, maxWidth: 200),
+  constraints: BoxConstraints(
+    maxHeight: MediaQuery.of(context).size.height * 0.2,
+    maxWidth: MediaQuery.of(context).size.width * 0.3,
+  ),
   child: Text(

327-349: Reduce code duplication in StepperDot BoxDecoration.

The BoxDecoration code is duplicated three times with minor variations.

Extract the common decoration logic into a method:

+  BoxDecoration _getStepperDotDecoration({
+    required Color backgroundColor,
+    required Color borderColor,
+    required bool isHover,
+  }) {
+    return BoxDecoration(
+      color: backgroundColor,
+      border: Border.all(
+        color: borderColor,
+        width: Base.defaultBorderWidth,
+      ),
+      borderRadius: const BorderRadius.all(
+        Radius.circular(Base.defaultCircularRadius),
+      ),
+      boxShadow: isHover
+          ? [
+              BoxShadow(
+                color: const DigitColors()
+                    .light
+                    .primary1
+                    .withOpacity(.12),
+                offset: const Offset(0, 0),
+                spreadRadius: 4,
+                blurRadius: 0,
+              ),
+            ]
+          : [],
+    );
+  }

Then use it in the widget:

decoration: _getStepperDotDecoration(
  backgroundColor: const DigitColors().light.primary1,
  borderColor: const DigitColors().light.primary1,
  isHover: isHover,
),

Also applies to: 364-386, 396-418

flutter/digit-ui-components/digit_components/README.md (3)

7-16: Structured Table of Contents
The reorganized Table of Contents improves navigation by grouping content with descriptive labels and appropriate emoji. Please verify that the link fragments (e.g., #-screenshot, #-quick-start) correctly resolve to the intended sections across various Markdown renderers.

🧰 Tools
🪛 markdownlint-cli2 (0.17.2)

15-15: Link fragments should be valid
null

(MD051, link-fragments)


89-95: Component Overview – Molecules Duplication Check
Within the Molecules section, the list includes "Form Cards," "Cards," and "Panel Cards." This may come off as redundant. Please verify if the generic "Cards" entry is intended or if the nomenclature could be refined for clarity. Also, consider whether "hamburger" should be capitalized (e.g., "Hamburger Menu") to maintain consistency.

🧰 Tools
🪛 LanguageTool

[duplication] ~89-~89: Possible typo: you repeated a word.
Context: ...ecules** (Combinations of Atoms) - Form Cards - Cards - Panel Cards - Table - hamburger - and...

(ENGLISH_WORD_REPEAT_RULE)


96-99: Wrapper Components Section
The Wrapper Components section succinctly lists the higher-level structures. For consistency, consider capitalizing “and more” to match the styling in other sections (e.g., “And More”).

flutter/digit-ui-components/digit_components/lib/widgets/atoms/digit_numeric_form_input.dart (2)

1-19: Enhance documentation with parameter descriptions.

While the example is helpful, the documentation could be improved by:

  • Documenting all parameters and their purposes
  • Describing the widget's behavior and constraints
  • Adding @return to describe the rendered widget

Add parameter descriptions like this:

 ///`DigitNumericFormInput` is a customizable formfield widget that extends the baseforminput.
+/// A form input widget specifically designed for numeric values with increment/decrement controls.
 ///
+/// Parameters:
+/// - [controller]: Controls the text being edited.
+/// - [initialValue]: The initial value of the field.
+/// - [readOnly]: Whether the text can be changed.
+/// - [isDisabled]: Whether the field is disabled.
+/// ...
 ///
 /// Example usage:

26-82: Improve constructor parameter organization.

Consider grouping related parameters together and adding comments to separate the groups for better readability.

Reorganize parameters like this:

 const DigitNumericFormInput({
   Key? key,
+  // Text control
   final TextEditingController? controller,
   final String? initialValue,
   final FocusNode? focusNode,
+  // Field state
   final bool readOnly = false,
   final bool isDisabled = false,
   final bool isRequired = false,
   final bool charCount = false,
   final bool editable = false,
+  // Field appearance
   final String? innerLabel,
   final String? helpText,
   final String suffixText = '+',
   final String prefixText = '-',
   final IconData prefixIcon = Icons.remove,
+  // Input constraints
   final TextInputType? keyboardType,
   final TextAlign textAlign = TextAlign.center,
   final int step = 5,
   final int minValue = 0,
   final int maxValue = 100,
   final int? maxLength,
   final double suffixPrefixWidth = 100,
   final List<TextInputFormatter>? inputFormatters,
+  // Validation
   final List<Validator>? validations,
   final String? errorMessage,
+  // Callbacks
   final void Function(String?)? onError,
   final void Function(String)? onChange,
   final void Function()? onFocusLost,
flutter/digit-ui-components/digit_components/lib/models/accordionModel.dart (1)

3-17: Add documentation for the DigitAccordionItem class and its properties.

Consider adding documentation to improve code maintainability and developer experience.

+/// A model class representing an item in a DigitAccordion widget.
 class DigitAccordionItem {
+  /// The header widget to be displayed in the accordion item.
   final Widget header;
+  /// The content widget to be displayed when the accordion item is expanded.
   final Widget content;
+  /// Whether to show a divider between the header and content when expanded.
   final bool divider;
+  /// Whether the accordion item should be initially expanded.
   final bool initiallyExpanded;
+  /// Whether to show a border around the accordion item.
   final bool showBorder;

   DigitAccordionItem({
     required this.header,
     required this.content,
     this.divider = false,
     this.initiallyExpanded = false,
     this.showBorder = true,
   });
 }
flutter/digit-ui-components/digit_components/lib/theme/ComponentTheme/digit_accordion_theme.dart (2)

5-32: Add documentation for the DigitAccordionThemeData class and its properties.

Consider adding documentation to improve code maintainability and developer experience.

+/// Theme data for the DigitAccordion widget.
+/// 
+/// This class defines the visual properties that can be customized in a DigitAccordion.
+/// Use this with [ThemeExtension] to provide consistent theming across your application.
 class DigitAccordionThemeData extends ThemeExtension<DigitAccordionThemeData> {
+  /// The background color of the accordion header.
   final Color? headerBackgroundColor;
+  /// The text color of the accordion header.
   final Color? headerTextColor;
   // Add documentation for remaining properties...

85-103: Improve null safety in the lerp method.

The lerp method should handle cases where individual properties in other are null.

   @override
   DigitAccordionThemeData lerp(ThemeExtension<DigitAccordionThemeData>? other, double t) {
     if (other is! DigitAccordionThemeData) return this;
 
     return DigitAccordionThemeData(
-      headerBackgroundColor: Color.lerp(headerBackgroundColor, other.headerBackgroundColor, t),
+      headerBackgroundColor: headerBackgroundColor == null && other.headerBackgroundColor == null
+          ? null
+          : Color.lerp(headerBackgroundColor, other.headerBackgroundColor, t),
       // Apply similar null checks for other color properties
       headerElevation: lerpDouble(headerElevation, other.headerElevation, t),
       // ... rest of the properties
     );
   }
flutter/digit-ui-components/digit_components/lib/widgets/atoms/accordion.dart (2)

57-63: Ensure proper cleanup in dispose method.

The current dispose implementation is good, but could be more explicit about nullifying references.

   @override
   void dispose() {
     for (var controller in _animationControllers) {
       controller.dispose();
     }
+    _animationControllers.clear();
+    _expandedStates.clear();
     super.dispose();
   }

93-195: Consider extracting the accordion item builder to a separate widget.

The _buildAccordionItem method is quite large and could be moved to a separate widget for better maintainability.

Consider creating a new _DigitAccordionItemWidget class to encapsulate the item building logic. This would improve code organization and make the code more maintainable.

flutter/digit-ui-components/digit_components/lib/widgets/atoms/digit_otp.dart (4)

87-127: Consider adding null safety checks in dispose method.

The dispose method might throw NPEs when accessing controllers or focus nodes that weren't initialized.

 @override
 void dispose() {
   for (var focusNode in _focusNodes) {
-      focusNode?.removeListener(() => handleFocusChange);
-      focusNode?.dispose();
+      if (focusNode != null) {
+        focusNode.removeListener(() => handleFocusChange);
+        focusNode.dispose();
+      }
   }

   for (var controller in _textControllers) {
-    controller?.dispose();
+    if (controller != null) {
+      controller.dispose();
+    }
   }
   super.dispose();
 }

279-338: Optimize state updates in onChanged callback.

The current implementation has multiple setState calls and complex logic. Consider refactoring to reduce state updates and improve readability.

 onChanged: (String str) {
+  if (str.isEmpty) return;
+
   setState(() {
     _hasError = false;
+    if (str.length > 1) {
+      _handlePaste(str, _findFirstEmptyIndex());
+    } else {
+      _handleSingleDigitInput(str, index);
+    }
+
+    // Notify callbacks
+    final currentPin = _getCurrentPin();
+    widget.onChanged?.call(currentPin);
+    
+    if (!_pin.contains('') && currentPin.length == widget.length) {
+      widget.onCompleted?.call(currentPin);
+    }
   });
-  
-  if (str.length > 1) {
-    _handlePaste(str, _findFirstEmptyIndex());
-    return;
-  }
-  // ... rest of the complex logic
 }

+ void _handleSingleDigitInput(String str, int index) {
+   // Extract the single digit input logic here
+ }

381-427: Improve paste handling logic.

The paste handling could be simplified and made more robust:

  1. Consider validating input against keyboardType
  2. Add support for copying the entire OTP
 void _handlePaste(String str, int index) {
+  // Validate input based on keyboardType
+  if (widget.keyboardType == TextInputType.number && !RegExp(r'^\d+$').hasMatch(str)) {
+    return;
+  }
+
   // Ensure the pasted string doesn't exceed the maximum length
   if (str.length > widget.length) {
     str = str.substring(0, widget.length);
   }
   // ... rest of the implementation
 }

+ // Add method for copying
+ void copyOTP() {
+   final pin = _getCurrentPin();
+   if (pin.isNotEmpty) {
+     Clipboard.setData(ClipboardData(text: pin));
+   }
+ }

1-494: Consider adding accessibility support.

The widget could benefit from improved accessibility:

  1. Add semantic labels for screen readers
  2. Support larger text sizes
  3. Add haptic feedback

Would you like me to generate an implementation that includes these accessibility improvements?

flutter/digit-ui-components/digit_components/lib/theme/typography.dart (1)

49-54: Consider consolidating link styles.

You've added three new link styles (linkL, linkM, linkS) that inherit from body styles, but there's also an existing link getter. This creates potential confusion about which link style to use.

Consider either:

  1. Deprecating the old link getter in favor of the new sized variants
  2. Making the new link styles utilize the existing link getter with size variations:
-  TextStyle get linkL => textTheme.bodyLarge!;
-  TextStyle get linkM => textTheme.bodyMedium!;
-  TextStyle get linkS => textTheme.bodySmall!;
+  TextStyle get linkL => link.copyWith(fontSize: 20);
+  TextStyle get linkM => link.copyWith(fontSize: 16);
+  TextStyle get linkS => link.copyWith(fontSize: 14);
flutter/digit-ui-components/digit_components/lib/widgets/atoms/digit_checkbox_icon.dart (3)

39-40: Unify border width usage to avoid inconsistencies.

The “unchecked” state uses Base.defaultBorderWidth while other states (lines 55 & 75) use DigitCheckboxConstants.borderWidth. It’s a good practice to adopt a single standard for border widths across the states.

- width: Base.defaultBorderWidth,
+ width: DigitCheckboxConstants.borderWidth,

Also applies to: 43-44, 46-46


51-52: Use a built-in icon for the intermediate state.

For the intermediate state, you might consider using Icons.indeterminate_check_box instead of Icons.square to better convey the meaning of a partially selected checkbox to users.

- Icons.square,
+ Icons.indeterminate_check_box,

Also applies to: 55-55, 58-58, 63-64


70-71: Consider extracting repetitive container building logic.

Unchecked, intermediate, and checked states each create a similar container with only slight differences in border color and icon. Refactoring into a helper method or builder function could reduce duplication and improve maintainability.

Also applies to: 74-74, 77-77, 83-83

flutter/digit-ui-components/digit_components/lib/services/location_bloc.dart (3)

28-55: Consider logging the error before rethrowing and clarifying maximum number of permission retries.
Currently, the code rethrows the caught exception without logging or attaching context, which could complicate debugging. Also, ensure that repeatedly requesting permissions with retry does not lead to excessive prompts for the user.


57-80: Add user feedback for service enablement loop.
Similar to the permission request loop, consider logging or handling user-facing messaging when location services remain disabled across multiple retries. This can improve the user’s understanding of why location services are required.


130-149: Avoid throwing raw exceptions for missing location data.
Throwing an exception if latitude or longitude is null may disrupt the BLoC unexpectedly. Consider either emitting an error state or a fallback handling that allows the BLoC to remain stable.

flutter/digit-ui-components/digit_components/lib/services/location_fetch_bloc.dart (1)

6-27: Handle the scenario when permission is denied permanently.
If the user permanently denies permissions, the method silently does nothing. Consider providing a fallback flow or user notification to guide them to change permission settings.

flutter/digit-ui-components/digit_components/lib/widgets/atoms/digit_location_form_input.dart (1)

79-81: Consider reusing onSuffixIconClick to avoid code duplication.

The onTap method duplicates the logic from onSuffixIconClick. Consider refactoring to reuse the existing implementation.

Apply this diff to eliminate the duplication:

@override
void onTap() async {
-  await locationBloc.getCurrentLocation(controller, widget.onChange);
+  await onSuffixIconClick();
}
flutter/digit-ui-components/digit_components/lib/widgets/atoms/digit_date_form_input.dart (1)

100-110: Consider reusing onSuffixIconClick to avoid code duplication.

The onTap method duplicates the logic from onSuffixIconClick. Consider refactoring to reuse the existing implementation.

Apply this diff to eliminate the duplication:

@override
void onTap() async {
-  await dateSelectionBloc.selectDate(
-    firstDate: widget.firstDate,
-    lastDate: widget.lastDate,
-    initialDate: widget.initialDate,
-    context: context,
-    controller: controller,
-    onChange: widget.onChange,
-  );
+  await onSuffixIconClick();
}
flutter/digit-ui-components/digit_components/lib/widgets/atoms/digit_radio_list.dart (5)

26-41: Clarify usage differences between isDisabled and readOnly.
Having separate flags for isDisabled and readOnly may be confusing, since both effectively block interaction. Consider unifying the concepts or documenting their distinct effect more explicitly (e.g., readOnly might allow visual focus but disable state changes).


50-51: Avoid constructor parameter sprawl.
You have many constructor parameters (e.g., errorMessage, readOnly, sentenceCaseEnabled, textDirection). If these are common across multiple widgets, consider grouping them into a configuration class or leveraging a theme extension to reduce parameter clutter.

Also applies to: 56-61, 65-66


76-78: Consider usability for large lists of radio buttons.
Storing hover and mouse-down states in long parallel lists might be less scalable for large or dynamically changing lists. If performance is a concern, consider state tracking approaches that don’t require multiple arrays or that leverage focus/hover listeners in sub-widgets.

Also applies to: 87-88


94-99: Reuse the computed capitalizedErrorMessage for clarity.
You’re assigning capitalizedErrorMessage but re-checking widget.errorMessage further down. Consider consistently using the new variable to reduce confusion.


204-210: Replace “DigitButton” variable name for clarity.
In _buildRadioDigitButtons, the local variable DigitButton is of type RadioButtonModel. Using a name like radioButtonModel or radioDigitButton makes the code more intuitive.

- (DigitButton) {
-   final index = widget.radioDigitButtons.indexOf(DigitButton);
+ (radioButton) {
+   final index = widget.radioDigitButtons.indexOf(radioButton);
    ...
-       widget.groupValue = DigitButton.code;
+       widget.groupValue = radioButton.code;
    ...

Also applies to: 289-297, 299-300, 305-307, 323-331

flutter/digit-ui-components/digit_components/lib/theme/ComponentTheme/radio_list_theme.dart (2)

27-41: Hard-coded hover color.
You have hoverColor: Colors.lightBlue in the defaultTheme. Consider referencing a color from theme.colorTheme to keep theming consistent across the app.


43-64: Document default values in copyWith.
While the code is self-explanatory, including small doc comments clarifying each parameter’s default usage can help, especially for new developers picking up the code.

flutter/digit-ui-components/digit_components/.flutter-plugins (1)

6-11:

❓ Verification inconclusive

Consider impact of file handling plugins.

The combination of file_picker and flutter_dropzone plugins might have overlapping functionality. Consider if both are necessary for your use case.

Run this script to analyze file handling usage:


🏁 Script executed:

#!/bin/bash
# Search for usage of file handling plugins
rg -A 3 "FilePicker|FlutterDropzone" 

Length of output: 556


Actionable: Verify and Refine File Handling Dependencies

  • We detected active use of file_picker (e.g., in flutter/digit-ui-components/digit_components/lib/widgets/atoms/upload_popUp.dart).
  • No direct usage of flutter_dropzone (or its web counterpart) was found in the code search.
  • Please confirm whether flutter_dropzone is intended for any platform-specific functionality or if it's a legacy dependency. If it’s not required, consider removing it to simplify dependency management and avoid potential overlaps.
flutter/digit-ui-components/digit_components/.flutter-plugins-dependencies (1)

1-1: Verify native build configurations.

Several plugins are marked with "native_build": false. This might affect performance on certain platforms. Consider using native implementations where available.

Check these specific plugins:

  • image_picker_linux
  • image_picker_macos
  • image_picker_windows
  • path_provider_linux
  • path_provider_windows
flutter/digit-ui-components/digit_components/lib/utils/fileService/web_file_download.dart (1)

7-19: Improve error handling and async implementation.

The implementation has a few areas for improvement:

  1. The method is marked as async but doesn't use any await operations.
  2. Error handling could be more robust by providing specific error types.

Consider this improved implementation:

-  Future<void> downloadFile(DroppedFile file) async {
+  Future<void> downloadFile(DroppedFile file) async {
+    if (file.data == null) {
+      throw ArgumentError('File data is null');
+    }
+
     try {
       html.AnchorElement(
           href: html.Url.createObjectUrlFromBlob(html.Blob([file.data])))
         ..setAttribute("download", file.name)
         ..click();
     } catch (e) {
-      // Handle the error, e.g., show an error message to the user
       if (kDebugMode) {
         print('Error downloading file: $e');
       }
+      throw Exception('Failed to download file: ${file.name}');
     }
   }
flutter/digit-ui-components/digit_components/lib/utils/fileService/web_file_service.dart (1)

6-15: Move MIME types to a constants file.

The MIME types map should be moved to a dedicated constants file for better maintainability and reusability.

flutter/digit-ui-components/digit_components/lib/utils/validators/file_validator.dart (2)

18-42: Improve null safety and documentation.

The implementation needs better null safety handling and documentation.

Consider this improved implementation:

+/// Validates a file against a list of validators.
+/// Returns an error message if validation fails, null otherwise.
 String? validateFile(PlatformFile file, List<FileValidator> validators) {
-  // Perform validation for the given file using the provided validators
+  if (file.name == null) {
+    return 'File name is required';
+  }
+
   for (var validator in validators) {
     switch (validator.type) {
       case FileValidatorType.fileType:
-        if (!_isFileTypeAllowed(file, validator.value)) {
+        if (!_isFileTypeAllowed(file, validator.value as List<String>)) {
           return validator.errorMessage ?? 'Invalid file type';
         }
         break;
       case FileValidatorType.minSize:
-        if (!_isFileSizeAboveMin(file, validator.value)) {
+        if (!_isFileSizeAboveMin(file, validator.value as int)) {
           return validator.errorMessage ?? 'File size is too small';
         }
         break;
       case FileValidatorType.maxSize:
-        if (!_isFileSizeBelowMax(file, validator.value)) {
+        if (!_isFileSizeBelowMax(file, validator.value as int)) {
           return validator.errorMessage ?? 'File size exceeds maximum limit';
         }
         break;
     }
   }

-  /// If the file passes all validations, return null
   return null;
 }

44-66: Add documentation and improve null safety in helper methods.

The helper methods need proper documentation and better null safety handling.

Consider this improved implementation:

+/// Checks if the file extension is in the list of allowed extensions.
 bool _isFileTypeAllowed(PlatformFile file, List<String> allowedExtensions) {
-  // Get the file extension
-  String fileExtension = file.name!.split('.').last.toLowerCase();
+  final parts = file.name!.split('.');
+  if (parts.length < 2) return false;
+  final fileExtension = parts.last.toLowerCase();

-  // Check if the file extension is in the list of allowed file types
   return allowedExtensions.contains(fileExtension);
 }

+/// Checks if the file size is above the minimum threshold.
 bool _isFileSizeAboveMin(PlatformFile file, int minFileSizeInBytes) {
-  // Get the file size in bytes
-  int fileSizeInBytes = file.size ?? 0;
+  final fileSizeInBytes = file.size ?? 0;

-  // Check if the file size is above the minimum threshold
   return fileSizeInBytes >= minFileSizeInBytes;
 }

+/// Checks if the file size is below the maximum threshold.
 bool _isFileSizeBelowMax(PlatformFile file, int maxFileSizeInBytes) {
-  // Get the file size in bytes
-  int fileSizeInBytes = file.size ?? 0;
+  final fileSizeInBytes = file.size ?? 0;

-  // Check if the file size is below the maximum threshold
   return fileSizeInBytes <= maxFileSizeInBytes;
 }
flutter/digit-ui-components/digit_components/lib/widgets/atoms/digit_info_card.dart (2)

40-41: Consider renaming capitalizedLetter for clarity.
“capitalizedLetter” might be misleading as it suggests capitalizing only a single character. A more descriptive name like shouldCapitalize or capitalizeText would clarify intent.


153-180: Improve handling of additional widgets.
Currently, the conditional checks for additionalWidgets and inline are spread across multiple lines. Consider extracting them into a helper widget or method to keep build() more concise.

flutter/digit-ui-components/digit_components/lib/widgets/atoms/digit_button.dart (2)

29-59: Avoid potential confusion with too many optional fields.
While flexibility is beneficial, consider grouping rarely used props, like mainAxisAlignment, crossAxisAlignment, and mainAxisSize, into a single layout configuration object to simplify the constructor.


99-118: Use a consistent text style approach across button sizes.
The switch statement is correct, but it’s lengthy. A mapped approach (size → style) within a single function/method could reduce repetition and make future size additions simpler.

flutter/digit-ui-components/digit_components/lib/theme/spacers.dart (2)

1-2: Documentation is brief but adequate.
The comment explains the file’s purpose. More usage examples or references to typical spacing patterns could further clarify the design system practice.


3-14: Consider grouping spacing constants.
Storing these in a static class or enumerations might help with future expansions (e.g., half or double steps) and reduce potential naming collisions.

flutter/digit-ui-components/digit_components/lib/constants/AppView.dart (3)

8-8: Fix incorrect comment about aspect ratio.

The comment is incorrect. An aspect ratio of <= 9/16 indicates a portrait orientation (taller than wide), not landscape.

-    return aspectRatio <= 9 / 16; /// Landscape or square aspect ratio
+    return aspectRatio <= 9 / 16; /// Portrait orientation (taller than wide)

13-13: Fix incorrect comment about aspect ratio.

The comment is incorrect. This range indicates a moderate portrait to nearly square orientation.

-    return aspectRatio > 9 / 16 && aspectRatio <= 3 / 4; /// Portrait aspect ratio
+    return aspectRatio > 9 / 16 && aspectRatio <= 3 / 4; /// Moderate portrait to nearly square orientation

18-18: Fix incorrect comment about aspect ratio.

The comment is incorrect. An aspect ratio > 3/4 indicates a landscape orientation (wider than tall).

-    return aspectRatio > 3 / 4; /// Landscape or square aspect ratio
+    return aspectRatio > 3 / 4; /// Landscape orientation (wider than tall)
flutter/digit-ui-components/digit_components/lib/theme/theme_notifier.dart (1)

23-29: Make the default case more explicit.

The default case handles system theme preference, but it could be more explicit by using ThemeMode.system directly.

-      default:
-      /// Follow system settings or fallback to light theme
+      case ThemeMode.system:
+      /// Follow system theme preference
        final brightness = MediaQuery.of(context).platformBrightness;
        return brightness == Brightness.dark
            ? DigitExtendedTheme.instance.getDarkTheme()
            : DigitExtendedTheme.instance.getLightTheme();
+      default:
+        return DigitExtendedTheme.instance.getLightTheme(); /// Explicit fallback to light theme
flutter/digit-ui-components/digit_components/lib/theme/TextTheme/button_text_theme.dart (3)

12-12: Use system font family as fallback.

The font family is hardcoded without a fallback. If 'Roboto-bold' is not available, the text might render with an unexpected font.

-      fontFamily: 'Roboto-bold',
+      fontFamily: 'Roboto-bold',
+      fontFamilyFallback: ['Roboto', '.SF Pro Text', 'Segoe UI'],

Apply this change to all three text styles.

Also applies to: 18-18, 24-24


13-13: Document the height value choice.

The line height value of 1.14 seems arbitrary. Consider adding a comment explaining why this specific value was chosen.

-      height: 1.14,
+      height: 1.14, // Provides optimal readability for button text

Apply this change to all three text styles.

Also applies to: 19-19, 25-25


51-52: Remove extra newline in lerp method.

There's an unnecessary newline before the closing parenthesis.

      buttonL: TextStyle.lerp(buttonL, other.buttonL, t)!,
      buttonM: TextStyle.lerp(buttonM, other.buttonM, t)!,
-      buttonS: TextStyle.lerp(buttonS, other.buttonS, t)!,
-
-    );
+      buttonS: TextStyle.lerp(buttonS, other.buttonS, t)!,
+    );
flutter/digit-ui-components/digit_components/lib/models/privacy_notice/privacy_notice_model.dart (2)

6-16: Add documentation for the model classes and fields.

Consider adding documentation to explain the purpose of each class and its fields.

 @freezed
+/// Represents a privacy notice with its header, module, and optional content.
 class PrivacyNoticeModel with _$PrivacyNoticeModel {
   const factory PrivacyNoticeModel({
+    /// The main header text of the privacy notice
     required String header,
+    /// The module this privacy notice belongs to
     required String module,
+    /// Whether this privacy notice is currently active
     bool? active,
+    /// List of content sections in this privacy notice
     List<ContentNoticeModel>? contents,
   }) = _PrivacyNoticeModel;

32-32: Consider using an enum for the type field.

The type field in both models could be an enum to ensure type safety and prevent invalid values.

+/// Defines the type of notice description
+enum NoticeDescriptionType {
+  text,
+  bullet,
+  number
+}

 @freezed
 class DescriptionNoticeModel with _$DescriptionNoticeModel {
   const factory DescriptionNoticeModel({
     String? text,
-    String? type,
+    NoticeDescriptionType? type,
     bool? isBold,
     List<SubDescriptionNoticeModel>? subDescriptions,
   }) = _DescriptionNoticeModel;

Apply similar change to SubDescriptionNoticeModel.

Also applies to: 44-44

flutter/digit-ui-components/digit_components/lib/theme/digit_colors.dart (2)

9-13: Add documentation for color constants.

Consider adding documentation comments to explain the purpose and usage of each color constant in the DigitExtendedColors class.

+ /// Transparent color with zero opacity
 Color get transparent => const Color.fromRGBO(0, 0, 0, 0);
+ /// Shadow color for elevation effects
 Color get shadowColor => const Color.fromRGBO(244, 119, 56, 0.25);
+ /// Dark primary color variant
 Color get darkPrimary1 => const Color.fromRGBO(234, 99, 31, 1);
+ /// Background color for surfaces
 Color get background => const Color(0xFF6F6F6F);
+ /// Overlay color for modals and dialogs
 Color get overLayColor => const Color(0xFF0B0C0C);

49-50: Remove incomplete header section.

The header section appears to be incomplete and should be removed.

-/// Header
flutter/digit-ui-components/digit_components/lib/theme/digit_theme_wrapper.dart (1)

5-15: Add class documentation and improve parameter documentation.

The public API should be well-documented to improve usability.

+/// A widget that provides theme management capabilities using Provider pattern.
+/// 
+/// This widget can be used in two ways:
+/// 1. With a child widget that will be wrapped in a MaterialApp
+/// 2. With a custom materialAppBuilder to build your own MaterialApp
 class DigitThemeWrapper extends StatelessWidget {
+  /// The child widget to be wrapped in a MaterialApp.
+  /// Required if [materialAppBuilder] is not provided.
   final Widget? child;
+  /// The initial theme mode. Defaults to system theme.
   final ThemeMode initialThemeMode;
+  /// Optional builder for custom MaterialApp configuration.
+  /// If provided, [child] will be ignored.
   final Widget Function(BuildContext, ThemeMode)? materialAppBuilder;
flutter/digit-ui-components/digit_components/lib/enum/app_enums.dart (1)

50-56: Add documentation for toast type values.

Each toast type value should be documented to explain its usage.

 /// Enum representing toast types
 enum ToastType {
+  /// Indicates a successful operation
   success,
+  /// Indicates an error or failure
   error,
+  /// Indicates a potential issue or caution
   warning,
+  /// Provides general information
   info,
 }
flutter/digit-ui-components/digit_components/lib/theme/digit_typography.dart (2)

3-101: Refactor typography constants for better maintainability.

Consider these improvements:

  1. Extract common properties to reduce duplication
  2. Add documentation for text style properties
 abstract class AppTypography {
+  /// Common font family for all text styles
+  static const _fontFamily = 'Roboto';
+
+  /// Common heading line height
+  static const _headingHeight = 1.14;
+
+  /// Common body line height
+  static const _bodyHeight = 1.37;
+
+  /// Base text style with common properties
+  static const _baseStyle = TextStyle(
+    fontFamily: _fontFamily,
+  );

   /// heading styles for extra large text
   static const headingXl = TextStyle(
     fontSize: 32,
     fontWeight: FontWeight.w700,
-    fontFamily: 'Roboto',
-    height: 1.14,
+    fontFamily: _fontFamily,
+    height: _headingHeight,
   );
   // Apply similar changes to other styles...

3-3: Consider renaming to maintain naming consistency.

To maintain consistency with other components, consider renaming AppTypography to DigitTypography.

-abstract class AppTypography {
+abstract class DigitTypography {
flutter/digit-ui-components/digit_components/lib/utils/utils.dart (1)

57-65: Consider using Map for efficient lookups.

For better performance, especially with large lists, consider converting the list to a Map for O(1) lookups instead of O(n) list traversal.

+Map<String, String> _valueMapperCache = {};
+
 String getAssociatedValue(String code, List<ValueMapper> valueMapper) {
+  if (_valueMapperCache.isEmpty) {
+    _valueMapperCache = {
+      for (var item in valueMapper) item.code: item.name
+    };
+  }
+  return _valueMapperCache[code] ?? '';
-  ValueMapper? mappedValue = valueMapper.firstWhere(
-    (value) => value.code == code,
-    orElse: () => const ValueMapper(code: '', name: ''),
-  );
-  return mappedValue.name;
 }
flutter/digit-ui-components/digit_components/lib/theme/TextTheme/tab_text_theme.dart (1)

4-95:

❓ Verification inconclusive

Consider font loading optimization and improve documentation.

  1. The class uses both 'Roboto' and 'Roboto Condensed' fonts. Ensure these fonts are properly declared in the pubspec.yaml and loaded efficiently.
  2. Add documentation about the intended use case for each text style.

Add documentation like this for each style:

 class DigitTabTextThemeExtension extends DigitTextTheme {
+  /// A text theme extension specifically designed for tabs.
+  /// 
+  /// [headingXl] - Used for primary tab headers
+  /// [headingL] - Used for secondary tab headers
+  /// [headingM] - Used for tertiary tab headers
+  /// ...
   const DigitTabTextThemeExtension()

Also verify the font declarations:


🏁 Script executed:

#!/bin/bash
# Check if fonts are properly declared in pubspec.yaml
echo "Checking font declarations in pubspec.yaml..."
rg -A 5 "fonts:" pubspec.yaml

Length of output: 183


Attention: Verify Font Declarations and Enhance Documentation

It looks like the automated check for font declarations couldn’t locate a pubspec.yaml at the repository root. Please verify manually whether your project’s font assets—specifically for both 'Roboto' and 'Roboto Condensed'—are declared in a pubspec.yaml (or an equivalent configuration file if stored elsewhere).

Additionally, consider adding documentation within the theme file to clarify each text style’s intended use. For example:

 class DigitTabTextThemeExtension extends DigitTextTheme {
+  /// This extension defines text styles specifically for tab components.
+  /// 
+  /// [headingXl] - For primary tab headers
+  /// [headingL]  - For secondary tab headers 
+  /// [headingM]  - For tertiary tab headers
+  /// ... additional documentation for other text styles
   const DigitTabTextThemeExtension()
  • Action Required:
    • Font Verification: Manually confirm that the fonts are declared and properly loaded in your Flutter asset configuration, especially if the pubspec.yaml is located in a non-standard directory.
    • Documentation: Update the file with inline comments as shown above to guide future maintenance.
flutter/digit-ui-components/digit_components/lib/theme/TextTheme/digit_text_theme.dart (1)

3-103: Add documentation and improve type safety.

  1. Add documentation for each text style field explaining its intended use.
  2. Consider making the class immutable with @immutable annotation.
  3. Add assertions for null checks in the constructor.
+import 'package:meta/meta.dart';
+
+/// Base text theme that defines the typography styles for the application.
+@immutable
 class DigitTextTheme extends ThemeExtension<DigitTextTheme> {
+  /// Extra large heading style used for main titles
   final TextStyle headingXl;
+  /// Large heading style used for section headers
   final TextStyle headingL;
   // ... add docs for other fields

   const DigitTextTheme({
     required this.headingXl,
     required this.headingL,
     // ...
-  });
+  }) : assert(headingXl != null, 'headingXl cannot be null'),
+       assert(headingL != null, 'headingL cannot be null'),
+       // ... add assertions for other required fields
+       ;
flutter/digit-ui-components/digit_components/lib/theme/ComponentTheme/back_button_theme.dart (1)

23-53: Consider adding documentation for the default theme method.

The default theme implementation is correct, but adding documentation would help developers understand the default values and their use cases.

+  /// Creates a default theme for the back button based on the current context.
+  /// 
+  /// Uses the current theme's color scheme and text theme to define default values
+  /// for the back button's appearance.
   static DigitBackButtonThemeData defaultTheme(BuildContext context) {
flutter/digit-ui-components/digit_components/lib/theme/ComponentTheme/checkbox_theme.dart (1)

32-55: Consider adding accessibility-related properties.

The default theme could benefit from properties that enhance accessibility, such as minimum tap target size.

   static DigitCheckboxThemeData defaultTheme(BuildContext context) {
     final theme = Theme.of(context);
     final textTheme = theme.digitTextTheme(context);
 
     return DigitCheckboxThemeData(
+      // Ensure minimum tap target size of 48x48 pixels for accessibility
+      iconSize: math.max(theme.spacerTheme.spacer6, 48.0),
       // ... rest of the properties
     );
   }
flutter/digit-ui-components/digit_components/lib/theme/ComponentTheme/info_card_theme.dart (1)

6-45: Consider making properties optional.

Making properties optional with default values in the constructor would provide more flexibility when creating custom themes.

-  const DigitInfoCardThemeData({
-    required this.titleTextStyle,
-    required this.descriptionTextStyle,
+  const DigitInfoCardThemeData({
+    this.titleTextStyle,
+    this.descriptionTextStyle,
     // ... make other properties optional
   });
flutter/digit-ui-components/digit_components/lib/widgets/atoms/digit_chip.dart (2)

178-181: Consider making the character limit configurable.

The 256-character limit for error messages is hardcoded. Consider making it a configurable property.

+  /// Maximum number of characters for error messages before truncation
+  final int maxErrorLength;
+
   const DigitChip({
     Key? key,
     required this.label,
+    this.maxErrorLength = 256,
     // ... other properties
   });

   // In build method:
-    widget.errorMessage!.length > 256
+    widget.errorMessage!.length > widget.maxErrorLength
         ? truncateWithEllipsis(
-            256, capitalizedErrorMessage!)
+            widget.maxErrorLength, capitalizedErrorMessage!)

74-105: Consider extracting box decoration to a separate method.

The box decoration logic is complex and could be more maintainable if extracted to a separate method.

+  BoxDecoration _buildDecoration(DigitChipThemeData chipThemeData, ThemeData theme) {
+    return BoxDecoration(
+      boxShadow: _buildBoxShadow(chipThemeData, theme),
+      border: Border.all(
+        color: _getBorderColor(chipThemeData, theme),
+        width: chipThemeData.borderWidth ?? 1,
+      ),
+      borderRadius: BorderRadius.circular(spacer1),
+      color: _getBackgroundColor(chipThemeData, theme),
+    );
+  }
flutter/digit-ui-components/digit_components/lib/theme/digit_extended_theme.dart (1)

14-339: Add documentation for the DigitExtendedTheme class.

The implementation is well-structured, but would benefit from:

  • Class-level documentation explaining its purpose and usage
  • Method-level documentation for getLightTheme and getDarkTheme
  • Examples showing how to use the theme extension

Add documentation like this:

/// A theme extension that provides comprehensive theming capabilities for Digit UI components.
///
/// This class manages both light and dark theme variants and includes specific theming for:
/// * Buttons (elevated, outlined, text)
/// * Input decorations
/// * Date and time pickers
/// * Dialog boxes
///
/// Example usage:
/// ```dart
/// final theme = DigitExtendedTheme.instance.getLightTheme();
/// ```
class DigitExtendedTheme {
  // ... existing code ...
}
flutter/digit-ui-components/README.md (2)

146-146: Improve wording clarity.

Consider revising the phrase "a variety of" to be more specific:

-Digit UI Components provides a variety of DigitButtons with optional suffix and prefix icons
+Digit UI Components provides several DigitButton types with optional suffix and prefix icons
🧰 Tools
🪛 LanguageTool

[style] ~146-~146: The phrase “a variety of” may be wordy. To make your writing clearer, consider replacing it.
Context: ...n Variants Digit UI Components provides a variety of DigitButtons with optional suffix and p...

(A_VARIETY_OF)


215-215: Fix grammar in option selection description.

Use the correct article:

-providing users with the ability to select a option
+providing users with the ability to select an option
🧰 Tools
🪛 LanguageTool

[misspelling] ~215-~215: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’.
Context: ...viding users with the ability to select a option. Each DigitButton is equipped wi...

(EN_A_VS_AN)

flutter/digit-ui-components/digit_components/lib/widgets/atoms/digit_base_form_input.dart (10)

41-42: Custom textStyle property is a welcome addition.
This allows external overrides of the default style. Consider ensuring consistent naming with other style properties (like prefixTextStyle, suffixTextStyle) for clarity.


123-135: Large set of new style, dimension, and callback properties.
Properties like suffixPrefixWidth, focusBorder, enableBorder, iconColor, onFocusLost, contentPadding, and iconSize considerably boost configurability. However, the constructor is becoming quite lengthy—consider grouping related properties into smaller objects or separate config classes to maintain readability.


209-209: Getter for _controller may warrant read-only exposure.
Currently, it's a direct pass-through getter. If there's a need to restrict writes, consider returning an unmodifiable interface or limiting direct access. Otherwise, no immediate issue.


251-255: Empty didChangeDependencies override.
There’s no custom logic here. Consider removing the overridden method if it’s not used, or keep it for future expansions.


325-326: Capitalizing innerLabel and helpText.
Good approach for consistent user-facing text. If i18n or special casing is needed, watch out for locale-specific TitleCase nuances.


341-345: Nested logic for maxLengthValue.
Combining the validator’s maxLength with the widget’s own maxLength is powerful but a bit verbose. Consider a small helper function to streamline clarity.


346-355: Manual width and minWidth.
The dynamic approach across mobile, tablet, and desktop is helpful, but relying on explicit breakpoints can be fragile. Think about letting parent constraints handle sizing or using responsive layout widgets for maintainability.


364-479: Text area logic with the resizable Stack approach.

  • The StatefulBuilder nested in the main State can make the code more complex. Consider extracting the text-area-plus-resizer logic into its own widget to reduce duplication and complexity.
  • The resizing with onPanUpdate is neat, but ensure the _height remains within a sensible range to avoid extreme resizing.

480-818: Standard text field with extensive prefix/suffix logic.

  • The prefix/suffix code is quite large and repeated (especially the container decorations). Restructuring into smaller helper methods or dedicated widgets can boost maintainability.
  • Overall, the logic is sound, but consider a new subcomponent to handle prefix and suffix variations elegantly.

819-942: Help text, error message, and char count block.

  • Presenting help/error text plus the char counter in a single Row is functional. The inline checks for _hasError || widget.errorMessage != null can be further simplified or extracted into helper methods for readability.
  • No obvious functional issues; just large conditional code that might benefit from a more modular approach.
flutter/digit-ui-components/digit_components/lib/widgets/atoms/digit_multiselect_dropdown.dart (2)

1-4: Capitalize the doc comments.
Dart documentation comments typically start with a capital letter. Consider applying the following minor refinement for clarity and consistency:

-///the MultiSelectDropDown component is used to create a multi-select dropdown with a list of options.
+/// The MultiSelectDropDown component is used to create a multi-select dropdown with a list of options.

78-82: Add doc comments for new dropdown properties.
emptyItemText, isSearchable, showSelectAll, and selectAllText are all new properties that improve usability, but they lack inline documentation. Consider adding short doc comments for discoverability:

/// Placeholder text to show when there are no options to display.
final String emptyItemText;

/// Determines whether the dropdown supports text search.
final bool isSearchable;

/// Controls whether "Select All" functionality is shown.
final bool showSelectAll;

/// Text used to label the "Select All" option.
final String selectAllText;
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a4bb54e and ae543f5.

⛔ Files ignored due to path filters (86)
  • .github/workflows/publishComponents.yml is excluded by !**/*.yml
  • .github/workflows/publishUICSS.yml is excluded by !**/*.yml
  • build/build-config.yml is excluded by !**/*.yml
  • flutter/digit-ui-components/digit_components/assets/animated_json/alert.json is excluded by !**/*.json
  • flutter/digit-ui-components/digit_components/assets/animated_json/error.json is excluded by !**/*.json
  • flutter/digit-ui-components/digit_components/assets/animated_json/inline_loader.json is excluded by !**/*.json
  • flutter/digit-ui-components/digit_components/assets/animated_json/overlay_loader.json is excluded by !**/*.json
  • flutter/digit-ui-components/digit_components/assets/animated_json/page_loader.json is excluded by !**/*.json
  • flutter/digit-ui-components/digit_components/assets/animated_json/success.json is excluded by !**/*.json
  • flutter/digit-ui-components/digit_components/assets/config.json is excluded by !**/*.json
  • flutter/digit-ui-components/digit_components/assets/fonts/Roboto/Roboto-Black.ttf is excluded by !**/*.ttf, !**/*.ttf
  • flutter/digit-ui-components/digit_components/assets/fonts/Roboto/Roboto-BlackItalic.ttf is excluded by !**/*.ttf, !**/*.ttf
  • flutter/digit-ui-components/digit_components/assets/fonts/Roboto/Roboto-Bold.ttf is excluded by !**/*.ttf, !**/*.ttf
  • flutter/digit-ui-components/digit_components/assets/fonts/Roboto/Roboto-BoldItalic.ttf is excluded by !**/*.ttf, !**/*.ttf
  • flutter/digit-ui-components/digit_components/assets/fonts/Roboto/Roboto-Italic.ttf is excluded by !**/*.ttf, !**/*.ttf
  • flutter/digit-ui-components/digit_components/assets/fonts/Roboto/Roboto-Light.ttf is excluded by !**/*.ttf, !**/*.ttf
  • flutter/digit-ui-components/digit_components/assets/fonts/Roboto/Roboto-LightItalic.ttf is excluded by !**/*.ttf, !**/*.ttf
  • flutter/digit-ui-components/digit_components/assets/fonts/Roboto/Roboto-Medium.ttf is excluded by !**/*.ttf, !**/*.ttf
  • flutter/digit-ui-components/digit_components/assets/fonts/Roboto/Roboto-MediumItalic.ttf is excluded by !**/*.ttf, !**/*.ttf
  • flutter/digit-ui-components/digit_components/assets/fonts/Roboto/Roboto-Thin.ttf is excluded by !**/*.ttf, !**/*.ttf
  • flutter/digit-ui-components/digit_components/assets/fonts/TextArea.ttf is excluded by !**/*.ttf, !**/*.ttf
  • flutter/digit-ui-components/digit_components/assets/icons/svg/doc.svg is excluded by !**/*.svg, !**/*.svg
  • flutter/digit-ui-components/digit_components/assets/icons/svg/file.svg is excluded by !**/*.svg, !**/*.svg
  • flutter/digit-ui-components/digit_components/assets/icons/svg/jpg.svg is excluded by !**/*.svg, !**/*.svg
  • flutter/digit-ui-components/digit_components/assets/icons/svg/pdf.svg is excluded by !**/*.svg, !**/*.svg
  • flutter/digit-ui-components/digit_components/assets/icons/svg/png.svg is excluded by !**/*.svg, !**/*.svg
  • flutter/digit-ui-components/digit_components/assets/icons/svg/profile_icon.svg is excluded by !**/*.svg, !**/*.svg
  • flutter/digit-ui-components/digit_components/assets/icons/svg/xlsx.svg is excluded by !**/*.svg, !**/*.svg
  • flutter/digit-ui-components/digit_components/assets/images/digit_logo_dark.png is excluded by !**/*.png, !**/*.png
  • flutter/digit-ui-components/digit_components/assets/images/digit_logo_light.png is excluded by !**/*.png, !**/*.png
  • flutter/digit-ui-components/digit_components/pubspec.lock is excluded by !**/*.lock, !**/*.lock
  • flutter/digit-ui-components/digit_components/pubspec.yaml is excluded by !**/*.yaml
  • flutter/digit-ui-components/example/assets/config.json is excluded by !**/*.json
  • flutter/digit-ui-components/example/assets/fonts/TextArea.ttf is excluded by !**/*.ttf, !**/*.ttf
  • flutter/digit-ui-components/example/assets/icons/svg/doc.svg is excluded by !**/*.svg, !**/*.svg
  • flutter/digit-ui-components/example/assets/icons/svg/file.svg is excluded by !**/*.svg, !**/*.svg
  • flutter/digit-ui-components/example/assets/icons/svg/jpg.svg is excluded by !**/*.svg, !**/*.svg
  • flutter/digit-ui-components/example/assets/icons/svg/pdf.svg is excluded by !**/*.svg, !**/*.svg
  • flutter/digit-ui-components/example/assets/icons/svg/png.svg is excluded by !**/*.svg, !**/*.svg
  • flutter/digit-ui-components/example/assets/icons/svg/xlsx.svg is excluded by !**/*.svg, !**/*.svg
  • flutter/digit-ui-components/example/lib/localization_data.json is excluded by !**/*.json
  • flutter/digit-ui-components/example/pubspec.lock is excluded by !**/*.lock, !**/*.lock
  • flutter/digit-ui-components/example/pubspec.yaml is excluded by !**/*.yaml
  • flutter/digit-ui-components/example/pubspec_overrides.yaml is excluded by !**/*.yaml
  • flutter/digit-ui-components/storybook/analysis_options.yaml is excluded by !**/*.yaml
  • flutter/digit-ui-components/storybook/android/app/src/debug/AndroidManifest.xml is excluded by !**/*.xml
  • flutter/digit-ui-components/storybook/android/app/src/main/AndroidManifest.xml is excluded by !**/*.xml
  • flutter/digit-ui-components/storybook/android/app/src/main/res/drawable-v21/launch_background.xml is excluded by !**/*.xml
  • flutter/digit-ui-components/storybook/android/app/src/main/res/drawable/launch_background.xml is excluded by !**/*.xml
  • flutter/digit-ui-components/storybook/android/app/src/main/res/mipmap-hdpi/ic_launcher.png is excluded by !**/*.png, !**/*.png
  • flutter/digit-ui-components/storybook/android/app/src/main/res/mipmap-mdpi/ic_launcher.png is excluded by !**/*.png, !**/*.png
  • flutter/digit-ui-components/storybook/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png is excluded by !**/*.png, !**/*.png
  • flutter/digit-ui-components/storybook/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png is excluded by !**/*.png, !**/*.png
  • flutter/digit-ui-components/storybook/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png is excluded by !**/*.png, !**/*.png
  • flutter/digit-ui-components/storybook/android/app/src/main/res/values-night/styles.xml is excluded by !**/*.xml
  • flutter/digit-ui-components/storybook/android/app/src/main/res/values/styles.xml is excluded by !**/*.xml
  • flutter/digit-ui-components/storybook/android/app/src/profile/AndroidManifest.xml is excluded by !**/*.xml
  • flutter/digit-ui-components/storybook/assets/animated_json/alert.json is excluded by !**/*.json
  • flutter/digit-ui-components/storybook/assets/animated_json/error.json is excluded by !**/*.json
  • flutter/digit-ui-components/storybook/assets/animated_json/inline_loader.json is excluded by !**/*.json
  • flutter/digit-ui-components/storybook/assets/animated_json/overlay_loader.json is excluded by !**/*.json
  • flutter/digit-ui-components/storybook/assets/animated_json/page_loader.json is excluded by !**/*.json
  • flutter/digit-ui-components/storybook/assets/animated_json/success.json is excluded by !**/*.json
  • flutter/digit-ui-components/storybook/assets/fonts/Roboto/Roboto-Regular.ttf is excluded by !**/*.ttf, !**/*.ttf
  • flutter/digit-ui-components/storybook/assets/fonts/Roboto/RobotoCondensed-Regular.ttf is excluded by !**/*.ttf, !**/*.ttf
  • flutter/digit-ui-components/storybook/assets/icons/svg/Profile.svg is excluded by !**/*.svg, !**/*.svg
  • flutter/digit-ui-components/storybook/assets/icons/svg/doc.svg is excluded by !**/*.svg, !**/*.svg
  • flutter/digit-ui-components/storybook/assets/icons/svg/file.svg is excluded by !**/*.svg, !**/*.svg
  • flutter/digit-ui-components/storybook/assets/icons/svg/jpg.svg is excluded by !**/*.svg, !**/*.svg
  • flutter/digit-ui-components/storybook/assets/icons/svg/no_result.svg is excluded by !**/*.svg, !**/*.svg
  • flutter/digit-ui-components/storybook/assets/icons/svg/pdf.svg is excluded by !**/*.svg, !**/*.svg
  • flutter/digit-ui-components/storybook/assets/icons/svg/png.svg is excluded by !**/*.svg, !**/*.svg
  • flutter/digit-ui-components/storybook/assets/icons/svg/profile_icon.svg is excluded by !**/*.svg, !**/*.svg
  • flutter/digit-ui-components/storybook/assets/icons/svg/text_area_expand.svg is excluded by !**/*.svg, !**/*.svg
  • flutter/digit-ui-components/storybook/assets/icons/svg/xlsx.svg is excluded by !**/*.svg, !**/*.svg
  • flutter/digit-ui-components/storybook/assets/images/Group 1079.png is excluded by !**/*.png, !**/*.png
  • flutter/digit-ui-components/storybook/assets/images/digit_logo_dark.png is excluded by !**/*.png, !**/*.png
  • flutter/digit-ui-components/storybook/assets/images/digit_logo_light.png is excluded by !**/*.png, !**/*.png
  • flutter/digit-ui-components/storybook/assets/images/powered_by_digit.png is excluded by !**/*.png, !**/*.png
  • flutter/digit-ui-components/storybook/assets/localized_data.json is excluded by !**/*.json
  • flutter/digit-ui-components/storybook/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json is excluded by !**/*.json
  • flutter/digit-ui-components/storybook/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png is excluded by !**/*.png, !**/*.png
  • flutter/digit-ui-components/storybook/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png is excluded by !**/*.png, !**/*.png
  • flutter/digit-ui-components/storybook/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png is excluded by !**/*.png, !**/*.png
  • flutter/digit-ui-components/storybook/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png is excluded by !**/*.png, !**/*.png
  • flutter/digit-ui-components/storybook/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png is excluded by !**/*.png, !**/*.png
📒 Files selected for processing (102)
  • .gitignore (1 hunks)
  • flutter/digit-ui-components/README.md (1 hunks)
  • flutter/digit-ui-components/digit_components/.flutter-plugins (1 hunks)
  • flutter/digit-ui-components/digit_components/.flutter-plugins-dependencies (1 hunks)
  • flutter/digit-ui-components/digit_components/CHANGELOG.md (1 hunks)
  • flutter/digit-ui-components/digit_components/README.md (2 hunks)
  • flutter/digit-ui-components/digit_components/assets/text_area_icons.dart (0 hunks)
  • flutter/digit-ui-components/digit_components/coverage/lcov.info (3 hunks)
  • flutter/digit-ui-components/digit_components/lib/blocs/DateSelection.dart (0 hunks)
  • flutter/digit-ui-components/digit_components/lib/blocs/LocationBloc.dart (0 hunks)
  • flutter/digit-ui-components/digit_components/lib/blocs/TimeSelectionBloc.dart (0 hunks)
  • flutter/digit-ui-components/digit_components/lib/constants/AppView.dart (1 hunks)
  • flutter/digit-ui-components/digit_components/lib/constants/app_constants.dart (1 hunks)
  • flutter/digit-ui-components/digit_components/lib/constants/constant.dart (1 hunks)
  • flutter/digit-ui-components/digit_components/lib/digit_components.dart (1 hunks)
  • flutter/digit-ui-components/digit_components/lib/enum/app_enums.dart (2 hunks)
  • flutter/digit-ui-components/digit_components/lib/models/accordionModel.dart (1 hunks)
  • flutter/digit-ui-components/digit_components/lib/models/chipModel.dart (0 hunks)
  • flutter/digit-ui-components/digit_components/lib/models/models.dart (1 hunks)
  • flutter/digit-ui-components/digit_components/lib/models/privacy_notice/privacy_notice_model.dart (1 hunks)
  • flutter/digit-ui-components/digit_components/lib/models/privacy_notice/privacy_notice_model.freezed.dart (1 hunks)
  • flutter/digit-ui-components/digit_components/lib/models/privacy_notice/privacy_notice_model.g.dart (1 hunks)
  • flutter/digit-ui-components/digit_components/lib/services/AppLocalization.dart (1 hunks)
  • flutter/digit-ui-components/digit_components/lib/services/DateSelection.dart (1 hunks)
  • flutter/digit-ui-components/digit_components/lib/services/TimeSelectionBloc.dart (1 hunks)
  • flutter/digit-ui-components/digit_components/lib/services/component_localization_delegate.dart (1 hunks)
  • flutter/digit-ui-components/digit_components/lib/services/location_bloc.dart (1 hunks)
  • flutter/digit-ui-components/digit_components/lib/services/location_bloc.freezed.dart (1 hunks)
  • flutter/digit-ui-components/digit_components/lib/services/location_fetch_bloc.dart (1 hunks)
  • flutter/digit-ui-components/digit_components/lib/theme/ColorTheme/color_theme.dart (1 hunks)
  • flutter/digit-ui-components/digit_components/lib/theme/ColorTheme/dark_color_theme.dart (1 hunks)
  • flutter/digit-ui-components/digit_components/lib/theme/ColorTheme/light_color_theme.dart (1 hunks)
  • flutter/digit-ui-components/digit_components/lib/theme/ComponentTheme/action_card_theme.dart (1 hunks)
  • flutter/digit-ui-components/digit_components/lib/theme/ComponentTheme/back_button_theme.dart (1 hunks)
  • flutter/digit-ui-components/digit_components/lib/theme/ComponentTheme/bread_crumb_theme.dart (1 hunks)
  • flutter/digit-ui-components/digit_components/lib/theme/ComponentTheme/button_theme.dart (1 hunks)
  • flutter/digit-ui-components/digit_components/lib/theme/ComponentTheme/checkbox_theme.dart (1 hunks)
  • flutter/digit-ui-components/digit_components/lib/theme/ComponentTheme/chip_theme.dart (1 hunks)
  • flutter/digit-ui-components/digit_components/lib/theme/ComponentTheme/digit_accordion_theme.dart (1 hunks)
  • flutter/digit-ui-components/digit_components/lib/theme/ComponentTheme/digit_tab_bar_theme.dart (1 hunks)
  • flutter/digit-ui-components/digit_components/lib/theme/ComponentTheme/digit_tag_theme.dart (1 hunks)
  • flutter/digit-ui-components/digit_components/lib/theme/ComponentTheme/divider_theme.dart (1 hunks)
  • flutter/digit-ui-components/digit_components/lib/theme/ComponentTheme/info_card_theme.dart (1 hunks)
  • flutter/digit-ui-components/digit_components/lib/theme/ComponentTheme/panel_theme.dart (1 hunks)
  • flutter/digit-ui-components/digit_components/lib/theme/ComponentTheme/pop_up_card_theme.dart (1 hunks)
  • flutter/digit-ui-components/digit_components/lib/theme/ComponentTheme/radio_list_theme.dart (1 hunks)
  • flutter/digit-ui-components/digit_components/lib/theme/ComponentTheme/switch_theme.dart (1 hunks)
  • flutter/digit-ui-components/digit_components/lib/theme/ComponentTheme/toast_theme_data.dart (1 hunks)
  • flutter/digit-ui-components/digit_components/lib/theme/SpacerTheme/spacer_theme.dart (1 hunks)
  • flutter/digit-ui-components/digit_components/lib/theme/TextTheme/button_text_theme.dart (1 hunks)
  • flutter/digit-ui-components/digit_components/lib/theme/TextTheme/desktop_text_theme.dart (1 hunks)
  • flutter/digit-ui-components/digit_components/lib/theme/TextTheme/digit_text_theme.dart (1 hunks)
  • flutter/digit-ui-components/digit_components/lib/theme/TextTheme/mobile_text_theme.dart (1 hunks)
  • flutter/digit-ui-components/digit_components/lib/theme/TextTheme/tab_text_theme.dart (1 hunks)
  • flutter/digit-ui-components/digit_components/lib/theme/colors.dart (1 hunks)
  • flutter/digit-ui-components/digit_components/lib/theme/digit_colors.dart (1 hunks)
  • flutter/digit-ui-components/digit_components/lib/theme/digit_extended_theme.dart (1 hunks)
  • flutter/digit-ui-components/digit_components/lib/theme/digit_theme.dart (7 hunks)
  • flutter/digit-ui-components/digit_components/lib/theme/digit_theme_wrapper.dart (1 hunks)
  • flutter/digit-ui-components/digit_components/lib/theme/digit_typography.dart (1 hunks)
  • flutter/digit-ui-components/digit_components/lib/theme/spacers.dart (1 hunks)
  • flutter/digit-ui-components/digit_components/lib/theme/text_theme_extension.dart (1 hunks)
  • flutter/digit-ui-components/digit_components/lib/theme/theme.dart (1 hunks)
  • flutter/digit-ui-components/digit_components/lib/theme/theme_notifier.dart (1 hunks)
  • flutter/digit-ui-components/digit_components/lib/theme/typography.dart (7 hunks)
  • flutter/digit-ui-components/digit_components/lib/utils/app_logger.dart (1 hunks)
  • flutter/digit-ui-components/digit_components/lib/utils/component_utils.dart (1 hunks)
  • flutter/digit-ui-components/digit_components/lib/utils/date_utils.dart (5 hunks)
  • flutter/digit-ui-components/digit_components/lib/utils/fileService/file_download.dart (1 hunks)
  • flutter/digit-ui-components/digit_components/lib/utils/fileService/file_service.dart (1 hunks)
  • flutter/digit-ui-components/digit_components/lib/utils/fileService/mobile_file_download.dart (1 hunks)
  • flutter/digit-ui-components/digit_components/lib/utils/fileService/mobile_file_service.dart (1 hunks)
  • flutter/digit-ui-components/digit_components/lib/utils/fileService/web_file_download.dart (1 hunks)
  • flutter/digit-ui-components/digit_components/lib/utils/fileService/web_file_service.dart (1 hunks)
  • flutter/digit-ui-components/digit_components/lib/utils/i18_key_constants.dart (1 hunks)
  • flutter/digit-ui-components/digit_components/lib/utils/utils.dart (1 hunks)
  • flutter/digit-ui-components/digit_components/lib/utils/validators/file_validator.dart (1 hunks)
  • flutter/digit-ui-components/digit_components/lib/utils/validators/image_validator.dart (1 hunks)
  • flutter/digit-ui-components/digit_components/lib/widgets/atoms/accordion.dart (1 hunks)
  • flutter/digit-ui-components/digit_components/lib/widgets/atoms/digit_action_card.dart (1 hunks)
  • flutter/digit-ui-components/digit_components/lib/widgets/atoms/digit_back_button.dart (1 hunks)
  • flutter/digit-ui-components/digit_components/lib/widgets/atoms/digit_base_form_input.dart (11 hunks)
  • flutter/digit-ui-components/digit_components/lib/widgets/atoms/digit_bread_crumbs.dart (1 hunks)
  • flutter/digit-ui-components/digit_components/lib/widgets/atoms/digit_button.dart (1 hunks)
  • flutter/digit-ui-components/digit_components/lib/widgets/atoms/digit_checkbox.dart (2 hunks)
  • flutter/digit-ui-components/digit_components/lib/widgets/atoms/digit_checkbox_icon.dart (2 hunks)
  • flutter/digit-ui-components/digit_components/lib/widgets/atoms/digit_chip.dart (1 hunks)
  • flutter/digit-ui-components/digit_components/lib/widgets/atoms/digit_date_form_input.dart (5 hunks)
  • flutter/digit-ui-components/digit_components/lib/widgets/atoms/digit_divider.dart (1 hunks)
  • flutter/digit-ui-components/digit_components/lib/widgets/atoms/digit_dob_picker.dart (1 hunks)
  • flutter/digit-ui-components/digit_components/lib/widgets/atoms/digit_info_card.dart (2 hunks)
  • flutter/digit-ui-components/digit_components/lib/widgets/atoms/digit_loader.dart (1 hunks)
  • flutter/digit-ui-components/digit_components/lib/widgets/atoms/digit_location_form_input.dart (1 hunks)
  • flutter/digit-ui-components/digit_components/lib/widgets/atoms/digit_multiselect_dropdown.dart (32 hunks)
  • flutter/digit-ui-components/digit_components/lib/widgets/atoms/digit_numeric_form_input.dart (5 hunks)
  • flutter/digit-ui-components/digit_components/lib/widgets/atoms/digit_otp.dart (1 hunks)
  • flutter/digit-ui-components/digit_components/lib/widgets/atoms/digit_password_form_input.dart (3 hunks)
  • flutter/digit-ui-components/digit_components/lib/widgets/atoms/digit_radio_list.dart (3 hunks)
  • flutter/digit-ui-components/digit_components/lib/widgets/atoms/digit_search_bar.dart (1 hunks)
  • flutter/digit-ui-components/digit_components/lib/widgets/atoms/digit_search_form_input.dart (2 hunks)
  • flutter/digit-ui-components/digit_components/lib/widgets/atoms/digit_stepper.dart (1 hunks)
  • flutter/digit-ui-components/digit_components/lib/widgets/atoms/digit_tab.dart (1 hunks)
💤 Files with no reviewable changes (5)
  • flutter/digit-ui-components/digit_components/lib/models/chipModel.dart
  • flutter/digit-ui-components/digit_components/assets/text_area_icons.dart
  • flutter/digit-ui-components/digit_components/lib/blocs/DateSelection.dart
  • flutter/digit-ui-components/digit_components/lib/blocs/TimeSelectionBloc.dart
  • flutter/digit-ui-components/digit_components/lib/blocs/LocationBloc.dart
✅ Files skipped from review due to trivial changes (5)
  • .gitignore
  • flutter/digit-ui-components/digit_components/lib/constants/constant.dart
  • flutter/digit-ui-components/digit_components/lib/theme/theme.dart
  • flutter/digit-ui-components/digit_components/lib/models/models.dart
  • flutter/digit-ui-components/digit_components/lib/models/privacy_notice/privacy_notice_model.g.dart
🧰 Additional context used
🧠 Learnings (2)
flutter/digit-ui-components/digit_components/lib/widgets/atoms/digit_back_button.dart (1)
Learnt from: rachana-egov
PR: egovernments/DIGIT-UI-LIBRARIES#137
File: flutter/digit-ui-components/storybook/lib/widgets/atoms/back_button_stories.dart:65-73
Timestamp: 2024-11-10T20:01:49.000Z
Learning: In `flutter/digit-ui-components/storybook/lib/widgets/atoms/back_button_stories.dart`, the `Backlink 3` story intentionally omits `digitBackButtonThemeData` to demonstrate a different configuration.
flutter/digit-ui-components/digit_components/lib/widgets/atoms/digit_search_bar.dart (1)
Learnt from: rachana-egov
PR: egovernments/DIGIT-UI-LIBRARIES#119
File: flutter/digit-ui-components/digit_components/lib/widgets/atoms/digit_search_bar.dart:9-89
Timestamp: 2024-11-12T10:40:17.779Z
Learning: In the `DigitSearchBar` component, the team prefers to use a `Widget` for the `icon` property to make it more customizable.
🪛 markdownlint-cli2 (0.17.2)
flutter/digit-ui-components/digit_components/README.md

15-15: Link fragments should be valid
null

(MD051, link-fragments)

🪛 LanguageTool
flutter/digit-ui-components/digit_components/README.md

[duplication] ~89-~89: Possible typo: you repeated a word.
Context: ...ecules** (Combinations of Atoms) - Form Cards - Cards - Panel Cards - Table - hamburger - and...

(ENGLISH_WORD_REPEAT_RULE)

flutter/digit-ui-components/README.md

[style] ~146-~146: The phrase “a variety of” may be wordy. To make your writing clearer, consider replacing it.
Context: ...n Variants Digit UI Components provides a variety of DigitButtons with optional suffix and p...

(A_VARIETY_OF)


[misspelling] ~215-~215: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’.
Context: ...viding users with the ability to select a option. Each DigitButton is equipped wi...

(EN_A_VS_AN)

🔇 Additional comments (169)
flutter/digit-ui-components/digit_components/lib/utils/i18_key_constants.dart (1)

1-1: LGTM! Well-structured constant declaration.

The constant declaration follows Dart best practices and provides a clean way to access the internationalization keys.

flutter/digit-ui-components/digit_components/lib/utils/date_utils.dart (5)

6-6: LGTM!

The method signature has been correctly updated to reflect the renamed class.


28-32: LGTM!

The return statement has been correctly updated to use the renamed class.


128-130: LGTM!

The formatting changes improve code readability without affecting functionality.


169-175: LGTM!

The class has been appropriately renamed to better reflect its purpose as a converter. The new name is more descriptive and follows the project's naming conventions.


89-89: LGTM!

The return statement has been made more explicit, which improves code clarity.

flutter/digit-ui-components/digit_components/lib/models/privacy_notice/privacy_notice_model.freezed.dart (2)

1-809: LGTM! Generated code follows Freezed's best practices.

The generated code implements immutable data classes with proper JSON serialization, equality checks, and copy methods.


6-6:

✅ Verification successful

Verify the source file exists.

Ensure that the source file privacy_notice_model.dart exists and contains the model definitions.


🏁 Script executed:

#!/bin/bash
# Description: Check if the source file exists
fd --type f "privacy_notice_model.dart$" --exec echo "Source file found: {}"

Length of output: 196


Source file verified

The source file privacy_notice_model.dart was found at:

  • ./flutter/digit-ui-components/digit_components/lib/models/privacy_notice/privacy_notice_model.dart

Please ensure that this file contains the expected model definitions. Based on the verification result, no further action is required.

flutter/digit-ui-components/digit_components/lib/widgets/atoms/digit_password_form_input.dart (3)

22-43: LGTM! Constructor parameter changes improve flexibility.

The changes to the constructor parameters are well-thought-out:

  • Making controller optional allows for both controlled and uncontrolled components
  • New parameters (keyboardType, onFocusLost, maxLength) enhance functionality
  • Parameter ordering follows a logical grouping

43-64: LGTM! Super constructor call is correctly updated.

The super constructor call correctly reflects the constructor parameter changes and sets appropriate default values.


96-96: LGTM! State class implementation is complete.

The state class implementation correctly handles password visibility toggling and maintains proper state management.

flutter/digit-ui-components/digit_components/lib/theme/ComponentTheme/action_card_theme.dart (4)

8-22: LGTM! Well-structured properties and constructor.

The properties and constructor are well-defined with appropriate nullability and immutability. The use of const constructor with optional parameters provides good flexibility for theme customization.


24-47: LGTM! Comprehensive default theme with responsive margins.

The default theme implementation is well-structured with:

  • Proper device type detection
  • Appropriate theme context usage
  • Well-defined decoration with shadow and border radius
  • Responsive margins based on device type

49-72: LGTM! Well-implemented copyWith with proper fallback handling.

The copyWith implementation correctly:

  • Handles context-based default theme fallback
  • Maintains nullable properties
  • Includes clear documentation

74-87: LGTM! Proper lerp implementation following Flutter patterns.

The lerp implementation correctly:

  • Checks the type of the other theme
  • Uses appropriate lerp methods for each property type
  • Follows Flutter's standard lerp pattern
flutter/digit-ui-components/digit_components/lib/theme/ComponentTheme/panel_theme.dart (3)

6-18: Well-structured theme extension class!

The class follows Flutter's theme extension pattern correctly with appropriate field types and good organization of styling properties.


19-31: LGTM! Constructor follows best practices.

The constructor is properly marked as const and requires all fields, ensuring proper initialization.


62-93: Excellent copyWith implementation!

The method follows Flutter's copyWith pattern with proper null handling and smart default theme fallback using context.

flutter/digit-ui-components/digit_components/lib/widgets/atoms/digit_back_button.dart (2)

1-16: LGTM! Well-structured class declaration.

The class follows Flutter best practices with const constructor and proper nullability for optional parameters.


18-24: LGTM! Robust theme fallback mechanism.

The theme initialization follows best practices with a clear fallback chain, allowing for theme customization at different levels.

flutter/digit-ui-components/digit_components/lib/theme/ComponentTheme/digit_tag_theme.dart (3)

1-25: Well-structured theme extension class!

The class follows Flutter's theme extension pattern with well-organized properties grouped by tag state. The nullable properties provide flexibility for theme customization.


80-119: LGTM! Well-implemented copyWith method.

The method follows Flutter's copyWith pattern and correctly handles all properties.


121-147: LGTM! Well-implemented lerp method.

The method correctly implements linear interpolation for all properties, using appropriate lerp methods for each type and a threshold approach for non-interpolatable properties.

flutter/digit-ui-components/digit_components/lib/constants/app_constants.dart (5)

39-71: LGTM! Excellent documentation and organization.

The detailed comments for each constant greatly improve code maintainability. The border color updates align well with the theme changes.


73-86: LGTM! Well-structured button constants with clear size variations.

The constants follow a consistent naming pattern and use spacer constants effectively. The documentation clearly explains each constant's purpose.


88-107: LGTM! Consistent color utilities with clear documentation.

The color utility methods follow a consistent pattern and the updated color references align with the theme changes.


109-119: LGTM! Well-documented dropdown constants.

The constants are well-organized and the use of spacer constants ensures consistency with the design system.


135-144: LGTM! Well-structured responsive margin constants.

The pop-up card margins are well-organized by screen size and clearly documented.

flutter/digit-ui-components/digit_components/lib/theme/ComponentTheme/switch_theme.dart (2)

1-7: LGTM! Well-structured theme extension class.

The class follows Flutter's theme extension pattern and project naming conventions.


49-72: LGTM! Well-implemented copyWith method.

The implementation correctly handles all properties and follows the immutable pattern.

flutter/digit-ui-components/digit_components/lib/theme/ComponentTheme/digit_tab_bar_theme.dart (1)

1-6: LGTM!

The imports are appropriate and the class correctly extends ThemeExtension for theme customization.

flutter/digit-ui-components/digit_components/lib/theme/ComponentTheme/toast_theme_data.dart (4)

10-28: LGTM! Well-structured theme extension class.

The class follows Flutter's theme extension pattern with a comprehensive set of nullable properties for flexible toast customization.


29-47: LGTM! Constructor follows Flutter's best practices.

The const constructor with named optional parameters aligns with Flutter's theme data class patterns.


89-128: LGTM! Proper implementation of copyWith method.

The method correctly follows Flutter's copyWith pattern, handling all properties appropriately.


130-154: LGTM! Proper implementation of lerp method.

The method correctly implements linear interpolation with appropriate strategies for different property types:

  • Uses built-in lerp methods for Color, TextStyle, and EdgeInsets
  • Uses threshold-based switching for non-interpolatable properties
flutter/digit-ui-components/digit_components/lib/theme/ComponentTheme/pop_up_card_theme.dart (2)

1-6: LGTM! Well-structured theme extension setup.

The imports are appropriate and the class properly extends ThemeExtension for theme customization.


65-93: LGTM! Well-implemented copyWith method.

The implementation correctly handles theme updates with appropriate fallback chain (new value -> default theme -> current value).

flutter/digit-ui-components/digit_components/lib/theme/SpacerTheme/spacer_theme.dart (2)

18-31: LGTM!

The constructor is well-implemented with:

  • Const constructor for immutability
  • Logical default values following a 4-point grid system
  • Optional parameters for flexibility

33-62: LGTM!

The copyWith method follows Flutter's best practices:

  • Correctly handles null values
  • Maintains immutability
  • Follows the standard copyWith pattern
flutter/digit-ui-components/digit_components/lib/theme/TextTheme/mobile_text_theme.dart (2)

1-4: LGTM! Clean imports and well-structured class declaration.

The imports are minimal and the class name follows the project's naming convention.


7-12:

❓ Verification inconclusive

Verify font availability.

The text styles use 'Roboto' and 'Roboto Condensed' fonts. Ensure these fonts are properly bundled with the application or available through a font service.

Run this script to check font declarations in pubspec.yaml:


🏁 Script executed:

#!/bin/bash
# Check font declarations in pubspec.yaml
echo "Checking font declarations..."
rg -A 10 "fonts:" pubspec.yaml

Length of output: 152


Manual Verification Required: Font Declarations & Accessibility

  • The automated check did not locate a root-level pubspec.yaml. Please verify that the fonts (i.e., 'Roboto' and 'Roboto Condensed') are declared in the appropriate configuration file (possibly within a module-specific pubspec.yaml).
  • Additionally, ensure that the font files are bundled or available via a font service.
  • Confirm that the font sizes (12px–32px) meet accessibility guidelines as expected.
flutter/digit-ui-components/digit_components/lib/theme/ColorTheme/color_theme.dart (1)

53-108: Verify color contrast ratios for accessibility.

Ensure that the alert colors meet WCAG 2.1 contrast requirements when used with their respective background colors.

#!/usr/bin/python3
import colorsys

def hex_to_rgb(hex_color):
    hex_color = hex_color.lstrip('#')
    return tuple(int(hex_color[i:i+2], 16)/255 for i in (0, 2, 4))

def calculate_relative_luminance(r, g, b):
    def adjust(value):
        return value/12.92 if value <= 0.03928 else ((value + 0.055)/1.055) ** 2.4
    return 0.2126 * adjust(r) + 0.7152 * adjust(g) + 0.0722 * adjust(b)

def calculate_contrast_ratio(color1, color2):
    l1 = calculate_relative_luminance(*hex_to_rgb(color1))
    l2 = calculate_relative_luminance(*hex_to_rgb(color2))
    lighter = max(l1, l2)
    darker = min(l1, l2)
    return (lighter + 0.05) / (darker + 0.05)

# Test alert colors against their backgrounds
alert_colors = {
    'error': ('#B91900', '#FFF5F4'),
    'success': ('#00703C', '#F1FFF8'),
    'info': ('#0057BD', '#DEEFFF'),
    'warning': ('#EA8D00', '#FFF9F0')
}

print("Contrast Ratios (WCAG 2.1 requires >= 4.5:1 for normal text):")
for name, (color, bg) in alert_colors.items():
    ratio = calculate_contrast_ratio(color, bg)
    print(f"{name}: {ratio:.2f}:1")
flutter/digit-ui-components/digit_components/lib/theme/ColorTheme/light_color_theme.dart (1)

5-77: Implementation looks good!

The light theme implementation:

  • Provides appropriate default colors
  • Correctly extends the base theme
  • Properly implements required methods
flutter/digit-ui-components/digit_components/lib/theme/ColorTheme/dark_color_theme.dart (1)

5-77: Verify dark theme colors for accessibility.

While the implementation is good, ensure that:

  1. Text colors meet WCAG contrast requirements against dark backgrounds
  2. Alert colors are visible in dark mode
#!/usr/bin/python3
# Reusing contrast calculation functions from earlier
# Testing dark theme specific combinations
dark_colors = {
    'primary_text': ('#E0E0E0', '#121212'),  # text vs background
    'secondary_text': ('#B0B0B0', '#121212'),
    'error_alert': ('#CF6C6C', '#2D2D2D'),
    'success_alert': ('#008A57', '#003C30'),
    'info_alert': ('#0062A0', '#002D5F'),
    'warning_alert': ('#EAA80D', '#4D3A00')
}

print("Dark Theme Contrast Ratios (WCAG 2.1 requires >= 4.5:1 for normal text):")
for name, (color, bg) in dark_colors.items():
    ratio = calculate_contrast_ratio(color, bg)
    print(f"{name}: {ratio:.2f}:1")
flutter/digit-ui-components/digit_components/lib/theme/colors.dart (5)

16-16: LGTM! Good performance optimization.

Making the constructor const allows for compile-time constant creation, which can improve performance.


19-21: LGTM! Clean standardization of primary colors.

The renaming of primary colors to a more generic naming scheme (primary1, primary2) makes the color system more flexible for future theme changes.


24-26: LGTM! Well-structured text color hierarchy.

The text colors follow a clear hierarchy with appropriate contrast levels for different text states.


33-40: LGTM! Comprehensive alert color system.

The alert color system is well-structured with:

  • Distinct colors for each alert type (error, success, info, warning)
  • Matching background colors for each alert type
  • Consistent naming convention

19-40: Verify color contrast ratios for accessibility.

Please ensure that the color combinations (especially text colors with backgrounds) meet WCAG contrast ratio requirements.

#!/usr/bin/env python3
import math

def hex_to_rgb(hex_color):
    hex_color = hex_color.lstrip('#')
    return tuple(int(hex_color[i:i+2], 16) for i in (0, 2, 4))

def get_relative_luminance(r, g, b):
    rs = r / 255
    gs = g / 255
    bs = b / 255
    
    rs = rs / 12.92 if rs <= 0.03928 else ((rs + 0.055) / 1.055) ** 2.4
    gs = gs / 12.92 if gs <= 0.03928 else ((gs + 0.055) / 1.055) ** 2.4
    bs = bs / 12.92 if bs <= 0.03928 else ((bs + 0.055) / 1.055) ** 2.4
    
    return 0.2126 * rs + 0.7152 * gs + 0.0722 * bs

def get_contrast_ratio(color1, color2):
    l1 = get_relative_luminance(*hex_to_rgb(color1))
    l2 = get_relative_luminance(*hex_to_rgb(color2))
    
    lighter = max(l1, l2)
    darker = min(l1, l2)
    
    return (lighter + 0.05) / (darker + 0.05)

# Test color combinations
color_pairs = [
    ('363636', 'FFFFFF'),  # textPrimary on paperPrimary
    ('787878', 'FFFFFF'),  # textSecondary on paperPrimary
    ('C5C5C5', 'FFFFFF'),  # textDisabled on paperPrimary
]

print("WCAG Contrast Ratio Requirements:")
print("- AA Normal Text: 4.5:1")
print("- AA Large Text: 3:1")
print("- AAA Normal Text: 7:1")
print("- AAA Large Text: 4.5:1\n")

for fg, bg in color_pairs:
    ratio = get_contrast_ratio(fg, bg)
    print(f"#{fg} on #{bg} - Contrast Ratio: {ratio:.2f}:1")
    if ratio < 4.5:
        print("WARNING: Does not meet WCAG AA requirements for normal text")
    elif ratio < 7:
        print("NOTE: Meets WCAG AA but not AAA requirements for normal text")
flutter/digit-ui-components/digit_components/lib/widgets/atoms/digit_divider.dart (2)

1-5: LGTM!

All necessary imports are present and properly organized.


18-30: LGTM!

The theme handling and thickness determination are well-implemented with proper fallbacks.

flutter/digit-ui-components/digit_components/lib/theme/ComponentTheme/divider_theme.dart (3)

1-5: LGTM!

All necessary imports are present and properly organized.


16-26: LGTM!

The constructor is well-designed with appropriate default values.


28-66: LGTM!

The copyWith and lerp methods are well-implemented with proper null safety and type checking.

flutter/digit-ui-components/digit_components/lib/widgets/atoms/digit_search_bar.dart (3)

9-20: Well-structured properties with good flexibility!

The properties are well-defined and provide excellent customization options. The icon property is correctly implemented as a Widget? type, allowing for custom icons as per team preferences.


21-33: Well-implemented constructor with appropriate defaults!

The constructor follows Flutter's best practices with named parameters and appropriate default values.


61-61:

❓ Verification inconclusive

Ensure theme extension is properly handled.

Using theme.colorTheme.text.primary directly could be fragile if the theme extension is not properly set up.


🏁 Script executed:

#!/bin/bash
# Check if the colorTheme extension is properly registered
ast-grep --pattern 'class $_ implements ThemeExtension<$_> {
  $$$
  final TextStyle? text;
  $$$
}'

Length of output: 102


Theme extension verification required.
The usage of theme.colorTheme.text.primary appears potentially fragile because our automated check to confirm the proper registration of a ThemeExtension with a text property did not yield any output. This could mean that either the extension isn’t registered as expected or that the search pattern didn’t match the implementation.

  • Action: Please manually verify that a ThemeExtension implementation with a final TextStyle? text; property exists in your theme setup.
  • Consideration: If the extension is implemented differently (e.g., using an alternative property name or structure), update this reference accordingly to prevent runtime issues.
flutter/digit-ui-components/digit_components/lib/widgets/atoms/digit_search_form_input.dart (1)

23-80:

❓ Verification inconclusive

LGTM! Verify Base.height constant.

The constructor changes improve flexibility and customization:

  • Making controller optional allows for more flexible usage
  • New input handling parameters enhance functionality
  • UI customization parameters improve theming capabilities

Verify that the Base.height constant is properly defined:


🏁 Script executed:

#!/bin/bash
# Description: Check if Base.height is properly defined in app_constants.dart

rg -A 5 "class Base" "app_constants.dart"

Length of output: 100


LGTM! But verify Base.height constant.

The constructor modifications increase flexibility and customization:

  • Making controller optional provides greater usage flexibility.
  • Adding parameters like keyboardType, onFocusLost, and onFieldSubmitted enhances input handling.
  • UI customization options (focusBorder, enableBorder, iconColor) improve theming capabilities.
  • The widget uses height: height ?? Base.height, so it's important to confirm that Base.height is defined appropriately.

Our initial search in app_constants.dart did not locate the Base class. Please verify—either by a repository-wide search or manual inspection—that Base.height exists and is set as expected.

flutter/digit-ui-components/digit_components/lib/digit_components.dart (2)

1-4: LGTM! Well-organized library structure.

The library declaration and core exports follow Dart naming conventions and are logically organized.


5-7:

✅ Verification successful

LGTM! Verify the exported files.

The new exports enhance the library's public API and follow consistent patterns. They support the broader reorganization mentioned in the PR objectives.

Let's verify that the exported files exist and contain the expected components:


🏁 Script executed:

#!/bin/bash
# Description: Verify the existence and content of exported files

# Check if the files exist
echo "Checking exported files..."
for file in "enum/app_enums.dart" "models/models.dart" "constants/constant.dart"; do
  if [ -f "flutter/digit-ui-components/digit_components/lib/$file" ]; then
    echo "$file exists"
    # Show file contents for verification
    echo "Contents of $file:"
    cat "flutter/digit-ui-components/digit_components/lib/$file"
    echo "---"
  else
    echo "$file not found"
  fi
done

# Verify the renamed components mentioned in the AI summary
echo "Checking for renamed components..."
rg "DigitButtonType" "flutter/digit-ui-components/digit_components/lib"

Length of output: 12054


LGTM! Export files verified and consistent.

  • All three files (enum/app_enums.dart, models/models.dart, and constants/constant.dart) exist and include the expected content.
  • The contents of enum/app_enums.dart properly define enums such as DigitButtonType and others, with their usage confirmed across the codebase.
  • The re-export in models/models.dart and constants/constant.dart align with the broader reorganization and API enhancements.
  • Instances of DigitButtonType across various widgets were verified, confirming the intended renaming.
flutter/digit-ui-components/digit_components/lib/theme/TextTheme/desktop_text_theme.dart (4)

1-6: LGTM! Well-structured class declaration.

The class follows good practices with:

  • Appropriate use of const constructor
  • Clear naming that follows extension pattern
  • Minimal necessary imports

55-72: LGTM! Well-defined body text styles.

The body text styles are well-structured with:

  • Appropriate font size progression
  • Good line height (1.37) for readability
  • Consistent regular weight

73-95: LGTM! Well-designed link styles.

The link styles are well-implemented with:

  • Consistent sizing with body text
  • Clear visual indication through underline decoration
  • Appropriate line height matching body text

7-36:

❓ Verification inconclusive

Verify font availability in the project.

The heading styles use both 'Roboto' and 'Roboto Condensed' fonts. Ensure these fonts are properly included in the project's pubspec.yaml and that they're bundled with the application.

Run this script to check font declarations in pubspec.yaml:


🏁 Script executed:

#!/bin/bash
# Check if fonts are declared in pubspec.yaml
rg -A 5 "fonts:" pubspec.yaml

Length of output: 82


Action: Verify font declarations configuration manually.

The heading styles use both Roboto and Roboto Condensed fonts, but our automated search for a pubspec.yaml file returned an error. This file is typically expected at the project root for Flutter projects. Please do the following:

  • Locate the font declarations: Verify whether the project uses a pubspec.yaml file (it might exist in a subdirectory) or another configuration file where fonts are declared.
  • Confirm font availability: Ensure that both the Roboto and Roboto Condensed fonts are properly bundled with the application.

If the pubspec.yaml file isn’t found in the expected location, please update the configuration or manually verify that the fonts are provided through an alternate method.

flutter/digit-ui-components/digit_components/lib/widgets/atoms/digit_checkbox.dart (1)

65-86: LGTM! Well-implemented state management.

Good improvements:

  • Proper state initialization
  • Added didUpdateWidget to keep internal state in sync with widget value
  • Added focus state tracking alongside hover state
flutter/digit-ui-components/digit_components/lib/theme/ComponentTheme/bread_crumb_theme.dart (1)

4-15: LGTM! Well-structured theme data class.

The class is well-designed with nullable properties allowing for theme inheritance and a const constructor for performance optimization.

flutter/digit-ui-components/digit_components/lib/widgets/atoms/digit_loader.dart (1)

1-8: LGTM!

The imports are well-organized and the class name follows the project's naming convention.

flutter/digit-ui-components/digit_components/lib/theme/ComponentTheme/chip_theme.dart (2)

1-22: LGTM! Well-structured theme class.

The class follows Flutter's theming conventions with comprehensive property coverage for both normal and error states.


23-39: LGTM! Well-designed constructor.

The const constructor with optional parameters enables efficient memory usage and flexible theme customization.

flutter/digit-ui-components/digit_components/lib/widgets/atoms/digit_dob_picker.dart (1)

1-52: LGTM! Well-structured widget declaration with appropriate imports.

The imports are comprehensive and the widget class is properly declared following the project's naming conventions.

flutter/digit-ui-components/digit_components/lib/theme/text_theme_extension.dart (2)

1-35: LGTM! Well-structured theme extension class.

The class follows Flutter's theming best practices with clear property naming and proper use of nullable types for flexibility.


186-219: LGTM! Proper implementation of copyWith.

The implementation correctly handles null values and maintains immutability.

flutter/digit-ui-components/digit_components/CHANGELOG.md (18)

4-7: Stable Release 0.2.0 Entry
This section marks a stable release with the note "A stable release of the flutter component library." and an update to the readme. Ensure that any breaking changes or important behavioral shifts (if any) are clearly documented so consumers can quickly assess impact.


8-11: Development Release 0.0.2-dev.15 Entry
The notes "fixed table rebuild issue" and "updated text styles for summary card" are succinct. It would be helpful to cross-verify these fixes in the related UI components to ensure that the changes mentioned here—from a visual or functional standpoint—reflect the intended improvements.


15-18: Development Release 0.0.2-dev.13 Entry
Fixes for the dropdown reset issue and stepper alignment are noted here. Verify that these visual and behavioral adjustments have been validated on all target devices to maintain UI consistency.


19-21: Development Release 0.0.2-dev.12 Entry
This entry mentions a fix for the hamburger menu update issue. Although the bullet point is terse, ensure that any potential UI regressions have been checked and that the fix does not introduce side effects.


22-25: Development Release 0.0.2-dev.11 Entry
Updates include an adjustment to the stepper component’s length and the addition of a maxLength property for a numeric field. Confirm that the new property includes proper validation and handles edge cases, as this can be critical for data integrity in forms.


31-33: Development Release 0.0.2-dev.9 Entry
A simple note addresses a fix for a table null issue. Although brief, it is important to verify that all null cases in the table rendering are handled correctly after the fix.


34-36: Development Release 0.0.2-dev.8 Entry
An added property to control sentence casing in dropdowns is mentioned. Please ensure this feature is documented in the component’s API and is backward compatible with existing implementations.


37-40: Development Release 0.0.2-dev.7 Entry
Fixes here pertain to dialog util action button alignment and language selection card issues. It’s a good idea to reconfirm that these fixes do not alter other parts of the UI unintentionally.


41-44: Development Release 0.0.2-dev.6 Entry
This update addresses a privacy component error message style and a table height issue. Confirm that the styling changes are consistent with the overall design system and that they improve readability and usability.


54-58: Development Release 0.0.2-dev.3 Entry
This entry covers dependency upgrades, the addition of a description prop for a labelled field, and menu card updates. Upgrading dependencies can sometimes introduce regressions, so comprehensive testing is advised.


59-62: Development Release 0.0.2-dev.2 Entry
Updates include an updated reactive form version and a fix for the privacy policy header alignment. Verify that these changes integrate seamlessly with existing form behaviors and layout standards.


63-66: Development Release 0.0.2-dev.1 Entry
This segment notes further revisions to the reactive form version along with the addition of a privacy policy component. Ensure that consumers of the component library are aware of these enhancements, especially if they impact validation logic or user flows.


83-86: Release 0.0.1+5 Entry
This update fixes a dropdown setState issue and adds a utility for text case transformation (including sentence, caps, and truncation). Ensure that these fixes are documented in related issue trackers to aid in future troubleshooting.


91-93: Release 0.0.1+3 Entry
This entry resolves dropdown overlay issues. The note is brief, so please verify that these fixes have been adequately validated with UI tests to prevent regressions in similar components.


97-99: Release 0.0.1+1 Entry
The update highlights compatibility improvements with reactive forms. The note is succinct and seems sufficient given the scope; just ensure that these changes are well integrated with existing form validation mechanisms.


100-102: Initial Release 0.0.1 Entry
This section captures the initial release details. As a historical reference entry, the minimal details are acceptable provided that comprehensive documentation exists elsewhere.


103-105: Test Release 0.0.3-beta Entry
The changelog simply labels this entry as a test release. It’s advisable to mark such releases distinctly as pre-release versions and potentially include known issues or stability notes.


106-108: Test Release 0.0.2-beta Entry
Like the previous beta release note, this entry is minimal. Consistency in labeling test or beta releases can help users know what to expect regarding stability and support.

flutter/digit-ui-components/digit_components/coverage/lcov.info (1)

662-662: Congratulations on achieving 100% coverage for DigitButtonConstants.

All lines covered—no further suggestions here!

flutter/digit-ui-components/digit_components/README.md (13)

1-1: Title Enhancement
The updated title now includes an emoji which helps enhance brand identity and attract attention.


3-3: Clear and Informative Introduction
The revised introductory paragraph clearly states the purpose and scope of the library, listing the categories of UI components in a concise manner.


19-23: Screenshot Section Clarity
The "Screenshot" section with the embedded image and caption provides a visually engaging preview of the UI components. This is an effective way to immediately convey the look and feel of the package.


26-39: Quick Start Section Update
The revised Quick Start section offers clear, step-by-step instructions. The update to the dependency version (digit_ui_components: 0.2.0) is correctly reflected, ensuring users install the intended release.


41-46: Usage Guidance
The usage instructions, including the proper import statement, are concise and provide straightforward guidance for integrating the package into a Flutter project.


50-60: Features List Update
The features section clearly showcases the key capabilities of the library with checkmark icons for emphasis. This format helps users quickly grasp the breadth of components available.


63-67: Demo Section Inclusion
Including a direct link to a live demo is a great way to illustrate the components in action. The prompt encouraging users to consult detailed documentation further enhances user experience.


70-75: Documentation Section
The documentation section appropriately directs users to comprehensive guides and API references, ensuring that in-depth information is readily available.


78-88: Component Overview – Atoms
The Atoms section clearly categorizes basic UI elements. The list is well-organized and informative, providing a good initial framework for what the library offers.


100-100: Full Documentation Call-out
The note emphasizing a complete list of components with a link to full documentation is a helpful addition that encourages further exploration by the user.


104-113: Contributing Instructions
The contributing guidelines are clearly articulated, with step-by-step directions (including a code block for cloning the repository). This provides clear direction for potential contributors.


115-117: License Information
The license section clearly states that the project uses the MIT License and links to the full license text, which is important for user clarity on usage rights.


120-124: Marketplace Information
The marketplace section effectively guides users to both Pub.dev and the GitHub repository, ensuring they know where to find and evaluate the package.

flutter/digit-ui-components/digit_components/lib/widgets/atoms/digit_otp.dart (1)

7-85: LGTM! Well-documented widget with comprehensive customization options.

The widget properties are well-documented and provide extensive customization options for the OTP input fields.

flutter/digit-ui-components/digit_components/lib/theme/typography.dart (1)

87-88: LGTM! Good typography improvements.

The addition of consistent line heights (1.14 for headings/labels and 1.37 for body text) and standardization of font family to 'Roboto' improves typography consistency across the application.

Also applies to: 93-94, 99-100, 105-106, 111-112, 117-119, 123-125, 129-131, 135-136, 141-142, 147-148

flutter/digit-ui-components/digit_components/lib/widgets/atoms/digit_checkbox_icon.dart (2)

17-25: Great addition of the flexible theme-based property.

Introducing checkboxThemeData and making it optional is a neat way to override the default styling. This enhances reusability and consistency across the UI library by allowing external code to provide different theme values if needed.


31-34: Ensure a graceful fallback when the theme extension is not provided.

Relying on both checkboxThemeData (via the constructor) and the theme.extension<DigitCheckboxThemeData>() is solid. However, if the extension is missing or not set at runtime, forced unwrap operators (!) later can lead to runtime exceptions. Consider adding guards or safer defaults in the theme data.

flutter/digit-ui-components/digit_components/lib/services/location_bloc.dart (3)

93-128: Validate partial permissions and handle errors more gracefully.
Although the code checks permissions and services systematically, consider adding user feedback when these checks fail to help diagnose issues and guide users to enable permissions or services.


151-172: Confirm retry defaults match usage.
You have different default retry values (5 for load vs. 1 for permission). Ensure these defaults are consistent with your intended user flow.


174-191: Overall state structure appears clean and well-defined.
The arrangement of fields and the latLngString getter look good and are straightforward.

flutter/digit-ui-components/digit_components/lib/services/TimeSelectionBloc.dart (1)

5-33: Looks good with straightforward usage.
The selectTime method properly updates the controller and handles optional callbacks. Using MediaQuery to toggle 24-hour format is neat. No major concerns.

flutter/digit-ui-components/digit_components/lib/services/DateSelection.dart (1)

5-28: LGTM! Well-structured date selection implementation.

The function is well-designed with proper handling of optional parameters, null safety, and custom date formatting.

flutter/digit-ui-components/digit_components/lib/widgets/atoms/digit_location_form_input.dart (3)

1-14: LGTM! Clear and helpful documentation.

The documentation provides a comprehensive example that demonstrates the widget's usage.


23-64: LGTM! Well-structured constructor with proper parameter handling.

The constructor is well-designed with appropriate default values and proper inheritance implementation.


74-76: LGTM! Proper location fetching implementation.

The function correctly delegates location fetching to the locationBloc.

flutter/digit-ui-components/digit_components/lib/widgets/atoms/digit_date_form_input.dart (3)

1-14: LGTM! Clear and helpful documentation.

The documentation provides a comprehensive example that demonstrates the widget's usage.


23-74: LGTM! Well-structured constructor with proper parameter handling.

The constructor is well-designed with appropriate default values and proper inheritance implementation.


84-97: LGTM! Proper date selection implementation.

The function correctly delegates date selection to the dateSelectionBloc with all necessary parameters.

flutter/digit-ui-components/digit_components/lib/services/location_bloc.freezed.dart (1)

1-1116: Skip review of generated code.

This is an auto-generated file by the Freezed package. No review needed.

flutter/digit-ui-components/digit_components/lib/widgets/atoms/digit_radio_list.dart (2)

1-16: Good documentation and usage example.
The doc comments and example usage are clear and helpful. Users can easily refer to this snippet to understand the widget’s capabilities.


229-254: Validate callback usage.
widget.onChanged!(DigitButton) implies onChanged is non-null, yet the code uses the null assertion operator (!). Consider enforcing a required callback or validating it prior to usage.

Also applies to: 260-261

flutter/digit-ui-components/digit_components/lib/theme/ComponentTheme/radio_list_theme.dart (2)

6-15: Well-structured theme extension.
Having a dedicated DigitRadioListThemeData class is a neat approach for theming. It neatly encapsulates the styling properties for radio lists.


66-81: Robust interpolation.
lerp logic is nicely implemented. Be sure to handle edge cases when dealing with partial or null theme data in the future.

flutter/digit-ui-components/digit_components/.flutter-plugins (2)

2-5:

❓ Verification inconclusive

Verify camera plugin compatibility across platforms.

The camera plugin (v0.11.0+2) and its platform-specific implementations are relatively old versions. The latest versions offer improved stability and features.


🌐 Web query:

What is the latest version of the Flutter camera plugin?

💡 Result:

The latest version of the Flutter camera plugin as of February 2025 is 0.11.1, released with updates including:

  • Added API support for image streaming[2]
  • Updated minimum supported SDK requirements to Flutter 3.27/Dart 3.6[2]
  • Migrated Android implementation to CameraX for better device compatibility[2]

This follows major updates in recent versions like:

  • Video FPS/bitrate control (0.10.6)[2]
  • Web support via camera_web (0.9.4)[2]
  • Pause/resume video recording (0.5.4)[2]

The package maintains active development with Good maintenance status and Dart 3 compatibility[1][10]. Developers should reference the official pub.dev changelog for real-time updates[2].

Citations:


Camera Plugin Version Update & Compatibility Verification

  • The .flutter-plugins file shows the camera plugin at version 0.11.0+2, whereas the latest version as of February 2025 is 0.11.1.
  • The update to 0.11.1 includes enhancements such as improved API support for image streaming, updated minimum SDK requirements, and a refreshed Android (CameraX) implementation.
  • Please verify that upgrading to the latest version maintains compatibility across all platforms (Android, iOS, and web) and does not introduce regressions.
  • Also, ensure that the platform-specific implementations (i.e., camera_android_camerax, camera_avfoundation, and camera_web) are aligned with your project requirements.

13-13:

❓ Verification inconclusive

Verify compatibility of location-related plugins.

The versions of fluttertoast (8.2.5), geolocator_android (4.6.1), and geolocator_apple (2.3.7) should be verified for compatibility with each other and the Flutter version.

Also applies to: 15-16


🌐 Web query:

What are the latest versions of fluttertoast and geolocator plugins for Flutter?

💡 Result:

The latest versions of the Flutter plugins are as follows:

fluttertoast

  • Latest Version: 8.2.12 (stable)
  • Features:
    • Supports Android, iOS, and Web platforms[4][7].
    • Offers two types of toasts: one requiring BuildContext (full UI control) and one without context (limited features)[4].
    • Includes queuing functionality and cancellation via Fluttertoast.cancel()[1][4].

geolocator

  • Latest Version: 13.0.2 (stable)
  • Features:
    • Cross-platform support (Android, iOS, macOS, Web, Windows)[2][6].
    • Key functionalities: last known location retrieval, real-time updates, distance/bearing calculations between coordinates[2][5].
    • Requires Flutter SDK ≥2.8.0 and Dart SDK ≥2.15.0[6].

For installation:

dependencies:
  fluttertoast: ^8.2.12
  geolocator: ^13.0.2

Run flutter pub get after updating your pubspec.yaml. Both packages are actively maintained and widely used in production apps[6][10].

Citations:


Action Required: Verify and Consider Upgrading Location-Related Plugins

The current entries in the .flutter-plugins file are:

  • fluttertoast: 8.2.5 (latest stable is 8.2.12)
  • geolocator plugins: geolocator_android at 4.6.1 and geolocator_apple at 2.3.7 (note that the unified geolocator package is now at 13.0.2)

Please verify that these version selections are fully compatible with your Flutter SDK. If there are no breaking changes, it might be beneficial to update to the latest versions (or explicitly document why the current versions remain pinned). This review applies to lines 13 and 15–16.

flutter/digit-ui-components/digit_components/.flutter-plugins-dependencies (1)

1-1:

❓ Verification inconclusive

Review Flutter version compatibility.

The dependency graph is generated with Flutter version 3.22.2. Ensure all plugins are compatible with this version.


🌐 Web query:

What is the latest stable version of Flutter and are there any known plugin compatibility issues?

💡 Result:

The latest stable version of Flutter as of February 2025 is 3.29.0, according to official release notes[4][9]. This follows earlier releases like 3.27 (December 2024) and 3.24 (August 2024)[3][9].

Known plugin compatibility issues:

  1. JetBrains IDE Plugin Incompatibility
    The Flutter plugin v81.0.2 has compatibility issues with JetBrains IDEs (Android Studio/IntelliJ) versions newer than 2024.1[2][6]. Developers either need to:

    • Downgrade their IDE to 2024.1 temporarily
    • Wait for an updated plugin version supporting IDE builds ≥2024.2
  2. Gradle Compatibility Challenges
    Multiple reports indicate issues when migrating to newer Gradle versions[5][10]:

    • Requires Gradle versions between 7.3-7.6.1 for Java compatibility
    • Solutions include:
      ./gradlew wrapper --gradle-version=7.6.1
      • Using Android Studio's AGP Upgrade Assistant
      • Configuring Java JDK paths explicitly via flutter config --jdk-dir

Recent improvements addressing compatibility:

  • Enhanced desktop support (Windows/macOS/Linux)[1][7]
  • Better web performance approaching native capabilities[1]
  • Updated Material 3 components and design system[8][9]
  • Swift Package Manager support for iOS (though plugins still use CocoaPods)[9]

Developers should monitor:

  • The Flutter breaking changes page[8] for migration guides
  • JetBrains plugin updates for IDE compatibility resolutions[2][6]
  • Official documentation's "What's new" section[9] for latest toolchain requirements

Citations:


Review Flutter Version Compatibility & Plugin Check

  • The dependency graph in .flutter-plugins-dependencies was generated using Flutter 3.22.2. However, the latest stable release as of February 2025 is Flutter 3.29.0.
  • Please verify that all the plugins listed (e.g., camera, file_picker, fluttertoast, geolocator, image_picker, location, path_provider, url_launcher, etc.) are fully compatible with Flutter 3.22.2.
  • If your environment is being updated or if you plan to use the latest stable version (3.29.0), double-check for any known compatibility issues—particularly related to Gradle requirements and JetBrains IDE plugin compatibility—as highlighted by current release notes.
  • Adjustments in dependency configurations might be required depending on whether you stay with 3.22.2 or upgrade to 3.29.0.
flutter/digit-ui-components/digit_components/lib/widgets/atoms/digit_info_card.dart (3)

1-16: Good use of doc comments and usage example.
They clearly demonstrate how to instantiate the InfoCard, which improves discoverability for new developers.


69-74: Validate return value of convertInToSentenceCase(description)!.
If convertInToSentenceCase potentially returns null for edge cases (e.g., empty strings or invalid input), force-unwrapping could cause runtime exceptions. Ensure that it always returns a non-null value or add a safety check.


102-109: Refine border widths for consistency.
The border widths differ between themeData.borderWidth and theme.spacerTheme.spacer1, which may create asymmetric edges. Confirm if this visual effect is intentional.

flutter/digit-ui-components/digit_components/lib/widgets/atoms/digit_button.dart (3)

1-4: Helpful introductory doc comments.
They summarize the widget’s purpose and usage scenarios, improving maintainability and context for other contributors.


60-77: Constructor alignment with new naming conventions.
Renaming from Button to DigitButton aligns well with the project’s naming scheme. Confirm that references throughout the codebase have also been updated.


256-265: Re-examine truncation limit of 64 characters.
This arbitrary cap may disrupt intended button labels in certain contexts. If it’s purely aesthetic, consider making the truncation length configurable or define a rationale in comments.

flutter/digit-ui-components/digit_components/lib/utils/utils.dart (2)

68-74: LGTM!

The function is simple, efficient, and handles the edge cases correctly.


38-54: ⚠️ Potential issue

Add empty string check before substring operation.

Similar to the previous function, this could crash when a word is empty but passes the isNotEmpty check.

 for (String word in words) {
   if (word.isNotEmpty) {
-    String capitalizedWord =
-        word[0].toUpperCase() + word.substring(1).toLowerCase();
+    String capitalizedWord = word.isEmpty 
+        ? "" 
+        : word[0].toUpperCase() + word.substring(1).toLowerCase();
     capitalizedWords.add(capitalizedWord);
   }
 }

Likely an incorrect or invalid review comment.

flutter/digit-ui-components/digit_components/lib/theme/ComponentTheme/back_button_theme.dart (3)

6-21: LGTM! Well-structured theme data class.

The class follows Flutter's theming patterns with nullable properties allowing for flexible customization.


55-77: LGTM! Robust copyWith implementation.

The implementation correctly handles the context parameter and falls back to default theme values when needed.


79-94: LGTM! Proper lerp implementation.

The lerp method correctly interpolates between theme instances for smooth transitions.

flutter/digit-ui-components/digit_components/lib/theme/ComponentTheme/checkbox_theme.dart (1)

5-31: LGTM! Well-structured checkbox theme data.

The class provides comprehensive theming options for checkbox components.

flutter/digit-ui-components/digit_components/lib/widgets/atoms/digit_chip.dart (1)

7-29: LGTM! Well-structured widget class.

The widget provides good customization options and follows Flutter's widget patterns.

flutter/digit-ui-components/digit_components/lib/theme/digit_theme.dart (3)

16-48: LGTM! Typography changes are well-structured.

The typography implementation is consistent across tab, desktop, and mobile variants, with proper font family and color definitions.


52-181: Verify color contrast ratios for accessibility.

The color scheme changes look good, but we should verify the color contrast ratios meet WCAG accessibility guidelines, especially for:

  • Text selection colors (primary1 and primary1Bg)
  • Button colors (primary1 and paperPrimary)
#!/usr/bin/env python3
from colorsys import rgb_to_hls
import re

def get_contrast_ratio(color1, color2):
    # Convert hex to RGB
    r1, g1, b1 = int(color1[1:3], 16), int(color1[3:5], 16), int(color1[5:7], 16)
    r2, g2, b2 = int(color2[1:3], 16), int(color2[3:5], 16), int(color2[5:7], 16)
    
    # Calculate relative luminance
    def get_luminance(r, g, b):
        r, g, b = r/255, g/255, b/255
        r = r/12.92 if r <= 0.03928 else ((r+0.055)/1.055) ** 2.4
        g = g/12.92 if g <= 0.03928 else ((g+0.055)/1.055) ** 2.4
        b = b/12.92 if b <= 0.03928 else ((b+0.055)/1.055) ** 2.4
        return 0.2126 * r + 0.7152 * g + 0.0722 * b
    
    l1, l2 = get_luminance(r1, g1, b1), get_luminance(r2, g2, b2)
    ratio = (max(l1, l2) + 0.05) / (min(l1, l2) + 0.05)
    return ratio

# Search for color definitions
colors = {}
with open('lib/theme/colors.dart', 'r') as f:
    content = f.read()
    color_matches = re.finditer(r'static const Color (\w+) = Color\((0x[A-Fa-f0-9]+)\)', content)
    for match in color_matches:
        colors[match.group(1)] = '#' + match.group(2)[4:]

# Check contrast ratios
critical_pairs = [
    ('primary1', 'primary1Bg'),
    ('primary1', 'paperPrimary')
]

for color1, color2 in critical_pairs:
    if color1 in colors and color2 in colors:
        ratio = get_contrast_ratio(colors[color1], colors[color2])
        print(f"Contrast ratio between {color1} and {color2}: {ratio:.2f}")
        print(f"Meets WCAG AA for large text: {ratio >= 3.0}")
        print(f"Meets WCAG AA for normal text: {ratio >= 4.5}")

183-318: LGTM! Theme changes are consistent.

The button, input, and dialog themes have been properly updated with consistent naming and styling.

flutter/digit-ui-components/digit_components/lib/widgets/atoms/digit_base_form_input.dart (20)

2-6: Imports are appropriate and pose no immediate concerns.
These added imports (digit_extended_theme, flutter_svg, and local utils) align with the new functionalities (e.g., extended theming and SVG usage). No issues found with versioning or paths.


13-13: Nullable controller usage properly handled.
Switching to TextEditingController? is correctly paired with the fallback initialization in the state (_controller = widget.controller ?? TextEditingController();). This approach avoids null reference errors.


27-28: Introduction of maxLength appears consistent.
Defining final int? maxLength; broadens flexibility for text inputs. Verified it ties into line 341 for the actual max-length logic.


57-59: onFieldSubmitted callback extension looks good.
This addition provides a clean way to handle form submission logic without relying solely on onChanged.


89-90: obscureText addition is useful for password-like fields.
This property, alongside the isVisible toggle logic, cleanly handles typical password hide/show functionality.


95-96: Optional keyboardType allows flexible input configurations.
Expanding from text-only to other input types (e.g., numeric) helps reusability. This also looks in harmony with read-only logic at lines 497-499.


102-105: focusNode and suffixTextStyle integration appear correct.
The nullable focusNode is handled gracefully, and the optional suffix text style complements the recently introduced text style properties. No issues spotted.


116-117: cancelText and confirmText expand UI flexibility.
These likely help date or dialog flows. Confirm consistent usage with any date-picking or confirmation dialogs in the codebase.


201-205: Added internal state fields for height, width, and controller.
These facilitate dynamic sizing (_height) and flexible layout (width, minWidth) in one place. The late final TextEditingController _controller; also ensures a consistent, single source of truth. This is well-structured.


213-217: onFocusLost callback integration is straightforward and beneficial.
This ensures external logic can respond to focus changes while reusing the existing validation flow.


241-241: Conditional creation of focusNode is correct.
This prevents accidentally disposing of user-provided FocusNodes. A solid pattern for reusing references or cleaning up local ones.


244-244: Conditional controller instantiation is tidy.
Same pattern as focusNode. Properly prevents disposing user-supplied controllers.


247-248: initialValue is assigned to the controller upon init.
This ensures the field starts with the expected data. Make sure that if the widget is re-used or re-built with different initial values, the logic in didUpdateWidget picks up changes (lines 260-264).


257-259: didUpdateWidget override is minimal but valid.
Calls super and sets up for future expansions. No immediate issues.


260-264: Updating _controller.text when initialValue changes.
This ensures the widget reacts to external changes in props. Good approach for dynamic input.


270-272: Disposing _controller only if locally owned.
This pattern prevents disposing user-supplied controllers. Correct resource management.


274-276: Disposing myFocusNode only if locally owned.
Mirrors the _controller disposal logic, avoiding double-disposal of externally provided nodes.


281-281: Safe fallback for validations array.
final List<Validator> allValidations = widget.validations ?? [] ensures no null pointer issues.


322-322: Context-based theme extraction with digitTextTheme.
Encapsulates styling logic in a consistent theme extension. No issues.


328-328: Similar capitalization for errorMessage.
Consistent with the approach for innerLabel and helpText.

flutter/digit-ui-components/digit_components/lib/widgets/atoms/digit_multiselect_dropdown.dart (6)

33-33: New import addition looks good.
No concerns regarding importing checkbox_theme.dart.


37-37: Import of utils.dart is fine.
No issues found.


39-39: Import of digit_chip.dart is fine.
No remarks here.


111-112: Verify _options initialization.
Declared as late, _options must be set before use to avoid runtime errors. While it's assigned in _initialize(), ensure _initialize() always runs during initState (or re-runs if needed in other scenarios).


124-125: New focus nodes for search are fine.
The addition of _searchController and _searchFocusNode looks consistent with the new search feature.


602-603: Deselection logic appears consistent.
When already selected, the code removes the chosen option. This is aligned with the multi-select behavior.

@jagankumar-egov jagankumar-egov merged commit dd055d1 into master Feb 20, 2025
1 check passed
@rachana-egov rachana-egov deleted the ui_components_0.2.0 branch February 20, 2025 11:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants