Skip to content

Commit

Permalink
fix: Added the ability to explicitly change the color of the status bar.
Browse files Browse the repository at this point in the history
  • Loading branch information
mathrunet committed Oct 3, 2023
1 parent 57d66b7 commit 2ccaeff
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 21 deletions.
8 changes: 4 additions & 4 deletions packages/katana_theme/example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -337,28 +337,28 @@ packages:
path: "../../katana"
relative: true
source: path
version: "2.4.1"
version: "2.4.2"
katana_theme:
dependency: "direct main"
description:
path: ".."
relative: true
source: path
version: "2.0.22"
version: "2.0.24"
katana_theme_annotation:
dependency: "direct overridden"
description:
path: "../../katana_theme_annotation"
relative: true
source: path
version: "2.0.16"
version: "2.0.17"
katana_theme_builder:
dependency: "direct dev"
description:
path: "../../katana_theme_builder"
relative: true
source: path
version: "2.0.20"
version: "2.0.21"
lints:
dependency: transitive
description:
Expand Down
40 changes: 36 additions & 4 deletions packages/katana_theme/lib/src/app_theme_data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,8 @@ class AppThemeData {
this.platform = TargetPlatform.iOS,
this.centerTitleOnAppBar,
Brightness brightness = Brightness.light,
this.statusBarBrightnessOnIOS,
this.statusBarBrightnessOnAndroid,
this.fixed = false,
}) : _lightColor = brightness == Brightness.light
? ColorThemeData._(
Expand Down Expand Up @@ -642,6 +644,8 @@ class AppThemeData {
bool useMaterial3 = true,
TargetPlatform platform = TargetPlatform.iOS,
bool? centerTitleOnAppBar,
Brightness? statusBarBrightnessOnIOS,
Brightness? statusBarBrightnessOnAndroid,
bool fixed = false,
}) : this(
primary: primary,
Expand Down Expand Up @@ -741,6 +745,8 @@ class AppThemeData {
centerTitleOnAppBar: centerTitleOnAppBar,
brightness: Brightness.light,
fixed: fixed,
statusBarBrightnessOnIOS: statusBarBrightnessOnIOS,
statusBarBrightnessOnAndroid: statusBarBrightnessOnAndroid,
themeMode: themeMode,
);

Expand Down Expand Up @@ -909,6 +915,8 @@ class AppThemeData {
bool useMaterial3 = true,
TargetPlatform platform = TargetPlatform.iOS,
bool? centerTitleOnAppBar,
Brightness? statusBarBrightnessOnIOS,
Brightness? statusBarBrightnessOnAndroid,
bool fixed = false,
}) : this(
primary: primary,
Expand Down Expand Up @@ -1008,6 +1016,8 @@ class AppThemeData {
centerTitleOnAppBar: centerTitleOnAppBar,
brightness: Brightness.dark,
fixed: fixed,
statusBarBrightnessOnIOS: statusBarBrightnessOnIOS,
statusBarBrightnessOnAndroid: statusBarBrightnessOnAndroid,
themeMode: themeMode,
);

Expand Down Expand Up @@ -1174,6 +1184,24 @@ class AppThemeData {
/// `true`の場合、ライトモードやダークモードの切り替えを行わず、常に同じテーマを使用します。
final bool fixed;

/// Explicitly specifies the color of the status bar icon.
///
/// Black for [Brightness.dark] and white for [Brightness.light].
///
/// ステータスバーのアイコンの色を明示的に指定します。
///
/// [Brightness.dark]の場合は黒、[Brightness.light]の場合は白になります。
final Brightness? statusBarBrightnessOnIOS;

/// Explicitly specifies the color of the status bar icon.
///
/// Black for [Brightness.dark] and white for [Brightness.light].
///
/// ステータスバーのアイコンの色を明示的に指定します。
///
/// [Brightness.dark]の場合は黒、[Brightness.light]の場合は白になります。
final Brightness? statusBarBrightnessOnAndroid;

/// Get [AppThemeData] placed on the widget tree.
///
/// ウィジェットツリー上に配置されている[AppThemeData]を取得します。
Expand Down Expand Up @@ -1314,9 +1342,11 @@ class AppThemeData {
) ??
IconThemeData(color: appBarForegroundColor),
systemOverlayStyle: SystemUiOverlayStyle(
systemNavigationBarIconBrightness: Brightness.dark,
systemNavigationBarIconBrightness:
statusBarBrightnessOnIOS ?? Brightness.dark,
statusBarBrightness: Brightness.dark,
statusBarIconBrightness: Brightness.light,
statusBarIconBrightness:
statusBarBrightnessOnAndroid ?? Brightness.light,
),
),
dialogBackgroundColor: color.dialogColor ?? color.surface,
Expand Down Expand Up @@ -1534,9 +1564,11 @@ class AppThemeData {
) ??
IconThemeData(color: appBarForegroundColor),
systemOverlayStyle: SystemUiOverlayStyle(
systemNavigationBarIconBrightness: Brightness.light,
systemNavigationBarIconBrightness:
statusBarBrightnessOnIOS ?? Brightness.light,
statusBarBrightness: Brightness.light,
statusBarIconBrightness: Brightness.dark,
statusBarIconBrightness:
statusBarBrightnessOnAndroid ?? Brightness.dark,
),
),
dialogBackgroundColor: color.dialogColor ?? color.surface,
Expand Down
22 changes: 11 additions & 11 deletions packages/katana_theme_annotation/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ packages:
dependency: transitive
description:
name: _fe_analyzer_shared
sha256: "58826e40314219b223f4723dd4205845040161cdc2df3e6a1cdceed5d8165084"
sha256: eb376e9acf6938204f90eb3b1f00b578640d3188b4c8a8ec054f9f479af8d051
url: "https://pub.dev"
source: hosted
version: "63.0.0"
version: "64.0.0"
analyzer:
dependency: transitive
description:
name: analyzer
sha256: f85566ec7b3d25cbea60f7dd4f157c5025f2f19233ca4feeed33b616c78a26a3
sha256: "69f54f967773f6c26c7dcb13e93d7ccee8b17a641689da39e878d5cf13b06893"
url: "https://pub.dev"
source: hosted
version: "6.1.0"
version: "6.2.0"
args:
dependency: transitive
description:
Expand Down Expand Up @@ -191,7 +191,7 @@ packages:
path: "../katana"
relative: true
source: path
version: "2.3.3"
version: "2.4.2"
lints:
dependency: transitive
description:
Expand Down Expand Up @@ -388,10 +388,10 @@ packages:
dependency: "direct dev"
description:
name: test
sha256: b9a384c4b9c4966dbf7215e7c033a78db1da7e5dcaf8da9232c5f24735f65652
sha256: "9b0dd8e36af4a5b1569029949d50a52cb2a2a2fdaa20cebb96e6603b9ae241f9"
url: "https://pub.dev"
source: hosted
version: "1.24.5"
version: "1.24.6"
test_api:
dependency: transitive
description:
Expand All @@ -404,10 +404,10 @@ packages:
dependency: transitive
description:
name: test_core
sha256: c6a536288535efef8526eea8adfa4e25fdd2849fa7f457ecb2a52099998ce8f7
sha256: "4bef837e56375537055fdbbbf6dd458b1859881f4c7e6da936158f77d61ab265"
url: "https://pub.dev"
source: hosted
version: "0.5.5"
version: "0.5.6"
tint:
dependency: transitive
description:
Expand Down Expand Up @@ -436,10 +436,10 @@ packages:
dependency: transitive
description:
name: vm_service
sha256: "0fae432c85c4ea880b33b497d32824b97795b04cdaa74d270219572a1f50268d"
sha256: c538be99af830f478718b51630ec1b6bee5e74e52c8a802d328d9e71d35d2583
url: "https://pub.dev"
source: hosted
version: "11.9.0"
version: "11.10.0"
watcher:
dependency: transitive
description:
Expand Down
4 changes: 2 additions & 2 deletions packages/katana_theme_builder/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -239,14 +239,14 @@ packages:
path: "../katana"
relative: true
source: path
version: "2.4.1"
version: "2.4.2"
katana_theme_annotation:
dependency: "direct main"
description:
path: "../katana_theme_annotation"
relative: true
source: path
version: "2.0.16"
version: "2.0.17"
lints:
dependency: transitive
description:
Expand Down

0 comments on commit 2ccaeff

Please sign in to comment.