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

System theme support #1

Merged
merged 16 commits into from
Nov 9, 2023
Merged

System theme support #1

merged 16 commits into from
Nov 9, 2023

Commits on Oct 23, 2023

  1. chore: Tidy, reorganise and prepare repo

    docs: update changelog and documentation
    
    feat(type): Add xSmall and conform to latest figma designs.
    thelukewalton authored and ps9310 committed Oct 23, 2023
    Configuration menu
    Copy the full SHA
    ea4082c View commit details
    Browse the repository at this point in the history
  2. "Refactored the ZetaColors class for better customization

    The ZetaColors class was heavily refactored for better customization of variables such as brightness, contrast, color swatches, and additional color attributes. Several fields were made final for the overall class safety. This change improves color control on different themes for the application."
    ps9310 committed Oct 23, 2023
    Configuration menu
    Copy the full SHA
    c2b936d View commit details
    Browse the repository at this point in the history
  3. "Updated the ZetaColor and Theme setup to use InheritedWidget

    The ZetaDefaults class was updated to Zeta inheriting from InheritedWidget. This change allows easy access to the Zeta theme settings (contrast, theme mode, theme data, color set) from anywhere in the widget tree. The ZetaAppBuilder function was updated to take in ThemeData and ThemeMode. The ZetaProvider was added to provide Zeta theming and contrast data down the widget tree. The code for the color and typography examples was adjusted to use the new Zeta context extension, instead of using Theme.of(context) to get colorScheme. This change was crucial to simplify the process of adapting the application visuals to different themes."
    ps9310 committed Oct 23, 2023
    Configuration menu
    Copy the full SHA
    42c2796 View commit details
    Browse the repository at this point in the history
  4. "Improve theme management functionality in Zeta

    Removed code concerning getting a color's RGB hex code from 'color_extensions.dart', as it was seldom used. Updated 'zeta_flutter.dart' to unhide ZetaColorGetters. Adaptations in 'zeta.dart' included switching mediaBrightness to _mediaBrightness for internal use and adding methods for accurate determination of color set and brightness settings based on the theme mode. Also, ZetaProvider was updated for 'system' theme mode support. example/lib/main.dart and example/lib/widgets.dart were updated to support these changes, including UI updates for seamless theme switching."
    ps9310 committed Oct 23, 2023
    Configuration menu
    Copy the full SHA
    4c7aff8 View commit details
    Browse the repository at this point in the history
  5. "Add theme update function and extend ZetaColorGetters

    Implemented a method in 'zeta.dart' to support updating the current theme data dynamically. Extended 'color_scheme.dart' by introducing _ZetaColorProperties and updating ZetaColorGetters. These changes increase flexibility for theme management and provide a structured and accessible way to get Zeta colors through the theme context."
    ps9310 committed Oct 23, 2023
    Configuration menu
    Copy the full SHA
    855abe0 View commit details
    Browse the repository at this point in the history
  6. Remove theme_extensions.dart and move contents to colors.dart

    Theme extensions were deleted and its contents were moved to colors.dart to consolidate all color-related codes in one file for easier navigation and editing. Additional enhancements include optimizing color assignments and making ZetaColors immutable for more robust color management.
    ps9310 committed Oct 23, 2023
    Configuration menu
    Copy the full SHA
    ef67857 View commit details
    Browse the repository at this point in the history
  7. Refactor code for color theme and add theme switcher

    Refactored codebase to improve the color theme handling: relocated theme related methods to colors.dart from theme_extensions.dart for consolidated color theme data. Optimized color assignments by leveraging the 'copyWith' method, allowing more efficient color management. Introduced the immutability of ZetaColors to enhance robustness. Bumped version in pubspec.yaml to 0.0.1+13 due to these changes. Renamed theme.dart to theme_data.dart for more semantic file naming. Added 'identifier' to the ZetaThemeData for easier theme identification.
    The visible application change is an added ThemeSwitcher in the example app, offering a UI to switch between different predefined themes.
    ps9310 committed Oct 23, 2023
    Configuration menu
    Copy the full SHA
    76ac5a4 View commit details
    Browse the repository at this point in the history
  8. Add ZetaThemeService and theme switcher in example app

    Implemented ZetaThemeService as an abstract class, providing structure for loading and saving themes within the app. Removed an obsolete comment within the contrast.dart and made necessary imports in zeta.dart. Asynchronous theme loading is added during app startup and saving is done upon theme updates. Also, for user-interaction, an exclusive ThemeSwitcher widget is added in the example app allowing users to select between available themes. This improves user experience, and optimizes theme handling and application performance.
    ps9310 committed Oct 23, 2023
    Configuration menu
    Copy the full SHA
    7d72a9e View commit details
    Browse the repository at this point in the history
  9. Refactor color swatch generation to utilize zeta

    Refactored color swatch generation in color_example.dart to use Zeta instead of directly using the Theme. Now the brightness for ZetaColorSwatch is being pulled from zeta object rather than theme. This ensures consistency across different parts of the application where Zeta is used. Also changed theme.colorScheme.surface to colors.surfacePrimary for better readability, and alignment with use of zeta object.
    ps9310 committed Oct 23, 2023
    Configuration menu
    Copy the full SHA
    66ad6be View commit details
    Browse the repository at this point in the history
  10. Add icon colors to color scheme

    Extended the color scheme in colors.dart to include default, subtle, disabled, and inverse icon colors. These were added to ensure consistent icon colors across the application and support dark mode by allowing inverted color swatches.
    ps9310 committed Oct 23, 2023
    Configuration menu
    Copy the full SHA
    4b37f1d View commit details
    Browse the repository at this point in the history
  11. Refactor theme switch settings and add new features

    Renamed 'theme_switch.dart' to 'theme_color_switch.dart' and added two new files 'theme_contrast_switch.dart' and 'theme_mode_switch.dart' in order to separate the theme settings logically into distinct features - Theme Color Switch, Theme Contrast Switch and Theme Mode Switch respectively. Also, the theme application feature has been refactored within 'widgets.dart' to use the newly created theme features instead of the old theme switch. This enhances modularity and the user's ability to switch theme settings easily.
    ps9310 committed Oct 23, 2023
    Configuration menu
    Copy the full SHA
    c0bfd26 View commit details
    Browse the repository at this point in the history

Commits on Oct 24, 2023

  1. Update method naming for consistent architecture in text.dart

    Changed the method name 'withColor' to 'themeWithColor' in text.dart for consistency with other part of the architecture and for better readability. This change supports the shift towards a consistently designed application architecture and helps developers easily decipher the role of the method in the code.
    ps9310 committed Oct 24, 2023
    Configuration menu
    Copy the full SHA
    75da56b View commit details
    Browse the repository at this point in the history

Commits on Oct 27, 2023

  1. Update color scheme mapping and library version in colors.dart and pu…

    …bspec.lock
    
    Refined the color mapping in ZetaColorScheme in colors.dart by replacing effectiveSurfaceTertiary with textDefault, enhancing the clarity of backdrop's color role. Concurrently, version of multiple dependencies in pubspec.lock are updated to benefit from recent fixes and improvements in those libraries.
    ps9310 committed Oct 27, 2023
    Configuration menu
    Copy the full SHA
    f3da228 View commit details
    Browse the repository at this point in the history
  2. Change Color to ZetaColorSwatch in theme files

    Adjusted the class references in colors.dart from `Color` to `ZetaColorSwatch` to provide a more consistent color swatch across the app. The swatch allows for more flexibility in using color variations. Adjustments were also made in color_scheme.dart and color_swatch.dart to include better explanatory messages and use standard dart documentation format. Changes in custom_docs/components/Color/flutter.md were made to align with these updates.
    ps9310 committed Oct 27, 2023
    Configuration menu
    Copy the full SHA
    d58de78 View commit details
    Browse the repository at this point in the history

Commits on Oct 31, 2023

  1. Enhance contrast and color handling in theme files

    Removed 'flutter.md' as it is no longer required due to improvements made in contrast and color handling. For better accessibility support, 'contrast.dart' was refactored for better contrast handling and 'color_extensions.dart' now includes a mechanism to generate color swatch based on contrast ratio. Also, 'zeta.dart' was updated to adapt to the system's brightness providing better user experience. Overall, these adjustments aim to enhance accessibility and user experience, apart from simplifying the codebase.
    ps9310 committed Oct 31, 2023
    Configuration menu
    Copy the full SHA
    2fae0c1 View commit details
    Browse the repository at this point in the history

Commits on Nov 1, 2023

  1. Add LICENSE-3RD-PARTY for third-party libraries

    Introduced license details for third-party libraries used in the project. MIT license applies to 'tinycolor' and SIL Open Font License applies to 'IBMPlexSans'. This ensures proper acknowledgement and licensure compliance for used third-party resources.
    ps9310 committed Nov 1, 2023
    Configuration menu
    Copy the full SHA
    72b0c0b View commit details
    Browse the repository at this point in the history