mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
* Update project.pbxproj files to say Flutter rather than Chromium Also, the templates now have an empty organization so that we don't cause people to give their apps a Flutter copyright. * Update the copyright notice checker to require a standard notice on all files * Update copyrights on Dart files. (This was a mechanical commit.) * Fix weird license headers on Dart files that deviate from our conventions; relicense Shrine. Some were already marked "The Flutter Authors", not clear why. Their dates have been normalized. Some were missing the blank line after the license. Some were randomly different in trivial ways for no apparent reason (e.g. missing the trailing period). * Clean up the copyrights in non-Dart files. (Manual edits.) Also, make sure templates don't have copyrights. * Fix some more ORGANIZATIONNAMEs
88 lines
3.0 KiB
Dart
88 lines
3.0 KiB
Dart
// Copyright 2014 The Flutter Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
import 'package:flutter/widgets.dart';
|
|
|
|
import 'colors.dart';
|
|
|
|
/// The Flutter logo, in widget form. This widget respects the [IconTheme].
|
|
/// For guidelines on using the Flutter logo, visit https://flutter.dev/brand.
|
|
///
|
|
/// See also:
|
|
///
|
|
/// * [IconTheme], which provides ambient configuration for icons.
|
|
/// * [Icon], for showing icons the Material design icon library.
|
|
/// * [ImageIcon], for showing icons from [AssetImage]s or other [ImageProvider]s.
|
|
class FlutterLogo extends StatelessWidget {
|
|
/// Creates a widget that paints the Flutter logo.
|
|
///
|
|
/// The [size] defaults to the value given by the current [IconTheme].
|
|
const FlutterLogo({
|
|
Key key,
|
|
this.size,
|
|
this.colors,
|
|
this.textColor = const Color(0xFF616161),
|
|
this.style = FlutterLogoStyle.markOnly,
|
|
this.duration = const Duration(milliseconds: 750),
|
|
this.curve = Curves.fastOutSlowIn,
|
|
}) : super(key: key);
|
|
|
|
/// The size of the logo in logical pixels.
|
|
///
|
|
/// The logo will be fit into a square this size.
|
|
///
|
|
/// Defaults to the current [IconTheme] size, if any. If there is no
|
|
/// [IconTheme], or it does not specify an explicit size, then it defaults to
|
|
/// 24.0.
|
|
final double size;
|
|
|
|
/// The color swatch to use to paint the logo, [Colors.blue] by default.
|
|
///
|
|
/// If for some reason the default colors are impractical, then one
|
|
/// of [Colors.amber], [Colors.red], or [Colors.indigo] swatches can be used.
|
|
/// These are Flutter's secondary colors.
|
|
///
|
|
/// In extreme cases where none of those four color schemes will work,
|
|
/// [Colors.pink], [Colors.purple], or [Colors.cyan] swatches can be used.
|
|
/// These are Flutter's tertiary colors.
|
|
final MaterialColor colors;
|
|
|
|
/// The color used to paint the "Flutter" text on the logo, if [style] is
|
|
/// [FlutterLogoStyle.horizontal] or [FlutterLogoStyle.stacked]. The
|
|
/// appropriate color is `const Color(0xFF616161)` (a medium gray), against a
|
|
/// white background.
|
|
final Color textColor;
|
|
|
|
/// Whether and where to draw the "Flutter" text. By default, only the logo
|
|
/// itself is drawn.
|
|
final FlutterLogoStyle style;
|
|
|
|
/// The length of time for the animation if the [style], [colors], or
|
|
/// [textColor] properties are changed.
|
|
final Duration duration;
|
|
|
|
/// The curve for the logo animation if the [style], [colors], or [textColor]
|
|
/// change.
|
|
final Curve curve;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final IconThemeData iconTheme = IconTheme.of(context);
|
|
final double iconSize = size ?? iconTheme.size;
|
|
final MaterialColor logoColors = colors ?? Colors.blue;
|
|
return AnimatedContainer(
|
|
width: iconSize,
|
|
height: iconSize,
|
|
duration: duration,
|
|
curve: curve,
|
|
decoration: FlutterLogoDecoration(
|
|
lightColor: logoColors.shade400,
|
|
darkColor: logoColors.shade900,
|
|
style: style,
|
|
textColor: textColor,
|
|
),
|
|
);
|
|
}
|
|
}
|