-
Notifications
You must be signed in to change notification settings - Fork 377
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
AppBar.system_overlay_style
prop (#2615)
* SystemOverlayStyle dataclass * parseSystemOverlayStyle * export PlaylistMode
- Loading branch information
1 parent
24b8004
commit e175224
Showing
4 changed files
with
76 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import 'dart:convert'; | ||
|
||
import 'package:flutter/material.dart'; | ||
import 'package:flutter/services.dart'; | ||
|
||
import '../models/control.dart'; | ||
import '../utils/numbers.dart'; | ||
import 'colors.dart'; | ||
|
||
SystemUiOverlayStyle? parseSystemOverlayStyle( | ||
ThemeData theme, Control control, String propName) { | ||
dynamic j; | ||
var v = control.attrString(propName, null); | ||
if (v == null) { | ||
return null; | ||
} | ||
j = json.decode(v); | ||
return overlayStyleFromJson(theme, j); | ||
} | ||
|
||
SystemUiOverlayStyle overlayStyleFromJson( | ||
ThemeData theme, Map<String, dynamic> json) { | ||
return SystemUiOverlayStyle( | ||
statusBarColor: json["status_bar_color"] != null | ||
? HexColor.fromString(theme, json["status_bar_color"] ?? "") | ||
: null, | ||
systemNavigationBarColor: json["system_navigation_bar_color"] != null | ||
? HexColor.fromString(theme, json["system_navigation_bar_color"] ?? "") | ||
: null, | ||
systemNavigationBarDividerColor: | ||
json["system_navigation_bar_divider_color"] != null | ||
? HexColor.fromString(theme, json["system_navigation_bar_divider_color"] ?? "") | ||
: null, | ||
systemStatusBarContrastEnforced: | ||
json["enforce_system_status_bar_contrast"] != null | ||
? parseBool(json["enforce_system_status_bar_contrast"]) | ||
: null, | ||
systemNavigationBarContrastEnforced: | ||
json["enforce_system_navigation_bar_contrast"] != null | ||
? parseBool(json["enforce_system_navigation_bar_contrast"]) | ||
: null, | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters