Vaibhav Surve 99902e743c Flutter application
- Created generated_plugin_registrant.cc and generated_plugin_registrant.h to manage plugin registration.
- Added generated_plugins.cmake for plugin configuration in CMake.
- Implemented CMakeLists.txt for the Windows runner, defining build settings and dependencies.
- Created Runner.rc for application resources including versioning and icons.
- Developed flutter_window.cpp and flutter_window.h to manage the Flutter window lifecycle.
- Implemented main.cpp as the entry point for the Windows application.
- Added resource.h for resource definitions.
- Included app icon in resources.
- Created runner.exe.manifest for application settings.
- Developed utils.cpp and utils.h for console management and command line argument handling.
- Implemented win32_window.cpp and win32_window.h for high DPI-aware window management.
2025-04-17 12:30:38 +05:30

466 lines
12 KiB
Dart

// ignore_for_file: annotate_overrides, overridden_fields
import 'package:flutter/material.dart';
import 'package:marco/helpers/widgets/my_text_style.dart';
class MyText extends StatelessWidget {
final Key? key;
final String text;
final TextStyle? style;
final int? fontWeight;
final bool muted, xMuted;
final double? letterSpacing;
final Color? color;
final TextDecoration decoration;
final double? height;
final double wordSpacing;
final double? fontSize;
final MyTextType textType;
final TextAlign? textAlign;
final int? maxLines;
final Locale? locale;
final TextOverflow? overflow;
final String? semanticsLabel;
final bool? softWrap;
final StrutStyle? strutStyle;
final TextDirection? textDirection;
final TextHeightBehavior? textHeightBehavior;
final double? textScaleFactor;
final TextWidthBasis? textWidthBasis;
MyText(this.text,
{this.style,
this.fontWeight = 500,
this.muted = false,
this.xMuted = false,
this.letterSpacing = 0.15,
this.color,
this.decoration = TextDecoration.none,
this.height,
this.wordSpacing = 0,
this.fontSize,
this.textType = MyTextType.bodyMedium,
this.key,
this.textAlign,
this.maxLines,
this.locale,
this.overflow,
this.semanticsLabel,
this.softWrap,
this.strutStyle,
this.textDirection,
this.textHeightBehavior,
this.textScaleFactor,
this.textWidthBasis});
MyText.displayLarge(this.text,
{this.style,
this.fontWeight,
this.muted = false,
this.xMuted = false,
this.letterSpacing,
this.color,
this.decoration = TextDecoration.none,
this.height,
this.wordSpacing = 0,
this.fontSize,
this.textType = MyTextType.displayLarge,
this.key,
this.textAlign,
this.maxLines,
this.locale,
this.overflow,
this.semanticsLabel,
this.softWrap,
this.strutStyle,
this.textDirection,
this.textHeightBehavior,
this.textScaleFactor,
this.textWidthBasis});
MyText.displayMedium(this.text,
{this.style,
this.fontWeight,
this.muted = false,
this.xMuted = false,
this.letterSpacing,
this.color,
this.decoration = TextDecoration.none,
this.height,
this.wordSpacing = 0,
this.fontSize,
this.textType = MyTextType.displayMedium,
this.key,
this.textAlign,
this.maxLines,
this.locale,
this.overflow,
this.semanticsLabel,
this.softWrap,
this.strutStyle,
this.textDirection,
this.textHeightBehavior,
this.textScaleFactor,
this.textWidthBasis});
MyText.displaySmall(this.text,
{this.style,
this.fontWeight,
this.muted = false,
this.xMuted = false,
this.letterSpacing,
this.color,
this.decoration = TextDecoration.none,
this.height,
this.wordSpacing = 0,
this.fontSize,
this.textType = MyTextType.displaySmall,
this.key,
this.textAlign,
this.maxLines,
this.locale,
this.overflow,
this.semanticsLabel,
this.softWrap,
this.strutStyle,
this.textDirection,
this.textHeightBehavior,
this.textScaleFactor,
this.textWidthBasis});
MyText.headlineLarge(this.text,
{this.style,
this.fontWeight = 500,
this.muted = false,
this.xMuted = false,
this.letterSpacing,
this.color,
this.decoration = TextDecoration.none,
this.height,
this.wordSpacing = 0,
this.fontSize,
this.textType = MyTextType.headlineLarge,
this.key,
this.textAlign,
this.maxLines,
this.locale,
this.overflow,
this.semanticsLabel,
this.softWrap,
this.strutStyle,
this.textDirection,
this.textHeightBehavior,
this.textScaleFactor,
this.textWidthBasis});
MyText.headlineMedium(this.text,
{this.style,
this.fontWeight = 500,
this.muted = false,
this.xMuted = false,
this.letterSpacing,
this.color,
this.decoration = TextDecoration.none,
this.height,
this.wordSpacing = 0,
this.fontSize,
this.textType = MyTextType.headlineMedium,
this.key,
this.textAlign,
this.maxLines,
this.locale,
this.overflow,
this.semanticsLabel,
this.softWrap,
this.strutStyle,
this.textDirection,
this.textHeightBehavior,
this.textScaleFactor,
this.textWidthBasis});
MyText.headlineSmall(this.text,
{this.style,
this.fontWeight = 500,
this.muted = false,
this.xMuted = false,
this.letterSpacing,
this.color,
this.decoration = TextDecoration.none,
this.height,
this.wordSpacing = 0,
this.fontSize,
this.textType = MyTextType.headlineSmall,
this.key,
this.textAlign,
this.maxLines,
this.locale,
this.overflow,
this.semanticsLabel,
this.softWrap,
this.strutStyle,
this.textDirection,
this.textHeightBehavior,
this.textScaleFactor,
this.textWidthBasis});
MyText.titleLarge(this.text,
{this.style,
this.fontWeight,
this.muted = false,
this.xMuted = false,
this.letterSpacing,
this.color,
this.decoration = TextDecoration.none,
this.height,
this.wordSpacing = 0,
this.fontSize,
this.textType = MyTextType.titleLarge,
this.key,
this.textAlign,
this.maxLines,
this.locale,
this.overflow,
this.semanticsLabel,
this.softWrap,
this.strutStyle,
this.textDirection,
this.textHeightBehavior,
this.textScaleFactor,
this.textWidthBasis});
MyText.titleMedium(this.text,
{this.style,
this.fontWeight,
this.muted = false,
this.xMuted = false,
this.letterSpacing,
this.color,
this.decoration = TextDecoration.none,
this.height,
this.wordSpacing = 0,
this.fontSize,
this.textType = MyTextType.titleMedium,
this.key,
this.textAlign,
this.maxLines,
this.locale,
this.overflow,
this.semanticsLabel,
this.softWrap,
this.strutStyle,
this.textDirection,
this.textHeightBehavior,
this.textScaleFactor,
this.textWidthBasis});
MyText.titleSmall(this.text,
{this.style,
this.fontWeight,
this.muted = false,
this.xMuted = false,
this.letterSpacing,
this.color,
this.decoration = TextDecoration.none,
this.height,
this.wordSpacing = 0,
this.fontSize,
this.textType = MyTextType.titleSmall,
this.key,
this.textAlign,
this.maxLines,
this.locale,
this.overflow,
this.semanticsLabel,
this.softWrap,
this.strutStyle,
this.textDirection,
this.textHeightBehavior,
this.textScaleFactor,
this.textWidthBasis});
MyText.labelLarge(this.text,
{this.style,
this.fontWeight,
this.muted = false,
this.xMuted = false,
this.letterSpacing,
this.color,
this.decoration = TextDecoration.none,
this.height,
this.wordSpacing = 0,
this.fontSize,
this.textType = MyTextType.labelLarge,
this.key,
this.textAlign,
this.maxLines,
this.locale,
this.overflow,
this.semanticsLabel,
this.softWrap,
this.strutStyle,
this.textDirection,
this.textHeightBehavior,
this.textScaleFactor,
this.textWidthBasis});
MyText.labelMedium(this.text,
{this.style,
this.fontWeight,
this.muted = false,
this.xMuted = false,
this.letterSpacing,
this.color,
this.decoration = TextDecoration.none,
this.height,
this.wordSpacing = 0,
this.fontSize,
this.textType = MyTextType.labelMedium,
this.key,
this.textAlign,
this.maxLines,
this.locale,
this.overflow,
this.semanticsLabel,
this.softWrap,
this.strutStyle,
this.textDirection,
this.textHeightBehavior,
this.textScaleFactor,
this.textWidthBasis});
MyText.labelSmall(this.text,
{this.style,
this.fontWeight,
this.muted = false,
this.xMuted = false,
this.letterSpacing,
this.color,
this.decoration = TextDecoration.none,
this.height,
this.wordSpacing = 0,
this.fontSize,
this.textType = MyTextType.labelSmall,
this.key,
this.textAlign,
this.maxLines,
this.locale,
this.overflow,
this.semanticsLabel,
this.softWrap,
this.strutStyle,
this.textDirection,
this.textHeightBehavior,
this.textScaleFactor,
this.textWidthBasis});
MyText.bodyLarge(this.text,
{this.style,
this.fontWeight,
this.muted = false,
this.xMuted = false,
this.letterSpacing,
this.color,
this.decoration = TextDecoration.none,
this.height,
this.wordSpacing = 0,
this.fontSize,
this.textType = MyTextType.bodyLarge,
this.key,
this.textAlign,
this.maxLines,
this.locale,
this.overflow,
this.semanticsLabel,
this.softWrap,
this.strutStyle,
this.textDirection,
this.textHeightBehavior,
this.textScaleFactor,
this.textWidthBasis});
MyText.bodyMedium(this.text,
{this.style,
this.fontWeight,
this.muted = false,
this.xMuted = false,
this.letterSpacing,
this.color,
this.decoration = TextDecoration.none,
this.height,
this.wordSpacing = 0,
this.fontSize,
this.textType = MyTextType.bodyMedium,
this.key,
this.textAlign,
this.maxLines,
this.locale,
this.overflow,
this.semanticsLabel,
this.softWrap,
this.strutStyle,
this.textDirection,
this.textHeightBehavior,
this.textScaleFactor,
this.textWidthBasis});
MyText.bodySmall(this.text,
{this.style,
this.fontWeight,
this.muted = false,
this.xMuted = false,
this.letterSpacing,
this.color,
this.decoration = TextDecoration.none,
this.height,
this.wordSpacing = 0,
this.fontSize,
this.textType = MyTextType.bodySmall,
this.key,
this.textAlign,
this.maxLines,
this.locale,
this.overflow,
this.semanticsLabel,
this.softWrap,
this.strutStyle,
this.textDirection,
this.textHeightBehavior,
this.textScaleFactor,
this.textWidthBasis});
@override
Widget build(BuildContext context) {
return Text(
text,
style: style ??
MyTextStyle.getStyle(
textStyle: style,
color: color,
fontWeight: fontWeight ??
MyTextStyle.defaultTextFontWeight[textType] ??
500,
muted: muted,
letterSpacing: letterSpacing ??
MyTextStyle.defaultLetterSpacing[textType] ??
0.15,
height: height,
xMuted: xMuted,
decoration: decoration,
wordSpacing: wordSpacing,
fontSize: fontSize ?? MyTextStyle.defaultTextSize[textType],
),
textAlign: textAlign,
maxLines: maxLines,
locale: locale,
overflow: overflow,
semanticsLabel: semanticsLabel,
softWrap: softWrap,
strutStyle: strutStyle,
textDirection: textDirection,
textHeightBehavior: textHeightBehavior,
textWidthBasis: textWidthBasis,
key: key,
);
}
}