commit
9d155bdce5
@ -121,6 +121,6 @@ Pancetta meatball tongue tenderloin rump tail jowl boudin.""";
|
|||||||
child: row
|
child: row
|
||||||
);
|
);
|
||||||
|
|
||||||
updateTaskDescription('Interactive Flex', topColor);
|
updateTaskDescription(label: 'Interactive Flex', color: topColor);
|
||||||
new DemoBinding(root: root);
|
new DemoBinding(root: root);
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,7 @@ import 'shell.dart';
|
|||||||
|
|
||||||
export 'package:sky_services/activity/activity.mojom.dart';
|
export 'package:sky_services/activity/activity.mojom.dart';
|
||||||
|
|
||||||
/// Dart wrapper around Activity mojo service available in Sky on Android.
|
/// Dart wrapper around Activity mojo service available in Flutter on Android.
|
||||||
///
|
///
|
||||||
/// Most clients will want to use these methods instead of the activity service
|
/// Most clients will want to use these methods instead of the activity service
|
||||||
/// directly.
|
/// directly.
|
||||||
@ -50,8 +50,10 @@ final PathService pathService = _pathServiceProxy.ptr;
|
|||||||
Color _cachedPrimaryColor;
|
Color _cachedPrimaryColor;
|
||||||
String _cachedLabel;
|
String _cachedLabel;
|
||||||
|
|
||||||
/// Sets the TaskDescription for the current Activity
|
/// Sets the TaskDescription for the current Activity.
|
||||||
void updateTaskDescription(String label, Color color) {
|
/// The color, if provided, must be opaque.
|
||||||
|
void updateTaskDescription({ String label, Color color }) {
|
||||||
|
assert(color == null || color.alpha == 0xFF);
|
||||||
if (_cachedPrimaryColor == color && _cachedLabel == label)
|
if (_cachedPrimaryColor == color && _cachedLabel == label)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -7,7 +7,9 @@ import 'package:flutter/widgets.dart';
|
|||||||
|
|
||||||
/// Controls the description of this app in the operating system.
|
/// Controls the description of this app in the operating system.
|
||||||
class Title extends StatelessComponent {
|
class Title extends StatelessComponent {
|
||||||
Title({ this.title, this.child, this.color });
|
Title({ this.title, this.child, this.color }) {
|
||||||
|
assert(color == null || color.alpha == 0xFF);
|
||||||
|
}
|
||||||
|
|
||||||
final Widget child;
|
final Widget child;
|
||||||
|
|
||||||
@ -18,13 +20,15 @@ class Title extends StatelessComponent {
|
|||||||
final Color color;
|
final Color color;
|
||||||
|
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
updateTaskDescription(title, color);
|
updateTaskDescription(label: title, color: color);
|
||||||
return child;
|
return child;
|
||||||
}
|
}
|
||||||
|
|
||||||
void debugFillDescription(List<String> description) {
|
void debugFillDescription(List<String> description) {
|
||||||
super.debugFillDescription(description);
|
super.debugFillDescription(description);
|
||||||
|
if (title != null)
|
||||||
description.add('"$title"');
|
description.add('"$title"');
|
||||||
|
if (color != null)
|
||||||
description.add('color: $color');
|
description.add('color: $color');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user