MoonFlag class
A widget that represents a flag with a moon shape.
This class extends BasicFlag and uses MoonPainter to draw the moon shape as part of the flag's elements. It inherits all the properties and customization options from BasicFlag.
Example usage:
import 'package:world_flags/world_flags.dart';
void main() {
final flag = MoonFlag(flagAbwProperties, aspectRatio: 1.5);
assert(flag.properties == flagAbwProperties);
}
- Inheritance
- Available extensions
- Annotations
-
- @Deprecated("Use BasicFlag(properties) instead - the painter is now resolved " "automatically from FlagProperties.baseElementType. " "Will be removed in the next major version.")
Constructors
-
MoonFlag(FlagProperties properties, {double? aspectRatio, CustomPainter? backgroundPainter, BoxDecoration? decoration, DecorationPosition? decorationPosition, CustomPainter? foregroundPainter, FlagWidgetBuilder<
Widget> ? foregroundWidgetBuilder, Key? key, EdgeInsetsGeometry? padding, Widget? child}) -
Creates a new instance of MoonFlag.
const
Properties
- aspectRatio → double?
-
The specified aspect ratio of the flag.
finalinherited
- backgroundPainter → CustomPainter?
-
A custom painter for the background of the flag.
finalinherited
- calculatedAspectRatio → double?
-
Available on T, provided by the DecoratedFlagInterfaceExtension extension
The calculated aspect ratio of the flag based on its width and height.no setter - child → Widget?
-
A widget to display in the foreground of the flag.
no setterinherited
- decoration → BoxDecoration?
-
The decoration of the flag.
finalinherited
- decorationPosition → DecorationPosition?
-
The position of the decoration.
finalinherited
-
elementsBuilder
→ FlagPainterBuilder<
CustomPainter> ? -
A builder for the elements of the flag.
finalinherited
- flagAspectRatio → double
-
The original aspect ratio of the flag.
no setterinherited
- flagChild → Widget?
-
A widget to display in the foreground of the flag.
finalinherited
- foregroundPainter → CustomPainter?
-
A custom painter for the foreground of the flag.
finalinherited
-
foregroundPainterBuilder
→ FlagPainterBuilder<
CustomPainter> ? -
A builder for the foreground painter.
finalinherited
-
foregroundWidgetBuilder
→ FlagWidgetBuilder<
Widget> ? -
A builder for the foreground widget.
finalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- height → double?
-
The height of the flag.
finalinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- padding → EdgeInsetsGeometry?
-
The padding around the flag.
finalinherited
- properties → FlagProperties
-
The properties of the flag.
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- width → double?
-
The width of the flag.
finalinherited
Methods
-
build(
BuildContext context) → Widget -
Describes the part of the user interface represented by this widget.
inherited
-
copyWith(
{FlagProperties? properties, double? aspectRatio, BoxDecoration? decoration, DecorationPosition? decorationPosition, EdgeInsetsGeometry? padding, FlagPainterBuilder< CustomPainter> ? elementsBuilder, CustomPainter? backgroundPainter, CustomPainter? foregroundPainter, FlagPainterBuilder<CustomPainter> ? foregroundPainterBuilder, FlagWidgetBuilder<Widget> ? foregroundWidgetBuilder, double? height, double? width, Widget? flagChild, Widget? child, Key? key}) → BasicFlag -
Available on T, provided by the BasicFlagExtensionCopyWith extension
Creates a copy of this BasicFlag but with the given fields replaced with the new values. -
copyWithTheme(
{FlagProperties? properties, DecoratedFlagInterface? theme, FlagPainterBuilder< CustomPainter> ? elementsBuilder, CustomPainter? backgroundPainter, CustomPainter? foregroundPainter, FlagPainterBuilder<CustomPainter> ? foregroundPainterBuilder, FlagWidgetBuilder<Widget> ? foregroundWidgetBuilder, Key? key}) → BasicFlag -
Available on T, provided by the BasicFlagExtensionCopyWith extension
Creates a copy of this BasicFlag but with fields taken from a DecoratedFlagInterface theme. -
createElement(
) → StatelessElement -
Creates a StatelessElement to manage this widget's location in the tree.
inherited
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of DiagnosticsNode objects describing this node's
children.
inherited
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
resolvePainter(
ElementsProps? elements, double ratio) → CustomPainter? -
Resolves the elements painter, preferring an explicit elementsBuilder
and falling back to auto-resolution from FlagProperties.baseElementType.
inherited
-
toData(
{Widget? flagChild}) → DecoratedFlagData -
Available on T, provided by the DecoratedFlagInterfaceExtension extension
Converts this DecoratedFlagInterface to a DecoratedFlagData instance. -
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
-
toThemeData(
{Widget? child}) → DecoratedFlagData -
Available on T, provided by the DecoratedFlagInterfaceExtension extension
Converts this DecoratedFlagInterface to a DecoratedFlagData instance.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited