Skip to content

SystemUiOverlayStyle, add two examples and improve documentation#122187

Merged
auto-submit[bot] merged 1 commit intoflutter:masterfrom
NevercodeHQ:improve_SystemUiOverlayStyle_documentation
Mar 8, 2023
Merged

SystemUiOverlayStyle, add two examples and improve documentation#122187
auto-submit[bot] merged 1 commit intoflutter:masterfrom
NevercodeHQ:improve_SystemUiOverlayStyle_documentation

Conversation

@bleroux
Copy link
Contributor

@bleroux bleroux commented Mar 8, 2023

Description

This PR updates some SystemUiOverlayStyle related documentation and adds two examples to demonstrate declarative alternatives for SystemChrome.setSystemUIOverlayStyle.

Related Issue

Fixes #24893.

Tests

Adds 2 tests, one for each new example.

@flutter-dashboard flutter-dashboard bot added d: api docs Issues with https://api.flutter.dev/ d: examples Sample code and demos documentation f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels. c: contributor-productivity Team-specific productivity, code health, technical debt. labels Mar 8, 2023
Copy link
Contributor

Choose a reason for hiding this comment

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

In both of these, do you feel it is worth mentioning whether one will override the other? If a developer uses both with different colors for example, what happens to the status bar?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's a good point but there are several possible combinations (depending on where the AnnotatedRegion is placed). Existing AppBar.setSystemUIOverlayStyle documentation avoid this question by stating: "Apps should not enclose an AppBar with their own [AnnotatedRegion]" (this is above the see also section I updated).

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// Flutter code sample for [SystemChrome.setSystemUIOverlayStyle].
// Flutter code sample for [AppBar.systemOverlayStyle].

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
void main() => runApp(const SystemOverlayStyleApp());
// Flutter code sample for setting the [SystemUiOverlayStyle] with an [AnnotatedRegion].
void main() => runApp(const SystemOverlayStyleApp());

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Did you mean to replace the comment on line 5 with this new one?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For the moment, I updated the PR and put this comment on line 5.

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh yes that is what I meant, sorry. Thanks!

@bleroux bleroux force-pushed the improve_SystemUiOverlayStyle_documentation branch from 42881dd to 293f50e Compare March 8, 2023 19:24
@bleroux bleroux requested a review from Piinks March 8, 2023 20:23
Copy link
Contributor

@Piinks Piinks left a comment

Choose a reason for hiding this comment

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

Flutter_LGTM

@Piinks Piinks added the autosubmit Merge PR when tree becomes green via auto submit App label Mar 8, 2023
@auto-submit auto-submit bot merged commit a5ed960 into flutter:master Mar 8, 2023
@bleroux bleroux deleted the improve_SystemUiOverlayStyle_documentation branch March 8, 2023 20:41
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 9, 2023
hannah-hyj pushed a commit to hannah-hyj/flutter that referenced this pull request Mar 11, 2023
…#122187)

SystemUiOverlayStyle, add two examples and improve documentation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App c: contributor-productivity Team-specific productivity, code health, technical debt. d: api docs Issues with https://api.flutter.dev/ d: examples Sample code and demos f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Document how to use AnnotatedRegion to correctly set system ui color

2 participants