title.dart 895 Bytes
Newer Older
Adam Barth's avatar
Adam Barth committed
1 2 3 4
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

5 6
import 'package:flutter/services.dart';
import 'package:flutter/widgets.dart';
7

8
/// Controls the description of this app in the operating system.
9
class Title extends StatelessComponent {
10
  Title({ this.title, this.child, this.color });
Adam Barth's avatar
Adam Barth committed
11 12

  final Widget child;
13 14

  /// A one-line description of this app for use in the window manager.
Adam Barth's avatar
Adam Barth committed
15
  final String title;
16 17

  /// A color that the window manager should use to identify this app.
18
  final Color color;
Adam Barth's avatar
Adam Barth committed
19

20
  Widget build(BuildContext context) {
21
    updateTaskDescription(title, color);
Adam Barth's avatar
Adam Barth committed
22 23
    return child;
  }
Hixie's avatar
Hixie committed
24 25 26 27

  void debugFillDescription(List<String> description) {
    super.debugFillDescription(description);
    description.add('"$title"');
28
    description.add('color: $color');
Hixie's avatar
Hixie committed
29
  }
Adam Barth's avatar
Adam Barth committed
30
}