The FlutterLogo
widget that paints the Flutter logo.
The default constructor creates a widget that paints the Flutter logo.
FlutterLogo(
size:
textColor:
style:
);
It contains many input parameters which can be configured to change its behavior and appearance.
The size
parameter is to provide size of the logo in logical pixels. The logo will be fit into a square this size.
The textColor
parameter is to apply the color used to paint the "Flutter" text on the logo.
The style parameter is to whether and where to draw the "Flutter" text. By default, FlutterLogoStyle.markOnly
only the logo itself is drawn.
The following code snippet shows how to configure FlutterLogo
widget.
FlutterLogo(
size: 100,
textColor: Colors.white,
style: FlutterLogoStyle.stacked,
);
This example shows Flutter's logo above the "Flutter" label.
import 'package:flutter/material.dart';
class FlutterLogoDemo extends StatelessWidget {
Widget build(BuildContext context) {
return Container(
child: FlutterLogo(
size: 100,
textColor: Colors.white,
// Show Flutter's logo above the "Flutter" label.
style: FlutterLogoStyle.stacked,
),
);
}
}
class MyApp extends StatelessWidget {
static const String _title = 'FlutterLogo Widget Demo';
Widget build(BuildContext context) {
return MaterialApp(
title: _title,
home: Scaffold(
appBar: AppBar(title: const Text(_title)),
body: FlutterLogoDemo(),
),
);
}
}
void main() => runApp(MyApp());