Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
efbd6f60
Unverified
Commit
efbd6f60
authored
Sep 24, 2018
by
Michael Klimushyn
Committed by
GitHub
Sep 24, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update docs on various platform APIs (#22060)
parent
6014f29b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
6 deletions
+14
-6
platform.dart
packages/flutter/lib/src/foundation/platform.dart
+6
-5
theme_data.dart
packages/flutter/lib/src/material/theme_data.dart
+8
-1
No files found.
packages/flutter/lib/src/foundation/platform.dart
View file @
efbd6f60
...
...
@@ -25,11 +25,12 @@ enum TargetPlatform {
///
/// This is the default value of [ThemeData.platform] (hence the name). Widgets
/// from the material library should use [Theme.of] to determine the current
/// platform, rather than using [defaultTargetPlatform]. However, if there is
/// widget behavior that depends on the actual underlying platform (e.g. because
/// it is controlling data being sent to the platform APIs, not just trying to
/// follow the platform's conventions) then depending on [defaultTargetPlatform]
/// makes sense.
/// platform for styling purposes, rather than using [defaultTargetPlatform].
/// However, if there is widget behavior that depends on the actual underlying
/// platform, then depending on [defaultTargetPlatform] makes sense.
/// [dart.io.Platform.environment] should be used directly only when it's
/// critical to actually know the current platform, without any overrides
/// possible (for example, when a system API is about to be called).
///
/// In a test environment, the platform returned is [TargetPlatform.android]
/// regardless of the host platform. (Android was chosen because the tests were
...
...
packages/flutter/lib/src/material/theme_data.dart
View file @
efbd6f60
...
...
@@ -530,7 +530,14 @@ class ThemeData extends Diagnosticable {
/// The platform the material widgets should adapt to target.
///
/// Defaults to the current platform.
/// Defaults to the current platform. This should be used in order to style UI
/// elements according to platform conventions.
///
/// [Platform.defaultTargetPlatform] should be used directly instead only in
/// rare cases where it's necessary to determine behavior based on the
/// platform. [dart.io.Platform.environment] should be used when it's critical
/// to actually know the current platform, without any overrides possible (for
/// example, when a system API is about to be called).
final
TargetPlatform
platform
;
/// Configures the hit test size of certain Material widgets.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment