From e2e752a53165aa0c1d3eb8342ecf5d1c8b46aa86 Mon Sep 17 00:00:00 2001 From: basemosama Date: Tue, 1 Jul 2025 15:24:39 +0300 Subject: [PATCH 1/2] Fix: Remove `--fix` from `dart format` command in `publish.yml` The `dart format` command in the `publish.yml` workflow was updated to remove the `--fix` flag. The command will now only check for formatting issues and not automatically fix them. --- .github/workflows/publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 8eb8e1c..65e7f73 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -18,7 +18,7 @@ jobs: - name: Install dependencies run: flutter pub get - name: Format code - run: dart format --fix . + run: dart format . - name: Publish uses: k-paxian/dart-package-publisher@v1.5.1 with: From 0ef857e4380460c85f1d0493513b11a8f8352b9a Mon Sep 17 00:00:00 2001 From: basemosama Date: Tue, 1 Jul 2025 15:26:28 +0300 Subject: [PATCH 2/2] refactor: Code cleanup --- lib/src/config/config.dart | 2 +- lib/src/controller/controller.dart | 2 +- lib/src/playx_theme.dart | 4 ---- lib/src/utils/build_context_extension.dart | 5 +---- 4 files changed, 3 insertions(+), 10 deletions(-) diff --git a/lib/src/config/config.dart b/lib/src/config/config.dart index 4cb5304..0fdcc86 100644 --- a/lib/src/config/config.dart +++ b/lib/src/config/config.dart @@ -19,7 +19,7 @@ class PlayxThemeConfig { final bool migratePrefsToAsyncPrefs; /// Whether to log theme changes or not. - final bool logThemeChanges ; + final bool logThemeChanges; /// Creates a [PlayxThemeConfig] instance. /// diff --git a/lib/src/controller/controller.dart b/lib/src/controller/controller.dart index ef656e7..09ecee1 100644 --- a/lib/src/controller/controller.dart +++ b/lib/src/controller/controller.dart @@ -236,7 +236,7 @@ class XThemeController extends ValueNotifier { /// Throws an exception if the ID is not found. Future updateById( String id, { - PlayxThemeAnimation animation = const PlayxThemeAnimation.fade(), + PlayxThemeAnimation animation = const PlayxThemeAnimation.fade(), bool animate = true, bool forceUpdateNonAnimatedTheme = false, }) async { diff --git a/lib/src/playx_theme.dart b/lib/src/playx_theme.dart index a90ff43..f605227 100644 --- a/lib/src/playx_theme.dart +++ b/lib/src/playx_theme.dart @@ -1,9 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:playx_theme/src/config/config.dart'; import 'package:playx_theme/src/controller/controller.dart'; -import 'package:playx_theme/src/model/playx_colors.dart'; -import 'package:playx_theme/src/model/playx_theme_animation.dart'; -import 'package:playx_theme/src/model/x_theme.dart'; import '../playx_theme.dart'; diff --git a/lib/src/utils/build_context_extension.dart b/lib/src/utils/build_context_extension.dart index 62e24f9..c6f8148 100644 --- a/lib/src/utils/build_context_extension.dart +++ b/lib/src/utils/build_context_extension.dart @@ -1,4 +1,3 @@ -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:playx_theme/playx_theme.dart'; @@ -24,10 +23,8 @@ extension BuildContextExtension on BuildContext { return xTheme.themeData; } - /// Returns Whether the current theme is a dark theme. - bool get isDarkMode{ + bool get isDarkMode { return xTheme.isDark; } - }