text stringlengths 6 1.82M | id stringlengths 12 200 | metadata dict | __index_level_0__ int64 0 784 |
|---|---|---|---|
cd example/
flutter build web
firebase deploy | Flutter-Neumorphic/deployWeb.sh/0 | {
"file_path": "Flutter-Neumorphic/deployWeb.sh",
"repo_id": "Flutter-Neumorphic",
"token_count": 12
} | 0 |
import 'package:example/tips/tips_home.dart';
import 'package:example/widgets/widgets_home.dart';
import 'package:flutter/material.dart';
import 'package:flutter_neumorphic/flutter_neumorphic.dart';
import 'accessibility/neumorphic_accessibility.dart';
import 'playground/neumorphic_playground.dart';
import 'playground/text_playground.dart';
import 'samples/sample_home.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return NeumorphicApp(
debugShowCheckedModeBanner: false,
themeMode: ThemeMode.light,
title: 'Flutter Neumorphic',
home: FullSampleHomePage(),
);
}
}
class FullSampleHomePage extends StatelessWidget {
Widget _buildButton({String text, VoidCallback onClick}) {
return NeumorphicButton(
margin: EdgeInsets.only(bottom: 12),
padding: EdgeInsets.symmetric(
vertical: 18,
horizontal: 24,
),
style: NeumorphicStyle(
boxShape: NeumorphicBoxShape.roundRect(
BorderRadius.circular(12),
),
//border: NeumorphicBorder(
// isEnabled: true,
// width: 0.3,
//),
shape: NeumorphicShape.flat,
),
child: Center(child: Text(text)),
onPressed: onClick,
);
}
@override
Widget build(BuildContext context) {
return NeumorphicTheme(
theme: NeumorphicThemeData(depth: 8),
child: Scaffold(
backgroundColor: NeumorphicColors.background,
body: SafeArea(
child: SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.all(18.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
mainAxisAlignment: MainAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: [
_buildButton(
text: "Neumorphic Playground",
onClick: () {
Navigator.of(context)
.push(MaterialPageRoute(builder: (context) {
return NeumorphicPlayground();
}));
},
),
SizedBox(height: 24),
_buildButton(
text: "Text Playground",
onClick: () {
Navigator.of(context)
.push(MaterialPageRoute(builder: (context) {
return NeumorphicTextPlayground();
}));
},
),
SizedBox(height: 24),
_buildButton(
text: "Samples",
onClick: () {
Navigator.of(context)
.push(MaterialPageRoute(builder: (context) {
return SamplesHome();
}));
}),
SizedBox(height: 24),
_buildButton(
text: "Widgets",
onClick: () {
Navigator.of(context)
.push(MaterialPageRoute(builder: (context) {
return WidgetsHome();
}));
}),
SizedBox(height: 24),
_buildButton(
text: "Tips",
onClick: () {
Navigator.of(context)
.push(MaterialPageRoute(builder: (context) {
return TipsHome();
}));
}),
SizedBox(height: 24),
_buildButton(
text: "Accessibility",
onClick: () {
Navigator.of(context)
.push(MaterialPageRoute(builder: (context) {
return NeumorphicAccessibility();
}));
}),
SizedBox(height: 12),
],
),
),
),
),
),
);
}
}
| Flutter-Neumorphic/example/lib/main_home.dart/0 | {
"file_path": "Flutter-Neumorphic/example/lib/main_home.dart",
"repo_id": "Flutter-Neumorphic",
"token_count": 2464
} | 1 |
import 'package:example/lib/top_bar.dart';
import 'package:flutter/material.dart';
import 'package:flutter_neumorphic/flutter_neumorphic.dart';
import 'border/tips_border.dart';
import 'border/tips_emboss_inside_emboss.dart';
class TipsHome extends StatelessWidget {
Widget _buildButton({String text, VoidCallback onClick}) {
return NeumorphicButton(
margin: EdgeInsets.only(bottom: 12),
padding: EdgeInsets.symmetric(
vertical: 18,
horizontal: 24,
),
style: NeumorphicStyle(
shape: NeumorphicShape.flat,
boxShape: NeumorphicBoxShape.roundRect(
BorderRadius.circular(12),
),
),
child: Center(child: Text(text)),
onPressed: onClick,
);
}
@override
Widget build(BuildContext context) {
return NeumorphicTheme(
theme: NeumorphicThemeData(depth: 8),
child: Scaffold(
backgroundColor: NeumorphicColors.background,
body: SafeArea(
child: SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.all(18.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
mainAxisAlignment: MainAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: [
TopBar(title: "Tips"),
_buildButton(
text: "Border",
onClick: () {
Navigator.of(context)
.push(MaterialPageRoute(builder: (context) {
return TipsBorderPage();
}));
}),
_buildButton(
text: "Recursive Emboss",
onClick: () {
Navigator.of(context)
.push(MaterialPageRoute(builder: (context) {
return TipsRecursiveeEmbossPage();
}));
}),
],
),
),
),
),
),
);
}
}
| Flutter-Neumorphic/example/lib/tips/tips_home.dart/0 | {
"file_path": "Flutter-Neumorphic/example/lib/tips/tips_home.dart",
"repo_id": "Flutter-Neumorphic",
"token_count": 1161
} | 2 |
import 'package:example/lib/top_bar.dart';
import 'package:example/widgets/appbar/widget_app_bar.dart';
import 'package:example/widgets/toggle/widget_toggle.dart';
import 'package:flutter/material.dart';
import 'package:flutter_neumorphic/flutter_neumorphic.dart';
import 'background/widget_background.dart';
import 'button/widget_button.dart';
import 'checkbox/widget_checkbox.dart';
import 'container/widget_container.dart';
import 'icon/widget_icon.dart';
import 'indeterminate_progress/widget_indeterminate_progress.dart';
import 'indicator/widget_indicator.dart';
import 'progress/widget_progress.dart';
import 'radiobutton/widget_radio_button.dart';
import 'range_slider/widget_range_slider.dart';
import 'slider/widget_slider.dart';
import 'switch/widget_switch.dart';
class WidgetsHome extends StatelessWidget {
Widget _buildButton({String text, VoidCallback onClick}) {
return NeumorphicButton(
margin: EdgeInsets.only(bottom: 12),
padding: EdgeInsets.symmetric(
vertical: 18,
horizontal: 24,
),
style: NeumorphicStyle(
boxShape: NeumorphicBoxShape.roundRect(
BorderRadius.circular(12),
),
shape: NeumorphicShape.flat,
),
child: Center(child: Text(text)),
onPressed: onClick,
);
}
@override
Widget build(BuildContext context) {
return NeumorphicTheme(
theme: NeumorphicThemeData(depth: 8),
child: Scaffold(
backgroundColor: NeumorphicColors.background,
body: SafeArea(
child: SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.all(18.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
mainAxisAlignment: MainAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: [
TopBar(title: "Widgets"),
_buildButton(
text: "Container",
onClick: () {
Navigator.of(context)
.push(MaterialPageRoute(builder: (context) {
return ContainerWidgetPage();
}));
}),
_buildButton(
text: "App bar",
onClick: () {
Navigator.of(context)
.push(MaterialPageRoute(builder: (context) {
return AppBarWidgetPage();
}));
}),
_buildButton(
text: "Button",
onClick: () {
Navigator.of(context)
.push(MaterialPageRoute(builder: (context) {
return ButtonWidgetPage();
}));
}),
_buildButton(
text: "Icon",
onClick: () {
Navigator.of(context)
.push(MaterialPageRoute(builder: (context) {
return IconWidgetPage();
}));
}),
_buildButton(
text: "RadioButton",
onClick: () {
Navigator.of(context)
.push(MaterialPageRoute(builder: (context) {
return RadioButtonWidgetPage();
}));
}),
_buildButton(
text: "Checkbox",
onClick: () {
Navigator.of(context)
.push(MaterialPageRoute(builder: (context) {
return CheckboxWidgetPage();
}));
}),
_buildButton(
text: "Switch",
onClick: () {
Navigator.of(context)
.push(MaterialPageRoute(builder: (context) {
return SwitchWidgetPage();
}));
}),
_buildButton(
text: "Toggle",
onClick: () {
Navigator.of(context)
.push(MaterialPageRoute(builder: (context) {
return ToggleWidgetPage();
}));
}),
_buildButton(
text: "Slider",
onClick: () {
Navigator.of(context)
.push(MaterialPageRoute(builder: (context) {
return SliderWidgetPage();
}));
}),
_buildButton(
text: "Range slider",
onClick: () {
Navigator.of(context)
.push(MaterialPageRoute(builder: (context) {
return RangeSliderWidgetPage();
}));
}),
_buildButton(
text: "Indicator",
onClick: () {
Navigator.of(context)
.push(MaterialPageRoute(builder: (context) {
return IndicatorWidgetPage();
}));
}),
_buildButton(
text: "Progress",
onClick: () {
Navigator.of(context)
.push(MaterialPageRoute(builder: (context) {
return ProgressWidgetPage();
}));
}),
_buildButton(
text: "IndeterminateProgress",
onClick: () {
Navigator.of(context)
.push(MaterialPageRoute(builder: (context) {
return IndeterminateProgressWidgetPage();
}));
}),
_buildButton(
text: "Background",
onClick: () {
Navigator.of(context)
.push(MaterialPageRoute(builder: (context) {
return BackgroundWidgetPage();
}));
}),
],
),
),
),
),
),
);
}
}
| Flutter-Neumorphic/example/lib/widgets/widgets_home.dart/0 | {
"file_path": "Flutter-Neumorphic/example/lib/widgets/widgets_home.dart",
"repo_id": "Flutter-Neumorphic",
"token_count": 4105
} | 3 |
import 'dart:ui' as ui;
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/painting.dart';
import '../theme/theme.dart';
import 'cache/neumorphic_painter_cache.dart';
import 'neumorphic_box_decoration_helper.dart';
import 'neumorphic_emboss_decoration_painter.dart';
class NeumorphicEmptyTextPainter extends BoxPainter {
NeumorphicEmptyTextPainter({required VoidCallback onChanged})
: super(onChanged);
@override
void paint(Canvas canvas, Offset offset, ImageConfiguration configuration) {
//does nothing
}
}
class NeumorphicDecorationTextPainter extends BoxPainter {
final NeumorphicStyle style;
final String text;
final TextStyle textStyle;
final TextAlign textAlign;
NeumorphicPainterCache _cache;
late Paint _backgroundPaint;
late Paint _whiteShadowPaint;
late Paint _whiteShadowMaskPaint;
late Paint _blackShadowPaint;
late Paint _blackShadowMaskPaint;
late Paint _gradientPaint;
late Paint _borderPaint;
late ui.Paragraph _textParagraph;
late ui.Paragraph _innerTextParagraph;
late ui.Paragraph _whiteShadowParagraph;
late ui.Paragraph _whiteShadowMaskParagraph;
late ui.Paragraph _blackShadowTextParagraph;
late ui.Paragraph _blackShadowTextMaskParagraph;
late ui.Paragraph _gradientParagraph;
void generatePainters() {
this._backgroundPaint = Paint();
this._whiteShadowPaint = Paint();
this._whiteShadowMaskPaint = Paint()..blendMode = BlendMode.dstOut;
this._blackShadowPaint = Paint();
this._blackShadowMaskPaint = Paint()..blendMode = BlendMode.dstOut;
this._gradientPaint = Paint();
this._borderPaint = Paint()
..strokeCap = StrokeCap.round
..strokeJoin = StrokeJoin.bevel
..style = PaintingStyle.stroke
..strokeWidth = style.border.width ?? 0.0
..color = style.border.color ?? Color(0xFFFFFFFF);
}
final bool drawGradient;
final bool drawShadow;
final bool drawBackground;
final bool renderingByPath;
NeumorphicDecorationTextPainter({
required this.style,
required this.textStyle,
required this.text,
required this.drawGradient,
required this.drawShadow,
required this.drawBackground,
required VoidCallback onChanged,
required this.textAlign,
this.renderingByPath = true,
}) : _cache = NeumorphicPainterCache(),
super(onChanged) {
generatePainters();
}
void _updateCache(Offset offset, ImageConfiguration configuration) {
bool invalidateSize = false;
if (configuration.size != null) {
invalidateSize = this
._cache
.updateSize(newOffset: offset, newSize: configuration.size!);
}
final bool invalidateLightSource = this
._cache
.updateLightSource(style.lightSource, style.oppositeShadowLightSource);
bool invalidateColor = false;
if (style.color != null) {
invalidateColor = this._cache.updateStyleColor(style.color!);
if (invalidateColor) {
_backgroundPaint..color = _cache.backgroundColor;
}
}
bool invalidateDepth = false;
if (style.depth != null) {
invalidateDepth = this._cache.updateStyleDepth(style.depth!, 3);
if (invalidateDepth) {
_blackShadowPaint..maskFilter = _cache.maskFilterBlur;
_whiteShadowPaint..maskFilter = _cache.maskFilterBlur;
}
}
bool invalidateShadowColors = false;
if (style.shadowLightColor != null &&
style.shadowDarkColor != null &&
style.intensity != null) {
invalidateShadowColors = this._cache.updateShadowColor(
newShadowLightColorEmboss: style.shadowLightColor!,
newShadowDarkColorEmboss: style.shadowDarkColor!,
newIntensity: style.intensity ?? neumorphicDefaultTheme.intensity,
);
if (invalidateShadowColors) {
if (_cache.shadowLightColor != null) {
_whiteShadowPaint..color = _cache.shadowLightColor!;
}
if (_cache.shadowDarkColor != null) {
_blackShadowPaint..color = _cache.shadowDarkColor!;
}
}
}
final constraints = ui.ParagraphConstraints(width: _cache.width);
final paragraphStyle = textStyle.getParagraphStyle(
textDirection: TextDirection.ltr, textAlign: this.textAlign);
final textParagraphBuilder = ui.ParagraphBuilder(paragraphStyle)
..pushStyle(ui.TextStyle(
foreground: _borderPaint,
))
..addText(text);
final innerTextParagraphBuilder = ui.ParagraphBuilder(paragraphStyle)
..pushStyle(ui.TextStyle(
foreground: _backgroundPaint,
))
..addText(text);
final whiteShadowParagraphBuilder = ui.ParagraphBuilder(paragraphStyle)
..pushStyle(ui.TextStyle(
foreground: _whiteShadowPaint,
))
..addText(text);
final whiteShadowMaskParagraphBuilder = ui.ParagraphBuilder(paragraphStyle)
..pushStyle(ui.TextStyle(
foreground: _whiteShadowMaskPaint,
))
..addText(text);
final blackShadowParagraphBuilder = ui.ParagraphBuilder(paragraphStyle)
..pushStyle(ui.TextStyle(
foreground: _blackShadowPaint,
))
..addText(text);
final blackShadowMaskParagraphBuilder = ui.ParagraphBuilder(paragraphStyle)
..pushStyle(ui.TextStyle(
foreground: _blackShadowMaskPaint,
))
..addText(text);
_textParagraph = textParagraphBuilder.build()..layout(constraints);
_innerTextParagraph = innerTextParagraphBuilder.build()
..layout(constraints);
_whiteShadowParagraph = whiteShadowParagraphBuilder.build()
..layout(constraints);
_whiteShadowMaskParagraph = whiteShadowMaskParagraphBuilder.build()
..layout(constraints);
_blackShadowTextParagraph = blackShadowParagraphBuilder.build()
..layout(constraints);
_blackShadowTextMaskParagraph = blackShadowMaskParagraphBuilder.build()
..layout(constraints);
//region gradient
final gradientParagraphBuilder = ui.ParagraphBuilder(paragraphStyle)
..pushStyle(ui.TextStyle(
foreground: _gradientPaint
..shader = getGradientShader(
gradientRect: Rect.fromLTRB(0, 0, _cache.width, _cache.height),
intensity: style.surfaceIntensity,
source: style.shape == NeumorphicShape.concave
? this.style.lightSource
: this.style.lightSource.invert(),
),
))
..addText(text);
_gradientParagraph = gradientParagraphBuilder.build()
..layout(ui.ParagraphConstraints(width: _cache.width));
//endregion
if (invalidateDepth || invalidateLightSource) {
_cache.updateDepthOffset();
}
if (invalidateLightSource || invalidateDepth || invalidateSize) {
_cache.updateTranslations();
}
}
@override
void paint(Canvas canvas, Offset offset, ImageConfiguration configuration) {
_updateCache(offset, configuration);
_drawShadow(offset: offset, canvas: canvas, path: _cache.path);
_drawElement(offset: offset, canvas: canvas, path: _cache.path);
}
void _drawElement(
{required Canvas canvas, required Offset offset, required Path path}) {
if (true) {
_drawBackground(offset: offset, canvas: canvas, path: path);
}
if (this.drawGradient) {
_drawGradient(offset: offset, canvas: canvas, path: path);
}
if (style.border.isEnabled) {
_drawBorder(canvas: canvas, offset: offset, path: path);
}
}
void _drawBorder(
{required Canvas canvas, required Offset offset, required Path path}) {
if (style.border.width != null && style.border.width! > 0) {
canvas
..save()
..translate(offset.dx, offset.dy)
..drawParagraph(_textParagraph, Offset.zero)
..restore();
}
}
void _drawBackground(
{required Canvas canvas, required Offset offset, required Path path}) {
canvas
..save()
..translate(offset.dx, offset.dy)
..drawParagraph(_innerTextParagraph, Offset.zero)
..restore();
}
void _drawShadow(
{required Canvas canvas, required Offset offset, required Path path}) {
if (style.depth != null && style.depth!.abs() >= 0.1) {
canvas
..saveLayer(_cache.layerRect, _whiteShadowPaint)
..translate(offset.dx + _cache.depthOffset.dx,
offset.dy + _cache.depthOffset.dy)
..drawParagraph(_whiteShadowParagraph, Offset.zero)
..translate(-_cache.depthOffset.dx, -_cache.depthOffset.dy)
..drawParagraph(_whiteShadowMaskParagraph, Offset.zero)
..restore();
canvas
..saveLayer(_cache.layerRect, _blackShadowPaint)
..translate(offset.dx - _cache.depthOffset.dx,
offset.dy - _cache.depthOffset.dy)
..drawParagraph(_blackShadowTextParagraph, Offset.zero)
..translate(_cache.depthOffset.dx, _cache.depthOffset.dy)
..drawParagraph(_blackShadowTextMaskParagraph, Offset.zero)
..restore();
}
}
void _drawGradient(
{required Canvas canvas, required Offset offset, required Path path}) {
if (style.shape == NeumorphicShape.concave ||
style.shape == NeumorphicShape.convex) {
canvas
..saveLayer(_cache.layerRect, _gradientPaint)
..translate(offset.dx, offset.dy)
..drawParagraph(_gradientParagraph, Offset.zero)
..restore();
}
}
}
| Flutter-Neumorphic/lib/src/decoration/neumorphic_text_decoration_painter.dart/0 | {
"file_path": "Flutter-Neumorphic/lib/src/decoration/neumorphic_text_decoration_painter.dart",
"repo_id": "Flutter-Neumorphic",
"token_count": 3546
} | 4 |
import 'dart:ui';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart' show IconThemeData, TextTheme;
import 'package:flutter/painting.dart';
import 'package:flutter_neumorphic/src/theme/app_bar.dart';
import 'package:flutter_neumorphic/src/widget/container.dart';
import '../../flutter_neumorphic.dart';
import '../colors.dart';
import '../light_source.dart';
import '../shape.dart';
export '../colors.dart';
export '../light_source.dart';
export '../shape.dart';
//region theme
const double _defaultDepth = 4;
const double _defaultIntensity = 0.7;
const Color _defaultAccent = NeumorphicColors.accent;
const Color _defaultVariant = NeumorphicColors.variant;
const Color _defaultDisabledColor = NeumorphicColors.disabled;
const Color _defaultTextColor = NeumorphicColors.defaultTextColor;
const LightSource _defaultLightSource = LightSource.topLeft;
const Color _defaultBaseColor = NeumorphicColors.background;
const double _defaultBorderSize = 0.3;
/// Used with the NeumorphicTheme
///
/// ```
/// NeumorphicTheme(
/// theme: NeumorphicThemeData(...)
/// darkTheme: : NeumorphicThemeData(...)
/// child: ...
/// )`
/// ``
///
/// Contains all default values used in child Neumorphic Elements as
/// default colors : baseColor, accentColor, variantColor
/// default depth & intensities, used to generate white / dark shadows
/// default lightsource, used to calculate the angle of the shadow
/// @see [LightSource]
///
@immutable
class NeumorphicThemeData {
final Color baseColor;
final Color accentColor;
final Color variantColor;
final Color disabledColor;
final Color shadowLightColor;
final Color shadowDarkColor;
final Color shadowLightColorEmboss;
final Color shadowDarkColorEmboss;
final NeumorphicBoxShape? _boxShape;
NeumorphicBoxShape get boxShape =>
_boxShape ?? NeumorphicBoxShape.roundRect(BorderRadius.circular(8));
final Color borderColor;
final double borderWidth;
final Color defaultTextColor; //TODO maybe use TextStyle here
final double _depth;
final double _intensity;
final LightSource lightSource;
final bool disableDepth;
/// Default text theme to use and apply across the app
final TextTheme textTheme;
/// Default button style to use and apply across the app
final NeumorphicStyle? buttonStyle;
/// Default icon theme to use and apply across the app
final IconThemeData iconTheme;
final NeumorphicAppBarThemeData appBarTheme;
/// Get this theme's depth, clamp to min/max neumorphic constants
double get depth => _depth.clamp(Neumorphic.MIN_DEPTH, Neumorphic.MAX_DEPTH);
/// Get this theme's intensity, clamp to min/max neumorphic constants
double get intensity =>
_intensity.clamp(Neumorphic.MIN_INTENSITY, Neumorphic.MAX_INTENSITY);
const NeumorphicThemeData({
this.baseColor = _defaultBaseColor,
double depth = _defaultDepth,
NeumorphicBoxShape? boxShape,
double intensity = _defaultIntensity,
this.accentColor = _defaultAccent,
this.variantColor = _defaultVariant,
this.disabledColor = _defaultDisabledColor,
this.shadowLightColor = NeumorphicColors.decorationMaxWhiteColor,
this.shadowDarkColor = NeumorphicColors.decorationMaxDarkColor,
this.shadowLightColorEmboss = NeumorphicColors.embossMaxWhiteColor,
this.shadowDarkColorEmboss = NeumorphicColors.embossMaxDarkColor,
this.defaultTextColor = _defaultTextColor,
this.lightSource = _defaultLightSource,
this.textTheme = const TextTheme(),
this.iconTheme = const IconThemeData(),
this.buttonStyle,
this.appBarTheme = const NeumorphicAppBarThemeData(),
this.borderColor = NeumorphicColors.defaultBorder,
this.borderWidth = _defaultBorderSize,
this.disableDepth = false,
}) : this._depth = depth,
this._boxShape = boxShape,
this._intensity = intensity;
const NeumorphicThemeData.dark({
this.baseColor = NeumorphicColors.darkBackground,
double depth = _defaultDepth,
NeumorphicBoxShape? boxShape,
double intensity = _defaultIntensity,
this.accentColor = _defaultAccent,
this.textTheme = const TextTheme(),
this.buttonStyle,
this.iconTheme = const IconThemeData(),
this.appBarTheme = const NeumorphicAppBarThemeData(),
this.variantColor = NeumorphicColors.darkVariant,
this.disabledColor = NeumorphicColors.darkDisabled,
this.shadowLightColor = NeumorphicColors.decorationMaxWhiteColor,
this.shadowDarkColor = NeumorphicColors.decorationMaxDarkColor,
this.shadowLightColorEmboss = NeumorphicColors.embossMaxWhiteColor,
this.shadowDarkColorEmboss = NeumorphicColors.embossMaxDarkColor,
this.defaultTextColor = NeumorphicColors.darkDefaultTextColor,
this.lightSource = _defaultLightSource,
this.borderColor = NeumorphicColors.darkDefaultBorder,
this.borderWidth = _defaultBorderSize,
this.disableDepth = false,
}) : this._depth = depth,
this._boxShape = boxShape,
this._intensity = intensity;
@override
String toString() {
return 'NeumorphicTheme{baseColor: $baseColor, boxShape: $boxShape, disableDepth: $disableDepth, accentColor: $accentColor, variantColor: $variantColor, disabledColor: $disabledColor, _depth: $_depth, intensity: $intensity, lightSource: $lightSource}';
}
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is NeumorphicThemeData &&
runtimeType == other.runtimeType &&
baseColor == other.baseColor &&
boxShape == other.boxShape &&
textTheme == other.textTheme &&
iconTheme == other.iconTheme &&
buttonStyle == other.buttonStyle &&
appBarTheme == other.appBarTheme &&
accentColor == other.accentColor &&
shadowDarkColor == other.shadowDarkColor &&
shadowLightColor == other.shadowLightColor &&
shadowDarkColorEmboss == other.shadowDarkColorEmboss &&
shadowLightColorEmboss == other.shadowLightColorEmboss &&
disabledColor == other.disabledColor &&
variantColor == other.variantColor &&
disableDepth == other.disableDepth &&
defaultTextColor == other.defaultTextColor &&
borderWidth == other.borderWidth &&
borderColor == other.borderColor &&
_depth == other._depth &&
_intensity == other._intensity &&
lightSource == other.lightSource;
@override
int get hashCode =>
baseColor.hashCode ^
textTheme.hashCode ^
iconTheme.hashCode ^
buttonStyle.hashCode ^
appBarTheme.hashCode ^
accentColor.hashCode ^
variantColor.hashCode ^
disabledColor.hashCode ^
shadowDarkColor.hashCode ^
shadowLightColor.hashCode ^
shadowDarkColorEmboss.hashCode ^
shadowLightColorEmboss.hashCode ^
defaultTextColor.hashCode ^
disableDepth.hashCode ^
borderWidth.hashCode ^
borderColor.hashCode ^
_depth.hashCode ^
boxShape.hashCode ^
_intensity.hashCode ^
lightSource.hashCode;
/// Create a copy of this theme
/// With possibly new values given from this method's arguments
NeumorphicThemeData copyWith({
Color? baseColor,
Color? accentColor,
Color? variantColor,
Color? disabledColor,
Color? shadowLightColor,
Color? shadowDarkColor,
Color? shadowLightColorEmboss,
Color? shadowDarkColorEmboss,
Color? defaultTextColor,
NeumorphicBoxShape? boxShape,
TextTheme? textTheme,
NeumorphicStyle? buttonStyle,
IconThemeData? iconTheme,
NeumorphicAppBarThemeData? appBarTheme,
NeumorphicStyle? defaultStyle,
bool? disableDepth,
double? depth,
double? intensity,
Color? borderColor,
double? borderSize,
LightSource? lightSource,
}) {
return new NeumorphicThemeData(
baseColor: baseColor ?? this.baseColor,
textTheme: textTheme ?? this.textTheme,
iconTheme: iconTheme ?? this.iconTheme,
buttonStyle: buttonStyle ?? this.buttonStyle,
boxShape: boxShape ?? this.boxShape,
appBarTheme: appBarTheme ?? this.appBarTheme,
accentColor: accentColor ?? this.accentColor,
variantColor: variantColor ?? this.variantColor,
disabledColor: disabledColor ?? this.disabledColor,
defaultTextColor: defaultTextColor ?? this.defaultTextColor,
disableDepth: disableDepth ?? this.disableDepth,
shadowDarkColor: shadowDarkColor ?? this.shadowDarkColor,
shadowLightColor: shadowLightColor ?? this.shadowLightColor,
shadowDarkColorEmboss:
shadowDarkColorEmboss ?? this.shadowDarkColorEmboss,
shadowLightColorEmboss:
shadowLightColorEmboss ?? this.shadowLightColorEmboss,
depth: depth ?? this._depth,
borderWidth: borderSize ?? this.borderWidth,
borderColor: borderColor ?? this.borderColor,
intensity: intensity ?? this._intensity,
lightSource: lightSource ?? this.lightSource,
);
}
/// Create a copy of this theme
/// With possibly new values given from the given second theme
NeumorphicThemeData copyFrom({
required NeumorphicThemeData other,
}) {
return new NeumorphicThemeData(
baseColor: other.baseColor,
accentColor: other.accentColor,
variantColor: other.variantColor,
disableDepth: other.disableDepth,
disabledColor: other.disabledColor,
defaultTextColor: other.defaultTextColor,
shadowDarkColor: other.shadowDarkColor,
shadowLightColor: other.shadowLightColor,
shadowDarkColorEmboss: other.shadowDarkColorEmboss,
shadowLightColorEmboss: other.shadowLightColorEmboss,
textTheme: other.textTheme,
iconTheme: other.iconTheme,
buttonStyle: other.buttonStyle,
appBarTheme: other.appBarTheme,
depth: other.depth,
boxShape: other.boxShape,
borderColor: other.borderColor,
borderWidth: other.borderWidth,
intensity: other.intensity,
lightSource: other.lightSource,
);
}
}
//endregion
//region style
const NeumorphicShape _defaultShape = NeumorphicShape.flat;
//const double _defaultBorderRadius = 5;
const neumorphicDefaultTheme = NeumorphicThemeData();
const neumorphicDefaultDarkTheme = NeumorphicThemeData.dark();
class NeumorphicBorder {
final bool isEnabled;
final Color? color;
final double? width;
const NeumorphicBorder({
this.isEnabled = true,
this.color,
this.width,
});
const NeumorphicBorder.none()
: this.isEnabled = true,
this.color = const Color(0x00000000),
this.width = 0;
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is NeumorphicBorder &&
runtimeType == other.runtimeType &&
isEnabled == other.isEnabled &&
color == other.color &&
width == other.width;
@override
int get hashCode => isEnabled.hashCode ^ color.hashCode ^ width.hashCode;
@override
String toString() {
return 'NeumorphicBorder{isEnabled: $isEnabled, color: $color, width: $width}';
}
static NeumorphicBorder? lerp(
NeumorphicBorder? a, NeumorphicBorder? b, double t) {
if (a == null && b == null) return null;
if (t == 0.0) return a;
if (t == 1.0) return b;
return NeumorphicBorder(
color: Color.lerp(a!.color, b!.color, t),
isEnabled: a.isEnabled,
width: lerpDouble(a.width, b.width, t),
);
}
NeumorphicBorder copyWithThemeIfNull({Color? color, double? width}) {
return NeumorphicBorder(
isEnabled: this.isEnabled,
color: this.color ?? color,
width: this.width ?? width,
);
}
}
class NeumorphicStyle {
final Color? color;
final double? _depth;
final double? _intensity;
final double _surfaceIntensity;
final LightSource lightSource;
final bool? disableDepth;
final NeumorphicBorder border;
final bool oppositeShadowLightSource;
final NeumorphicShape shape;
final NeumorphicBoxShape? boxShape;
final NeumorphicThemeData? theme;
//override the "white" color
final Color? shadowLightColor;
//override the "dark" color
final Color? shadowDarkColor;
//override the "white" color
final Color? shadowLightColorEmboss;
//override the "dark" color
final Color? shadowDarkColorEmboss;
const NeumorphicStyle({
this.shape = _defaultShape,
this.lightSource = LightSource.topLeft,
this.border = const NeumorphicBorder.none(),
this.color,
this.boxShape, //nullable by default, will use the one defined in theme if not set
this.shadowLightColor,
this.shadowDarkColor,
this.shadowLightColorEmboss,
this.shadowDarkColorEmboss,
double? depth,
double? intensity,
double surfaceIntensity = 0.25,
this.disableDepth,
this.oppositeShadowLightSource = false,
}) : this._depth = depth,
this.theme = null,
this._intensity = intensity,
this._surfaceIntensity = surfaceIntensity;
// with theme constructor is only available privately, please use copyWithThemeIfNull
const NeumorphicStyle._withTheme({
this.theme,
this.shape = _defaultShape,
this.lightSource = LightSource.topLeft,
this.color,
this.boxShape,
this.border = const NeumorphicBorder.none(),
this.shadowLightColor,
this.shadowDarkColor,
this.shadowLightColorEmboss,
this.shadowDarkColorEmboss,
this.oppositeShadowLightSource = false,
this.disableDepth,
double? depth,
double? intensity,
double surfaceIntensity = 0.25,
}) : this._depth = depth,
this._intensity = intensity,
this._surfaceIntensity = surfaceIntensity;
double? get depth =>
_depth?.clamp(Neumorphic.MIN_DEPTH, Neumorphic.MAX_DEPTH);
double? get intensity =>
_intensity?.clamp(Neumorphic.MIN_INTENSITY, Neumorphic.MAX_INTENSITY);
double get surfaceIntensity => _surfaceIntensity.clamp(
Neumorphic.MIN_INTENSITY, Neumorphic.MAX_INTENSITY);
NeumorphicStyle copyWithThemeIfNull(NeumorphicThemeData theme) {
return NeumorphicStyle._withTheme(
theme: theme,
color: this.color ?? theme.baseColor,
boxShape: this.boxShape ?? theme.boxShape,
shape: this.shape,
border: this.border.copyWithThemeIfNull(
color: theme.borderColor, width: theme.borderWidth),
shadowDarkColor: this.shadowDarkColor ?? theme.shadowDarkColor,
shadowLightColor: this.shadowLightColor ?? theme.shadowLightColor,
shadowDarkColorEmboss:
this.shadowDarkColorEmboss ?? theme.shadowDarkColorEmboss,
shadowLightColorEmboss:
this.shadowLightColorEmboss ?? theme.shadowLightColorEmboss,
depth: this.depth ?? theme.depth,
intensity: this.intensity ?? theme.intensity,
disableDepth: this.disableDepth ?? theme.disableDepth,
surfaceIntensity: this.surfaceIntensity,
oppositeShadowLightSource: this.oppositeShadowLightSource,
lightSource: this.lightSource);
}
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is NeumorphicStyle &&
runtimeType == other.runtimeType &&
color == other.color &&
boxShape == other.boxShape &&
border == other.border &&
shadowDarkColor == other.shadowDarkColor &&
shadowLightColor == other.shadowLightColor &&
shadowDarkColorEmboss == other.shadowDarkColorEmboss &&
shadowLightColorEmboss == other.shadowLightColorEmboss &&
disableDepth == other.disableDepth &&
_depth == other._depth &&
_intensity == other._intensity &&
_surfaceIntensity == other._surfaceIntensity &&
lightSource == other.lightSource &&
oppositeShadowLightSource == other.oppositeShadowLightSource &&
shape == other.shape &&
theme == other.theme;
@override
int get hashCode =>
color.hashCode ^
shadowDarkColor.hashCode ^
boxShape.hashCode ^
shadowLightColor.hashCode ^
shadowDarkColorEmboss.hashCode ^
shadowLightColorEmboss.hashCode ^
_depth.hashCode ^
border.hashCode ^
_intensity.hashCode ^
disableDepth.hashCode ^
_surfaceIntensity.hashCode ^
lightSource.hashCode ^
oppositeShadowLightSource.hashCode ^
shape.hashCode ^
theme.hashCode;
NeumorphicStyle copyWith({
Color? color,
NeumorphicBorder? border,
NeumorphicBoxShape? boxShape,
Color? shadowLightColor,
Color? shadowDarkColor,
Color? shadowLightColorEmboss,
Color? shadowDarkColorEmboss,
double? depth,
double? intensity,
double? surfaceIntensity,
LightSource? lightSource,
bool? disableDepth,
double? borderRadius,
bool? oppositeShadowLightSource,
NeumorphicShape? shape,
}) {
return NeumorphicStyle._withTheme(
color: color ?? this.color,
border: border ?? this.border,
boxShape: boxShape ?? this.boxShape,
shadowDarkColor: shadowDarkColor ?? this.shadowDarkColor,
shadowLightColor: shadowLightColor ?? this.shadowLightColor,
shadowDarkColorEmboss:
shadowDarkColorEmboss ?? this.shadowDarkColorEmboss,
shadowLightColorEmboss:
shadowLightColorEmboss ?? this.shadowLightColorEmboss,
depth: depth ?? this.depth,
theme: this.theme,
intensity: intensity ?? this.intensity,
surfaceIntensity: surfaceIntensity ?? this.surfaceIntensity,
disableDepth: disableDepth ?? this.disableDepth,
lightSource: lightSource ?? this.lightSource,
oppositeShadowLightSource:
oppositeShadowLightSource ?? this.oppositeShadowLightSource,
shape: shape ?? this.shape,
);
}
@override
String toString() {
return 'NeumorphicStyle{color: $color, boxShape: $boxShape, _depth: $_depth, intensity: $intensity, disableDepth: $disableDepth, lightSource: $lightSource, shape: $shape, theme: $theme, oppositeShadowLightSource: $oppositeShadowLightSource}';
}
NeumorphicStyle applyDisableDepth() {
if (disableDepth == true) {
return this.copyWith(depth: 0);
} else {
return this;
}
}
}
//endregion
| Flutter-Neumorphic/lib/src/theme/theme.dart/0 | {
"file_path": "Flutter-Neumorphic/lib/src/theme/theme.dart",
"repo_id": "Flutter-Neumorphic",
"token_count": 6439
} | 5 |
import 'package:flutter/widgets.dart';
import '../neumorphic_box_shape.dart';
import '../theme/neumorphic_theme.dart';
import 'button.dart';
import 'container.dart';
typedef void NeumorphicRadioListener<T>(T value);
/// A Style used to customize a [NeumorphicRadio]
///
/// [selectedDepth] : the depth when checked
/// [unselectedDepth] : the depth when unchecked (default : theme.depth)
///
/// [intensity] : a customizable neumorphic intensity for this widget
///
/// [boxShape] : a customizable neumorphic boxShape for this widget
/// @see [NeumorphicBoxShape]
///
/// [shape] : a customizable neumorphic shape for this widget
/// @see [NeumorphicShape] (concave, convex, flat)
///
class NeumorphicRadioStyle {
final double? selectedDepth;
final double? unselectedDepth;
final bool disableDepth;
final Color? selectedColor; //null for default
final Color? unselectedColor; //null for unchanged color
final double? intensity;
final NeumorphicShape? shape;
final NeumorphicBorder border;
final NeumorphicBoxShape? boxShape;
final LightSource? lightSource;
const NeumorphicRadioStyle({
this.selectedDepth,
this.unselectedDepth,
this.selectedColor,
this.unselectedColor,
this.lightSource,
this.disableDepth = false,
this.boxShape,
this.border = const NeumorphicBorder.none(),
this.intensity,
this.shape,
});
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is NeumorphicRadioStyle &&
runtimeType == other.runtimeType &&
disableDepth == other.disableDepth &&
lightSource == other.lightSource &&
border == other.border &&
selectedDepth == other.selectedDepth &&
unselectedDepth == other.unselectedDepth &&
selectedColor == other.selectedColor &&
unselectedColor == other.unselectedColor &&
boxShape == other.boxShape &&
intensity == other.intensity &&
shape == other.shape;
@override
int get hashCode =>
disableDepth.hashCode ^
selectedDepth.hashCode ^
lightSource.hashCode ^
selectedColor.hashCode ^
unselectedColor.hashCode ^
boxShape.hashCode ^
border.hashCode ^
unselectedDepth.hashCode ^
intensity.hashCode ^
shape.hashCode;
}
/// A Neumorphic Radio
///
/// It takes a `value` and a `groupValue`
/// if (value == groupValue) => checked
///
/// takes a NeumorphicRadioStyle as `style`
///
/// notifies the parent when user interact with this widget with `onChanged`
///
/// ```
/// int _groupValue;
///
/// Widget _buildRadios() {
/// return Row(
/// children: <Widget>[
///
/// NeumorphicRadio(
/// child: SizedBox(
/// height: 50,
/// width: 50,
/// child: Center(
/// child: Text("1"),
/// ),
/// ),
/// value: 1,
/// groupValue: _groupValue,
/// onChanged: (value) {
/// setState(() {
/// _groupValue = value;
/// });
/// },
/// ),
///
/// NeumorphicRadio(
/// child: SizedBox(
/// height: 50,
/// width: 50,
/// child: Center(
/// child: Text("2"),
/// ),
/// ),
/// value: 2,
/// groupValue: _groupValue,
/// onChanged: (value) {
/// setState(() {
/// _groupValue = value;
/// });
/// },
/// ),
///
/// NeumorphicRadio(
/// child: SizedBox(
/// height: 50,
/// width: 50,
/// child: Center(
/// child: Text("3"),
/// ),
/// ),
/// value: 3,
/// groupValue: _groupValue,
/// onChanged: (value) {
/// setState(() {
/// _groupValue = value;
/// });
/// },
/// ),
///
/// ],
/// );
/// }
/// ```
///
@immutable
class NeumorphicRadio<T> extends StatelessWidget {
final Widget? child;
final T? value;
final T? groupValue;
final EdgeInsets padding;
final NeumorphicRadioStyle style;
final NeumorphicRadioListener<T?>? onChanged;
final bool isEnabled;
final Duration duration;
final Curve curve;
NeumorphicRadio({
this.child,
this.style = const NeumorphicRadioStyle(),
this.value,
this.curve = Neumorphic.DEFAULT_CURVE,
this.duration = Neumorphic.DEFAULT_DURATION,
this.padding = EdgeInsets.zero,
this.groupValue,
this.onChanged,
this.isEnabled = true,
});
bool get isSelected => this.value != null && this.value == this.groupValue;
void _onClick() {
if (this.onChanged != null) {
if (this.value == this.groupValue) {
//unselect
this.onChanged!(null);
} else {
this.onChanged!(this.value);
}
}
}
@override
Widget build(BuildContext context) {
final NeumorphicThemeData theme = NeumorphicTheme.currentTheme(context);
final double selectedDepth =
-1 * (this.style.selectedDepth ?? theme.depth).abs();
final double unselectedDepth =
(this.style.unselectedDepth ?? theme.depth).abs();
double depth = isSelected ? selectedDepth : unselectedDepth;
if (!this.isEnabled) {
depth = 0;
}
final Color unselectedColor = this.style.unselectedColor ?? theme.baseColor;
final Color selectedColor = this.style.selectedColor ?? unselectedColor;
final Color color = isSelected ? selectedColor : unselectedColor;
return NeumorphicButton(
onPressed: () {
_onClick();
},
duration: this.duration,
curve: this.curve,
padding: this.padding,
pressed: isSelected,
minDistance: selectedDepth,
child: this.child,
style: NeumorphicStyle(
border: this.style.border,
color: color,
boxShape: this.style.boxShape,
lightSource: this.style.lightSource ?? theme.lightSource,
disableDepth: this.style.disableDepth,
intensity: this.style.intensity,
depth: depth,
shape: this.style.shape ?? NeumorphicShape.flat,
),
);
}
}
| Flutter-Neumorphic/lib/src/widget/radio.dart/0 | {
"file_path": "Flutter-Neumorphic/lib/src/widget/radio.dart",
"repo_id": "Flutter-Neumorphic",
"token_count": 2586
} | 6 |
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>app</name>
<comment>Project app created by Buildship.</comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
</natures>
</projectDescription>
| Flutter-UI-Kit/android/app/.project/0 | {
"file_path": "Flutter-UI-Kit/android/app/.project",
"repo_id": "Flutter-UI-Kit",
"token_count": 237
} | 7 |
org.gradle.jvmargs=-Xmx1536M
| Flutter-UI-Kit/android/gradle.properties/0 | {
"file_path": "Flutter-UI-Kit/android/gradle.properties",
"repo_id": "Flutter-UI-Kit",
"token_count": 15
} | 8 |
import 'package:flutter_uikit/model/post.dart';
class PostViewModel {
List<Post> postItems;
PostViewModel({this.postItems});
getPosts() => <Post>[
Post(
personName: "Pawan",
address: "New Delhi, India",
likesCount: 100,
commentsCount: 10,
message:
"Google Developer Expert for Flutter. Passionate #Flutter, #Android Developer. #Entrepreneur #YouTuber",
personImage:
"https://avatars0.githubusercontent.com/u/12619420?s=460&v=4",
messageImage:
"https://cdn.pixabay.com/photo/2018/03/09/16/32/woman-3211957_1280.jpg",
postTime: "Just Now"),
Post(
personName: "Amanda",
address: "Canada",
likesCount: 123,
commentsCount: 78,
messageImage:
"https://cdn.pixabay.com/photo/2016/04/10/21/34/woman-1320810_960_720.jpg",
message:
"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s",
personImage:
"https://cdn.pixabay.com/photo/2016/04/10/21/34/woman-1320810_960_720.jpg",
postTime: "5h ago"),
Post(
personName: "Eric",
address: "California",
likesCount: 50,
commentsCount: 5,
message:
"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s",
personImage:
"https://cdn.pixabay.com/photo/2013/07/18/20/24/brad-pitt-164880_960_720.jpg",
postTime: "2h ago"),
Post(
personName: "Jack",
address: "California",
likesCount: 23,
commentsCount: 4,
messageImage:
"https://cdn.pixabay.com/photo/2014/09/07/16/53/hands-437968_960_720.jpg",
message:
"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s",
personImage:
"https://cdn.pixabay.com/photo/2016/04/01/09/51/actor-1299629_960_720.png",
postTime: "3h ago"),
Post(
personName: "Neha",
address: "Punjab",
likesCount: 35,
commentsCount: 2,
messageImage:
"https://cdn.pixabay.com/photo/2015/11/26/00/14/fashion-1063100_960_720.jpg",
message:
"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s",
personImage:
"https://cdn.pixabay.com/photo/2015/11/26/00/14/fashion-1063100_960_720.jpg",
postTime: "1d ago"),
Post(
personName: "Pawan",
address: "New Delhi, India",
likesCount: 100,
commentsCount: 10,
message:
"Google Developer Expert for Flutter. Passionate #Flutter, #Android Developer. #Entrepreneur #YouTuber",
personImage:
"https://avatars0.githubusercontent.com/u/12619420?s=460&v=4",
messageImage:
"https://cdn.pixabay.com/photo/2018/03/09/16/32/woman-3211957_1280.jpg",
postTime: "Just Now"),
Post(
personName: "Eric",
address: "California",
likesCount: 50,
commentsCount: 5,
message:
"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s",
personImage:
"https://cdn.pixabay.com/photo/2013/07/18/20/24/brad-pitt-164880_960_720.jpg",
postTime: "2h ago"),
Post(
personName: "Jack",
address: "California",
likesCount: 23,
commentsCount: 4,
messageImage:
"https://cdn.pixabay.com/photo/2014/09/07/16/53/hands-437968_960_720.jpg",
message:
"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s",
personImage:
"https://cdn.pixabay.com/photo/2016/04/01/09/51/actor-1299629_960_720.png",
postTime: "3h ago"),
Post(
personName: "Amanda",
address: "Canada",
likesCount: 123,
commentsCount: 78,
messageImage:
"https://cdn.pixabay.com/photo/2016/04/10/21/34/woman-1320810_960_720.jpg",
message:
"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s",
personImage:
"https://cdn.pixabay.com/photo/2016/04/10/21/34/woman-1320810_960_720.jpg",
postTime: "5h ago"),
Post(
personName: "Neha",
address: "Punjab",
likesCount: 35,
commentsCount: 2,
messageImage:
"https://cdn.pixabay.com/photo/2015/11/26/00/14/fashion-1063100_960_720.jpg",
message:
"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s",
personImage:
"https://cdn.pixabay.com/photo/2015/11/26/00/14/fashion-1063100_960_720.jpg",
postTime: "1d ago"),
];
}
| Flutter-UI-Kit/lib/logic/viewmodel/post_view_model.dart/0 | {
"file_path": "Flutter-UI-Kit/lib/logic/viewmodel/post_view_model.dart",
"repo_id": "Flutter-UI-Kit",
"token_count": 2894
} | 9 |
import 'dart:async';
import 'package:flutter_uikit/model/login.dart';
import 'package:flutter_uikit/model/otp.dart';
import 'package:flutter_uikit/services/abstract/i_otp_service.dart';
import 'package:flutter_uikit/services/network_service.dart';
import 'package:flutter_uikit/services/network_service_response.dart';
import 'package:flutter_uikit/services/restclient.dart';
class OTPService extends NetworkService implements IOTPService {
static const _kCreateOtpUrl = "/createOtpForUser/{1}";
static const _kUserOtpLogin = "/userotplogin";
OTPService(RestClient rest) : super(rest);
@override
Future<NetworkServiceResponse<CreateOTPResponse>> createOTP(
String phoneNumber) async {
var result = await rest.getAsync<CreateOTPResponse>(
Uri.parse(_kCreateOtpUrl.replaceFirst("{1}", phoneNumber)).toString());
if (result.mappedResult != null) {
var res = CreateOTPResponse.fromJson(result.mappedResult);
return new NetworkServiceResponse(
content: res,
success: result.networkServiceResponse.success,
);
}
return new NetworkServiceResponse(
success: result.networkServiceResponse.success,
message: result.networkServiceResponse.message);
}
@override
Future<NetworkServiceResponse<OTPResponse>> fetchOTPLoginResponse(
Login userLogin) async {
var result = await rest.postAsync<OTPResponse>(_kUserOtpLogin, userLogin);
if (result.mappedResult != null) {
var res = OTPResponse.fromJson(result.mappedResult);
return new NetworkServiceResponse(
content: res,
success: result.networkServiceResponse.success,
);
}
return new NetworkServiceResponse(
success: result.networkServiceResponse.success,
message: result.networkServiceResponse.message);
}
}
| Flutter-UI-Kit/lib/services/real/real_otp_service.dart/0 | {
"file_path": "Flutter-UI-Kit/lib/services/real/real_otp_service.dart",
"repo_id": "Flutter-UI-Kit",
"token_count": 650
} | 10 |
import 'package:flutter/material.dart';
import 'package:flutter_uikit/ui/widgets/common_scaffold.dart';
import 'package:flutter_uikit/ui/widgets/common_switch.dart';
import 'package:flutter_uikit/utils/uidata.dart';
class SettingsOnePage extends StatelessWidget {
Widget bodyData() => SingleChildScrollView(
child: Theme(
data: ThemeData(fontFamily: UIData.ralewayFont),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
//1
Padding(
padding: const EdgeInsets.all(16.0),
child: Text(
"General Setting",
style: TextStyle(color: Colors.grey.shade700),
),
),
Card(
color: Colors.white,
elevation: 2.0,
child: Column(
children: <Widget>[
ListTile(
leading: Icon(
Icons.person,
color: Colors.grey,
),
title: Text("Account"),
trailing: Icon(Icons.arrow_right),
),
ListTile(
leading: Icon(
Icons.mail,
color: Colors.red,
),
title: Text("Gmail"),
trailing: Icon(Icons.arrow_right),
),
ListTile(
leading: Icon(
Icons.sync,
color: Colors.blue,
),
title: Text("Sync Data"),
trailing: Icon(Icons.arrow_right),
)
],
),
),
//2
Padding(
padding: const EdgeInsets.all(16.0),
child: Text(
"Network",
style: TextStyle(color: Colors.grey.shade700),
),
),
Card(
color: Colors.white,
elevation: 2.0,
child: Column(
children: <Widget>[
ListTile(
leading: Icon(
Icons.sim_card,
color: Colors.grey,
),
title: Text("Simcard & Network"),
trailing: Icon(Icons.arrow_right),
),
ListTile(
leading: Icon(
Icons.wifi,
color: Colors.amber,
),
title: Text("Wifi"),
trailing: CommonSwitch(
defValue: true,
)),
ListTile(
leading: Icon(
Icons.bluetooth,
color: Colors.blue,
),
title: Text("Bluetooth"),
trailing: CommonSwitch(
defValue: false,
),
),
ListTile(
leading: Icon(
Icons.more_horiz,
color: Colors.grey,
),
title: Text("More"),
trailing: Icon(Icons.arrow_right),
),
],
),
),
//3
Padding(
padding: const EdgeInsets.all(16.0),
child: Text(
"Sound",
style: TextStyle(color: Colors.grey.shade700),
),
),
Card(
color: Colors.white,
elevation: 2.0,
child: Column(
children: <Widget>[
ListTile(
leading: Icon(
Icons.do_not_disturb_off,
color: Colors.orange,
),
title: Text("Silent Mode"),
trailing: CommonSwitch(
defValue: false,
),
),
ListTile(
leading: Icon(
Icons.vibration,
color: Colors.purple,
),
title: Text("Vibrate Mode"),
trailing: CommonSwitch(
defValue: true,
),
),
ListTile(
leading: Icon(
Icons.volume_up,
color: Colors.green,
),
title: Text("Sound Volume"),
trailing: Icon(Icons.arrow_right),
),
ListTile(
leading: Icon(
Icons.phonelink_ring,
color: Colors.grey,
),
title: Text("Ringtone"),
trailing: Icon(Icons.arrow_right),
)
],
),
),
],
),
),
);
@override
Widget build(BuildContext context) {
return CommonScaffold(
appTitle: "Device Settings",
showDrawer: false,
showFAB: false,
backGroundColor: Colors.grey.shade300,
bodyData: bodyData(),
);
}
}
| Flutter-UI-Kit/lib/ui/page/settings/settings_one_page.dart/0 | {
"file_path": "Flutter-UI-Kit/lib/ui/page/settings/settings_one_page.dart",
"repo_id": "Flutter-UI-Kit",
"token_count": 3899
} | 11 |
import 'package:flutter/material.dart';
import 'package:flutter_uikit/ui/widgets/about_tile.dart';
import 'package:flutter_uikit/utils/uidata.dart';
class CommonDrawer extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Drawer(
child: ListView(
padding: EdgeInsets.zero,
children: <Widget>[
UserAccountsDrawerHeader(
accountName: Text(
"Pawan Kumar",
),
accountEmail: Text(
"mtechviral@gmail.com",
),
currentAccountPicture: new CircleAvatar(
backgroundImage: new AssetImage(UIData.pkImage),
),
),
new ListTile(
title: Text(
"Profile",
style: TextStyle(fontWeight: FontWeight.w700, fontSize: 18.0),
),
leading: Icon(
Icons.person,
color: Colors.blue,
),
),
new ListTile(
title: Text(
"Shopping",
style: TextStyle(fontWeight: FontWeight.w700, fontSize: 18.0),
),
leading: Icon(
Icons.shopping_cart,
color: Colors.green,
),
),
new ListTile(
title: Text(
"Dashboard",
style: TextStyle(fontWeight: FontWeight.w700, fontSize: 18.0),
),
leading: Icon(
Icons.dashboard,
color: Colors.red,
),
),
new ListTile(
title: Text(
"Timeline",
style: TextStyle(fontWeight: FontWeight.w700, fontSize: 18.0),
),
leading: Icon(
Icons.timeline,
color: Colors.cyan,
),
),
Divider(),
new ListTile(
title: Text(
"Settings",
style: TextStyle(fontWeight: FontWeight.w700, fontSize: 18.0),
),
leading: Icon(
Icons.settings,
color: Colors.brown,
),
),
Divider(),
MyAboutTile()
],
),
);
}
}
| Flutter-UI-Kit/lib/ui/widgets/common_drawer.dart/0 | {
"file_path": "Flutter-UI-Kit/lib/ui/widgets/common_drawer.dart",
"repo_id": "Flutter-UI-Kit",
"token_count": 1270
} | 12 |
import 'package:flutter/material.dart';
import 'package:flutter_mates/ui/friends/friends_list_page.dart';
void main() {
runApp(new MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new MaterialApp(
theme: new ThemeData(
primarySwatch: Colors.blue,
accentColor: const Color(0xFFF850DD),
),
home: new FriendsListPage(),
);
}
} | FlutterMates/lib/main.dart/0 | {
"file_path": "FlutterMates/lib/main.dart",
"repo_id": "FlutterMates",
"token_count": 166
} | 13 |
library beautiful_popup;
import 'dart:typed_data';
import 'package:flutter/material.dart';
import 'dart:ui' as ui;
import 'package:image/image.dart' as img;
import 'package:flutter/services.dart';
import 'templates/Common.dart';
import 'templates/OrangeRocket.dart';
import 'templates/GreenRocket.dart';
import 'templates/OrangeRocket2.dart';
import 'templates/Coin.dart';
import 'templates/BlueRocket.dart';
import 'templates/Thumb.dart';
import 'templates/Gift.dart';
import 'templates/Camera.dart';
import 'templates/Notification.dart';
import 'templates/Geolocation.dart';
import 'templates/Success.dart';
import 'templates/Fail.dart';
import 'templates/Authentication.dart';
import 'templates/Term.dart';
import 'templates/RedPacket.dart';
export 'templates/Common.dart';
export 'templates/OrangeRocket.dart';
export 'templates/GreenRocket.dart';
export 'templates/OrangeRocket2.dart';
export 'templates/Coin.dart';
export 'templates/BlueRocket.dart';
export 'templates/Thumb.dart';
export 'templates/Gift.dart';
export 'templates/Camera.dart';
export 'templates/Notification.dart';
export 'templates/Geolocation.dart';
export 'templates/Success.dart';
export 'templates/Fail.dart';
export 'templates/Authentication.dart';
export 'templates/Term.dart';
export 'templates/RedPacket.dart';
class BeautifulPopup {
BuildContext _context;
BuildContext get context => _context;
Type? _template;
Type? get template => _template;
BeautifulPopupTemplate Function(BeautifulPopup options)? _build;
BeautifulPopupTemplate get instance {
final build = _build;
if (build != null) return build(this);
switch (template) {
case TemplateOrangeRocket:
return TemplateOrangeRocket(this);
case TemplateGreenRocket:
return TemplateGreenRocket(this);
case TemplateOrangeRocket2:
return TemplateOrangeRocket2(this);
case TemplateCoin:
return TemplateCoin(this);
case TemplateBlueRocket:
return TemplateBlueRocket(this);
case TemplateThumb:
return TemplateThumb(this);
case TemplateGift:
return TemplateGift(this);
case TemplateCamera:
return TemplateCamera(this);
case TemplateNotification:
return TemplateNotification(this);
case TemplateGeolocation:
return TemplateGeolocation(this);
case TemplateSuccess:
return TemplateSuccess(this);
case TemplateFail:
return TemplateFail(this);
case TemplateAuthentication:
return TemplateAuthentication(this);
case TemplateTerm:
return TemplateTerm(this);
case TemplateRedPacket:
default:
return TemplateRedPacket(this);
}
}
ui.Image? _illustration;
ui.Image? get illustration => _illustration;
dynamic title = '';
dynamic content = '';
List<Widget>? actions;
Widget? close;
bool? barrierDismissible;
Color? primaryColor;
BeautifulPopup({
required BuildContext context,
required Type? template,
}) : _context = context,
_template = template {
primaryColor = instance.primaryColor; // Get the default primary color.
}
static BeautifulPopup customize({
required BuildContext context,
required BeautifulPopupTemplate Function(BeautifulPopup options) build,
}) {
final popup = BeautifulPopup(
context: context,
template: null,
);
popup._build = build;
return popup;
}
/// Recolor the BeautifulPopup.
/// This method is kind of slow.R
Future<BeautifulPopup> recolor(Color color) async {
this.primaryColor = color;
final illustrationData = await rootBundle.load(instance.illustrationKey);
final buffer = illustrationData.buffer.asUint8List();
img.Image? asset;
asset = img.readPng(buffer);
if (asset != null) {
img.adjustColor(
asset,
saturation: 0,
// hue: 0,
);
img.colorOffset(
asset,
red: color.red,
// I don't know why the effect is nicer with the number ╮(╯▽╰)╭
green: color.green ~/ 3,
blue: color.blue ~/ 2,
alpha: 0,
);
}
final paint = await PaintingBinding.instance?.instantiateImageCodec(
asset != null ? Uint8List.fromList(img.encodePng(asset)) : buffer);
final nextFrame = await paint?.getNextFrame();
_illustration = nextFrame?.image;
return this;
}
/// `title`: Must be a `String` or `Widget`. Defaults to `''`.
///
/// `content`: Must be a `String` or `Widget`. Defaults to `''`.
///
/// `actions`: The set of actions that are displaed at bottom of the dialog,
///
/// Typically this is a list of [BeautifulPopup.button]. Defaults to `[]`.
///
/// `barrierDismissible`: Determine whether this dialog can be dismissed. Default to `False`.
///
/// `close`: Close widget.
Future<T?> show<T>({
dynamic title,
dynamic content,
List<Widget>? actions,
bool barrierDismissible = false,
Widget? close,
}) {
this.title = title;
this.content = content;
this.actions = actions;
this.barrierDismissible = barrierDismissible;
this.close = close ?? instance.close;
final child = WillPopScope(
onWillPop: () {
return Future.value(barrierDismissible);
},
child: instance,
);
return showGeneralDialog<T>(
barrierColor: Colors.black38,
barrierDismissible: barrierDismissible,
barrierLabel: barrierDismissible ? 'beautiful_popup' : null,
context: context,
pageBuilder: (context, animation1, animation2) {
return child;
},
transitionDuration: Duration(milliseconds: 150),
transitionBuilder: (ctx, a1, a2, child) {
return Transform.scale(
scale: a1.value,
child: Opacity(
opacity: a1.value,
child: child,
),
);
},
);
}
BeautifulPopupButton get button => instance.button;
}
| Flutter_beautiful_popup/lib/main.dart/0 | {
"file_path": "Flutter_beautiful_popup/lib/main.dart",
"repo_id": "Flutter_beautiful_popup",
"token_count": 2207
} | 14 |
import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart';
import 'Common.dart';
import '../main.dart';
import 'package:auto_size_text/auto_size_text.dart';
/// 
class TemplateThumb extends BeautifulPopupTemplate {
final BeautifulPopup options;
TemplateThumb(this.options) : super(options);
@override
final illustrationPath = 'img/bg/thumb.png';
@override
Color get primaryColor => options.primaryColor ?? Color(0xfffb675d);
@override
final maxWidth = 400;
@override
final maxHeight = 570;
@override
final bodyMargin = 0;
@override
Widget get title {
if (options.title is Widget) {
return SizedBox(
width: percentW(54),
height: percentH(10),
child: options.title,
);
}
return SizedBox(
width: percentW(54),
child: Opacity(
opacity: 0.9,
child: AutoSizeText(
options.title,
maxLines: 1,
style: TextStyle(
fontSize: Theme.of(options.context).textTheme.headline6?.fontSize,
color: Colors.white,
fontWeight: FontWeight.bold,
),
),
),
);
}
@override
BeautifulPopupButton get button {
return ({
required String label,
required void Function() onPressed,
bool outline = false,
bool flat = false,
TextStyle labelStyle = const TextStyle(),
}) {
final gradient = LinearGradient(colors: [
primaryColor.withOpacity(0.5),
primaryColor,
]);
final double elevation = (outline || flat) ? 0 : 2;
final labelColor =
(outline || flat) ? primaryColor : Colors.white.withOpacity(0.95);
final decoration = BoxDecoration(
gradient: (outline || flat) ? null : gradient,
borderRadius: BorderRadius.all(Radius.circular(80.0)),
border: Border.all(
color: outline ? primaryColor : Colors.transparent,
width: (outline && !flat) ? 1 : 0,
),
);
final minHeight = 40.0 - (outline ? 2 : 0);
return RaisedButton(
color: Colors.transparent,
elevation: elevation,
highlightElevation: 0,
splashColor: Colors.transparent,
child: Ink(
decoration: decoration,
child: Container(
constraints: BoxConstraints(
minWidth: 100,
minHeight: minHeight,
),
alignment: Alignment.center,
child: Text(
label,
style: TextStyle(
color: Colors.white.withOpacity(0.95),
).merge(labelStyle),
),
),
),
padding: EdgeInsets.all(0),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(50),
),
onPressed: onPressed,
);
};
}
@override
get layout {
return [
Positioned(
child: background,
),
Positioned(
top: percentH(10),
left: percentW(10),
child: title,
),
Positioned(
top: percentH(28),
left: percentW(10),
right: percentW(10),
height: percentH(actions == null ? 62 : 50),
child: content,
),
Positioned(
bottom: percentW(14),
left: percentW(10),
right: percentW(10),
child: actions ?? Container(),
),
];
}
}
| Flutter_beautiful_popup/lib/templates/Thumb.dart/0 | {
"file_path": "Flutter_beautiful_popup/lib/templates/Thumb.dart",
"repo_id": "Flutter_beautiful_popup",
"token_count": 1609
} | 15 |
manifest.json,1641774262310,f81e4554dc7f05633a2c5597416813859de5ace688342db41b201d42790fb8a7
flutter_service_worker.js,1641774661603,4ba5e20515b0200b83b1139b8fa2a5bfd7449edcd218a558fdf13850e835d26e
index.html,1641774661196,5780182119495d698400b870b9ade8a4b236147acadd7ae1217483b19ce7dd1d
assets/AssetManifest.json,1641774661189,e1765baf5f9582d7f51cb137538999d143b3054c36c13a0eecaa940b3079e566
version.json,1641774661094,2f06c1ff01b63ded25d9e999e5651966d897994731d5fc924f36d69cf29d9a41
assets/FontManifest.json,1641774661189,9ea504185602e57d97b7c3517d382b8627a13c0181c490c96a9b55a5d5c8810c
favicon.png,1631367171538,fcc7c4545d5b62ad01682589e6fdc7ea03d0a3b42069963c815c344b632eb5cf
icons/Icon-192.png,1631367171538,d2e0131bb7851eb9d98f7885edb5ae4b4d6b7a6c7addf8a25b9b712b39274c0f
icons/Icon-512.png,1631367171538,7a31ce91e554f1941158ca46f31c7f3f2b7c8c129229ea74a8fae1affe335033
icons/Icon-maskable-192.png,1631367222753,dd96c123fdf6817cdf7e63d9693bcc246bac2e3782a41a6952fa41c0617c5573
icons/Icon-maskable-512.png,1631367222738,e7983524dc70254adc61764657d7e03d19284de8da586b5818d737bc08c6d14e
canvaskit/canvaskit.js,315426600000,332d67a51b86f5129fc7d929d6bb6bd0416b17fd853899efc1f5044770954ed6
canvaskit/profiling/canvaskit.js,315426600000,41ae97b4ac8a386f55b22f1962c7b564da96df256fd938d684e73a8061e70b61
assets/packages/cupertino_icons/assets/CupertinoIcons.ttf,1636501093570,3064af137aeffc9011ba060601a01177b279963822310a778aeafa74c209732c
assets/NOTICES,1641774661190,795a16e06e6dfd87b3ea62658b7b447bc99bb82b8a6f16f39c4dad17c6a9a488
assets/fonts/MaterialIcons-Regular.otf,1615596762000,5f71a8843e4edc9656c39061c2232458a6fc77e1603305960e4efa9c77f8b7a2
main.dart.js,1641774660616,0db953825ec2f14f8cc2a386d8daed616effc5dda307b286f12931fd88be27b2
canvaskit/canvaskit.wasm,315426600000,8dae2a06cf716711e3578aa55ee7b03ccdc54b4bdc9be9ee50c33515d2b3a7fe
canvaskit/profiling/canvaskit.wasm,315426600000,cb4c2221f1c20811ac3a33666833b4458656193de55b276b3c8fc31856b2f3a0
| Liquid-Pull-To-Refresh/example/.firebase/hosting.YnVpbGQvd2Vi.cache/0 | {
"file_path": "Liquid-Pull-To-Refresh/example/.firebase/hosting.YnVpbGQvd2Vi.cache",
"repo_id": "Liquid-Pull-To-Refresh",
"token_count": 1065
} | 16 |
name: liquid_pull_to_refresh
description: A beautiful and custom refresh indicator with some cool animations and transitions for flutter.
version: 3.0.1
homepage: https://github.com/aagarwal1012/Liquid-Pull-To-Refresh/
environment:
sdk: '>=2.12.0 <3.0.0'
dependencies:
flutter:
sdk: flutter
dev_dependencies:
flutter_test:
sdk: flutter
flutter: | Liquid-Pull-To-Refresh/pubspec.yaml/0 | {
"file_path": "Liquid-Pull-To-Refresh/pubspec.yaml",
"repo_id": "Liquid-Pull-To-Refresh",
"token_count": 133
} | 17 |
class CardMessage {
String id;
String avatar;
String name;
String message;
String time;
CardMessage({this.id, this.avatar, this.name, this.message, this.time});
factory CardMessage.fromJson(Map<String, dynamic> json) {
return CardMessage(
id: json["id"],
avatar: json['avatar'],
name: json['name'],
message: json['message'],
time: json['time'],
);
}
}
| animated_selection_slide/lib/model.dart/0 | {
"file_path": "animated_selection_slide/lib/model.dart",
"repo_id": "animated_selection_slide",
"token_count": 158
} | 18 |
## 3.0.0
- Upgraded to null safety
## 2.1.0
- Added `textKey` parameter
## 2.0.2+1
- Fixed screenshots
## 2.0.2
- Fixed bug where `textScaleFactor` was not taken into account (thanks @Kavantix)
## 2.0.1
- Allow fractional font sizes again
- Fixed bug with `wrapWords` not working
## 2.0.0+2
- Added logo
## 2.0.0
- Significant performance improvements
- Prevent word wrapping using `wordWrap: false`
- Replacement widget in case of text overflow: `overflowReplacement`
- Added `strutStyle` parameter from `Text`
- Fixed problem in case the `AutoSizeTextGroup` changes
- Improved documentation
- Added many more tests
## 1.1.2
- Fixed bug where system font scale was applied twice (thanks @jeffersonatsafe)
## 1.1.1
- Fixed bug where setting the style of a `TextSpan` to null in `AutoSizeText.rich` didn't work (thanks @Koridev)
- Allow `minFontSize = 0`
## 1.1.0
- Added `group` parameter and `AutoSizeGroup` to synchronize multiple `AutoSizeText`s
- Fixed bug where `minFontSize` was not used correctly
- Improved documentation
## 1.0.0
- Library is used in multiple projects in production and is considered stable now.
- Added more tests
## 0.3.0
- Added textScaleFactor property with fallback to `MediaQuery.textScaleFactorOf()` (thanks @jeroentrappers)
## 0.2.2
- Fixed tests
- Improved documentation
## 0.2.1
- Fixed problem with `minFontSize` and `maxFontSize` (thanks @apaatsio)
## 0.2.0
- Added support for Rich Text using `AutoSizeText.rich()` with one or multiple `TextSpan`s.
- Improved text size calculation (using `textScaleFactor`)
## 0.1.0
- Fixed documentation (thanks @g-balas)
- Added tests
## 0.0.2
- Fixed documentation
- Added example
## 0.0.1
- First Release
| auto_size_text/CHANGELOG.md/0 | {
"file_path": "auto_size_text/CHANGELOG.md",
"repo_id": "auto_size_text",
"token_count": 537
} | 19 |
name: example
description: AutoSizeText example
version: 1.0.0
environment:
sdk: '>=2.12.0-0 <3.0.0'
dependencies:
flutter:
sdk: flutter
auto_size_text:
path: ../
dev_dependencies:
flutter_test:
sdk: flutter
flutter:
uses-material-design: true
publish_to: none | auto_size_text/example/pubspec.yaml/0 | {
"file_path": "auto_size_text/example/pubspec.yaml",
"repo_id": "auto_size_text",
"token_count": 126
} | 20 |
import 'package:auto_size_text/auto_size_text.dart';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'utils.dart';
void main() {
testWidgets('Do not wrap words', (tester) async {
await pumpAndExpectFontSize(
tester: tester,
expectedFontSize: 20,
widget: SizedBox(
width: 100,
child: AutoSizeText(
'XXXXX XXXXX',
style: TextStyle(fontSize: 25),
wrapWords: false,
),
),
);
var height = tester.getSize(find.byType(RichText)).height;
expect(height, 40);
await pumpAndExpectFontSize(
tester: tester,
expectedFontSize: 10,
widget: SizedBox(
width: 40,
child: AutoSizeText(
'XXXXX',
style: TextStyle(fontSize: 25),
minFontSize: 10,
maxLines: 10,
wrapWords: false,
),
),
);
height = tester.getSize(find.byType(RichText)).height;
expect(height, 20);
});
testWidgets('Wrap words', (tester) async {
await pumpAndExpectFontSize(
tester: tester,
expectedFontSize: 30,
widget: SizedBox(
width: 90,
child: AutoSizeText(
'XXXXXX',
style: TextStyle(fontSize: 40),
maxLines: 2,
),
),
);
final height = tester.getSize(find.byType(RichText)).height;
expect(height, 60);
});
}
| auto_size_text/test/wrap_words_test.dart/0 | {
"file_path": "auto_size_text/test/wrap_words_test.dart",
"repo_id": "auto_size_text",
"token_count": 667
} | 21 |
import 'package:backdrop/backdrop.dart';
import 'package:flutter/material.dart';
/// Contextual info preview app.
class ContextualInfo extends StatelessWidget {
/// Default constructor for [ContextualInfo].
const ContextualInfo({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Theme(
data: ThemeData.light(),
child: BackdropScaffold(
appBar: BackdropAppBar(
title: const Text("Contextual Info Example"),
automaticallyImplyLeading: false,
),
backLayer: _createBackLayer(context),
frontLayer: _createFrontLayer(context),
stickyFrontLayer: true,
),
);
}
Widget _createBackLayer(BuildContext context) => ListView(
shrinkWrap: true,
children: const [
ListTile(
leading: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
"Name",
),
],
),
title: Text(
"Laptop Model X",
style: TextStyle(fontWeight: FontWeight.bold),
),
),
ListTile(
leading: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text("Year of production"),
],
),
title: Text(
"2019",
style: TextStyle(fontWeight: FontWeight.bold),
),
),
ListTile(
leading: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text("Place of Manufacture"),
],
),
title: Text(
"USA",
style: TextStyle(fontWeight: FontWeight.bold),
),
),
ListTile(
leading: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text("Price"),
],
),
title: Text(
"\$999",
style: TextStyle(fontWeight: FontWeight.bold),
),
),
],
);
Widget _createFrontLayer(BuildContext context) => Container(
margin: const EdgeInsets.all(16.0),
child: Column(
children: [
Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
const Icon(
Icons.computer,
size: 64.0,
),
Text(
"Laptop",
style: Theme.of(context)
.textTheme
.displaySmall!
.apply(color: Colors.black),
),
],
),
Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.center,
children: [
const Text(
"Price",
style: TextStyle(color: Colors.grey),
),
Container(
margin: const EdgeInsets.all(8.0),
child: const Text(
"\$999",
style: TextStyle(fontSize: 18),
),
),
],
),
Container(
margin: const EdgeInsets.all(8.0),
child: const Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Row(
children: [
Icon(Icons.star, color: Colors.grey),
Icon(Icons.star, color: Colors.grey),
Icon(Icons.star, color: Colors.grey),
Icon(Icons.star, color: Colors.grey),
Icon(Icons.star_half, color: Colors.grey),
],
),
Text(
"73 Reviews",
style: TextStyle(color: Colors.grey),
)
],
),
),
Container(
margin: const EdgeInsets.all(16.0),
child: Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Builder(
builder: (context) => ElevatedButton(
child: const Text("More about this product"),
onPressed: () => Backdrop.of(context).fling(),
),
)
],
),
),
ListTile(
title: Text("Reviews",
style: Theme.of(context)
.textTheme
.titleLarge!
.apply(color: Colors.black)),
),
const ListTile(
leading: Icon(Icons.account_box),
title: Text("Really satisfied!"),
subtitle: Text("John Doe"),
trailing: Text("5/5"),
),
const ListTile(
leading: Icon(Icons.account_box),
title: Text("Good price!"),
subtitle: Text("Jane Doe"),
trailing: Text("4.5/5"),
)
],
),
);
}
| backdrop/demo/lib/use_cases/contextual_info/contextual_info.dart/0 | {
"file_path": "backdrop/demo/lib/use_cases/contextual_info/contextual_info.dart",
"repo_id": "backdrop",
"token_count": 3272
} | 22 |
# example
A new Flutter project.
## Getting Started
For help getting started with Flutter, view our online
[documentation](https://flutter.io/).
| backdrop/example/README.md/0 | {
"file_path": "backdrop/example/README.md",
"repo_id": "backdrop",
"token_count": 42
} | 23 |
#!/usr/bin/env bash
##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn ( ) {
echo "$*"
}
die ( ) {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
esac
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
function splitJvmOpts() {
JVM_OPTS=("$@")
}
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
| backdrop/example/android/gradlew/0 | {
"file_path": "backdrop/example/android/gradlew",
"repo_id": "backdrop",
"token_count": 2233
} | 24 |
import 'package:backdrop/backdrop.dart';
import 'package:flutter/material.dart';
/// A wrapper for adding a sub-header to the used backdrop front layer(s).
///
/// This class can be passed to [BackdropScaffold] to specify the sub-header
/// that should be shown while the front layer is "inactive" (the back layer is
/// "showing").
///
/// Usage example:
/// ```dart
/// BackdropScaffold(
/// appBar: ...,
/// backLayer: ...,
/// subHeader: BackdropSubHeader(
/// title: Text("Sub Header"),
/// ),
/// frontLayer: ...,
/// )
/// ```
class BackdropSubHeader extends StatelessWidget {
/// The primary content of the sub-header.
final Widget title;
/// The divider that should be shown at the bottom of the sub-header.
///
/// Defaults to `Divider(height: 4.0, indent: 16.0, endIndent: 16.0)`.
final Widget? divider;
/// Padding that will be applied to the sub-header.
///
/// Defaults to `EdgeInsets.symmetric(vertical: 12.0, horizontal: 16.0)`.
final EdgeInsets padding;
/// Flag indicating whether to add default leading widget.
///
/// If set to `true`, a leading `Icon(Icons.keyboard_arrow_up)` is added to
/// the sub-header.
///
/// Defaults to `false`.
final bool automaticallyImplyLeading;
/// Flag indicating whether to add default trailing widget.
///
/// If set to `true`, a trailing `Icon(Icons.keyboard_arrow_up)` is added to
/// the sub-header.
///
/// Defaults to `true`.
final bool automaticallyImplyTrailing;
/// Widget to be shown as leading element to the sub-header.
///
/// If set, the value of [automaticallyImplyLeading] is ignored.
final Widget? leading;
/// Widget to be shown as trailing element to the sub-header.
///
/// If set, the value of [automaticallyImplyTrailing] is ignored.
final Widget? trailing;
/// Creates a [BackdropSubHeader] instance.
///
/// The [title] argument must not be `null`.
const BackdropSubHeader({
Key? key,
required this.title,
this.divider,
this.padding = const EdgeInsets.symmetric(vertical: 12.0, horizontal: 16.0),
this.automaticallyImplyLeading = false,
this.automaticallyImplyTrailing = true,
this.leading,
this.trailing,
}) : super(key: key);
@override
Widget build(BuildContext context) {
Widget buildAutomaticLeadingOrTrailing(BuildContext context) =>
FadeTransition(
opacity: Tween(begin: 1.0, end: 0.0)
.animate(Backdrop.of(context).animationController),
child: const Icon(Icons.keyboard_arrow_up),
);
return Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Padding(
padding: padding,
child: Row(
children: <Widget>[
leading ??
(automaticallyImplyLeading
? buildAutomaticLeadingOrTrailing(context)
: Container()),
Expanded(
child: title,
),
trailing ??
(automaticallyImplyTrailing
? buildAutomaticLeadingOrTrailing(context)
: Container()),
],
),
),
divider ?? const Divider(height: 4.0, indent: 16.0, endIndent: 16.0),
],
);
}
}
| backdrop/lib/src/sub_header.dart/0 | {
"file_path": "backdrop/lib/src/sub_header.dart",
"repo_id": "backdrop",
"token_count": 1297
} | 25 |
<?xml version="1.0" encoding="utf-8"?>
<!-- Modify this file to customize your launch splash screen -->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="?android:colorBackground" />
<!-- You can insert your own image assets here -->
<!-- <item>
<bitmap
android:gravity="center"
android:src="@mipmap/launch_image" />
</item> -->
</layer-list>
| before_after/example/android/app/src/main/res/drawable-v21/launch_background.xml/0 | {
"file_path": "before_after/example/android/app/src/main/res/drawable-v21/launch_background.xml",
"repo_id": "before_after",
"token_count": 166
} | 26 |
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import '../before_after.dart';
/// A custom painter for rendering a slider.
///
/// The `SliderPainter` class is a custom painter that renders a slider with a track and a thumb.
/// It extends the [ChangeNotifier] class and implements the [CustomPainter] class.
///
/// The slider can be configured with various properties such as the axis (horizontal or vertical),
/// the current value, track width and color, thumb size and decoration, and more.
///
/// Example usage:
///
/// ```dart
/// SliderPainter painter = SliderPainter(
/// overlayAnimation: AnimationController(
/// vsync: this,
/// duration: Duration(milliseconds: 100),
/// ),
/// );
/// painter.axis = SliderAxis.horizontal;
/// painter.value = 0.5;
/// painter.trackWidth = 4.0;
/// painter.trackColor = Colors.grey;
/// painter.thumbValue = 0.5;
/// painter.thumbWidth = 20.0;
/// painter.thumbHeight = 40.0;
/// painter.thumbDecoration = BoxDecoration(
/// color: Colors.blue,
/// shape: BoxShape.circle,
/// );
///
/// CustomPaint(
/// painter: painter,
/// child: Container(
/// // Child widget
/// ),
/// )
/// ```
class SliderPainter extends ChangeNotifier implements CustomPainter {
/// Creates a slider painter.
SliderPainter({
required Animation<double> overlayAnimation,
ValueSetter<Rect>? onThumbRectChanged,
}) : _overlayAnimation = overlayAnimation,
_onThumbRectChanged = onThumbRectChanged {
_overlayAnimation.addListener(notifyListeners);
}
/// The animation of the thumb overlay.
final Animation<double> _overlayAnimation;
/// Callback to notify when the thumb rect changes.
final ValueSetter<Rect>? _onThumbRectChanged;
/// The axis of the slider.
SliderDirection get axis => _axis!;
SliderDirection? _axis;
set axis(SliderDirection value) {
if (_axis != value) {
_axis = value;
notifyListeners();
}
}
/// The current value of the slider.
double get value => _value!;
double? _value;
set value(double value) {
if (_value != value) {
_value = value;
notifyListeners();
}
}
/// The width of the track.
double get trackWidth => _trackWidth!;
double? _trackWidth;
set trackWidth(double value) {
if (_trackWidth != value) {
_trackWidth = value;
notifyListeners();
}
}
/// The color of the track.
Color get trackColor => _trackColor!;
Color? _trackColor;
set trackColor(Color value) {
if (_trackColor != value) {
_trackColor = value;
notifyListeners();
}
}
/// The value of the thumb.
double get thumbValue => _thumbValue!;
double? _thumbValue;
set thumbValue(double value) {
if (_thumbValue != value) {
_thumbValue = value;
notifyListeners();
}
}
/// The width of the thumb.
double get thumbWidth => _thumbWidth!;
double? _thumbWidth;
set thumbWidth(double value) {
if (_thumbWidth != value) {
_thumbWidth = value;
notifyListeners();
}
}
/// The height of the thumb.
double get thumbHeight => _thumbHeight!;
double? _thumbHeight;
set thumbHeight(double value) {
if (_thumbHeight != value) {
_thumbHeight = value;
notifyListeners();
}
}
/// The color of the thumb overlay.
Color get overlayColor => _overlayColor!;
Color? _overlayColor;
set overlayColor(Color value) {
if (_overlayColor != value) {
_overlayColor = value;
notifyListeners();
}
}
/// The decoration of the thumb.
BoxDecoration get thumbDecoration => _thumbDecoration!;
BoxDecoration? _thumbDecoration;
set thumbDecoration(BoxDecoration? value) {
if (_thumbDecoration != value) {
_thumbDecoration = value;
// Dispose and reset the thumb painter if it exists.
_thumbPainter?.dispose();
_thumbPainter = null;
notifyListeners();
}
}
/// The image configuration for the thumb.
ImageConfiguration get configuration => _configuration!;
ImageConfiguration? _configuration;
set configuration(ImageConfiguration value) {
if (_configuration != value) {
_configuration = value;
notifyListeners();
}
}
/// Whether to hide the thumb.
bool get hideThumb => _hideThumb!;
bool? _hideThumb;
set hideThumb(bool value) {
if (_hideThumb != value) {
_hideThumb = value;
notifyListeners();
}
}
@override
void paint(Canvas canvas, Size size) {
// Clip the canvas to the size of the slider so that we don't draw outside.
canvas.clipRect(Rect.fromLTWH(0, 0, size.width, size.height));
final isHorizontal = axis == SliderDirection.horizontal;
final trackPaint = Paint()
..color = trackColor
..strokeWidth = trackWidth;
// If the thumb is hidden, draw a straight line.
if (hideThumb) {
return canvas.drawLine(
Offset(
isHorizontal ? size.width * value : 0.0,
isHorizontal ? 0.0 : size.height * value,
),
Offset(
isHorizontal ? size.width * value : size.width,
isHorizontal ? size.height : size.height * value,
),
trackPaint,
);
}
// Draw track (first and second half).
canvas
..drawLine(
Offset(
isHorizontal ? size.width * value : 0.0,
isHorizontal ? 0.0 : size.height * value,
),
Offset(
isHorizontal
? size.width * value
: size.width * thumbValue - (thumbHeight / 2),
isHorizontal
? size.height * thumbValue - (thumbHeight / 2)
: size.height * value,
),
trackPaint,
)
..drawLine(
Offset(
isHorizontal
? size.width * value
: size.width * thumbValue + thumbHeight / 2,
isHorizontal
? size.height * thumbValue + thumbHeight / 2
: size.height * value,
),
Offset(
isHorizontal ? size.width * value : size.width,
isHorizontal ? size.height : size.height * value,
),
trackPaint,
);
// Calculate the thumb rect.
final thumbRect = Rect.fromCenter(
center: Offset(
isHorizontal ? size.width * value : size.width * thumbValue,
isHorizontal ? size.height * thumbValue : size.height * value,
),
width: isHorizontal ? thumbWidth : thumbHeight,
height: isHorizontal ? thumbHeight : thumbWidth,
);
// Notify the listener of the thumb rect.
_onThumbRectChanged?.call(thumbRect);
// Draw the thumb overlay.
if (!_overlayAnimation.isDismissed) {
const lengthMultiplier = 2;
final overlayRect = Rect.fromCenter(
center: thumbRect.center,
width: thumbRect.width * lengthMultiplier * _overlayAnimation.value,
height: thumbRect.height * lengthMultiplier * _overlayAnimation.value,
);
// Draw the overlay.
_drawOverlay(canvas, overlayRect);
}
// Draw the thumb.
_drawThumb(canvas, thumbRect);
}
void _drawOverlay(Canvas canvas, Rect overlayRect) {
Path? overlayPath;
switch (thumbDecoration.shape) {
case BoxShape.circle:
assert(thumbDecoration.borderRadius == null);
final Offset center = overlayRect.center;
final double radius = overlayRect.shortestSide / 2.0;
final Rect square = Rect.fromCircle(center: center, radius: radius);
overlayPath = Path()..addOval(square);
break;
case BoxShape.rectangle:
if (thumbDecoration.borderRadius == null ||
thumbDecoration.borderRadius == BorderRadius.zero) {
overlayPath = Path()..addRect(overlayRect);
} else {
overlayPath = Path()
..addRRect(thumbDecoration.borderRadius!
.resolve(configuration.textDirection)
.toRRect(overlayRect));
}
break;
}
canvas.drawPath(overlayPath, Paint()..color = overlayColor);
}
bool _isPainting = false;
void _handleThumbChange() {
// If the thumb decoration is available synchronously, we'll get called here
// during paint. There's no reason to mark ourselves as needing paint if we
// are already in the middle of painting. (In fact, doing so would trigger
// an assert).
if (!_isPainting) {
notifyListeners();
}
}
BoxPainter? _thumbPainter;
void _drawThumb(Canvas canvas, Rect thumbRect) {
try {
_isPainting = true;
if (_thumbPainter == null) {
_thumbPainter?.dispose();
_thumbPainter = thumbDecoration.createBoxPainter(_handleThumbChange);
}
final config = configuration.copyWith(size: thumbRect.size);
_thumbPainter!.paint(canvas, thumbRect.topLeft, config);
} finally {
_isPainting = false;
}
}
@override
void dispose() {
_thumbPainter?.dispose();
_thumbPainter = null;
_overlayAnimation.removeListener(notifyListeners);
super.dispose();
}
@override
bool shouldRepaint(covariant SliderPainter oldDelegate) => false;
@override
bool? hitTest(Offset position) => null;
@override
SemanticsBuilderCallback? get semanticsBuilder => null;
@override
bool shouldRebuildSemantics(covariant CustomPainter oldDelegate) => false;
@override
String toString() => describeIdentity(this);
}
| before_after/lib/src/slider_painter.dart/0 | {
"file_path": "before_after/lib/src/slider_painter.dart",
"repo_id": "before_after",
"token_count": 3588
} | 27 |
// This is a basic Flutter widget test.
//
// To perform an interaction with a widget in your test, use the WidgetTester
// utility that Flutter provides. For example, you can send tap and scroll
// gestures. You can also use WidgetTester to find child widgets in the widget
// tree, read text, and verify that the values of widget properties are correct.
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:bitmap_example/main.dart';
void main() {
testWidgets('Verify Platform version', (WidgetTester tester) async {
// Build our app and trigger a frame.
await tester.pumpWidget(MyApp());
// Verify that platform version is retrieved.
expect(
find.byWidgetPredicate(
(Widget widget) =>
widget is Text && widget.data!.startsWith('Running on:'),
),
findsOneWidget,
);
});
}
| bitmap/example/test/widget_test.dart/0 | {
"file_path": "bitmap/example/test/widget_test.dart",
"repo_id": "bitmap",
"token_count": 288
} | 28 |
import '../bitmap.dart';
export 'adjust_color.dart';
export 'brightness.dart';
export 'contrast.dart';
export 'crop.dart';
export 'flip.dart';
export 'resize.dart';
export 'rgb_overlay.dart';
export 'rotation.dart';
abstract class BitmapOperation {
Bitmap applyTo(Bitmap bitmap);
}
| bitmap/lib/src/operation/operation.dart/0 | {
"file_path": "bitmap/lib/src/operation/operation.dart",
"repo_id": "bitmap",
"token_count": 109
} | 29 |
org.gradle.jvmargs=-Xmx1536M
android.useAndroidX=true
android.enableJetifier=true
| bottom_navy_bar/example/android/gradle.properties/0 | {
"file_path": "bottom_navy_bar/example/android/gradle.properties",
"repo_id": "bottom_navy_bar",
"token_count": 31
} | 30 |
name: bottom_navy_bar
description: A beautiful and animated bottom navigation. The navigation bar uses your current theme, but you are free to customize it.
version: 6.0.0
homepage: https://github.com/pedromassango/bottom_navy_bar
environment:
sdk: ">=2.17.0-0 <3.0.0"
dependencies:
flutter:
sdk: flutter
dev_dependencies:
flutter_test:
sdk: flutter
| bottom_navy_bar/pubspec.yaml/0 | {
"file_path": "bottom_navy_bar/pubspec.yaml",
"repo_id": "bottom_navy_bar",
"token_count": 132
} | 31 |
.vscode/*
example
images | card_settings/.pubignore/0 | {
"file_path": "card_settings/.pubignore",
"repo_id": "card_settings",
"token_count": 9
} | 32 |
org.gradle.jvmargs=-Xmx1536M
android.useAndroidX=true
android.enableJetifier=true
| card_settings/example/android/gradle.properties/0 | {
"file_path": "card_settings/example/android/gradle.properties",
"repo_id": "card_settings",
"token_count": 31
} | 33 |
name: card_settings_example
description: A Flutter project that demonstrated the use of the card_settings package.
version: 1.0.0
publish_to: none
dependencies:
flutter:
sdk: flutter
flutter_localizations:
sdk: flutter
card_settings:
path: ../
font_awesome_flutter:
adaptive_theme: ^2.0.0
google_fonts: ^4.0.0
dev_dependencies:
flutter_lints: ^1.0.4
flutter_test:
sdk: flutter
environment:
sdk: ">=2.12.0 <4.0.0"
flutter:
uses-material-design: true
assets:
- assets/twilight_sparkle.png
| card_settings/example/pubspec.yaml/0 | {
"file_path": "card_settings/example/pubspec.yaml",
"repo_id": "card_settings",
"token_count": 222
} | 34 |
import 'dart:math' as math;
import 'package:flutter/services.dart';
/// Limits text entry to decimal characters only
class DecimalTextInputFormatter extends TextInputFormatter {
DecimalTextInputFormatter({this.decimalDigits})
: assert(decimalDigits == null || decimalDigits > 0);
final int? decimalDigits;
@override
TextEditingValue formatEditUpdate(
TextEditingValue oldValue, // unused.
TextEditingValue newValue,
) {
TextSelection newSelection = newValue.selection;
String truncated = newValue.text;
if (decimalDigits != null) {
String value = newValue.text;
if (value.contains(".") &&
value.substring(value.indexOf(".") + 1).length > decimalDigits!) {
truncated = oldValue.text;
newSelection = oldValue.selection;
} else if (value == ".") {
truncated = "0.";
newSelection = newValue.selection.copyWith(
baseOffset: math.min(truncated.length, truncated.length + 1),
extentOffset: math.min(truncated.length, truncated.length + 1),
);
}
return TextEditingValue(
text: truncated,
selection: newSelection,
composing: TextRange.empty,
);
}
return newValue;
}
}
| card_settings/lib/helpers/decimal_text_input_formatter.dart/0 | {
"file_path": "card_settings/lib/helpers/decimal_text_input_formatter.dart",
"repo_id": "card_settings",
"token_count": 480
} | 35 |
// Copyright (c) 2018, codegrue. All rights reserved. Use of this source code
// is governed by the MIT license that can be found in the LICENSE file.
import 'package:card_settings/helpers/platform_functions.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_cupertino_settings/flutter_cupertino_settings.dart';
import '../../card_settings.dart';
import '../../interfaces/common_field_properties.dart';
/// This is a field that allows a boolean to be set via a switch widget.
class CardSettingsSlider extends FormField<double>
implements ICommonFieldProperties {
CardSettingsSlider({
Key? key,
bool autovalidate = false,
AutovalidateMode autovalidateMode = AutovalidateMode.onUserInteraction,
FormFieldSetter<double>? onSaved,
FormFieldValidator<double>? validator,
double initialValue = 0.0,
this.enabled = true,
this.visible = true,
this.label = 'Label',
this.requiredIndicator,
this.labelAlign,
this.labelWidth,
this.icon,
this.contentAlign,
this.onChanged,
this.onChangedStart,
this.onChangedEnd,
this.min,
this.max,
this.divisions,
this.showMaterialonIOS,
this.fieldPadding,
}) : super(
key: key,
initialValue: initialValue,
onSaved: onSaved,
validator: validator,
// autovalidate: autovalidate,
autovalidateMode: autovalidateMode,
builder: (FormFieldState<double> field) =>
(field as _CardSettingsSliderState)._build(field.context));
/// The text to identify the field to the user
@override
final String label;
/// The alignment of the label paret of the field. Default is left.
@override
final TextAlign? labelAlign;
/// The width of the field label. If provided overrides the global setting.
@override
final double? labelWidth;
/// controls how the widget in the content area of the field is aligned
@override
final TextAlign? contentAlign;
/// The icon to display to the left of the field content
@override
final Icon? icon;
/// If false the field is grayed out and unresponsive
@override
final bool enabled;
/// A widget to show next to the label if the field is required
@override
final Widget? requiredIndicator;
@override
final ValueChanged<double>? onChanged;
final ValueChanged<double>? onChangedEnd;
final ValueChanged<double>? onChangedStart;
/// If false hides the widget on the card setting panel
@override
final bool visible;
/// Force the widget to use Material style on an iOS device
@override
final bool? showMaterialonIOS;
/// provides padding to wrap the entire field
@override
final EdgeInsetsGeometry? fieldPadding;
/// how many divisions to have between min and max
final int? divisions;
/// The value at the minimum position
final double? min;
/// The value at the maximum position
final double? max;
@override
_CardSettingsSliderState createState() => _CardSettingsSliderState();
}
class _CardSettingsSliderState extends FormFieldState<double> {
@override
CardSettingsSlider get widget => super.widget as CardSettingsSlider;
Widget _build(BuildContext context) {
if (showCupertino(context, widget.showMaterialonIOS))
return _cupertinoSettingsSlider();
else
return _materialSettingsSlider();
}
Widget _cupertinoSettingsSlider() {
final ls = labelStyle(context, widget.enabled);
return Container(
child: widget.visible == false
? null
: CSControl(
nameWidget: Container(
width: widget.labelWidth ??
CardSettings.of(context)?.labelWidth ??
120.0,
child: widget.requiredIndicator != null
? Text(
(widget.label) + ' *',
style: ls,
)
: Text(
widget.label,
style: ls,
),
),
contentWidget: CupertinoSlider(
value: value!,
divisions: widget.divisions,
min: widget.min ?? 0,
max: widget.max ?? 1,
onChangeEnd: widget.onChangedEnd,
onChangeStart: widget.onChangedStart,
onChanged: (widget.enabled)
? (value) {
didChange(value);
if (widget.onChanged != null) widget.onChanged!(value);
}
: null, // to disable, we need to not provide an onChanged function
),
style: CSWidgetStyle(icon: widget.icon),
),
);
}
Widget _materialSettingsSlider() {
return CardSettingsField(
label: widget.label,
labelAlign: widget.labelAlign,
labelWidth: widget.labelWidth,
visible: widget.visible,
enabled: widget.enabled,
icon: widget.icon,
requiredIndicator: widget.requiredIndicator,
errorText: errorText,
fieldPadding: widget.fieldPadding,
content: Row(children: <Widget>[
Expanded(
child: Container(
padding: EdgeInsets.all(0.0),
child: Container(
height: 20.0,
child: SliderTheme(
data: SliderThemeData(
trackShape: _CustomTrackShape(),
),
child: Slider(
activeColor: Theme.of(context).primaryColor,
value: value!,
divisions: widget.divisions,
min: widget.min ?? 0,
max: widget.max ?? 1,
onChangeEnd: widget.onChangedEnd,
onChangeStart: widget.onChangedStart,
onChanged: (widget.enabled)
? (value) {
didChange(value);
if (widget.onChanged != null)
widget.onChanged!(value);
}
: null, // to disable, we need to not provide an onChanged function
),
),
),
),
),
]),
);
}
}
// https://github.com/flutter/flutter/issues/37057
class _CustomTrackShape extends RoundedRectSliderTrackShape {
@override
Rect getPreferredRect({
required RenderBox parentBox,
Offset offset = Offset.zero,
required SliderThemeData sliderTheme,
bool isEnabled = false,
bool isDiscrete = false,
}) {
final double trackHeight = sliderTheme.trackHeight ?? 10;
final double trackLeft = offset.dx;
final double trackTop =
offset.dy + (parentBox.size.height - trackHeight) / 2;
final double trackWidth = parentBox.size.width;
return Rect.fromLTWH(trackLeft, trackTop, trackWidth, trackHeight);
}
}
| card_settings/lib/widgets/numeric_fields/card_settings_slider.dart/0 | {
"file_path": "card_settings/lib/widgets/numeric_fields/card_settings_slider.dart",
"repo_id": "card_settings",
"token_count": 3000
} | 36 |
// Copyright (c) 2018, codegrue. All rights reserved. Use of this source code
// is governed by the MIT license that can be found in the LICENSE file.
import 'package:card_settings/helpers/platform_functions.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:extended_masked_text/extended_masked_text.dart';
import 'package:flutter_cupertino_settings/flutter_cupertino_settings.dart';
import 'package:flutter/cupertino.dart';
import '../../card_settings.dart';
import '../../interfaces/common_field_properties.dart';
import '../../interfaces/text_field_properties.dart';
/// This is a standard one line text entry It's based on the [TextFormField] widget.
class CardSettingsText extends FormField<String>
implements ICommonFieldProperties, ITextFieldProperties {
CardSettingsText({
Key? key,
String? initialValue,
bool autovalidate = false,
AutovalidateMode autovalidateMode = AutovalidateMode.onUserInteraction,
this.enabled = true,
this.onSaved,
this.validator,
this.onChanged,
this.controller,
this.textCapitalization = TextCapitalization.none,
this.keyboardType = TextInputType.text,
this.maxLengthEnforcement = MaxLengthEnforcement.enforced,
this.inputMask,
this.inputFormatters,
this.onFieldSubmitted,
this.style,
this.focusNode,
this.inputAction,
this.inputActionNode,
this.label = 'Label',
this.contentOnNewLine = false,
this.maxLength = 20,
this.numberOfLines = 1,
this.showCounter = false,
this.visible = true,
this.autocorrect = true,
this.obscureText = false,
this.autofocus = false,
this.contentAlign,
this.hintText,
this.icon,
this.labelAlign,
this.labelWidth,
this.prefixText,
this.requiredIndicator,
this.unitLabel,
this.showMaterialonIOS,
this.showClearButtonIOS = OverlayVisibilityMode.never,
this.fieldPadding,
this.contentPadding = const EdgeInsets.all(0.0),
}) : assert(maxLength > 0),
assert(controller == null || inputMask == null),
super(
key: key,
initialValue: initialValue,
onSaved: onSaved,
validator: validator,
autovalidateMode: autovalidateMode,
builder: (FormFieldState<String> field) =>
(field as _CardSettingsTextState)._build(field.context),
);
@override
final ValueChanged<String>? onChanged;
final TextEditingController? controller;
final String? inputMask;
final FocusNode? focusNode;
final TextInputAction? inputAction;
final FocusNode? inputActionNode;
final TextInputType keyboardType;
final TextCapitalization textCapitalization;
final TextStyle? style;
// If false the field is grayed out and unresponsive
@override
// If false, grays out the field and makes it unresponsive
final bool enabled;
final MaxLengthEnforcement? maxLengthEnforcement;
final ValueChanged<String>? onFieldSubmitted;
final List<TextInputFormatter>? inputFormatters;
// The text to identify the field to the user
@override
final String label;
// The alignment of the label paret of the field. Default is left.
@override
final TextAlign? labelAlign;
// The width of the field label. If provided overrides the global setting.
@override
final double? labelWidth;
// controls how the widget in the content area of the field is aligned
@override
final TextAlign? contentAlign;
final String? unitLabel;
final String? prefixText;
@override
// text to display to guide the user on what to enter
final String? hintText;
// The icon to display to the left of the field content
@override
final Icon? icon;
// A widget to show next to the label if the field is required
@override
final Widget? requiredIndicator;
final bool contentOnNewLine;
final int maxLength;
final int numberOfLines;
final bool showCounter;
// If false hides the widget on the card setting panel
@override
final bool visible;
final bool autofocus;
final bool obscureText;
final bool autocorrect;
// Force the widget to use Material style on an iOS device
@override
final bool? showMaterialonIOS;
// provides padding to wrap the entire field
@override
final EdgeInsetsGeometry? fieldPadding;
final EdgeInsetsGeometry contentPadding;
///Since the CupertinoTextField does not support onSaved, please use [onChanged] or [onFieldSubmitted] instead
@override
final FormFieldSetter<String>? onSaved;
///In material mode this shows the validation text under the field
///In cupertino mode, it shows a [red] [Border] around the [CupertinoTextField]
@override
final FormFieldValidator<String>? validator;
final OverlayVisibilityMode showClearButtonIOS;
@override
_CardSettingsTextState createState() => _CardSettingsTextState();
}
class _CardSettingsTextState extends FormFieldState<String> {
TextEditingController? _controller;
@override
CardSettingsText get widget => super.widget as CardSettingsText;
@override
void initState() {
super.initState();
_initController(widget.initialValue);
}
@override
void didUpdateWidget(CardSettingsText oldWidget) {
super.didUpdateWidget(oldWidget);
if (widget.controller != oldWidget.controller) {
oldWidget.controller?.removeListener(_handleControllerChanged);
_initController(oldWidget.controller?.value.toString());
}
}
void _initController(String? initialValue) {
if (widget.controller == null) {
if (widget.inputMask == null) {
_controller = TextEditingController(text: initialValue);
} else {
_controller =
MaskedTextController(mask: widget.inputMask!, text: initialValue);
}
} else {
_controller = widget.controller;
}
_controller!.addListener(_handleControllerChanged);
}
@override
void dispose() {
widget.controller?.removeListener(_handleControllerChanged);
super.dispose();
}
@override
void reset() {
super.reset();
setState(() {
_controller!.text = widget.initialValue ?? '';
});
}
void _handleControllerChanged() {
if (_controller!.text != value) {
didChange(_controller!.text);
}
}
void _handleOnChanged(String value) {
if (widget.onChanged != null) {
// `value` doesn't apple any masks when this is called, so the controller has the actual formatted value
widget.onChanged!(_controller!.value.text);
}
}
void _onFieldSubmitted(String value) {
if (this.widget.focusNode != null) this.widget.focusNode!.unfocus();
if (this.widget.inputActionNode != null) {
this.widget.inputActionNode!.requestFocus();
return;
}
if (this.widget.onFieldSubmitted != null)
this.widget.onFieldSubmitted!(value);
}
Widget _build(BuildContext context) {
if (showCupertino(context, widget.showMaterialonIOS))
return _buildCupertinoTextbox(context);
else
return _buildMaterialTextbox(context);
}
Container _buildCupertinoTextbox(BuildContext context) {
bool hasError = false;
if (widget.validator != null) {
String? errorMessage = widget.validator!(value);
hasError = (errorMessage != null);
}
final ls = labelStyle(context, widget.enabled);
final _child = Container(
child: CupertinoTextField(
prefix: widget.prefixText == null
? null
: Text(
widget.prefixText ?? '',
style: ls,
),
suffix: widget.unitLabel == null
? null
: Text(
widget.unitLabel ?? '',
style: ls,
),
controller: _controller,
focusNode: widget.focusNode,
textInputAction: widget.inputAction,
keyboardType: widget.keyboardType,
textCapitalization: widget.textCapitalization,
style: contentStyle(context, value, widget.enabled),
decoration: hasError
? BoxDecoration(
border: Border.all(color: Colors.red),
borderRadius: BorderRadius.all(
Radius.circular(4.0),
),
)
: BoxDecoration(
border: Border(
top: BorderSide(
color: CupertinoColors.lightBackgroundGray,
style: BorderStyle.solid,
width: 0.0,
),
bottom: BorderSide(
color: CupertinoColors.lightBackgroundGray,
style: BorderStyle.solid,
width: 0.0,
),
left: BorderSide(
color: CupertinoColors.lightBackgroundGray,
style: BorderStyle.solid,
width: 0.0,
),
right: BorderSide(
color: CupertinoColors.lightBackgroundGray,
style: BorderStyle.solid,
width: 0.0,
),
),
borderRadius: BorderRadius.all(
Radius.circular(4.0),
),
),
clearButtonMode: widget.showClearButtonIOS,
placeholder: widget.hintText,
textAlign: widget.contentAlign ?? TextAlign.end,
autofocus: widget.autofocus,
obscureText: widget.obscureText,
autocorrect: widget.autocorrect,
maxLengthEnforcement: widget.maxLengthEnforcement,
maxLines: widget.numberOfLines,
maxLength: (widget.showCounter)
? widget.maxLength
: null, // if we want counter use default behavior
onChanged: _handleOnChanged,
onSubmitted: _onFieldSubmitted,
inputFormatters: widget.inputFormatters ??
[
// if we don't want the counter, use this maxLength instead
LengthLimitingTextInputFormatter(widget.maxLength)
],
enabled: widget.enabled,
),
);
return Container(
child: widget.visible == false
? null
: widget.contentOnNewLine == true
? Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
CSControl(
nameWidget: widget.requiredIndicator != null
? Text(
(widget.label) + ' *',
style: ls,
)
: Text(widget.label, style: ls),
contentWidget: Container(),
style: CSWidgetStyle(icon: widget.icon),
),
Container(
padding: EdgeInsets.all(5.0),
child: _child,
color: Theme.of(context).brightness == Brightness.dark
? null
: CupertinoColors.white,
),
Container(
padding: widget.showCounter ? EdgeInsets.all(5.0) : null,
color: Theme.of(context).brightness == Brightness.dark
? null
: CupertinoColors.white,
child: widget.showCounter
? Row(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
Text(
"${_controller?.text.length ?? 0}/${widget.maxLength}",
style: TextStyle(
color: CupertinoColors.inactiveGray,
),
),
],
)
: null,
),
],
)
: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
CSControl(
nameWidget: Container(
width: widget.labelWidth ??
CardSettings.of(context)?.labelWidth ??
120.0,
child: widget.requiredIndicator != null
? Text((widget.label) + ' *', style: ls)
: Text(widget.label, style: ls),
),
contentWidget: Expanded(
child: Container(
padding: EdgeInsets.only(left: 10.0),
child: _child,
),
),
style: CSWidgetStyle(icon: widget.icon),
),
Container(
padding: widget.showCounter ? EdgeInsets.all(5.0) : null,
color: Theme.of(context).brightness == Brightness.dark
? null
: CupertinoColors.white,
child: widget.showCounter
? Row(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
Text(
"${_controller?.text.length ?? 0}/${widget.maxLength}",
style: TextStyle(
color: CupertinoColors.inactiveGray,
),
),
],
)
: null,
),
],
),
);
}
CardSettingsField _buildMaterialTextbox(BuildContext context) {
return CardSettingsField(
label: widget.label,
labelAlign: widget.labelAlign,
labelWidth: widget.labelWidth,
visible: widget.visible,
unitLabel: widget.unitLabel,
icon: widget.icon,
requiredIndicator: widget.requiredIndicator,
contentOnNewLine: widget.contentOnNewLine,
enabled: widget.enabled,
fieldPadding: widget.fieldPadding,
content: TextField(
controller: _controller,
focusNode: widget.focusNode,
keyboardType: widget.keyboardType,
textInputAction: widget.inputAction,
textCapitalization: widget.textCapitalization,
enabled: widget.enabled,
readOnly: !widget.enabled,
style: contentStyle(context, value, widget.enabled),
decoration: InputDecoration(
contentPadding: widget.contentPadding,
border: InputBorder.none,
errorText: errorText,
prefixText: widget.prefixText,
hintText: widget.hintText,
isDense: true,
),
textAlign:
widget.contentAlign ?? CardSettings.of(context)!.contentAlign,
autofocus: widget.autofocus,
obscureText: widget.obscureText,
autocorrect: widget.autocorrect,
maxLengthEnforcement: widget.maxLengthEnforcement,
maxLines: widget.numberOfLines,
maxLength: (widget.showCounter)
? widget.maxLength
: null, // if we want counter use default behavior
onChanged: _handleOnChanged,
onSubmitted: _onFieldSubmitted,
inputFormatters: widget.inputFormatters ??
[
// if we don't want the counter, use this maxLength instead
LengthLimitingTextInputFormatter(widget.maxLength)
],
),
);
}
}
| card_settings/lib/widgets/text_fields/card_settings_text.dart/0 | {
"file_path": "card_settings/lib/widgets/text_fields/card_settings_text.dart",
"repo_id": "card_settings",
"token_count": 7317
} | 37 |
export './constants.dart';
export './theme/clay_text_theme.dart';
export './theme/clay_theme.dart';
export './theme/clay_theme_data.dart';
export './widgets/clay_animated_container.dart';
export './widgets/clay_container.dart';
export './widgets/clay_text.dart';
| clay_containers/lib/clay_containers.dart/0 | {
"file_path": "clay_containers/lib/clay_containers.dart",
"repo_id": "clay_containers",
"token_count": 104
} | 38 |
#include "Generated.xcconfig"
| direct-select-flutter/example/ios/Flutter/Debug.xcconfig/0 | {
"file_path": "direct-select-flutter/example/ios/Flutter/Debug.xcconfig",
"repo_id": "direct-select-flutter",
"token_count": 12
} | 39 |
org.gradle.jvmargs=-Xmx1536M
android.enableR8=true
android.enableJetifier=true
android.useAndroidX=true
#systemProp.http.nonProxyHosts=*.vclound.com
#systemProp.http.proxyHost=127.0.0.1
#systemProp.http.proxyPort=8888
#systemProp.https.nonProxyHosts=*.vclound.com
#systemProp.https.proxyHost=127.0.0.1
#systemProp.https.proxyPort=8888
| dynamic_widget/example/android/gradle.properties/0 | {
"file_path": "dynamic_widget/example/android/gradle.properties",
"repo_id": "dynamic_widget",
"token_count": 135
} | 40 |
import 'package:dynamic_widget/dynamic_widget.dart';
import 'package:flutter/widgets.dart';
class ExpandedWidgetParser extends WidgetParser {
@override
Widget parse(Map<String, dynamic> map, BuildContext buildContext,
ClickListener? listener) {
return Expanded(
child: DynamicWidgetBuilder.buildFromMap(
map["child"], buildContext, listener)!,
flex: map.containsKey("flex") ? map["flex"] : 1,
);
}
@override
String get widgetName => "Expanded";
@override
Map<String, dynamic> export(Widget? widget, BuildContext? buildContext) {
var realWidget = widget as Expanded;
return <String, dynamic>{
"type": widgetName,
"flex": realWidget.flex,
"child": DynamicWidgetBuilder.export(realWidget.child, buildContext)
};
}
@override
Type get widgetType => Expanded;
}
| dynamic_widget/lib/dynamic_widget/basic/expanded_widget_parser.dart/0 | {
"file_path": "dynamic_widget/lib/dynamic_widget/basic/expanded_widget_parser.dart",
"repo_id": "dynamic_widget",
"token_count": 296
} | 41 |
import 'package:dynamic_widget/dynamic_widget.dart';
import 'package:dynamic_widget/dynamic_widget/utils.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
class SelectableTextWidgetParser implements WidgetParser {
@override
Widget parse(Map<String, dynamic> map, BuildContext buildContext,
ClickListener? listener) {
String? data = map['data'];
String? textAlignString = map['textAlign'];
int? maxLines = map['maxLines'];
String? textDirectionString = map['textDirection'];
// double textScaleFactor = map['textScaleFactor'];
var textSpan;
var textSpanParser = SelectableTextSpanParser();
if (map.containsKey("textSpan")) {
textSpan = textSpanParser.parse(map['textSpan'], listener);
}
if (textSpan == null) {
return SelectableText(
data!,
textAlign: parseTextAlign(textAlignString),
maxLines: maxLines,
textDirection: parseTextDirection(textDirectionString),
style: map.containsKey('style') ? parseTextStyle(map['style']) : null,
// textScaleFactor: textScaleFactor,
);
} else {
return SelectableText.rich(
textSpan,
textAlign: parseTextAlign(textAlignString),
maxLines: maxLines,
textDirection: parseTextDirection(textDirectionString),
style: map.containsKey('style') ? parseTextStyle(map['style']) : null,
// textScaleFactor: textScaleFactor,
);
}
}
@override
String get widgetName => "SelectableText";
@override
Map<String, dynamic> export(Widget? widget, BuildContext? buildContext) {
var realWidget = widget as SelectableText;
if (realWidget.textSpan == null) {
return <String, dynamic>{
"type": "SelectableText",
"data": realWidget.data,
"textAlign": realWidget.textAlign != null
? exportTextAlign(realWidget.textAlign)
: "start",
"maxLines": realWidget.maxLines,
"textDirection": exportTextDirection(realWidget.textDirection),
"style": exportTextStyle(realWidget.style),
};
} else {
var parser = SelectableTextSpanParser();
return <String, dynamic>{
"type": "SelectableText",
"textSpan": parser.export(realWidget.textSpan!),
"textAlign": realWidget.textAlign != null
? exportTextAlign(realWidget.textAlign)
: "start",
"maxLines": realWidget.maxLines,
"textDirection": exportTextDirection(realWidget.textDirection),
"style": exportTextStyle(realWidget.style),
};
}
}
@override
bool matchWidgetForExport(Widget? widget) => widget is SelectableText;
@override
Type get widgetType => SelectableText;
}
class SelectableTextSpanParser {
TextSpan parse(Map<String, dynamic> map, ClickListener? listener) {
String? clickEvent = map.containsKey("recognizer") ? map['recognizer'] : "";
var textSpan = TextSpan(
text: map['text'],
style: parseTextStyle(map['style']),
recognizer: TapGestureRecognizer()
..onTap = () {
listener!.onClicked(clickEvent);
},
children: []);
if (map.containsKey('children')) {
parseChildren(textSpan, map['children'], listener);
}
return textSpan;
}
void parseChildren(
TextSpan textSpan, List<dynamic> childrenSpan, ClickListener? listener) {
for (var childmap in childrenSpan) {
textSpan.children!.add(parse(childmap, listener));
}
}
Map<String, dynamic> export(TextSpan textSpan) {
return <String, dynamic>{
"text": textSpan.text,
"style": exportTextStyle(textSpan.style),
"children": exportChildren(textSpan)
};
}
List<Map<String, dynamic>> exportChildren(TextSpan textSpan) {
List<Map<String, dynamic>> rt = [];
if (textSpan.children != null && textSpan.children!.isNotEmpty) {
for (var span in textSpan.children!) {
rt.add(export(span as TextSpan));
}
}
return rt;
}
}
| dynamic_widget/lib/dynamic_widget/basic/selectabletext_widget_parser.dart/0 | {
"file_path": "dynamic_widget/lib/dynamic_widget/basic/selectabletext_widget_parser.dart",
"repo_id": "dynamic_widget",
"token_count": 1615
} | 42 |
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project> | fancy_bottom_navigation/.idea/vcs.xml/0 | {
"file_path": "fancy_bottom_navigation/.idea/vcs.xml",
"repo_id": "fancy_bottom_navigation",
"token_count": 66
} | 43 |
import 'package:flutter/material.dart';
const double ICON_OFF = -3;
const double ICON_ON = 0;
const double TEXT_OFF = 3;
const double TEXT_ON = 1;
const double ALPHA_OFF = 0;
const double ALPHA_ON = 1;
const int ANIM_DURATION = 300;
class TabItem extends StatelessWidget {
TabItem(
{required this.uniqueKey,
required this.selected,
required this.iconData,
required this.title,
required this.callbackFunction,
required this.textColor,
required this.iconColor});
final UniqueKey uniqueKey;
final String title;
final IconData iconData;
final bool selected;
final Function(UniqueKey uniqueKey) callbackFunction;
final Color textColor;
final Color iconColor;
final double iconYAlign = ICON_ON;
final double textYAlign = TEXT_OFF;
final double iconAlpha = ALPHA_ON;
@override
Widget build(BuildContext context) {
return Expanded(
child: Stack(
fit: StackFit.expand,
children: [
Container(
height: double.infinity,
width: double.infinity,
child: AnimatedAlign(
duration: Duration(milliseconds: ANIM_DURATION),
alignment: Alignment(0, (selected) ? TEXT_ON : TEXT_OFF),
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Text(
title,
overflow: TextOverflow.ellipsis,
maxLines: 1,
style: TextStyle(
fontWeight: FontWeight.w600, color: textColor),
),
)),
),
Container(
height: double.infinity,
width: double.infinity,
child: AnimatedAlign(
duration: Duration(milliseconds: ANIM_DURATION),
curve: Curves.easeIn,
alignment: Alignment(0, (selected) ? ICON_OFF : ICON_ON),
child: AnimatedOpacity(
duration: Duration(milliseconds: ANIM_DURATION),
opacity: (selected) ? ALPHA_OFF : ALPHA_ON,
child: IconButton(
highlightColor: Colors.transparent,
splashColor: Colors.transparent,
padding: EdgeInsets.all(0),
alignment: Alignment(0, 0),
icon: Icon(
iconData,
color: iconColor,
),
onPressed: () {
callbackFunction(uniqueKey);
},
),
),
),
)
],
),
);
}
}
| fancy_bottom_navigation/lib/internal/tab_item.dart/0 | {
"file_path": "fancy_bottom_navigation/lib/internal/tab_item.dart",
"repo_id": "fancy_bottom_navigation",
"token_count": 1341
} | 44 |
analyze:
flutter analyze
checkFormat:
dart format -o none --set-exit-if-changed .
checkstyle:
make analyze && make checkFormat
format:
dart format .
runTests:
flutter test
checkoutToPR:
git fetch origin pull/$(id)/head:pr-$(id) --force; \
git checkout pr-$(id)
# Tells you in which version this commit has landed
findVersion:
git describe --contains $(commit) | sed 's/~.*//'
# Runs both `make runTests` and `make checkstyle`. Use this before pushing your code.
sure:
make runTests && make checkstyle
# To create generated files (for example mock files in unit_tests)
codeGen:
flutter pub run build_runner build --delete-conflicting-outputs
showTestCoverage:
flutter test --coverage
genhtml coverage/lcov.info -o coverage/html
source ./scripts/makefile_scripts.sh && open_link "coverage/html/index.html"
buildRunner:
flutter packages pub run build_runner build --delete-conflicting-outputs
| fl_chart/Makefile/0 | {
"file_path": "fl_chart/Makefile",
"repo_id": "fl_chart",
"token_count": 296
} | 45 |
import 'dart:async';
import 'dart:math';
import 'package:fl_chart_app/presentation/resources/app_resources.dart';
import 'package:fl_chart_app/util/extensions/color_extensions.dart';
import 'package:fl_chart/fl_chart.dart';
import 'package:flutter/material.dart';
class BarChartSample1 extends StatefulWidget {
BarChartSample1({super.key});
List<Color> get availableColors => const <Color>[
AppColors.contentColorPurple,
AppColors.contentColorYellow,
AppColors.contentColorBlue,
AppColors.contentColorOrange,
AppColors.contentColorPink,
AppColors.contentColorRed,
];
final Color barBackgroundColor =
AppColors.contentColorWhite.darken().withOpacity(0.3);
final Color barColor = AppColors.contentColorWhite;
final Color touchedBarColor = AppColors.contentColorGreen;
@override
State<StatefulWidget> createState() => BarChartSample1State();
}
class BarChartSample1State extends State<BarChartSample1> {
final Duration animDuration = const Duration(milliseconds: 250);
int touchedIndex = -1;
bool isPlaying = false;
@override
Widget build(BuildContext context) {
return AspectRatio(
aspectRatio: 1,
child: Stack(
children: <Widget>[
Padding(
padding: const EdgeInsets.all(16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
const Text(
'Mingguan',
style: TextStyle(
color: AppColors.contentColorGreen,
fontSize: 24,
fontWeight: FontWeight.bold,
),
),
const SizedBox(
height: 4,
),
Text(
'Grafik konsumsi kalori',
style: TextStyle(
color: AppColors.contentColorGreen.darken(),
fontSize: 18,
fontWeight: FontWeight.bold,
),
),
const SizedBox(
height: 38,
),
Expanded(
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 8),
child: BarChart(
isPlaying ? randomData() : mainBarData(),
swapAnimationDuration: animDuration,
),
),
),
const SizedBox(
height: 12,
),
],
),
),
Padding(
padding: const EdgeInsets.all(8),
child: Align(
alignment: Alignment.topRight,
child: IconButton(
icon: Icon(
isPlaying ? Icons.pause : Icons.play_arrow,
color: AppColors.contentColorGreen,
),
onPressed: () {
setState(() {
isPlaying = !isPlaying;
if (isPlaying) {
refreshState();
}
});
},
),
),
)
],
),
);
}
BarChartGroupData makeGroupData(
int x,
double y, {
bool isTouched = false,
Color? barColor,
double width = 22,
List<int> showTooltips = const [],
}) {
barColor ??= widget.barColor;
return BarChartGroupData(
x: x,
barRods: [
BarChartRodData(
toY: isTouched ? y + 1 : y,
color: isTouched ? widget.touchedBarColor : barColor,
width: width,
borderSide: isTouched
? BorderSide(color: widget.touchedBarColor.darken(80))
: const BorderSide(color: Colors.white, width: 0),
backDrawRodData: BackgroundBarChartRodData(
show: true,
toY: 20,
color: widget.barBackgroundColor,
),
),
],
showingTooltipIndicators: showTooltips,
);
}
List<BarChartGroupData> showingGroups() => List.generate(7, (i) {
switch (i) {
case 0:
return makeGroupData(0, 5, isTouched: i == touchedIndex);
case 1:
return makeGroupData(1, 6.5, isTouched: i == touchedIndex);
case 2:
return makeGroupData(2, 5, isTouched: i == touchedIndex);
case 3:
return makeGroupData(3, 7.5, isTouched: i == touchedIndex);
case 4:
return makeGroupData(4, 9, isTouched: i == touchedIndex);
case 5:
return makeGroupData(5, 11.5, isTouched: i == touchedIndex);
case 6:
return makeGroupData(6, 6.5, isTouched: i == touchedIndex);
default:
return throw Error();
}
});
BarChartData mainBarData() {
return BarChartData(
barTouchData: BarTouchData(
touchTooltipData: BarTouchTooltipData(
getTooltipColor: (_) => Colors.blueGrey,
tooltipHorizontalAlignment: FLHorizontalAlignment.right,
tooltipMargin: -10,
getTooltipItem: (group, groupIndex, rod, rodIndex) {
String weekDay;
switch (group.x) {
case 0:
weekDay = 'Monday';
break;
case 1:
weekDay = 'Tuesday';
break;
case 2:
weekDay = 'Wednesday';
break;
case 3:
weekDay = 'Thursday';
break;
case 4:
weekDay = 'Friday';
break;
case 5:
weekDay = 'Saturday';
break;
case 6:
weekDay = 'Sunday';
break;
default:
throw Error();
}
return BarTooltipItem(
'$weekDay\n',
const TextStyle(
color: Colors.white,
fontWeight: FontWeight.bold,
fontSize: 18,
),
children: <TextSpan>[
TextSpan(
text: (rod.toY - 1).toString(),
style: const TextStyle(
color: Colors.white, //widget.touchedBarColor,
fontSize: 16,
fontWeight: FontWeight.w500,
),
),
],
);
},
),
touchCallback: (FlTouchEvent event, barTouchResponse) {
setState(() {
if (!event.isInterestedForInteractions ||
barTouchResponse == null ||
barTouchResponse.spot == null) {
touchedIndex = -1;
return;
}
touchedIndex = barTouchResponse.spot!.touchedBarGroupIndex;
});
},
),
titlesData: FlTitlesData(
show: true,
rightTitles: const AxisTitles(
sideTitles: SideTitles(showTitles: false),
),
topTitles: const AxisTitles(
sideTitles: SideTitles(showTitles: false),
),
bottomTitles: AxisTitles(
sideTitles: SideTitles(
showTitles: true,
getTitlesWidget: getTitles,
reservedSize: 38,
),
),
leftTitles: const AxisTitles(
sideTitles: SideTitles(
showTitles: false,
),
),
),
borderData: FlBorderData(
show: false,
),
barGroups: showingGroups(),
gridData: const FlGridData(show: false),
);
}
Widget getTitles(double value, TitleMeta meta) {
const style = TextStyle(
color: Colors.white,
fontWeight: FontWeight.bold,
fontSize: 14,
);
Widget text;
switch (value.toInt()) {
case 0:
text = const Text('M', style: style);
break;
case 1:
text = const Text('T', style: style);
break;
case 2:
text = const Text('W', style: style);
break;
case 3:
text = const Text('T', style: style);
break;
case 4:
text = const Text('F', style: style);
break;
case 5:
text = const Text('S', style: style);
break;
case 6:
text = const Text('S', style: style);
break;
default:
text = const Text('', style: style);
break;
}
return SideTitleWidget(
axisSide: meta.axisSide,
space: 16,
child: text,
);
}
BarChartData randomData() {
return BarChartData(
barTouchData: BarTouchData(
enabled: false,
),
titlesData: FlTitlesData(
show: true,
bottomTitles: AxisTitles(
sideTitles: SideTitles(
showTitles: true,
getTitlesWidget: getTitles,
reservedSize: 38,
),
),
leftTitles: const AxisTitles(
sideTitles: SideTitles(
showTitles: false,
),
),
topTitles: const AxisTitles(
sideTitles: SideTitles(
showTitles: false,
),
),
rightTitles: const AxisTitles(
sideTitles: SideTitles(
showTitles: false,
),
),
),
borderData: FlBorderData(
show: false,
),
barGroups: List.generate(7, (i) {
switch (i) {
case 0:
return makeGroupData(
0,
Random().nextInt(15).toDouble() + 6,
barColor: widget.availableColors[
Random().nextInt(widget.availableColors.length)],
);
case 1:
return makeGroupData(
1,
Random().nextInt(15).toDouble() + 6,
barColor: widget.availableColors[
Random().nextInt(widget.availableColors.length)],
);
case 2:
return makeGroupData(
2,
Random().nextInt(15).toDouble() + 6,
barColor: widget.availableColors[
Random().nextInt(widget.availableColors.length)],
);
case 3:
return makeGroupData(
3,
Random().nextInt(15).toDouble() + 6,
barColor: widget.availableColors[
Random().nextInt(widget.availableColors.length)],
);
case 4:
return makeGroupData(
4,
Random().nextInt(15).toDouble() + 6,
barColor: widget.availableColors[
Random().nextInt(widget.availableColors.length)],
);
case 5:
return makeGroupData(
5,
Random().nextInt(15).toDouble() + 6,
barColor: widget.availableColors[
Random().nextInt(widget.availableColors.length)],
);
case 6:
return makeGroupData(
6,
Random().nextInt(15).toDouble() + 6,
barColor: widget.availableColors[
Random().nextInt(widget.availableColors.length)],
);
default:
return throw Error();
}
}),
gridData: const FlGridData(show: false),
);
}
Future<dynamic> refreshState() async {
setState(() {});
await Future<dynamic>.delayed(
animDuration + const Duration(milliseconds: 50),
);
if (isPlaying) {
await refreshState();
}
}
}
| fl_chart/example/lib/presentation/samples/bar/bar_chart_sample1.dart/0 | {
"file_path": "fl_chart/example/lib/presentation/samples/bar/bar_chart_sample1.dart",
"repo_id": "fl_chart",
"token_count": 6276
} | 46 |
import 'package:fl_chart_app/presentation/resources/app_resources.dart';
import 'package:fl_chart/fl_chart.dart';
import 'package:flutter/material.dart';
class LineChartSample5 extends StatefulWidget {
const LineChartSample5({
super.key,
Color? gradientColor1,
Color? gradientColor2,
Color? gradientColor3,
Color? indicatorStrokeColor,
}) : gradientColor1 = gradientColor1 ?? AppColors.contentColorBlue,
gradientColor2 = gradientColor2 ?? AppColors.contentColorPink,
gradientColor3 = gradientColor3 ?? AppColors.contentColorRed,
indicatorStrokeColor = indicatorStrokeColor ?? AppColors.mainTextColor1;
final Color gradientColor1;
final Color gradientColor2;
final Color gradientColor3;
final Color indicatorStrokeColor;
@override
State<LineChartSample5> createState() => _LineChartSample5State();
}
class _LineChartSample5State extends State<LineChartSample5> {
List<int> showingTooltipOnSpots = [1, 3, 5];
List<FlSpot> get allSpots => const [
FlSpot(0, 1),
FlSpot(1, 2),
FlSpot(2, 1.5),
FlSpot(3, 3),
FlSpot(4, 3.5),
FlSpot(5, 5),
FlSpot(6, 8),
];
Widget bottomTitleWidgets(double value, TitleMeta meta, double chartWidth) {
final style = TextStyle(
fontWeight: FontWeight.bold,
color: AppColors.contentColorPink,
fontFamily: 'Digital',
fontSize: 18 * chartWidth / 500,
);
String text;
switch (value.toInt()) {
case 0:
text = '00:00';
break;
case 1:
text = '04:00';
break;
case 2:
text = '08:00';
break;
case 3:
text = '12:00';
break;
case 4:
text = '16:00';
break;
case 5:
text = '20:00';
break;
case 6:
text = '23:59';
break;
default:
return Container();
}
return SideTitleWidget(
axisSide: meta.axisSide,
child: Text(text, style: style),
);
}
@override
Widget build(BuildContext context) {
final lineBarsData = [
LineChartBarData(
showingIndicators: showingTooltipOnSpots,
spots: allSpots,
isCurved: true,
barWidth: 4,
shadow: const Shadow(
blurRadius: 8,
),
belowBarData: BarAreaData(
show: true,
gradient: LinearGradient(
colors: [
widget.gradientColor1.withOpacity(0.4),
widget.gradientColor2.withOpacity(0.4),
widget.gradientColor3.withOpacity(0.4),
],
),
),
dotData: const FlDotData(show: false),
gradient: LinearGradient(
colors: [
widget.gradientColor1,
widget.gradientColor2,
widget.gradientColor3,
],
stops: const [0.1, 0.4, 0.9],
),
),
];
final tooltipsOnBar = lineBarsData[0];
return AspectRatio(
aspectRatio: 2.5,
child: Padding(
padding: const EdgeInsets.symmetric(
horizontal: 24.0,
vertical: 10,
),
child: LayoutBuilder(builder: (context, constraints) {
return LineChart(
LineChartData(
showingTooltipIndicators: showingTooltipOnSpots.map((index) {
return ShowingTooltipIndicators([
LineBarSpot(
tooltipsOnBar,
lineBarsData.indexOf(tooltipsOnBar),
tooltipsOnBar.spots[index],
),
]);
}).toList(),
lineTouchData: LineTouchData(
enabled: true,
handleBuiltInTouches: false,
touchCallback:
(FlTouchEvent event, LineTouchResponse? response) {
if (response == null || response.lineBarSpots == null) {
return;
}
if (event is FlTapUpEvent) {
final spotIndex = response.lineBarSpots!.first.spotIndex;
setState(() {
if (showingTooltipOnSpots.contains(spotIndex)) {
showingTooltipOnSpots.remove(spotIndex);
} else {
showingTooltipOnSpots.add(spotIndex);
}
});
}
},
mouseCursorResolver:
(FlTouchEvent event, LineTouchResponse? response) {
if (response == null || response.lineBarSpots == null) {
return SystemMouseCursors.basic;
}
return SystemMouseCursors.click;
},
getTouchedSpotIndicator:
(LineChartBarData barData, List<int> spotIndexes) {
return spotIndexes.map((index) {
return TouchedSpotIndicatorData(
const FlLine(
color: Colors.pink,
),
FlDotData(
show: true,
getDotPainter: (spot, percent, barData, index) =>
FlDotCirclePainter(
radius: 8,
color: lerpGradient(
barData.gradient!.colors,
barData.gradient!.stops!,
percent / 100,
),
strokeWidth: 2,
strokeColor: widget.indicatorStrokeColor,
),
),
);
}).toList();
},
touchTooltipData: LineTouchTooltipData(
getTooltipColor: (touchedSpot) => Colors.pink,
tooltipRoundedRadius: 8,
getTooltipItems: (List<LineBarSpot> lineBarsSpot) {
return lineBarsSpot.map((lineBarSpot) {
return LineTooltipItem(
lineBarSpot.y.toString(),
const TextStyle(
color: Colors.white,
fontWeight: FontWeight.bold,
),
);
}).toList();
},
),
),
lineBarsData: lineBarsData,
minY: 0,
titlesData: FlTitlesData(
leftTitles: const AxisTitles(
axisNameWidget: Text('count'),
axisNameSize: 24,
sideTitles: SideTitles(
showTitles: false,
reservedSize: 0,
),
),
bottomTitles: AxisTitles(
sideTitles: SideTitles(
showTitles: true,
interval: 1,
getTitlesWidget: (value, meta) {
return bottomTitleWidgets(
value,
meta,
constraints.maxWidth,
);
},
reservedSize: 30,
),
),
rightTitles: const AxisTitles(
axisNameWidget: Text('count'),
sideTitles: SideTitles(
showTitles: false,
reservedSize: 0,
),
),
topTitles: const AxisTitles(
axisNameWidget: Text(
'Wall clock',
textAlign: TextAlign.left,
),
axisNameSize: 24,
sideTitles: SideTitles(
showTitles: true,
reservedSize: 0,
),
),
),
gridData: const FlGridData(show: false),
borderData: FlBorderData(
show: true,
border: Border.all(
color: AppColors.borderColor,
),
),
),
);
}),
),
);
}
}
/// Lerps between a [LinearGradient] colors, based on [t]
Color lerpGradient(List<Color> colors, List<double> stops, double t) {
if (colors.isEmpty) {
throw ArgumentError('"colors" is empty.');
} else if (colors.length == 1) {
return colors[0];
}
if (stops.length != colors.length) {
stops = [];
/// provided gradientColorStops is invalid and we calculate it here
colors.asMap().forEach((index, color) {
final percent = 1.0 / (colors.length - 1);
stops.add(percent * index);
});
}
for (var s = 0; s < stops.length - 1; s++) {
final leftStop = stops[s];
final rightStop = stops[s + 1];
final leftColor = colors[s];
final rightColor = colors[s + 1];
if (t <= leftStop) {
return leftColor;
} else if (t < rightStop) {
final sectionT = (t - leftStop) / (rightStop - leftStop);
return Color.lerp(leftColor, rightColor, sectionT)!;
}
}
return colors.last;
}
| fl_chart/example/lib/presentation/samples/line/line_chart_sample5.dart/0 | {
"file_path": "fl_chart/example/lib/presentation/samples/line/line_chart_sample5.dart",
"repo_id": "fl_chart",
"token_count": 5146
} | 47 |
import 'dart:math' as math;
import 'package:url_launcher/url_launcher.dart';
class AppUtils {
factory AppUtils() {
return _singleton;
}
AppUtils._internal();
static final AppUtils _singleton = AppUtils._internal();
double degreeToRadian(double degree) {
return degree * math.pi / 180;
}
double radianToDegree(double radian) {
return radian * 180 / math.pi;
}
Future<bool> tryToLaunchUrl(String url) async {
final uri = Uri.parse(url);
if (await canLaunchUrl(uri)) {
return await launchUrl(uri);
}
return false;
}
}
| fl_chart/example/lib/util/app_utils.dart/0 | {
"file_path": "fl_chart/example/lib/util/app_utils.dart",
"repo_id": "fl_chart",
"token_count": 217
} | 48 |
<!DOCTYPE html>
<html>
<head>
<!--
If you are serving your web app in a path other than the root, change the
href value below to reflect the base path you are serving from.
The path provided below has to start and end with a slash "/" in order for
it to work correctly.
For more details:
* https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base
This is a placeholder for base href that will be replaced by the value of
the `--base-href` argument provided to `flutter build`.
-->
<base href="$FLUTTER_BASE_HREF">
<meta charset="UTF-8">
<meta content="IE=Edge" http-equiv="X-UA-Compatible">
<meta name="description" content="FL Chart App is an application to demonstrate samples of the fl_chart (A Flutter package to draw charts).">
<!-- iOS meta tags & icons -->
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-mobile-web-app-title" content="FL Chart App">
<link rel="apple-touch-icon" href="icons/Icon-192.png">
<!-- Favicon -->
<link rel="icon" type="image/png" href="favicon.png"/>
<title>FL Chart App</title>
<link rel="manifest" href="manifest.json">
<script>
// The value below is injected by flutter build, do not touch.
var serviceWorkerVersion = null;
</script>
<!-- This script adds the flutter initialization JS code -->
<script src="flutter.js" defer></script>
</head>
<style>
.loading {
display: flex;
justify-content: center;
align-items: center;
margin: 0;
position: absolute;
top: 50%;
left: 50%;
-ms-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
}
.loader {
border-radius: 50%;
border: 6px solid ;
border-top: 6px solid transparent;
border-right: 6px solid #50E4FF;
border-bottom: 6px solid transparent;
border-left: 6px solid #50E4FF;
width: 52px;
height: 52px;
-webkit-animation: spin 2s linear infinite;
animation: spin 2s linear infinite;
}
@-webkit-keyframes spin {
0% {
-webkit-transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(360deg);
}
}
@keyframes spin {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
body {
background: #282E45;
}
</style>
<body>
<div class="loading">
<div class="loader"></div>
</div>
<script>
window.addEventListener('load', function(ev) {
// Download main.dart.js
_flutter.loader.loadEntrypoint({
serviceWorker: {
serviceWorkerVersion: serviceWorkerVersion,
}
}).then(function(engineInitializer) {
return engineInitializer.initializeEngine();
}).then(function(appRunner) {
return appRunner.runApp();
});
});
</script>
</body>
</html>
| fl_chart/example/web/index.html/0 | {
"file_path": "fl_chart/example/web/index.html",
"repo_id": "fl_chart",
"token_count": 1160
} | 49 |
import 'package:fl_chart/fl_chart.dart';
import 'package:fl_chart/src/chart/base/axis_chart/axis_chart_helper.dart';
import 'package:flutter/material.dart';
import 'package:flutter/scheduler.dart';
/// Wraps a [child] widget and applies some default behaviours
///
/// Recommended to be used in [SideTitles.getTitlesWidget]
/// You need to pass [axisSide] value that provided by [TitleMeta]
/// It forces the widget to be close to the chart.
/// It also applies a [space] to the chart.
/// You can also fill [angle] in radians if you need to rotate your widget.
/// To force widget to be positioned within its axis bounding box,
/// define [fitInside] by passing [SideTitleFitInsideData]
class SideTitleWidget extends StatefulWidget {
const SideTitleWidget({
super.key,
required this.child,
required this.axisSide,
this.space = 8.0,
this.angle = 0.0,
this.fitInside = const SideTitleFitInsideData(
enabled: false,
distanceFromEdge: 0,
parentAxisSize: 0,
axisPosition: 0,
),
});
final AxisSide axisSide;
final double space;
final Widget child;
final double angle;
/// Define fitInside options with [SideTitleFitInsideData]
///
/// To makes things simpler, it's recommended to use
/// [SideTitleFitInsideData.fromTitleMeta] and pass the
/// TitleMeta provided from [SideTitles.getTitlesWidget]
///
/// If [fitInside.enabled] is true, the widget will be placed
/// inside the parent axis bounding box.
///
/// Some translations will be applied to force
/// children to be positioned inside the parent axis bounding box.
///
/// Will override the [SideTitleWidget.space] and caused
/// spacing between [SideTitles] children might be not equal.
final SideTitleFitInsideData fitInside;
@override
State<SideTitleWidget> createState() => _SideTitleWidgetState();
}
class _SideTitleWidgetState extends State<SideTitleWidget> {
Alignment _getAlignment() {
switch (widget.axisSide) {
case AxisSide.left:
return Alignment.centerRight;
case AxisSide.top:
return Alignment.bottomCenter;
case AxisSide.right:
return Alignment.centerLeft;
case AxisSide.bottom:
return Alignment.topCenter;
}
}
EdgeInsets _getMargin() {
switch (widget.axisSide) {
case AxisSide.left:
return EdgeInsets.only(right: widget.space);
case AxisSide.top:
return EdgeInsets.only(bottom: widget.space);
case AxisSide.right:
return EdgeInsets.only(left: widget.space);
case AxisSide.bottom:
return EdgeInsets.only(top: widget.space);
}
}
/// Calculate child width/height
final GlobalKey widgetKey = GlobalKey();
double? _childSize;
void _getChildSize(_) {
// If fitInside is false, no need to find child size
if (!widget.fitInside.enabled) return;
// If childSize is not null, no need to find the size anymore
if (_childSize != null) return;
final context = widgetKey.currentContext;
if (context == null) return;
// Set size based on its axis side
final size = switch (widget.axisSide) {
AxisSide.left || AxisSide.right => context.size?.height ?? 0,
AxisSide.top || AxisSide.bottom => context.size?.width ?? 0,
};
// If childSize is the same, no need to set new value
if (_childSize == size) return;
setState(() => _childSize = size);
}
@override
void initState() {
super.initState();
SchedulerBinding.instance.addPostFrameCallback(_getChildSize);
}
@override
void didUpdateWidget(covariant SideTitleWidget oldWidget) {
super.didUpdateWidget(oldWidget);
SchedulerBinding.instance.addPostFrameCallback(_getChildSize);
}
@override
Widget build(BuildContext context) {
return Transform.translate(
offset: !widget.fitInside.enabled
? Offset.zero
: AxisChartHelper().calcFitInsideOffset(
axisSide: widget.axisSide,
childSize: _childSize,
parentAxisSize: widget.fitInside.parentAxisSize,
axisPosition: widget.fitInside.axisPosition,
distanceFromEdge: widget.fitInside.distanceFromEdge,
),
child: Transform.rotate(
angle: widget.angle,
child: Container(
key: widgetKey,
margin: _getMargin(),
alignment: _getAlignment(),
child: widget.child,
),
),
);
}
}
| fl_chart/lib/src/chart/base/axis_chart/axis_chart_widgets.dart/0 | {
"file_path": "fl_chart/lib/src/chart/base/axis_chart/axis_chart_widgets.dart",
"repo_id": "fl_chart",
"token_count": 1585
} | 50 |
import 'dart:math' as math;
import 'package:fl_chart/fl_chart.dart';
import 'package:fl_chart/src/chart/base/base_chart/base_chart_painter.dart';
import 'package:fl_chart/src/chart/base/line.dart';
import 'package:fl_chart/src/chart/pie_chart/pie_chart_data.dart';
import 'package:fl_chart/src/extensions/paint_extension.dart';
import 'package:fl_chart/src/utils/canvas_wrapper.dart';
import 'package:fl_chart/src/utils/utils.dart';
import 'package:flutter/material.dart';
/// Paints [PieChartData] in the canvas, it can be used in a [CustomPainter]
class PieChartPainter extends BaseChartPainter<PieChartData> {
/// Paints [dataList] into canvas, it is the animating [PieChartData],
/// [targetData] is the animation's target and remains the same
/// during animation, then we should use it when we need to show
/// tooltips or something like that, because [dataList] is changing constantly.
///
/// [textScale] used for scaling texts inside the chart,
/// parent can use [MediaQuery.textScaleFactor] to respect
/// the system's font size.
PieChartPainter() : super() {
_sectionPaint = Paint()..style = PaintingStyle.stroke;
_sectionSaveLayerPaint = Paint();
_sectionStrokePaint = Paint()..style = PaintingStyle.stroke;
_centerSpacePaint = Paint()..style = PaintingStyle.fill;
}
late Paint _sectionPaint;
late Paint _sectionSaveLayerPaint;
late Paint _sectionStrokePaint;
late Paint _centerSpacePaint;
/// Paints [PieChartData] into the provided canvas.
@override
void paint(
BuildContext context,
CanvasWrapper canvasWrapper,
PaintHolder<PieChartData> holder,
) {
super.paint(context, canvasWrapper, holder);
final data = holder.data;
if (data.sections.isEmpty) {
return;
}
final sectionsAngle = calculateSectionsAngle(data.sections, data.sumValue);
final centerRadius = calculateCenterRadius(canvasWrapper.size, holder);
drawCenterSpace(canvasWrapper, centerRadius, holder);
drawSections(canvasWrapper, sectionsAngle, centerRadius, holder);
drawTexts(context, canvasWrapper, holder, centerRadius);
}
@visibleForTesting
List<double> calculateSectionsAngle(
List<PieChartSectionData> sections,
double sumValue,
) {
return sections.map((section) {
return 360 * (section.value / sumValue);
}).toList();
}
@visibleForTesting
void drawCenterSpace(
CanvasWrapper canvasWrapper,
double centerRadius,
PaintHolder<PieChartData> holder,
) {
final data = holder.data;
final viewSize = canvasWrapper.size;
final centerX = viewSize.width / 2;
final centerY = viewSize.height / 2;
_centerSpacePaint.color = data.centerSpaceColor;
canvasWrapper.drawCircle(
Offset(centerX, centerY),
centerRadius,
_centerSpacePaint,
);
}
@visibleForTesting
void drawSections(
CanvasWrapper canvasWrapper,
List<double> sectionsAngle,
double centerRadius,
PaintHolder<PieChartData> holder,
) {
final data = holder.data;
final viewSize = canvasWrapper.size;
final center = Offset(viewSize.width / 2, viewSize.height / 2);
var tempAngle = data.startDegreeOffset;
for (var i = 0; i < data.sections.length; i++) {
final section = data.sections[i];
final sectionDegree = sectionsAngle[i];
if (sectionDegree == 360) {
final radius = centerRadius + section.radius / 2;
final rect = Rect.fromCircle(center: center, radius: radius);
_sectionPaint
..setColorOrGradient(
section.color,
section.gradient,
rect,
)
..strokeWidth = section.radius
..style = PaintingStyle.fill;
final bounds = Rect.fromCircle(
center: center,
radius: centerRadius + section.radius,
);
canvasWrapper
..saveLayer(bounds, _sectionSaveLayerPaint)
..drawCircle(
center,
centerRadius + section.radius,
_sectionPaint..blendMode = BlendMode.srcOver,
)
..drawCircle(
center,
centerRadius,
_sectionPaint..blendMode = BlendMode.srcOut,
)
..restore();
_sectionPaint.blendMode = BlendMode.srcOver;
if (section.borderSide.width != 0.0 &&
section.borderSide.color.opacity != 0.0) {
_sectionStrokePaint
..strokeWidth = section.borderSide.width
..color = section.borderSide.color;
// Outer
canvasWrapper
..drawCircle(
center,
centerRadius + section.radius - (section.borderSide.width / 2),
_sectionStrokePaint,
)
// Inner
..drawCircle(
center,
centerRadius + (section.borderSide.width / 2),
_sectionStrokePaint,
);
}
return;
}
final sectionPath = generateSectionPath(
section,
data.sectionsSpace,
tempAngle,
sectionDegree,
center,
centerRadius,
);
drawSection(section, sectionPath, canvasWrapper);
drawSectionStroke(section, sectionPath, canvasWrapper, viewSize);
tempAngle += sectionDegree;
}
}
/// Generates a path around a section
@visibleForTesting
Path generateSectionPath(
PieChartSectionData section,
double sectionSpace,
double tempAngle,
double sectionDegree,
Offset center,
double centerRadius,
) {
final sectionRadiusRect = Rect.fromCircle(
center: center,
radius: centerRadius + section.radius,
);
final centerRadiusRect = Rect.fromCircle(
center: center,
radius: centerRadius,
);
final startRadians = Utils().radians(tempAngle);
final sweepRadians = Utils().radians(sectionDegree);
final endRadians = startRadians + sweepRadians;
final startLineDirection =
Offset(math.cos(startRadians), math.sin(startRadians));
final startLineFrom = center + startLineDirection * centerRadius;
final startLineTo = startLineFrom + startLineDirection * section.radius;
final startLine = Line(startLineFrom, startLineTo);
final endLineDirection = Offset(math.cos(endRadians), math.sin(endRadians));
final endLineFrom = center + endLineDirection * centerRadius;
final endLineTo = endLineFrom + endLineDirection * section.radius;
final endLine = Line(endLineFrom, endLineTo);
var sectionPath = Path()
..moveTo(startLine.from.dx, startLine.from.dy)
..lineTo(startLine.to.dx, startLine.to.dy)
..arcTo(sectionRadiusRect, startRadians, sweepRadians, false)
..lineTo(endLine.from.dx, endLine.from.dy)
..arcTo(centerRadiusRect, endRadians, -sweepRadians, false)
..moveTo(startLine.from.dx, startLine.from.dy)
..close();
/// Subtract section space from the sectionPath
if (sectionSpace != 0) {
final startLineSeparatorPath = createRectPathAroundLine(
Line(startLineFrom, startLineTo),
sectionSpace,
);
try {
sectionPath = Path.combine(
PathOperation.difference,
sectionPath,
startLineSeparatorPath,
);
} catch (e) {
/// It's a flutter engine issue with [Path.combine] in web-html renderer
/// https://github.com/imaNNeo/fl_chart/issues/955
}
final endLineSeparatorPath =
createRectPathAroundLine(Line(endLineFrom, endLineTo), sectionSpace);
try {
sectionPath = Path.combine(
PathOperation.difference,
sectionPath,
endLineSeparatorPath,
);
} catch (e) {
/// It's a flutter engine issue with [Path.combine] in web-html renderer
/// https://github.com/imaNNeo/fl_chart/issues/955
}
}
return sectionPath;
}
/// Creates a rect around a narrow line
@visibleForTesting
Path createRectPathAroundLine(Line line, double width) {
width = width / 2;
final normalized = line.normalize();
final verticalAngle = line.direction() + (math.pi / 2);
final verticalDirection =
Offset(math.cos(verticalAngle), math.sin(verticalAngle));
final startPoint1 = Offset(
line.from.dx -
(normalized * (width / 2)).dx -
(verticalDirection * width).dx,
line.from.dy -
(normalized * (width / 2)).dy -
(verticalDirection * width).dy,
);
final startPoint2 = Offset(
line.to.dx +
(normalized * (width / 2)).dx -
(verticalDirection * width).dx,
line.to.dy +
(normalized * (width / 2)).dy -
(verticalDirection * width).dy,
);
final startPoint3 = Offset(
startPoint2.dx + (verticalDirection * (width * 2)).dx,
startPoint2.dy + (verticalDirection * (width * 2)).dy,
);
final startPoint4 = Offset(
startPoint1.dx + (verticalDirection * (width * 2)).dx,
startPoint1.dy + (verticalDirection * (width * 2)).dy,
);
return Path()
..moveTo(startPoint1.dx, startPoint1.dy)
..lineTo(startPoint2.dx, startPoint2.dy)
..lineTo(startPoint3.dx, startPoint3.dy)
..lineTo(startPoint4.dx, startPoint4.dy)
..lineTo(startPoint1.dx, startPoint1.dy);
}
@visibleForTesting
void drawSection(
PieChartSectionData section,
Path sectionPath,
CanvasWrapper canvasWrapper,
) {
_sectionPaint
..setColorOrGradient(
section.color,
section.gradient,
sectionPath.getBounds(),
)
..style = PaintingStyle.fill;
canvasWrapper.drawPath(sectionPath, _sectionPaint);
}
@visibleForTesting
void drawSectionStroke(
PieChartSectionData section,
Path sectionPath,
CanvasWrapper canvasWrapper,
Size viewSize,
) {
if (section.borderSide.width != 0.0 &&
section.borderSide.color.opacity != 0.0) {
canvasWrapper
..saveLayer(
Rect.fromLTWH(0, 0, viewSize.width, viewSize.height),
Paint(),
)
..clipPath(sectionPath);
_sectionStrokePaint
..strokeWidth = section.borderSide.width * 2
..color = section.borderSide.color;
canvasWrapper
..drawPath(
sectionPath,
_sectionStrokePaint,
)
..restore();
}
}
/// Calculates layout of overlaying elements, includes:
/// - title text
/// - badge widget positions
@visibleForTesting
void drawTexts(
BuildContext context,
CanvasWrapper canvasWrapper,
PaintHolder<PieChartData> holder,
double centerRadius,
) {
final data = holder.data;
final viewSize = canvasWrapper.size;
final center = Offset(viewSize.width / 2, viewSize.height / 2);
var tempAngle = data.startDegreeOffset;
for (var i = 0; i < data.sections.length; i++) {
final section = data.sections[i];
final startAngle = tempAngle;
final sweepAngle = 360 * (section.value / data.sumValue);
final sectionCenterAngle = startAngle + (sweepAngle / 2);
double? rotateAngle;
if (data.titleSunbeamLayout) {
if (sectionCenterAngle >= 90 && sectionCenterAngle <= 270) {
rotateAngle = sectionCenterAngle - 180;
} else {
rotateAngle = sectionCenterAngle;
}
}
Offset sectionCenter(double percentageOffset) =>
center +
Offset(
math.cos(Utils().radians(sectionCenterAngle)) *
(centerRadius + (section.radius * percentageOffset)),
math.sin(Utils().radians(sectionCenterAngle)) *
(centerRadius + (section.radius * percentageOffset)),
);
final sectionCenterOffsetTitle =
sectionCenter(section.titlePositionPercentageOffset);
if (section.showTitle) {
final span = TextSpan(
style: Utils().getThemeAwareTextStyle(context, section.titleStyle),
text: section.title,
);
final tp = TextPainter(
text: span,
textAlign: TextAlign.center,
textDirection: TextDirection.ltr,
textScaler: holder.textScaler,
)..layout();
canvasWrapper.drawText(
tp,
sectionCenterOffsetTitle - Offset(tp.width / 2, tp.height / 2),
rotateAngle,
);
}
tempAngle += sweepAngle;
}
}
/// Calculates center radius based on the provided sections radius
@visibleForTesting
double calculateCenterRadius(
Size viewSize,
PaintHolder<PieChartData> holder,
) {
final data = holder.data;
if (data.centerSpaceRadius.isFinite) {
return data.centerSpaceRadius;
}
final maxRadius =
data.sections.reduce((a, b) => a.radius > b.radius ? a : b).radius;
return (viewSize.shortestSide - (maxRadius * 2)) / 2;
}
/// Makes a [PieTouchedSection] based on the provided [localPosition]
///
/// Processes [localPosition] and checks
/// the elements of the chart that are near the offset,
/// then makes a [PieTouchedSection] from the elements that has been touched.
PieTouchedSection handleTouch(
Offset localPosition,
Size viewSize,
PaintHolder<PieChartData> holder,
) {
final data = holder.data;
final sectionsAngle = calculateSectionsAngle(data.sections, data.sumValue);
final center = Offset(viewSize.width / 2, viewSize.height / 2);
final touchedPoint2 = localPosition - center;
final touchX = touchedPoint2.dx;
final touchY = touchedPoint2.dy;
final touchR = math.sqrt(math.pow(touchX, 2) + math.pow(touchY, 2));
var touchAngle = Utils().degrees(math.atan2(touchY, touchX));
touchAngle = touchAngle < 0 ? (180 - touchAngle.abs()) + 180 : touchAngle;
PieChartSectionData? foundSectionData;
var foundSectionDataPosition = -1;
/// Find the nearest section base on the touch spot
final relativeTouchAngle = (touchAngle - data.startDegreeOffset) % 360;
var tempAngle = 0.0;
for (var i = 0; i < data.sections.length; i++) {
final section = data.sections[i];
var sectionAngle = sectionsAngle[i];
tempAngle %= 360;
if (data.sections.length == 1) {
sectionAngle = 360;
} else {
sectionAngle %= 360;
}
/// degree criteria
final space = data.sectionsSpace / 2;
final fromDegree = tempAngle + space;
final toDegree = sectionAngle + tempAngle - space;
final isInDegree =
relativeTouchAngle >= fromDegree && relativeTouchAngle <= toDegree;
/// radius criteria
final centerRadius = calculateCenterRadius(viewSize, holder);
final sectionRadius = centerRadius + section.radius;
final isInRadius = touchR > centerRadius && touchR <= sectionRadius;
if (isInDegree && isInRadius) {
foundSectionData = section;
foundSectionDataPosition = i;
break;
}
tempAngle += sectionAngle;
}
return PieTouchedSection(
foundSectionData,
foundSectionDataPosition,
touchAngle,
touchR,
);
}
/// Exposes offset for laying out the badge widgets upon the chart.
Map<int, Offset> getBadgeOffsets(
Size viewSize,
PaintHolder<PieChartData> holder,
) {
final data = holder.data;
final center = viewSize.center(Offset.zero);
final badgeWidgetsOffsets = <int, Offset>{};
if (data.sections.isEmpty) {
return badgeWidgetsOffsets;
}
var tempAngle = data.startDegreeOffset;
final sectionsAngle = calculateSectionsAngle(data.sections, data.sumValue);
for (var i = 0; i < data.sections.length; i++) {
final section = data.sections[i];
final startAngle = tempAngle;
final sweepAngle = sectionsAngle[i];
final sectionCenterAngle = startAngle + (sweepAngle / 2);
final centerRadius = calculateCenterRadius(viewSize, holder);
Offset sectionCenter(double percentageOffset) =>
center +
Offset(
math.cos(Utils().radians(sectionCenterAngle)) *
(centerRadius + (section.radius * percentageOffset)),
math.sin(Utils().radians(sectionCenterAngle)) *
(centerRadius + (section.radius * percentageOffset)),
);
final sectionCenterOffsetBadgeWidget =
sectionCenter(section.badgePositionPercentageOffset);
badgeWidgetsOffsets[i] = sectionCenterOffsetBadgeWidget;
tempAngle += sweepAngle;
}
return badgeWidgetsOffsets;
}
}
| fl_chart/lib/src/chart/pie_chart/pie_chart_painter.dart/0 | {
"file_path": "fl_chart/lib/src/chart/pie_chart/pie_chart_painter.dart",
"repo_id": "fl_chart",
"token_count": 6701
} | 51 |
import 'package:fl_chart/fl_chart.dart';
import 'package:flutter/widgets.dart';
extension FlBorderDataExtension on FlBorderData {
EdgeInsets get allSidesPadding {
return EdgeInsets.only(
left: show ? border.left.width : 0.0,
top: show ? border.top.width : 0.0,
right: show ? border.right.width : 0.0,
bottom: show ? border.bottom.width : 0.0,
);
}
}
| fl_chart/lib/src/extensions/fl_border_data_extension.dart/0 | {
"file_path": "fl_chart/lib/src/extensions/fl_border_data_extension.dart",
"repo_id": "fl_chart",
"token_count": 157
} | 52 |
import 'package:fl_chart/src/utils/utils.dart';
import 'package:flutter_test/flutter_test.dart';
import '../data_pool.dart';
void main() {
const tolerance = 0.001;
test('test magnitude()', () {
expect(line1.magnitude(), closeTo(14.142, tolerance));
expect(line2.magnitude(), closeTo(22.360, tolerance));
expect(line3.magnitude(), closeTo(18.027, tolerance));
expect(line4.magnitude(), closeTo(32.310, tolerance));
expect(line5.magnitude(), closeTo(5.830, tolerance));
});
test('test angle()', () {
expect(line1.direction(), closeTo(Utils().radians(45), tolerance));
expect(line2.direction(), closeTo(Utils().radians(63.434), tolerance));
expect(line3.direction(), closeTo(Utils().radians(-3.179), tolerance));
expect(line4.direction(), closeTo(Utils().radians(68.198), tolerance));
expect(line5.direction(), closeTo(Utils().radians(59), tolerance));
});
test('test normalize()', () {
expect(line1.normalize().dx, closeTo(0.707, tolerance));
expect(line1.normalize().dy, closeTo(0.707, tolerance));
expect(line2.normalize().dx, closeTo(0.447, tolerance));
expect(line2.normalize().dy, closeTo(0.894, tolerance));
expect(line3.normalize().dx, closeTo(-0.998, tolerance));
expect(line3.normalize().dy, closeTo(0.0554, tolerance));
expect(line4.normalize().dx, closeTo(-0.371, tolerance));
expect(line4.normalize().dy, closeTo(-0.928, tolerance));
expect(line5.normalize().dx, closeTo(0.514, tolerance));
expect(line5.normalize().dy, closeTo(0.857, tolerance));
});
}
| fl_chart/test/chart/base/line_test.dart/0 | {
"file_path": "fl_chart/test/chart/base/line_test.dart",
"repo_id": "fl_chart",
"token_count": 574
} | 53 |
// Mocks generated by Mockito 5.4.4 from annotations
// in fl_chart/test/chart/radar_chart/radar_chart_painter_test.dart.
// Do not manually edit this file.
// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'dart:typed_data' as _i5;
import 'dart:ui' as _i2;
import 'package:fl_chart/fl_chart.dart' as _i7;
import 'package:fl_chart/src/utils/canvas_wrapper.dart' as _i6;
import 'package:fl_chart/src/utils/utils.dart' as _i8;
import 'package:flutter/cupertino.dart' as _i3;
import 'package:flutter/foundation.dart' as _i4;
import 'package:mockito/mockito.dart' as _i1;
import 'package:mockito/src/dummies.dart' as _i9;
// ignore_for_file: type=lint
// ignore_for_file: avoid_redundant_argument_values
// ignore_for_file: avoid_setters_without_getters
// ignore_for_file: comment_references
// ignore_for_file: deprecated_member_use
// ignore_for_file: deprecated_member_use_from_same_package
// ignore_for_file: implementation_imports
// ignore_for_file: invalid_use_of_visible_for_testing_member
// ignore_for_file: prefer_const_constructors
// ignore_for_file: unnecessary_parenthesis
// ignore_for_file: camel_case_types
// ignore_for_file: subtype_of_sealed_class
class _FakeRect_0 extends _i1.SmartFake implements _i2.Rect {
_FakeRect_0(
Object parent,
Invocation parentInvocation,
) : super(
parent,
parentInvocation,
);
}
class _FakeCanvas_1 extends _i1.SmartFake implements _i2.Canvas {
_FakeCanvas_1(
Object parent,
Invocation parentInvocation,
) : super(
parent,
parentInvocation,
);
}
class _FakeSize_2 extends _i1.SmartFake implements _i2.Size {
_FakeSize_2(
Object parent,
Invocation parentInvocation,
) : super(
parent,
parentInvocation,
);
}
class _FakeWidget_3 extends _i1.SmartFake implements _i3.Widget {
_FakeWidget_3(
Object parent,
Invocation parentInvocation,
) : super(
parent,
parentInvocation,
);
@override
String toString({_i3.DiagnosticLevel? minLevel = _i3.DiagnosticLevel.info}) =>
super.toString();
}
class _FakeInheritedWidget_4 extends _i1.SmartFake
implements _i3.InheritedWidget {
_FakeInheritedWidget_4(
Object parent,
Invocation parentInvocation,
) : super(
parent,
parentInvocation,
);
@override
String toString({_i3.DiagnosticLevel? minLevel = _i3.DiagnosticLevel.info}) =>
super.toString();
}
class _FakeDiagnosticsNode_5 extends _i1.SmartFake
implements _i3.DiagnosticsNode {
_FakeDiagnosticsNode_5(
Object parent,
Invocation parentInvocation,
) : super(
parent,
parentInvocation,
);
@override
String toString({
_i4.TextTreeConfiguration? parentConfiguration,
_i3.DiagnosticLevel? minLevel = _i3.DiagnosticLevel.info,
}) =>
super.toString();
}
class _FakeOffset_6 extends _i1.SmartFake implements _i2.Offset {
_FakeOffset_6(
Object parent,
Invocation parentInvocation,
) : super(
parent,
parentInvocation,
);
}
class _FakeBorderSide_7 extends _i1.SmartFake implements _i3.BorderSide {
_FakeBorderSide_7(
Object parent,
Invocation parentInvocation,
) : super(
parent,
parentInvocation,
);
@override
String toString({_i3.DiagnosticLevel? minLevel = _i3.DiagnosticLevel.info}) =>
super.toString();
}
class _FakeTextStyle_8 extends _i1.SmartFake implements _i3.TextStyle {
_FakeTextStyle_8(
Object parent,
Invocation parentInvocation,
) : super(
parent,
parentInvocation,
);
@override
String toString({_i3.DiagnosticLevel? minLevel = _i3.DiagnosticLevel.info}) =>
super.toString();
}
/// A class which mocks [Canvas].
///
/// See the documentation for Mockito's code generation for more information.
class MockCanvas extends _i1.Mock implements _i2.Canvas {
MockCanvas() {
_i1.throwOnMissingStub(this);
}
@override
void save() => super.noSuchMethod(
Invocation.method(
#save,
[],
),
returnValueForMissingStub: null,
);
@override
void saveLayer(
_i2.Rect? bounds,
_i2.Paint? paint,
) =>
super.noSuchMethod(
Invocation.method(
#saveLayer,
[
bounds,
paint,
],
),
returnValueForMissingStub: null,
);
@override
void restore() => super.noSuchMethod(
Invocation.method(
#restore,
[],
),
returnValueForMissingStub: null,
);
@override
void restoreToCount(int? count) => super.noSuchMethod(
Invocation.method(
#restoreToCount,
[count],
),
returnValueForMissingStub: null,
);
@override
int getSaveCount() => (super.noSuchMethod(
Invocation.method(
#getSaveCount,
[],
),
returnValue: 0,
) as int);
@override
void translate(
double? dx,
double? dy,
) =>
super.noSuchMethod(
Invocation.method(
#translate,
[
dx,
dy,
],
),
returnValueForMissingStub: null,
);
@override
void scale(
double? sx, [
double? sy,
]) =>
super.noSuchMethod(
Invocation.method(
#scale,
[
sx,
sy,
],
),
returnValueForMissingStub: null,
);
@override
void rotate(double? radians) => super.noSuchMethod(
Invocation.method(
#rotate,
[radians],
),
returnValueForMissingStub: null,
);
@override
void skew(
double? sx,
double? sy,
) =>
super.noSuchMethod(
Invocation.method(
#skew,
[
sx,
sy,
],
),
returnValueForMissingStub: null,
);
@override
void transform(_i5.Float64List? matrix4) => super.noSuchMethod(
Invocation.method(
#transform,
[matrix4],
),
returnValueForMissingStub: null,
);
@override
_i5.Float64List getTransform() => (super.noSuchMethod(
Invocation.method(
#getTransform,
[],
),
returnValue: _i5.Float64List(0),
) as _i5.Float64List);
@override
void clipRect(
_i2.Rect? rect, {
_i2.ClipOp? clipOp = _i2.ClipOp.intersect,
bool? doAntiAlias = true,
}) =>
super.noSuchMethod(
Invocation.method(
#clipRect,
[rect],
{
#clipOp: clipOp,
#doAntiAlias: doAntiAlias,
},
),
returnValueForMissingStub: null,
);
@override
void clipRRect(
_i2.RRect? rrect, {
bool? doAntiAlias = true,
}) =>
super.noSuchMethod(
Invocation.method(
#clipRRect,
[rrect],
{#doAntiAlias: doAntiAlias},
),
returnValueForMissingStub: null,
);
@override
void clipPath(
_i2.Path? path, {
bool? doAntiAlias = true,
}) =>
super.noSuchMethod(
Invocation.method(
#clipPath,
[path],
{#doAntiAlias: doAntiAlias},
),
returnValueForMissingStub: null,
);
@override
_i2.Rect getLocalClipBounds() => (super.noSuchMethod(
Invocation.method(
#getLocalClipBounds,
[],
),
returnValue: _FakeRect_0(
this,
Invocation.method(
#getLocalClipBounds,
[],
),
),
) as _i2.Rect);
@override
_i2.Rect getDestinationClipBounds() => (super.noSuchMethod(
Invocation.method(
#getDestinationClipBounds,
[],
),
returnValue: _FakeRect_0(
this,
Invocation.method(
#getDestinationClipBounds,
[],
),
),
) as _i2.Rect);
@override
void drawColor(
_i2.Color? color,
_i2.BlendMode? blendMode,
) =>
super.noSuchMethod(
Invocation.method(
#drawColor,
[
color,
blendMode,
],
),
returnValueForMissingStub: null,
);
@override
void drawLine(
_i2.Offset? p1,
_i2.Offset? p2,
_i2.Paint? paint,
) =>
super.noSuchMethod(
Invocation.method(
#drawLine,
[
p1,
p2,
paint,
],
),
returnValueForMissingStub: null,
);
@override
void drawPaint(_i2.Paint? paint) => super.noSuchMethod(
Invocation.method(
#drawPaint,
[paint],
),
returnValueForMissingStub: null,
);
@override
void drawRect(
_i2.Rect? rect,
_i2.Paint? paint,
) =>
super.noSuchMethod(
Invocation.method(
#drawRect,
[
rect,
paint,
],
),
returnValueForMissingStub: null,
);
@override
void drawRRect(
_i2.RRect? rrect,
_i2.Paint? paint,
) =>
super.noSuchMethod(
Invocation.method(
#drawRRect,
[
rrect,
paint,
],
),
returnValueForMissingStub: null,
);
@override
void drawDRRect(
_i2.RRect? outer,
_i2.RRect? inner,
_i2.Paint? paint,
) =>
super.noSuchMethod(
Invocation.method(
#drawDRRect,
[
outer,
inner,
paint,
],
),
returnValueForMissingStub: null,
);
@override
void drawOval(
_i2.Rect? rect,
_i2.Paint? paint,
) =>
super.noSuchMethod(
Invocation.method(
#drawOval,
[
rect,
paint,
],
),
returnValueForMissingStub: null,
);
@override
void drawCircle(
_i2.Offset? c,
double? radius,
_i2.Paint? paint,
) =>
super.noSuchMethod(
Invocation.method(
#drawCircle,
[
c,
radius,
paint,
],
),
returnValueForMissingStub: null,
);
@override
void drawArc(
_i2.Rect? rect,
double? startAngle,
double? sweepAngle,
bool? useCenter,
_i2.Paint? paint,
) =>
super.noSuchMethod(
Invocation.method(
#drawArc,
[
rect,
startAngle,
sweepAngle,
useCenter,
paint,
],
),
returnValueForMissingStub: null,
);
@override
void drawPath(
_i2.Path? path,
_i2.Paint? paint,
) =>
super.noSuchMethod(
Invocation.method(
#drawPath,
[
path,
paint,
],
),
returnValueForMissingStub: null,
);
@override
void drawImage(
_i2.Image? image,
_i2.Offset? offset,
_i2.Paint? paint,
) =>
super.noSuchMethod(
Invocation.method(
#drawImage,
[
image,
offset,
paint,
],
),
returnValueForMissingStub: null,
);
@override
void drawImageRect(
_i2.Image? image,
_i2.Rect? src,
_i2.Rect? dst,
_i2.Paint? paint,
) =>
super.noSuchMethod(
Invocation.method(
#drawImageRect,
[
image,
src,
dst,
paint,
],
),
returnValueForMissingStub: null,
);
@override
void drawImageNine(
_i2.Image? image,
_i2.Rect? center,
_i2.Rect? dst,
_i2.Paint? paint,
) =>
super.noSuchMethod(
Invocation.method(
#drawImageNine,
[
image,
center,
dst,
paint,
],
),
returnValueForMissingStub: null,
);
@override
void drawPicture(_i2.Picture? picture) => super.noSuchMethod(
Invocation.method(
#drawPicture,
[picture],
),
returnValueForMissingStub: null,
);
@override
void drawParagraph(
_i2.Paragraph? paragraph,
_i2.Offset? offset,
) =>
super.noSuchMethod(
Invocation.method(
#drawParagraph,
[
paragraph,
offset,
],
),
returnValueForMissingStub: null,
);
@override
void drawPoints(
_i2.PointMode? pointMode,
List<_i2.Offset>? points,
_i2.Paint? paint,
) =>
super.noSuchMethod(
Invocation.method(
#drawPoints,
[
pointMode,
points,
paint,
],
),
returnValueForMissingStub: null,
);
@override
void drawRawPoints(
_i2.PointMode? pointMode,
_i5.Float32List? points,
_i2.Paint? paint,
) =>
super.noSuchMethod(
Invocation.method(
#drawRawPoints,
[
pointMode,
points,
paint,
],
),
returnValueForMissingStub: null,
);
@override
void drawVertices(
_i2.Vertices? vertices,
_i2.BlendMode? blendMode,
_i2.Paint? paint,
) =>
super.noSuchMethod(
Invocation.method(
#drawVertices,
[
vertices,
blendMode,
paint,
],
),
returnValueForMissingStub: null,
);
@override
void drawAtlas(
_i2.Image? atlas,
List<_i2.RSTransform>? transforms,
List<_i2.Rect>? rects,
List<_i2.Color>? colors,
_i2.BlendMode? blendMode,
_i2.Rect? cullRect,
_i2.Paint? paint,
) =>
super.noSuchMethod(
Invocation.method(
#drawAtlas,
[
atlas,
transforms,
rects,
colors,
blendMode,
cullRect,
paint,
],
),
returnValueForMissingStub: null,
);
@override
void drawRawAtlas(
_i2.Image? atlas,
_i5.Float32List? rstTransforms,
_i5.Float32List? rects,
_i5.Int32List? colors,
_i2.BlendMode? blendMode,
_i2.Rect? cullRect,
_i2.Paint? paint,
) =>
super.noSuchMethod(
Invocation.method(
#drawRawAtlas,
[
atlas,
rstTransforms,
rects,
colors,
blendMode,
cullRect,
paint,
],
),
returnValueForMissingStub: null,
);
@override
void drawShadow(
_i2.Path? path,
_i2.Color? color,
double? elevation,
bool? transparentOccluder,
) =>
super.noSuchMethod(
Invocation.method(
#drawShadow,
[
path,
color,
elevation,
transparentOccluder,
],
),
returnValueForMissingStub: null,
);
}
/// A class which mocks [CanvasWrapper].
///
/// See the documentation for Mockito's code generation for more information.
class MockCanvasWrapper extends _i1.Mock implements _i6.CanvasWrapper {
MockCanvasWrapper() {
_i1.throwOnMissingStub(this);
}
@override
_i2.Canvas get canvas => (super.noSuchMethod(
Invocation.getter(#canvas),
returnValue: _FakeCanvas_1(
this,
Invocation.getter(#canvas),
),
) as _i2.Canvas);
@override
_i2.Size get size => (super.noSuchMethod(
Invocation.getter(#size),
returnValue: _FakeSize_2(
this,
Invocation.getter(#size),
),
) as _i2.Size);
@override
void drawRRect(
_i2.RRect? rrect,
_i2.Paint? paint,
) =>
super.noSuchMethod(
Invocation.method(
#drawRRect,
[
rrect,
paint,
],
),
returnValueForMissingStub: null,
);
@override
void save() => super.noSuchMethod(
Invocation.method(
#save,
[],
),
returnValueForMissingStub: null,
);
@override
void restore() => super.noSuchMethod(
Invocation.method(
#restore,
[],
),
returnValueForMissingStub: null,
);
@override
void clipRect(
_i2.Rect? rect, {
_i2.ClipOp? clipOp = _i2.ClipOp.intersect,
bool? doAntiAlias = true,
}) =>
super.noSuchMethod(
Invocation.method(
#clipRect,
[rect],
{
#clipOp: clipOp,
#doAntiAlias: doAntiAlias,
},
),
returnValueForMissingStub: null,
);
@override
void translate(
double? dx,
double? dy,
) =>
super.noSuchMethod(
Invocation.method(
#translate,
[
dx,
dy,
],
),
returnValueForMissingStub: null,
);
@override
void rotate(double? radius) => super.noSuchMethod(
Invocation.method(
#rotate,
[radius],
),
returnValueForMissingStub: null,
);
@override
void drawPath(
_i2.Path? path,
_i2.Paint? paint,
) =>
super.noSuchMethod(
Invocation.method(
#drawPath,
[
path,
paint,
],
),
returnValueForMissingStub: null,
);
@override
void saveLayer(
_i2.Rect? bounds,
_i2.Paint? paint,
) =>
super.noSuchMethod(
Invocation.method(
#saveLayer,
[
bounds,
paint,
],
),
returnValueForMissingStub: null,
);
@override
void drawPicture(_i2.Picture? picture) => super.noSuchMethod(
Invocation.method(
#drawPicture,
[picture],
),
returnValueForMissingStub: null,
);
@override
void drawImage(
_i2.Image? image,
_i2.Offset? offset,
_i2.Paint? paint,
) =>
super.noSuchMethod(
Invocation.method(
#drawImage,
[
image,
offset,
paint,
],
),
returnValueForMissingStub: null,
);
@override
void clipPath(
_i2.Path? path, {
bool? doAntiAlias = true,
}) =>
super.noSuchMethod(
Invocation.method(
#clipPath,
[path],
{#doAntiAlias: doAntiAlias},
),
returnValueForMissingStub: null,
);
@override
void drawRect(
_i2.Rect? rect,
_i2.Paint? paint,
) =>
super.noSuchMethod(
Invocation.method(
#drawRect,
[
rect,
paint,
],
),
returnValueForMissingStub: null,
);
@override
void drawLine(
_i2.Offset? p1,
_i2.Offset? p2,
_i2.Paint? paint,
) =>
super.noSuchMethod(
Invocation.method(
#drawLine,
[
p1,
p2,
paint,
],
),
returnValueForMissingStub: null,
);
@override
void drawCircle(
_i2.Offset? center,
double? radius,
_i2.Paint? paint,
) =>
super.noSuchMethod(
Invocation.method(
#drawCircle,
[
center,
radius,
paint,
],
),
returnValueForMissingStub: null,
);
@override
void drawArc(
_i2.Rect? rect,
double? startAngle,
double? sweepAngle,
bool? useCenter,
_i2.Paint? paint,
) =>
super.noSuchMethod(
Invocation.method(
#drawArc,
[
rect,
startAngle,
sweepAngle,
useCenter,
paint,
],
),
returnValueForMissingStub: null,
);
@override
void drawText(
_i3.TextPainter? tp,
_i2.Offset? offset, [
double? rotateAngle,
]) =>
super.noSuchMethod(
Invocation.method(
#drawText,
[
tp,
offset,
rotateAngle,
],
),
returnValueForMissingStub: null,
);
@override
void drawVerticalText(
_i3.TextPainter? tp,
_i2.Offset? offset,
) =>
super.noSuchMethod(
Invocation.method(
#drawVerticalText,
[
tp,
offset,
],
),
returnValueForMissingStub: null,
);
@override
void drawDot(
_i7.FlDotPainter? painter,
_i7.FlSpot? spot,
_i2.Offset? offset,
) =>
super.noSuchMethod(
Invocation.method(
#drawDot,
[
painter,
spot,
offset,
],
),
returnValueForMissingStub: null,
);
@override
void drawRotated({
required _i2.Size? size,
_i2.Offset? rotationOffset = _i2.Offset.zero,
_i2.Offset? drawOffset = _i2.Offset.zero,
required double? angle,
required _i6.DrawCallback? drawCallback,
}) =>
super.noSuchMethod(
Invocation.method(
#drawRotated,
[],
{
#size: size,
#rotationOffset: rotationOffset,
#drawOffset: drawOffset,
#angle: angle,
#drawCallback: drawCallback,
},
),
returnValueForMissingStub: null,
);
@override
void drawDashedLine(
_i2.Offset? from,
_i2.Offset? to,
_i2.Paint? painter,
List<int>? dashArray,
) =>
super.noSuchMethod(
Invocation.method(
#drawDashedLine,
[
from,
to,
painter,
dashArray,
],
),
returnValueForMissingStub: null,
);
}
/// A class which mocks [BuildContext].
///
/// See the documentation for Mockito's code generation for more information.
class MockBuildContext extends _i1.Mock implements _i3.BuildContext {
MockBuildContext() {
_i1.throwOnMissingStub(this);
}
@override
_i3.Widget get widget => (super.noSuchMethod(
Invocation.getter(#widget),
returnValue: _FakeWidget_3(
this,
Invocation.getter(#widget),
),
) as _i3.Widget);
@override
bool get mounted => (super.noSuchMethod(
Invocation.getter(#mounted),
returnValue: false,
) as bool);
@override
bool get debugDoingBuild => (super.noSuchMethod(
Invocation.getter(#debugDoingBuild),
returnValue: false,
) as bool);
@override
_i3.InheritedWidget dependOnInheritedElement(
_i3.InheritedElement? ancestor, {
Object? aspect,
}) =>
(super.noSuchMethod(
Invocation.method(
#dependOnInheritedElement,
[ancestor],
{#aspect: aspect},
),
returnValue: _FakeInheritedWidget_4(
this,
Invocation.method(
#dependOnInheritedElement,
[ancestor],
{#aspect: aspect},
),
),
) as _i3.InheritedWidget);
@override
void visitAncestorElements(_i3.ConditionalElementVisitor? visitor) =>
super.noSuchMethod(
Invocation.method(
#visitAncestorElements,
[visitor],
),
returnValueForMissingStub: null,
);
@override
void visitChildElements(_i3.ElementVisitor? visitor) => super.noSuchMethod(
Invocation.method(
#visitChildElements,
[visitor],
),
returnValueForMissingStub: null,
);
@override
void dispatchNotification(_i3.Notification? notification) =>
super.noSuchMethod(
Invocation.method(
#dispatchNotification,
[notification],
),
returnValueForMissingStub: null,
);
@override
_i3.DiagnosticsNode describeElement(
String? name, {
_i4.DiagnosticsTreeStyle? style = _i4.DiagnosticsTreeStyle.errorProperty,
}) =>
(super.noSuchMethod(
Invocation.method(
#describeElement,
[name],
{#style: style},
),
returnValue: _FakeDiagnosticsNode_5(
this,
Invocation.method(
#describeElement,
[name],
{#style: style},
),
),
) as _i3.DiagnosticsNode);
@override
_i3.DiagnosticsNode describeWidget(
String? name, {
_i4.DiagnosticsTreeStyle? style = _i4.DiagnosticsTreeStyle.errorProperty,
}) =>
(super.noSuchMethod(
Invocation.method(
#describeWidget,
[name],
{#style: style},
),
returnValue: _FakeDiagnosticsNode_5(
this,
Invocation.method(
#describeWidget,
[name],
{#style: style},
),
),
) as _i3.DiagnosticsNode);
@override
List<_i3.DiagnosticsNode> describeMissingAncestor(
{required Type? expectedAncestorType}) =>
(super.noSuchMethod(
Invocation.method(
#describeMissingAncestor,
[],
{#expectedAncestorType: expectedAncestorType},
),
returnValue: <_i3.DiagnosticsNode>[],
) as List<_i3.DiagnosticsNode>);
@override
_i3.DiagnosticsNode describeOwnershipChain(String? name) =>
(super.noSuchMethod(
Invocation.method(
#describeOwnershipChain,
[name],
),
returnValue: _FakeDiagnosticsNode_5(
this,
Invocation.method(
#describeOwnershipChain,
[name],
),
),
) as _i3.DiagnosticsNode);
}
/// A class which mocks [Utils].
///
/// See the documentation for Mockito's code generation for more information.
class MockUtils extends _i1.Mock implements _i8.Utils {
MockUtils() {
_i1.throwOnMissingStub(this);
}
@override
double radians(double? degrees) => (super.noSuchMethod(
Invocation.method(
#radians,
[degrees],
),
returnValue: 0.0,
) as double);
@override
double degrees(double? radians) => (super.noSuchMethod(
Invocation.method(
#degrees,
[radians],
),
returnValue: 0.0,
) as double);
@override
_i2.Size getDefaultSize(_i2.Size? screenSize) => (super.noSuchMethod(
Invocation.method(
#getDefaultSize,
[screenSize],
),
returnValue: _FakeSize_2(
this,
Invocation.method(
#getDefaultSize,
[screenSize],
),
),
) as _i2.Size);
@override
double translateRotatedPosition(
double? size,
double? degree,
) =>
(super.noSuchMethod(
Invocation.method(
#translateRotatedPosition,
[
size,
degree,
],
),
returnValue: 0.0,
) as double);
@override
_i2.Offset calculateRotationOffset(
_i2.Size? size,
double? degree,
) =>
(super.noSuchMethod(
Invocation.method(
#calculateRotationOffset,
[
size,
degree,
],
),
returnValue: _FakeOffset_6(
this,
Invocation.method(
#calculateRotationOffset,
[
size,
degree,
],
),
),
) as _i2.Offset);
@override
_i3.BorderRadius? normalizeBorderRadius(
_i3.BorderRadius? borderRadius,
double? width,
) =>
(super.noSuchMethod(Invocation.method(
#normalizeBorderRadius,
[
borderRadius,
width,
],
)) as _i3.BorderRadius?);
@override
_i3.BorderSide normalizeBorderSide(
_i3.BorderSide? borderSide,
double? width,
) =>
(super.noSuchMethod(
Invocation.method(
#normalizeBorderSide,
[
borderSide,
width,
],
),
returnValue: _FakeBorderSide_7(
this,
Invocation.method(
#normalizeBorderSide,
[
borderSide,
width,
],
),
),
) as _i3.BorderSide);
@override
double getEfficientInterval(
double? axisViewSize,
double? diffInAxis, {
double? pixelPerInterval = 40.0,
}) =>
(super.noSuchMethod(
Invocation.method(
#getEfficientInterval,
[
axisViewSize,
diffInAxis,
],
{#pixelPerInterval: pixelPerInterval},
),
returnValue: 0.0,
) as double);
@override
double roundInterval(double? input) => (super.noSuchMethod(
Invocation.method(
#roundInterval,
[input],
),
returnValue: 0.0,
) as double);
@override
int getFractionDigits(double? value) => (super.noSuchMethod(
Invocation.method(
#getFractionDigits,
[value],
),
returnValue: 0,
) as int);
@override
String formatNumber(
double? axisMin,
double? axisMax,
double? axisValue,
) =>
(super.noSuchMethod(
Invocation.method(
#formatNumber,
[
axisMin,
axisMax,
axisValue,
],
),
returnValue: _i9.dummyValue<String>(
this,
Invocation.method(
#formatNumber,
[
axisMin,
axisMax,
axisValue,
],
),
),
) as String);
@override
_i3.TextStyle getThemeAwareTextStyle(
_i3.BuildContext? context,
_i3.TextStyle? providedStyle,
) =>
(super.noSuchMethod(
Invocation.method(
#getThemeAwareTextStyle,
[
context,
providedStyle,
],
),
returnValue: _FakeTextStyle_8(
this,
Invocation.method(
#getThemeAwareTextStyle,
[
context,
providedStyle,
],
),
),
) as _i3.TextStyle);
@override
double getBestInitialIntervalValue(
double? min,
double? max,
double? interval, {
double? baseline = 0.0,
}) =>
(super.noSuchMethod(
Invocation.method(
#getBestInitialIntervalValue,
[
min,
max,
interval,
],
{#baseline: baseline},
),
returnValue: 0.0,
) as double);
@override
double convertRadiusToSigma(double? radius) => (super.noSuchMethod(
Invocation.method(
#convertRadiusToSigma,
[radius],
),
returnValue: 0.0,
) as double);
}
| fl_chart/test/chart/radar_chart/radar_chart_painter_test.mocks.dart/0 | {
"file_path": "fl_chart/test/chart/radar_chart/radar_chart_painter_test.mocks.dart",
"repo_id": "fl_chart",
"token_count": 16151
} | 54 |
import 'dart:ui';
import 'package:fl_chart/src/extensions/path_extension.dart';
import 'package:fl_chart/src/utils/path_drawing/dash_path.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_test/flutter_test.dart';
import '../helper_methods.dart';
void main() {
test('test transparentIfWidthIsZero', () {
final path1 = Path()
..moveTo(0, 0)
..lineTo(10, 0);
expect(
path1.toDashedPath(null),
path1,
);
final path2 =
dashPath(path1, dashArray: CircularIntervalList<double>([10.0, 5.0]));
expect(HelperMethods.equalsPaths(path1.toDashedPath([10, 5]), path2), true);
});
}
| fl_chart/test/extensions/path_extension_test.dart/0 | {
"file_path": "fl_chart/test/extensions/path_extension_test.dart",
"repo_id": "fl_chart",
"token_count": 274
} | 55 |
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta content="IE=Edge" http-equiv="X-UA-Compatible">
<meta name="description" content="A new Flutter project.">
<!-- iOS meta tags & icons -->
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-status-bar-style" content="black">
<meta name="apple-mobile-web-app-title" content="example">
<link rel="apple-touch-icon" href="/icons/Icon-192.png">
<title>example</title>
<link rel="manifest" href="/manifest.json">
</head>
<body>
<!-- This script installs service_worker.js to provide PWA functionality to
application. For more information, see:
https://developers.google.com/web/fundamentals/primers/service-workers -->
<script>
if ('serviceWorker' in navigator) {
window.addEventListener('load', function () {
navigator.serviceWorker.register('/flutter_service_worker.js');
});
}
</script>
<script src="main.dart.js" type="application/javascript"></script>
</body>
</html>
| fleather/packages/fleather/example/web/index.html/0 | {
"file_path": "fleather/packages/fleather/example/web/index.html",
"repo_id": "fleather",
"token_count": 365
} | 56 |
import 'package:flutter/services.dart';
import 'package:parchment_delta/parchment_delta.dart';
/// Encapsulates clipboard data
///
/// One of the properties should be non-null or null should be returned
/// from [FleatherCustomClipboardGetData].
/// When pasting data in editor, [delta] has precedence over [plainText].
class FleatherClipboardData {
final String? plainText;
final Delta? delta;
FleatherClipboardData({this.plainText, this.delta})
: assert(plainText != null || delta != null);
bool get hasDelta => delta != null;
bool get hasPlainText => plainText != null;
bool get isEmpty => !hasPlainText && !hasDelta;
}
/// An abstract class for getting and setting data to clipboard
abstract class ClipboardManager {
const ClipboardManager();
Future<void> setData(FleatherClipboardData data);
Future<FleatherClipboardData?> getData();
}
/// A [ClipboardManager] which only handles reading and setting
/// of [FleatherClipboardData.plainText] and used by default in editor.
class PlainTextClipboardManager extends ClipboardManager {
const PlainTextClipboardManager();
@override
Future<void> setData(FleatherClipboardData data) async {
if (data.hasPlainText) {
await Clipboard.setData(ClipboardData(text: data.plainText!));
}
}
@override
Future<FleatherClipboardData?> getData() =>
Clipboard.getData(Clipboard.kTextPlain).then((data) => data?.text != null
? FleatherClipboardData(plainText: data!.text!)
: null);
}
/// Used by [FleatherCustomClipboardManager] to get clipboard data.
///
/// Null should be returned in case clipboard has no data
/// or data is invalid and both [FleatherClipboardData.plainText]
/// and [FleatherClipboardData.delta] are null.
typedef FleatherCustomClipboardGetData = Future<FleatherClipboardData?>
Function();
/// Used by [FleatherCustomClipboardManager] to set clipboard data.
typedef FleatherCustomClipboardSetData = Future<void> Function(
FleatherClipboardData data);
/// A [ClipboardManager] which delegates getting and setting data to user and
/// can be used to have rich clipboard.
final class FleatherCustomClipboardManager extends ClipboardManager {
final FleatherCustomClipboardGetData _getData;
final FleatherCustomClipboardSetData _setData;
const FleatherCustomClipboardManager({
required FleatherCustomClipboardGetData getData,
required FleatherCustomClipboardSetData setData,
}) : _getData = getData,
_setData = setData;
@override
Future<void> setData(FleatherClipboardData data) => _setData(data);
@override
Future<FleatherClipboardData?> getData() => _getData();
}
| fleather/packages/fleather/lib/src/services/clipboard_manager.dart/0 | {
"file_path": "fleather/packages/fleather/lib/src/services/clipboard_manager.dart",
"repo_id": "fleather",
"token_count": 832
} | 57 |
import 'package:flutter/widgets.dart';
import 'package:parchment/parchment.dart';
import 'package:parchment_delta/parchment_delta.dart';
import 'controller.dart';
import '../util.dart';
/// Provides undo/redo capabilities for text editing.
///
/// Listens to [controller] as a [ValueNotifier] and saves relevant values for
/// undoing/redoing. The cadence at which values are saved is a best
/// approximation of the native behaviors of a hardware keyboard on Flutter's
/// desktop platforms, as there are subtle differences between each of these
/// platforms.
///
/// Listens to keyboard undo/redo shortcuts and send update to [controller].
class FleatherHistory extends StatefulWidget {
/// Creates an instance of [FleatherHistory].
const FleatherHistory(
{super.key, required this.child, required this.controller});
/// The child widget of [FleatherHistory].
final Widget child;
/// The [FleatherController] to save the state of over time.
final FleatherController controller;
@override
State<FleatherHistory> createState() => _FleatherHistoryState();
}
class _FleatherHistoryState extends State<FleatherHistory> {
void _undo(UndoTextIntent intent) {
widget.controller.undo();
}
void _redo(RedoTextIntent intent) {
widget.controller.redo();
}
@override
void initState() {
super.initState();
}
@override
void didUpdateWidget(FleatherHistory oldWidget) {
super.didUpdateWidget(oldWidget);
}
@override
void dispose() {
super.dispose();
}
@override
Widget build(BuildContext context) {
return Actions(
actions: <Type, Action<Intent>>{
UndoTextIntent: Action<UndoTextIntent>.overridable(
context: context,
defaultAction: CallbackAction<UndoTextIntent>(onInvoke: _undo)),
RedoTextIntent: Action<RedoTextIntent>.overridable(
context: context,
defaultAction: CallbackAction<RedoTextIntent>(onInvoke: _redo)),
},
child: widget.child,
);
}
}
/// A data structure representing a chronological list of states that can be
/// undone and redone.
/// Initial state of the stack contains the document [Delta] at the time of
/// instantiation
class HistoryStack {
/// Creates an instance of [HistoryStack].
HistoryStack(this._currentState);
/// Creates an instance of [HistoryStack] from a [ParchmentDocument].
HistoryStack.doc(ParchmentDocument? doc)
: this(doc?.toDelta() ?? ParchmentDocument().toDelta());
// List of historical changes made to document
final List<_Change> _list = [];
// The index of the current value, or -1 if the list is empty.
int _currentIndex = -1;
Delta _currentState;
_Change? get _currentChange => _list.isEmpty ? null : _list[_currentIndex];
/// Add a new document state change to the stack.
void push(Delta newState) {
final redoDelta = _currentState.diff(newState);
if (redoDelta.isEmpty) return;
final undoDelta = redoDelta.invert(_currentState);
_currentState = newState;
if (_list.isEmpty) {
_currentIndex = 0;
_list.add(_Change(undoDelta, redoDelta));
return;
}
assert(_currentIndex < _list.length && _currentIndex >= -1);
// If anything has been undone in this stack, remove those irrelevant states
// before adding the new one.
if (_currentIndex != _list.length - 1) {
_list.removeRange(_currentIndex + 1, _list.length);
}
_list.add(_Change(undoDelta, redoDelta));
_currentIndex = _list.length - 1;
}
/// Returns the current [_Change] to apply to current document to reach desired
/// document state.
///
/// An undo operation moves the current value to the previously pushed value,
/// if any.
///
/// Iff the stack is completely empty, then returns null.
Delta? undo() {
if (_list.isEmpty) {
return null;
}
assert(_currentIndex < _list.length && _currentIndex >= -1);
if (_currentIndex == -1) {
return null;
}
final undoDelta = _currentChange!.undoDelta;
_currentState = _currentState.compose(undoDelta);
_currentIndex = _currentIndex - 1;
return undoDelta;
}
/// Returns true if there is at least one undo operation.
bool get canUndo {
return _list.isNotEmpty && _currentIndex != -1;
}
/// Returns the current [_Change] to apply to current document to reach desired
/// document state.
///
/// A redo operation moves the current value to the value that was last
/// undone, if any.
///
/// Iff the stack is completely empty, then returns null.
Delta? redo() {
if (_list.isEmpty) {
return null;
}
assert(_currentIndex < _list.length && _currentIndex >= -1);
if (_currentIndex < _list.length - 1) {
_currentIndex = _currentIndex + 1;
final redoDelta = _currentChange!.redoDelta;
_currentState = _currentState.compose(redoDelta);
return redoDelta;
}
return null;
}
/// Returns true if there is at least one redo operation.
bool get canRedo {
return _list.isNotEmpty && (_currentIndex < _list.length - 1);
}
static TextSelection selectionFromDelta(Delta changeDelta) {
assert(changeDelta.isNotEmpty);
final firstOp = changeDelta.first;
int baseOffset = 0;
// change starts at index following first plain retain
if (firstOp.isRetain && firstOp.attributes == null) {
baseOffset = firstOp.length;
}
int extentOffset = baseOffset;
final lastOp = changeDelta.last;
// if change is a change in format, selection must cover the rest of the
// change
if (lastOp.isRetain && lastOp.attributes != null) {
extentOffset = changeDelta.textLength;
}
// if change is an insertion, cursor is set at the end of the insertion
if (lastOp.isInsert) {
baseOffset = changeDelta.textLength;
extentOffset = baseOffset;
}
return TextSelection(baseOffset: baseOffset, extentOffset: extentOffset);
}
}
/// Stores undo & redo [Delta] from current document [Delta] state
/// Both need to be stored in order to replay or rewind history without
/// having to store complete versions of the document
class _Change {
_Change(this.undoDelta, this.redoDelta);
final Delta undoDelta;
final Delta redoDelta;
}
| fleather/packages/fleather/lib/src/widgets/history.dart/0 | {
"file_path": "fleather/packages/fleather/lib/src/widgets/history.dart",
"repo_id": "fleather",
"token_count": 2028
} | 58 |
import 'dart:convert';
import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart';
class FakeTextChannel implements MethodChannel {
FakeTextChannel(this.outgoing);
Future<dynamic> Function(MethodCall) outgoing;
Future<void> Function(MethodCall)? incoming;
List<MethodCall> outgoingCalls = <MethodCall>[];
@override
BinaryMessenger get binaryMessenger => throw UnimplementedError();
@override
MethodCodec get codec => const JSONMethodCodec();
@override
Future<List<T>> invokeListMethod<T>(String method, [dynamic arguments]) =>
throw UnimplementedError();
@override
Future<Map<K, V>> invokeMapMethod<K, V>(String method, [dynamic arguments]) =>
throw UnimplementedError();
@override
Future<T> invokeMethod<T>(String method, [dynamic arguments]) async {
final MethodCall call = MethodCall(method, arguments);
outgoingCalls.add(call);
return await outgoing(call) as T;
}
@override
String get name => 'flutter/textinput';
@override
void setMethodCallHandler(Future<void> Function(MethodCall call)? handler) =>
incoming = handler;
void validateOutgoingMethodCalls(List<MethodCall> calls) {
expect(outgoingCalls.length, calls.length);
final StringBuffer output = StringBuffer();
bool hasError = false;
for (int i = 0; i < calls.length; i++) {
final ByteData outgoingData = codec.encodeMethodCall(outgoingCalls[i]);
final ByteData expectedData = codec.encodeMethodCall(calls[i]);
final String outgoingString =
utf8.decode(outgoingData.buffer.asUint8List());
final String expectedString =
utf8.decode(expectedData.buffer.asUint8List());
if (outgoingString != expectedString) {
output.writeln(
'Index $i did not match:\n'
' actual: $outgoingString\n'
' expected: $expectedString',
);
hasError = true;
}
}
if (hasError) {
fail('Calls did not match:\n$output');
}
}
}
| fleather/packages/fleather/test/text_input_utils.dart/0 | {
"file_path": "fleather/packages/fleather/test/text_input_utils.dart",
"repo_id": "fleather",
"token_count": 724
} | 59 |
**Parchment** is a rich text document model for [Fleather][] project based on [Notus](https://github.com/memspace/zefyr/tree/master/packages/notus).
If you found a bug or have a feature request, please file it at
the [issue tracker][].
For documentation, please see the main [Fleather][] repository.
Parchment is a **generic Dart package** and does not depend
on Flutter in any way. It can be used on any platform supported
by the Dart language: web, server (mac, linux, windows) and,
of course, mobile (android and ios).
[Fleather]: https://github.com/fleather-editor/fleather
[issue tracker]: https://github.com/fleather-editor/fleather/issues
| fleather/packages/parchment/README.md/0 | {
"file_path": "fleather/packages/parchment/README.md",
"repo_id": "fleather",
"token_count": 186
} | 60 |
import 'package:parchment_delta/parchment_delta.dart';
import 'utils.dart';
/// A heuristic rule for delete operations.
abstract class DeleteRule {
/// Constant constructor allows subclasses to declare constant constructors.
const DeleteRule();
/// Applies heuristic rule to a delete operation on a [document] and returns
/// resulting [Delta].
Delta? apply(Delta document, int index, int length);
}
class EnsureLastLineBreakDeleteRule extends DeleteRule {
@override
Delta? apply(Delta document, int index, int length) {
final iter = DeltaIterator(document);
iter.skip(index + length);
return Delta()
..retain(index)
..delete(iter.hasNext ? length : length - 1);
}
}
/// Fallback rule for delete operations which simply deletes specified text
/// range without any special handling.
class CatchAllDeleteRule extends DeleteRule {
const CatchAllDeleteRule();
@override
Delta? apply(Delta document, int index, int length) {
final iter = DeltaIterator(document);
iter.skip(index + length);
return Delta()
..retain(index)
..delete(iter.hasNext ? length : length - 1);
}
}
/// Preserves line format when user deletes the line's newline character
/// effectively merging it with the next line.
///
/// This rule makes sure to apply all style attributes of deleted newline
/// to the next available newline, which may reset any style attributes
/// already present there.
class PreserveLineStyleOnMergeRule extends DeleteRule {
const PreserveLineStyleOnMergeRule();
@override
Delta? apply(Delta document, int index, int length) {
final iter = DeltaIterator(document);
iter.skip(index);
final target = iter.next(1);
if (target.data != '\n') return null;
iter.skip(length - 1);
if (!iter.hasNext) {
// User attempts to delete the last newline character, prevent it.
return Delta()
..retain(index)
..delete(length - 1);
}
final result = Delta()
..retain(index)
..delete(length);
// Look for next newline to apply the attributes
while (iter.hasNext) {
final op = iter.next();
final opText = op.data is String ? op.data as String : '';
final lf = opText.indexOf('\n');
if (lf == -1) {
result.retain(op.length);
continue;
}
var attributes = _unsetAttributes(op.attributes);
if (target.isNotPlain) {
attributes ??= <String, dynamic>{};
attributes.addAll(target.attributes!);
}
result
..retain(lf)
..retain(1, attributes);
break;
}
return result;
}
Map<String, dynamic>? _unsetAttributes(Map<String, dynamic>? attributes) {
if (attributes == null) return null;
return attributes.map<String, dynamic>(
(String key, dynamic value) => MapEntry<String, dynamic>(key, null));
}
}
/// Prevents user from merging a line containing a block embed with other lines.
class EnsureEmbedLineRule extends DeleteRule {
const EnsureEmbedLineRule();
@override
Delta? apply(Delta document, int index, int length) {
final iter = DeltaIterator(document);
// First, check if newline deleted after an embed.
var op = iter.skip(index);
var indexDelta = 0;
var lengthDelta = 0;
var remaining = length;
var foundBlockEmbed = false;
var hasLineBreakBefore = false;
if (op != null && isBlockEmbed(op.data)) {
foundBlockEmbed = true;
var candidate = iter.next(1);
remaining--;
if (candidate.data == '\n') {
indexDelta += 1;
lengthDelta -= 1;
/// Check if it's an empty line
candidate = iter.next(1);
remaining--;
if (candidate.data == '\n') {
// Allow deleting empty line after an embed.
lengthDelta += 1;
}
}
} else {
// If op is `null` it's beginning of the doc, e.g. implicit line break.
final opText = op?.data is String ? op?.data as String : '';
hasLineBreakBefore = op == null || opText.endsWith('\n');
}
// Second, check if newline deleted before an embed.
op = iter.skip(remaining);
final opText = op?.data is String ? op!.data as String : '';
if (op != null && opText.endsWith('\n')) {
final candidate = iter.next(1);
// If there is a newline before deleted range we allow the operation
// since it results in a correctly formatted line with a single embed in
// it.
if (!hasLineBreakBefore && isBlockEmbed(candidate.data)) {
foundBlockEmbed = true;
lengthDelta -= 1;
}
}
if (foundBlockEmbed) {
return Delta()
..retain(index + indexDelta)
..delete(length + lengthDelta);
}
return null;
}
}
| fleather/packages/parchment/lib/src/heuristics/delete_rules.dart/0 | {
"file_path": "fleather/packages/parchment/lib/src/heuristics/delete_rules.dart",
"repo_id": "fleather",
"token_count": 1706
} | 61 |
import 'package:parchment/parchment.dart';
import 'package:parchment_delta/parchment_delta.dart';
import 'package:test/test.dart';
final ul = ParchmentAttribute.ul.toJson();
final bold = ParchmentAttribute.bold.toJson();
void main() {
group('$CatchAllInsertRule', () {
final rule = CatchAllInsertRule();
test('applies change as-is', () {
final doc = Delta()..insert('Document\n');
final actual = rule.apply(doc, 8, '!');
final expected = Delta()
..retain(8)
..insert('!');
expect(actual, expected);
});
});
group('$PreserveLineStyleOnSplitRule', () {
final rule = PreserveLineStyleOnSplitRule();
test('skips at the beginning of a document', () {
final doc = Delta()..insert('One\n');
final actual = rule.apply(doc, 0, '\n');
expect(actual, isNull);
});
test('applies in a block', () {
final doc = Delta()
..insert('One and two')
..insert('\n', ul)
..insert('Three')
..insert('\n', ul);
final actual = rule.apply(doc, 8, '\n');
final expected = Delta()
..retain(8)
..insert('\n', ul);
expect(actual, isNotNull);
expect(actual, expected);
});
test('applies before an embed', () {
final doc = Delta()
..insert('Hello ')
..insert({'_type': 'icon', '_inline': true})
..insert('\n');
final actual = rule.apply(doc, 6, '\n');
final expected = Delta()
..retain(6)
..insert('\n');
expect(actual, isNotNull);
expect(actual, expected);
});
});
group('$PreserveLineFormatOnNewLineRule', () {
final rule = const PreserveLineFormatOnNewLineRule();
test('applies when line-break is inserted at the end of line', () {
final doc = Delta()
..insert('Hello world')
..insert('\n', ParchmentAttribute.h1.toJson());
final actual = rule.apply(doc, 11, '\n');
expect(actual, isNotNull);
final expected = Delta()
..retain(11)
..insert('\n', ParchmentAttribute.h1.toJson())
..retain(1, ParchmentAttribute.heading.unset.toJson());
expect(actual, expected);
});
test('applies without style reset if not needed', () {
final doc = Delta()..insert('Hello world\n');
final actual = rule.apply(doc, 11, '\n');
expect(actual, isNotNull);
final expected = Delta()
..retain(11)
..insert('\n');
expect(actual, expected);
});
test('applies at the beginning of a document', () {
final doc = Delta()..insert('\n', ParchmentAttribute.h1.toJson());
final actual = rule.apply(doc, 0, '\n');
expect(actual, isNotNull);
final expected = Delta()
..insert('\n', ParchmentAttribute.h1.toJson())
..retain(1, ParchmentAttribute.heading.unset.toJson());
expect(actual, expected);
});
test('applies and keeps block style', () {
final style = ParchmentAttribute.ul.toJson();
style.addAll(ParchmentAttribute.h1.toJson());
final doc = Delta()
..insert('Hello world')
..insert('\n', style);
final actual = rule.apply(doc, 11, '\n');
expect(actual, isNotNull);
final expected = Delta()
..retain(11)
..insert('\n', style)
..retain(1, ParchmentAttribute.heading.unset.toJson());
expect(actual, expected);
});
test('applies to a line in the middle of a document', () {
final doc = Delta()
..insert('Hello \nworld!\nMore lines here.')
..insert('\n', ParchmentAttribute.h2.toJson());
final actual = rule.apply(doc, 30, '\n');
expect(actual, isNotNull);
final expected = Delta()
..retain(30)
..insert('\n', ParchmentAttribute.h2.toJson())
..retain(1, ParchmentAttribute.heading.unset.toJson());
expect(actual, expected);
});
});
group('$AutoExitBlockRule', () {
final rule = AutoExitBlockRule();
test('applies when newline is inserted on the last empty line in a block',
() {
final ul = ParchmentAttribute.ul.toJson();
final doc = Delta()
..insert('Item 1')
..insert('\n', ul)
..insert('Item 2')
..insert('\n\n', ul);
final actual = rule.apply(doc, 14, '\n');
expect(actual, isNotNull);
final expected = Delta()
..retain(14)
..retain(1, ParchmentAttribute.block.unset.toJson());
expect(actual, expected);
});
test('applies only on empty line', () {
final ul = ParchmentAttribute.ul.toJson();
final doc = Delta()
..insert('Item 1')
..insert('\n', ul);
final actual = rule.apply(doc, 6, '\n');
expect(actual, isNull);
});
test('applies at the beginning of a document', () {
final ul = ParchmentAttribute.ul.toJson();
final doc = Delta()..insert('\n', ul);
final actual = rule.apply(doc, 0, '\n');
expect(actual, isNotNull);
final expected = Delta()
..retain(1, ParchmentAttribute.block.unset.toJson());
expect(actual, expected);
});
test('ignores non-empty line at the beginning of a document', () {
final ul = ParchmentAttribute.ul.toJson();
final doc = Delta()
..insert('Text')
..insert('\n', ul);
final actual = rule.apply(doc, 0, '\n');
expect(actual, isNull);
});
test('ignores empty lines in the middle of a block', () {
final ul = ParchmentAttribute.ul.toJson();
final doc = Delta()
..insert('Line1')
..insert('\n\n\n\n', ul);
final actual = rule.apply(doc, 7, '\n');
expect(actual, isNull);
});
});
group('$PreserveInlineStylesRule', () {
final rule = PreserveInlineStylesRule();
test('apply', () {
final doc = Delta()
..insert('Doc with ')
..insert('bold', bold)
..insert(' text');
final actual = rule.apply(doc, 13, 'er');
final expected = Delta()
..retain(13)
..insert('er', bold);
expect(expected, actual);
});
test('apply preserve link formatting within link', () {
final doc = Delta()
..insert('Doc with link')
..insert('http://fleather-editor.github.io',
{'a': 'http://fleather-editor.github.io'})
..insert(' link');
final actual = rule.apply(doc, 17, 's');
final expected = Delta()
..retain(17)
..insert('s', {'a': 'http://fleather-editor.github.io'});
expect(expected, actual);
});
test('apply remove link formatting on link boundaries', () {
final doc = Delta()
..insert('Doc with link')
..insert('http://fleather-editor.github.io',
{'a': 'http://fleather-editor.github.io'})
..insert(' link');
final actual = rule.apply(doc, 13, 'like this ');
final expected = Delta()
..retain(13)
..insert('like this ');
expect(expected, actual);
});
test('apply at the beginning of a document', () {
final doc = Delta()..insert('Doc with ');
final actual = rule.apply(doc, 0, 'A ');
expect(actual, isNull);
});
});
group('$PreserveBlockStyleOnInsertRule', () {
final rule = PreserveBlockStyleOnInsertRule();
test('applies in a block', () {
final doc = Delta()
..insert('One and two')
..insert('\n', ul)
..insert('Three')
..insert('\n', ul);
final actual = rule.apply(doc, 8, 'also \n');
final expected = Delta()
..retain(8)
..insert('also ')
..insert('\n', ul);
expect(actual, isNotNull);
expect(actual, expected);
});
test('applies for single newline insert', () {
final doc = Delta()
..insert('One and two')
..insert('\n\n', ul)
..insert('Three')
..insert('\n', ul);
final actual = rule.apply(doc, 12, '\n');
final expected = Delta()
..retain(12)
..insert('\n', ul);
expect(actual, expected);
});
test('applies for multi line insert', () {
final doc = Delta()
..insert('One and two')
..insert('\n\n', ul)
..insert('Three')
..insert('\n', ul);
final actual = rule.apply(doc, 8, '111\n222\n333');
final expected = Delta()
..retain(8)
..insert('111')
..insert('\n', ul)
..insert('222')
..insert('\n', ul)
..insert('333');
expect(actual, expected);
});
test('preserves heading style of the original line', () {
final quote = ParchmentAttribute.block.quote.toJson();
final h1Unset = ParchmentAttribute.heading.unset.toJson();
final quoteH1 = ParchmentAttribute.block.quote.toJson();
quoteH1.addAll(ParchmentAttribute.heading.level1.toJson());
final doc = Delta()
..insert('One and two')
..insert('\n', quoteH1)
..insert('Three')
..insert('\n', quote);
final actual = rule.apply(doc, 8, '111\n');
final expected = Delta()
..retain(8)
..insert('111')
..insert('\n', quoteH1)
..retain(3)
..retain(1, h1Unset);
expect(actual, expected);
});
test('preserves checked style of the original line', () {
final cl = ParchmentAttribute.cl.toJson();
final checkedUnset = ParchmentAttribute.checked.unset.toJson();
final clChecked = ParchmentAttribute.cl.toJson();
clChecked.addAll(ParchmentAttribute.checked.toJson());
final doc = Delta()
..insert('One and two')
..insert('\n', clChecked)
..insert('Three')
..insert('\n', cl);
final actual = rule.apply(doc, 8, '111\n');
final expected = Delta()
..retain(8)
..insert('111')
..insert('\n', clChecked)
..retain(3)
..retain(1, checkedUnset);
expect(actual, expected);
});
});
group('$InsertBlockEmbedsRule', () {
final rule = InsertBlockEmbedsRule();
test('insert on an empty line', () {
final doc = Delta()
..insert('One and two')
..insert('\n')
..insert('\n')
..insert('Three')
..insert('\n');
final actual = rule.apply(doc, 12, BlockEmbed.horizontalRule);
final expected = Delta()
..retain(12)
..insert(BlockEmbed.horizontalRule);
expect(actual, isNotNull);
expect(actual, expected);
});
test('insert in the beginning of a line', () {
final doc = Delta()
..insert('One and two\n')
..insert('embed here\n')
..insert('Three')
..insert('\n');
final actual = rule.apply(doc, 12, BlockEmbed.horizontalRule);
final expected = Delta()
..retain(12)
..insert(BlockEmbed.horizontalRule)
..insert('\n');
expect(actual, isNotNull);
expect(actual, expected);
});
test('insert in the end of a line', () {
final doc = Delta()
..insert('One and two\n')
..insert('embed here\n')
..insert('Three')
..insert('\n');
final actual = rule.apply(doc, 11, BlockEmbed.horizontalRule);
final expected = Delta()
..retain(11)
..insert('\n')
..insert(BlockEmbed.horizontalRule);
expect(actual, isNotNull);
expect(actual, expected);
});
test('insert in the middle of a line', () {
final doc = Delta()
..insert('One and two\n')
..insert('embed here\n')
..insert('Three')
..insert('\n');
final actual = rule.apply(doc, 17, BlockEmbed.horizontalRule);
final expected = Delta()
..retain(17)
..insert('\n')
..insert(BlockEmbed.horizontalRule)
..insert('\n');
expect(actual, isNotNull);
expect(actual, expected);
});
test('inserted object is not block embed', () {
final doc = Delta()
..insert('One and two\n')
..insert('embed here\n')
..insert('Three')
..insert('\n');
expect(rule.apply(doc, 17, 'Some text'), isNull);
expect(rule.apply(doc, 17, SpanEmbed('span')), isNull);
});
});
}
| fleather/packages/parchment/test/heuristics/insert_rules_test.dart/0 | {
"file_path": "fleather/packages/parchment/test/heuristics/insert_rules_test.dart",
"repo_id": "fleather",
"token_count": 5227
} | 62 |
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/lib" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/.dart_tool" />
<excludeFolder url="file://$MODULE_DIR$/.idea" />
<excludeFolder url="file://$MODULE_DIR$/.pub" />
<excludeFolder url="file://$MODULE_DIR$/build" />
</content>
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Dart SDK" level="project" />
<orderEntry type="library" name="Flutter Plugins" level="project" />
<orderEntry type="library" name="Dart Packages" level="project" />
</component>
</module> | flutter-fb-reactions-animation/facebook_reaction_animation.iml/0 | {
"file_path": "flutter-fb-reactions-animation/facebook_reaction_animation.iml",
"repo_id": "flutter-fb-reactions-animation",
"token_count": 339
} | 63 |
# Specify analysis options.
#
# For a list of lints, see: https://dart.dev/tools/linter-rules
# For guidelines on configuring static analysis, see:
# https://dart.dev/tools/analysis
#
# There are other similar analysis options files in the flutter repos,
# which should be kept in sync with this file:
#
# - analysis_options.yaml (this file)
# - https://github.com/flutter/engine/blob/main/analysis_options.yaml
# - https://github.com/flutter/packages/blob/main/analysis_options.yaml
#
# This file contains the analysis options used for code in the flutter/flutter
# repository.
analyzer:
language:
strict-casts: true
strict-inference: true
strict-raw-types: true
errors:
# allow deprecated members (we do this because otherwise we have to annotate
# every member in every test, assert, etc, when we or the Dart SDK deprecates
# something (https://github.com/flutter/flutter/issues/143312)
deprecated_member_use: ignore
deprecated_member_use_from_same_package: ignore
exclude:
- "bin/cache/**"
# Ignore protoc generated files
- "dev/conductor/lib/proto/*"
linter:
rules:
# This list is derived from the list of all available lints located at
# https://github.com/dart-lang/sdk/blob/main/pkg/linter/example/all.yaml
- always_declare_return_types
- always_put_control_body_on_new_line
# - always_put_required_named_parameters_first # we prefer having parameters in the same order as fields https://github.com/flutter/flutter/issues/10219
- always_specify_types
# - always_use_package_imports # we do this commonly
- annotate_overrides
- annotate_redeclares
# - avoid_annotating_with_dynamic # conflicts with always_specify_types
- avoid_bool_literals_in_conditional_expressions
# - avoid_catches_without_on_clauses # blocked on https://github.com/dart-lang/linter/issues/3023
# - avoid_catching_errors # blocked on https://github.com/dart-lang/linter/issues/3023
# - avoid_classes_with_only_static_members # we do this commonly for `abstract final class`es
- avoid_double_and_int_checks
- avoid_dynamic_calls
- avoid_empty_else
- avoid_equals_and_hash_code_on_mutable_classes
- avoid_escaping_inner_quotes
- avoid_field_initializers_in_const_classes
# - avoid_final_parameters # incompatible with prefer_final_parameters
- avoid_function_literals_in_foreach_calls
# - avoid_implementing_value_types # see https://github.com/dart-lang/linter/issues/4558
- avoid_init_to_null
- avoid_js_rounded_ints
# - avoid_multiple_declarations_per_line # seems to be a stylistic choice we don't subscribe to
- avoid_null_checks_in_equality_operators
# - avoid_positional_boolean_parameters # would have been nice to enable this but by now there's too many places that break it
- avoid_print
# - avoid_private_typedef_functions # we prefer having typedef (discussion in https://github.com/flutter/flutter/pull/16356)
- avoid_redundant_argument_values
- avoid_relative_lib_imports
- avoid_renaming_method_parameters
- avoid_return_types_on_setters
- avoid_returning_null_for_void
# - avoid_returning_this # there are enough valid reasons to return `this` that this lint ends up with too many false positives
- avoid_setters_without_getters
- avoid_shadowing_type_parameters
- avoid_single_cascade_in_expression_statements
- avoid_slow_async_io
- avoid_type_to_string
- avoid_types_as_parameter_names
# - avoid_types_on_closure_parameters # conflicts with always_specify_types
- avoid_unnecessary_containers
- avoid_unused_constructor_parameters
- avoid_void_async
# - avoid_web_libraries_in_flutter # we use web libraries in web-specific code, and our tests prevent us from using them elsewhere
- await_only_futures
- camel_case_extensions
- camel_case_types
- cancel_subscriptions
# - cascade_invocations # doesn't match the typical style of this repo
- cast_nullable_to_non_nullable
# - close_sinks # not reliable enough
- collection_methods_unrelated_type
- combinators_ordering
# - comment_references # blocked on https://github.com/dart-lang/linter/issues/1142
- conditional_uri_does_not_exist
# - constant_identifier_names # needs an opt-out https://github.com/dart-lang/linter/issues/204
- control_flow_in_finally
- curly_braces_in_flow_control_structures
- dangling_library_doc_comments
- depend_on_referenced_packages
- deprecated_consistency
# - deprecated_member_use_from_same_package # we allow self-references to deprecated members
# - diagnostic_describe_all_properties # enabled only at the framework level (packages/flutter/lib)
- directives_ordering
# - discarded_futures # too many false positives, similar to unawaited_futures
# - do_not_use_environment # there are appropriate times to use the environment, especially in our tests and build logic
- empty_catches
- empty_constructor_bodies
- empty_statements
- eol_at_end_of_file
- exhaustive_cases
- file_names
- flutter_style_todos
- hash_and_equals
- implementation_imports
- implicit_call_tearoffs
- implicit_reopen
- invalid_case_patterns
# - join_return_with_assignment # not required by flutter style
- leading_newlines_in_multiline_strings
- library_annotations
- library_names
- library_prefixes
- library_private_types_in_public_api
# - lines_longer_than_80_chars # not required by flutter style
- literal_only_boolean_expressions
# - matching_super_parameters # blocked on https://github.com/dart-lang/language/issues/2509
- missing_code_block_language_in_doc_comment
- missing_whitespace_between_adjacent_strings
- no_adjacent_strings_in_list
- no_default_cases
- no_duplicate_case_values
- no_leading_underscores_for_library_prefixes
- no_leading_underscores_for_local_identifiers
- no_literal_bool_comparisons
- no_logic_in_create_state
# - no_runtimeType_toString # ok in tests; we enable this only in packages/
- no_self_assignments
- no_wildcard_variable_uses
- non_constant_identifier_names
- noop_primitive_operations
- null_check_on_nullable_type_parameter
- null_closures
# - omit_local_variable_types # opposite of always_specify_types
# - one_member_abstracts # too many false positives
- only_throw_errors # this does get disabled in a few places where we have legacy code that uses strings et al
- overridden_fields
- package_api_docs
- package_names
- package_prefixed_library_names
# - parameter_assignments # we do this commonly
- prefer_adjacent_string_concatenation
- prefer_asserts_in_initializer_lists
# - prefer_asserts_with_message # not required by flutter style
- prefer_collection_literals
- prefer_conditional_assignment
- prefer_const_constructors
- prefer_const_constructors_in_immutables
- prefer_const_declarations
- prefer_const_literals_to_create_immutables
# - prefer_constructors_over_static_methods # far too many false positives
- prefer_contains
# - prefer_double_quotes # opposite of prefer_single_quotes
# - prefer_expression_function_bodies # conflicts with https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#consider-using--for-short-functions-and-methods
- prefer_final_fields
- prefer_final_in_for_each
- prefer_final_locals
# - prefer_final_parameters # adds too much verbosity
- prefer_for_elements_to_map_fromIterable
- prefer_foreach
- prefer_function_declarations_over_variables
- prefer_generic_function_type_aliases
- prefer_if_elements_to_conditional_expressions
- prefer_if_null_operators
- prefer_initializing_formals
- prefer_inlined_adds
# - prefer_int_literals # conflicts with https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#use-double-literals-for-double-constants
- prefer_interpolation_to_compose_strings
- prefer_is_empty
- prefer_is_not_empty
- prefer_is_not_operator
- prefer_iterable_whereType
- prefer_mixin
# - prefer_null_aware_method_calls # "call()" is confusing to people new to the language since it's not documented anywhere
- prefer_null_aware_operators
- prefer_relative_imports
- prefer_single_quotes
- prefer_spread_collections
- prefer_typing_uninitialized_variables
- prefer_void_to_null
- provide_deprecation_message
# - public_member_api_docs # enabled on a case-by-case basis; see e.g. packages/analysis_options.yaml
- recursive_getters
# - require_trailing_commas # would be nice, but requires a lot of manual work: 10,000+ code locations would need to be reformatted by hand after bulk fix is applied
- secure_pubspec_urls
- sized_box_for_whitespace
- sized_box_shrink_expand
- slash_for_doc_comments
- sort_child_properties_last
- sort_constructors_first
# - sort_pub_dependencies # prevents separating pinned transitive dependencies
- sort_unnamed_constructors_first
- test_types_in_equals
- throw_in_finally
- tighten_type_of_initializing_formals
# - type_annotate_public_apis # subset of always_specify_types
- type_init_formals
- type_literal_in_constant_pattern
# - unawaited_futures # too many false positives, especially with the way AnimationController works
- unnecessary_await_in_return
- unnecessary_brace_in_string_interps
- unnecessary_breaks
- unnecessary_const
- unnecessary_constructor_name
# - unnecessary_final # conflicts with prefer_final_locals
- unnecessary_getters_setters
# - unnecessary_lambdas # has false positives: https://github.com/dart-lang/linter/issues/498
- unnecessary_late
- unnecessary_library_directive
# - unnecessary_library_name # blocked on https://github.com/dart-lang/lints/issues/181#issuecomment-2018919034
- unnecessary_new
- unnecessary_null_aware_assignments
- unnecessary_null_aware_operator_on_extension_on_nullable
- unnecessary_null_checks
- unnecessary_null_in_if_null_operators
- unnecessary_nullable_for_final_variable_declarations
- unnecessary_overrides
- unnecessary_parenthesis
# - unnecessary_raw_strings # what's "necessary" is a matter of opinion; consistency across strings can help readability more than this lint
- unnecessary_statements
- unnecessary_string_escapes
- unnecessary_string_interpolations
- unnecessary_this
- unnecessary_to_list_in_spreads
- unreachable_from_main
- unrelated_type_equality_checks
- unsafe_html
- use_build_context_synchronously
- use_colored_box
# - use_decorated_box # leads to bugs: DecoratedBox and Container are not equivalent (Container inserts extra padding)
- use_enums
- use_full_hex_values_for_flutter_colors
- use_function_type_syntax_for_parameters
- use_if_null_to_convert_nulls_to_bools
- use_is_even_rather_than_modulo
- use_key_in_widget_constructors
- use_late_for_private_fields_and_variables
- use_named_constants
- use_raw_strings
- use_rethrow_when_possible
- use_setters_to_change_properties
# - use_string_buffers # has false positives: https://github.com/dart-lang/sdk/issues/34182
- use_string_in_part_of_directives
- use_super_parameters
- use_test_throws_matchers
# - use_to_and_as_if_applicable # has false positives, so we prefer to catch this by code-review
- valid_regexps
- void_checks
| flutter/analysis_options.yaml/0 | {
"file_path": "flutter/analysis_options.yaml",
"repo_id": "flutter",
"token_count": 4077
} | 64 |
20a2f8dbddcf1a96ad4c720b9afd1d0876d17ffc
| flutter/bin/internal/libplist.version/0 | {
"file_path": "flutter/bin/internal/libplist.version",
"repo_id": "flutter",
"token_count": 28
} | 65 |
// 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 Flutter
import UIKit
@main
@objc class AppDelegate: FlutterAppDelegate {
override func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
GeneratedPluginRegistrant.register(with: self)
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
}
}
| flutter/dev/a11y_assessments/ios/Runner/AppDelegate.swift/0 | {
"file_path": "flutter/dev/a11y_assessments/ios/Runner/AppDelegate.swift",
"repo_id": "flutter",
"token_count": 163
} | 66 |
// 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/material.dart';
import 'use_cases.dart';
class DialogUseCase extends UseCase {
@override
String get name => 'Dialog';
@override
String get route => '/dialog';
@override
Widget build(BuildContext context) => const _MainWidget();
}
class _MainWidget extends StatelessWidget {
const _MainWidget();
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: Theme.of(context).colorScheme.inversePrimary,
title: const Text('Dialog'),
),
body: Center(
child: TextButton(
onPressed: () => showDialog<String>(
context: context,
builder: (BuildContext context) => Dialog(
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
const Text('This is a typical dialog.'),
const SizedBox(height: 15),
Row(
children: <Widget>[
TextButton(
onPressed: () {
Navigator.pop(context);
},
child: const Text('OK'),
),
TextButton(
onPressed: () {
Navigator.pop(context);
},
child: const Text('Cancel'),
),
],
),
],
),
),
),
),
child: const Text('Show Dialog'),
),
),
);
}
}
| flutter/dev/a11y_assessments/lib/use_cases/dialog.dart/0 | {
"file_path": "flutter/dev/a11y_assessments/lib/use_cases/dialog.dart",
"repo_id": "flutter",
"token_count": 1098
} | 67 |
#include "ephemeral/Flutter-Generated.xcconfig"
| flutter/dev/a11y_assessments/macos/Flutter/Flutter-Debug.xcconfig/0 | {
"file_path": "flutter/dev/a11y_assessments/macos/Flutter/Flutter-Debug.xcconfig",
"repo_id": "flutter",
"token_count": 19
} | 68 |
// 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:a11y_assessments/use_cases/dialog.dart';
import 'package:flutter_test/flutter_test.dart';
import 'test_utils.dart';
void main() {
testWidgets('dialog can run', (WidgetTester tester) async {
await pumpsUseCase(tester, DialogUseCase());
expect(find.text('Show Dialog'), findsOneWidget);
Future<void> invokeDialog() async {
await tester.tap(find.text('Show Dialog'));
await tester.pumpAndSettle();
expect(find.text('This is a typical dialog.'), findsOneWidget);
}
await invokeDialog();
await tester.tap(find.text('OK'));
await tester.pumpAndSettle();
expect(find.text('This is a typical dialog.'), findsNothing);
await invokeDialog();
await tester.tap(find.text('Cancel'));
await tester.pumpAndSettle();
expect(find.text('This is a typical dialog.'), findsNothing);
});
}
| flutter/dev/a11y_assessments/test/dialog_test.dart/0 | {
"file_path": "flutter/dev/a11y_assessments/test/dialog_test.dart",
"repo_id": "flutter",
"token_count": 358
} | 69 |
include: ../analysis_options.yaml
linter:
rules:
avoid_print: false # We use prints as debugging tools here a lot.
# Tests try to throw and catch things in exciting ways all the time, so
# we disable these lints for the tests.
only_throw_errors: false
avoid_catching_errors: false
avoid_catches_without_on_clauses: false
| flutter/dev/analysis_options.yaml/0 | {
"file_path": "flutter/dev/analysis_options.yaml",
"repo_id": "flutter",
"token_count": 114
} | 70 |
// 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 'dart:async';
import 'package:flutter_test/flutter_test.dart';
void main() {
failingPendingTimerTest();
}
void failingPendingTimerTest() {
testWidgets('flutter_test pending timer - negative', (WidgetTester tester) async {
Timer(const Duration(minutes: 10), () {});
});
}
| flutter/dev/automated_tests/test_smoke_test/pending_timer_fail_test.dart/0 | {
"file_path": "flutter/dev/automated_tests/test_smoke_test/pending_timer_fail_test.dart",
"repo_id": "flutter",
"token_count": 144
} | 71 |
// 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 'dart:async';
import 'dart:ui';
import 'package:flutter/material.dart';
import 'picture_cache.dart';
class ClipperCachePage extends StatefulWidget {
const ClipperCachePage({super.key});
@override
State<ClipperCachePage> createState() => _ClipperCachePageState();
}
class _ClipperCachePageState extends State<ClipperCachePage>
with TickerProviderStateMixin {
final double _animateOffset = 100;
final ScrollController _controller = ScrollController();
final bool _isComplex = true;
late double _topMargin;
@override
void initState() {
super.initState();
_controller.addListener(() {
if (_controller.offset < 10) {
_controller.animateTo(_animateOffset, duration: const Duration(milliseconds: 1000), curve: Curves.ease);
} else if (_controller.offset > _animateOffset - 10) {
_controller.animateTo(0, duration: const Duration(milliseconds: 1000), curve: Curves.ease);
}
});
Timer(const Duration(milliseconds: 500), () {
_controller.animateTo(_animateOffset, duration: const Duration(milliseconds: 1000), curve: Curves.ease);
});
}
@override
void didChangeDependencies() {
super.didChangeDependencies();
const double itemHeight = 140;
final FlutterView view = View.of(context);
_topMargin = (view.physicalSize.height / view.devicePixelRatio - itemHeight * 3) / 2;
if (_topMargin < 0) {
_topMargin = 0;
}
}
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.blue,
body: ListView(
controller: _controller,
children: <Widget>[
SizedBox(height: _topMargin),
ClipPath(
clipBehavior: Clip.antiAliasWithSaveLayer,
child: _makeChild(0, _isComplex)
),
ClipRect(
clipBehavior: Clip.antiAliasWithSaveLayer,
child: _makeChild(1, _isComplex)
),
ClipRRect(
clipBehavior: Clip.antiAliasWithSaveLayer,
child: _makeChild(2, _isComplex)
),
const SizedBox(height: 1000),
],
),
);
}
Widget _makeChild(int itemIndex, bool complex) {
final BoxDecoration decoration = BoxDecoration(
color: Colors.white70,
boxShadow: const <BoxShadow>[
BoxShadow(
blurRadius: 5.0,
),
],
borderRadius: BorderRadius.circular(5.0),
);
return RepaintBoundary(
child: Container(
margin: const EdgeInsets.fromLTRB(10, 5, 10, 5),
decoration: complex ? decoration : null,
child: ListItem(index: itemIndex),
),
);
}
@override
void dispose() {
_controller.dispose();
super.dispose();
}
}
| flutter/dev/benchmarks/macrobenchmarks/lib/src/clipper_cache.dart/0 | {
"file_path": "flutter/dev/benchmarks/macrobenchmarks/lib/src/clipper_cache.dart",
"repo_id": "flutter",
"token_count": 1154
} | 72 |
// 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/material.dart';
class MultiWidgetConstructTable extends StatefulWidget {
const MultiWidgetConstructTable(this.columnCount, this.rowCount, {super.key});
final int columnCount;
final int rowCount;
@override
State<MultiWidgetConstructTable> createState() => _MultiWidgetConstructTableState();
}
class _MultiWidgetConstructTableState extends State<MultiWidgetConstructTable>
with SingleTickerProviderStateMixin {
static const List<MaterialColor> colorList = <MaterialColor>[
Colors.pink, Colors.red, Colors.deepOrange, Colors.orange, Colors.amber,
Colors.yellow, Colors.lime, Colors.lightGreen, Colors.green, Colors.teal,
Colors.cyan, Colors.lightBlue, Colors.blue, Colors.indigo, Colors.purple,
];
int counter = 0;
late AnimationController _controller;
@override
void initState() {
super.initState();
_controller = AnimationController(
vsync: this,
duration: const Duration(milliseconds: 10000),
upperBound: colorList.length + 1.0,
)..repeat();
}
@override
void dispose() {
_controller.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return AnimatedBuilder(
animation: _controller,
builder: (BuildContext context, _) {
final int totalLength = widget.rowCount * widget.columnCount;
final int widgetCounter = counter * totalLength;
final double height = MediaQuery.of(context).size.height / widget.rowCount;
final double colorPosition = _controller.value;
final int c1Position = colorPosition.floor();
final Color c1 = colorList[c1Position % colorList.length][900]!;
final Color c2 = colorList[(c1Position + 1) % colorList.length][900]!;
final Color baseColor = Color.lerp(c1, c2, colorPosition - c1Position)!;
counter++;
return Scaffold(
body: Table(
children: List<TableRow>.generate(
widget.rowCount,
(int row) => TableRow(
children: List<Widget>.generate(
widget.columnCount,
(int column) {
final int label = row * widget.columnCount + column;
// This implementation rebuild the widget tree for every
// frame, and is intentionally designed of poor performance
// for benchmark purposes.
return counter.isEven
? Container(
// This key forces rebuilding the element
key: ValueKey<int>(widgetCounter + label),
color: Color.lerp(
Colors.white, baseColor, label / totalLength),
constraints: BoxConstraints.expand(height: height),
child: Text('${widgetCounter + label}'),
)
: MyContainer(
// This key forces rebuilding the element
key: ValueKey<int>(widgetCounter + label),
color: Color.lerp(
Colors.white, baseColor, label / totalLength)!,
constraints: BoxConstraints.expand(height: height),
child: Text('${widgetCounter + label}'),
);
},
),
),
),
),
);
},
);
}
}
// This class is intended to break the original Widget tree
class MyContainer extends StatelessWidget {
const MyContainer({required this.color, required this.child, required this.constraints, super.key});
final Color color;
final Widget child;
final BoxConstraints constraints;
@override
Widget build(BuildContext context) {
return Container(
color: color,
constraints: constraints,
child: child,
);
}
}
| flutter/dev/benchmarks/macrobenchmarks/lib/src/multi_widget_construction.dart/0 | {
"file_path": "flutter/dev/benchmarks/macrobenchmarks/lib/src/multi_widget_construction.dart",
"repo_id": "flutter",
"token_count": 1776
} | 73 |
// 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/material.dart';
import 'recorder.dart';
/// Measures how expensive it is to construct material checkboxes.
///
/// Creates a 10x10 grid of tristate checkboxes.
class BenchBuildMaterialCheckbox extends WidgetBuildRecorder {
BenchBuildMaterialCheckbox() : super(name: benchmarkName);
static const String benchmarkName = 'build_material_checkbox';
static bool? _isChecked;
@override
Widget createWidget() {
return Directionality(
textDirection: TextDirection.ltr,
child: Material(
child: Column(
children: List<Widget>.generate(10, (int i) {
return _buildRow();
}),
),
),
);
}
Row _buildRow() {
_isChecked = switch (_isChecked) {
null => true,
true => false,
false => null,
};
return Row(
children: List<Widget>.generate(10, (int i) {
return Expanded(
child: Checkbox(
value: _isChecked,
tristate: true,
onChanged: (bool? newValue) {
// Intentionally empty.
},
),
);
}),
);
}
}
| flutter/dev/benchmarks/macrobenchmarks/lib/src/web/bench_build_material_checkbox.dart/0 | {
"file_path": "flutter/dev/benchmarks/macrobenchmarks/lib/src/web/bench_build_material_checkbox.dart",
"repo_id": "flutter",
"token_count": 539
} | 74 |
// 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 'dart:ui';
// The code below was generated by modify several parts of the engine
// May 2020 and running Flutter Gallery.
late PathFillType gFillType;
late Rect gBounds;
late List<dynamic> allPaths;
late Path path8;
late Path path10;
late Path path12;
late Path path14;
late Path path16;
late Path path18;
late Path path34;
late Path path50;
late Path path60;
late Path path63;
late Path path66;
late Path path69;
late Path path72;
late Path path75;
late Path path78;
late Path path80;
late Path path82;
late Path path84;
late Path path86;
late Path path88;
late Path path119;
late Path path120;
late Path path121;
late Path path122;
late Path path123;
late Path path125;
late Path path127;
late Path path129;
late Path path131;
late Path path132;
late Path path134;
late Path path137;
late Path path140;
late Path path143;
late Path path145;
late Path path147;
late Path path208;
late Path path209;
late Path path210;
late Path path211;
late Path path213;
late Path path216;
late Path path219;
late Path path222;
late Path path225;
late Path path227;
late Path path229;
late Path path232;
late Path path235;
late Path path238;
late Path path240;
late Path path242;
late Path path277;
late Path path278;
late Path path279;
late Path path280;
late Path path281;
late Path path282;
late Path path284;
late Path path286;
late Path path288;
late Path path290;
late Path path292;
late Path path295;
late Path path298;
late Path path301;
late Path path330;
late Path path331;
late Path path332;
late Path path333;
late Path path334;
late Path path336;
late Path path338;
late Path path340;
late Path path342;
late Path path344;
late Path path345;
late Path path346;
late Path path349;
late Path path352;
late Path path356;
late Path path358;
late Path path359;
late Path path360;
late Path path361;
late Path path362;
late Path path363;
late Path path366;
late Path path369;
late Path path372;
late Path path373;
late Path path374;
late Path path375;
late Path path376;
late Path path379;
late Path path382;
late Path path385;
late Path path386;
late Path path387;
late Path path388;
late Path path389;
late Path path392;
late Path path395;
late Path path398;
late Path path399;
late Path path400;
late Path path401;
late Path path402;
late Path path405;
late Path path408;
late Path path411;
late Path path412;
late Path path413;
late Path path414;
late Path path415;
late Path path418;
late Path path421;
late Path path424;
late Path path425;
late Path path426;
late Path path427;
late Path path428;
late Path path431;
late Path path434;
late Path path437;
late Path path438;
late Path path439;
late Path path440;
late Path path441;
late Path path444;
late Path path447;
late Path path450;
late Path path451;
late Path path452;
late Path path453;
late Path path454;
late Path path457;
late Path path460;
late Path path463;
late Path path464;
late Path path465;
late Path path466;
late Path path467;
late Path path470;
late Path path473;
late Path path476;
late Path path477;
late Path path478;
late Path path479;
late Path path480;
late Path path483;
late Path path486;
late Path path489;
late Path path490;
late Path path491;
late Path path492;
late Path path493;
late Path path496;
late Path path499;
late Path path502;
late Path path503;
late Path path504;
late Path path505;
late Path path506;
late Path path509;
late Path path512;
late Path path515;
late Path path516;
late Path path517;
late Path path518;
late Path path519;
late Path path522;
late Path path525;
late Path path528;
late Path path529;
late Path path530;
late Path path531;
late Path path532;
late Path path535;
late Path path538;
late Path path541;
late Path path542;
late Path path543;
late Path path544;
late Path path545;
late Path path548;
late Path path551;
late Path path554;
late Path path555;
late Path path556;
late Path path557;
late Path path558;
late Path path561;
late Path path564;
late Path path573;
late Path path577;
late Path path579;
late Path path591;
late Path path592;
late Path path593;
late Path path594;
late Path path595;
late Path path597;
late Path path599;
late Path path601;
late Path path603;
late Path path606;
late Path path608;
void createPaths() {
allPaths = <dynamic>[];
pathOps0();
pathOps1();
pathOps2();
pathOps3();
pathOps4();
pathOps5();
pathOps6();
pathOps7();
pathOps8();
pathOps9();
pathOps10();
pathOps11();
pathOps12();
pathOps13();
pathOps14();
pathOps15();
pathOps16();
pathOps17();
pathOps18();
pathOps19();
pathOps20();
pathOps21();
pathOps22();
pathOps23();
pathOps24();
pathOps25();
pathOps26();
pathOps27();
pathOps28();
pathOps29();
pathOps30();
pathOps31();
pathOps32();
pathOps33();
pathOps34();
pathOps35();
pathOps36();
pathOps37();
pathOps38();
pathOps39();
pathOps40();
pathOps41();
pathOps42();
pathOps43();
pathOps44();
pathOps45();
pathOps46();
pathOps47();
pathOps48();
pathOps49();
pathOps50();
pathOps51();
pathOps52();
pathOps53();
pathOps54();
pathOps55();
pathOps56();
pathOps57();
pathOps58();
pathOps59();
pathOps60();
pathOps61();
pathOps62();
pathOps63();
pathOps64();
pathOps65();
pathOps66();
pathOps67();
pathOps68();
pathOps69();
pathOps70();
pathOps71();
pathOps72();
pathOps73();
pathOps74();
pathOps75();
pathOps76();
pathOps77();
pathOps78();
pathOps79();
pathOps80();
pathOps81();
pathOps82();
pathOps83();
pathOps84();
pathOps85();
pathOps86();
pathOps87();
pathOps88();
pathOps89();
pathOps90();
pathOps91();
pathOps92();
pathOps93();
pathOps94();
pathOps95();
pathOps96();
pathOps97();
pathOps98();
pathOps99();
pathOps100();
pathOps101();
pathOps102();
pathOps103();
pathOps104();
pathOps105();
pathOps106();
pathOps107();
pathOps108();
pathOps109();
pathOps110();
pathOps111();
pathOps112();
pathOps113();
pathOps114();
pathOps115();
pathOps116();
pathOps117();
pathOps118();
pathOps119();
pathOps120();
pathOps121();
pathOps122();
pathOps123();
pathOps124();
pathOps125();
pathOps126();
pathOps127();
pathOps128();
pathOps129();
pathOps130();
pathOps131();
pathOps132();
pathOps133();
pathOps134();
pathOps135();
pathOps136();
pathOps137();
pathOps138();
pathOps139();
pathOps140();
pathOps141();
pathOps142();
pathOps143();
pathOps144();
pathOps145();
pathOps146();
pathOps147();
pathOps149();
pathOps150();
pathOps155();
pathOps156();
pathOps161();
pathOps162();
pathOps164();
pathOps165();
pathOps167();
pathOps168();
pathOps173();
pathOps174();
pathOps178();
pathOps179();
pathOps180();
pathOps181();
pathOps182();
pathOps183();
pathOps184();
pathOps185();
pathOps186();
pathOps187();
pathOps188();
pathOps189();
pathOps190();
pathOps191();
pathOps192();
pathOps193();
pathOps194();
pathOps195();
pathOps196();
pathOps197();
pathOps198();
pathOps199();
pathOps200();
pathOps201();
pathOps202();
pathOps203();
pathOps204();
pathOps205();
pathOps206();
pathOps207();
pathOps208();
pathOps209();
pathOps210();
pathOps211();
pathOps212();
pathOps213();
pathOps214();
pathOps215();
pathOps216();
pathOps217();
pathOps218();
pathOps219();
pathOps220();
pathOps221();
pathOps222();
pathOps223();
pathOps224();
pathOps225();
pathOps226();
pathOps227();
pathOps228();
pathOps229();
pathOps230();
pathOps231();
pathOps232();
pathOps233();
pathOps234();
pathOps235();
pathOps236();
pathOps237();
pathOps238();
pathOps239();
pathOps240();
pathOps241();
pathOps242();
pathOps243();
pathOps244();
pathOps245();
pathOps246();
pathOps247();
pathOps248();
pathOps249();
pathOps250();
pathOps251();
pathOps252();
pathOps253();
pathOps254();
pathOps255();
pathOps256();
pathOps257();
pathOps258();
pathOps259();
pathOps260();
pathOps261();
pathOps262();
pathOps263();
pathOps264();
pathOps265();
pathOps266();
pathOps267();
pathOps268();
pathOps269();
pathOps270();
pathOps271();
pathOps272();
pathOps273();
pathOps274();
pathOps275();
pathOps276();
pathOps277();
pathOps278();
pathOps279();
pathOps280();
pathOps281();
pathOps282();
pathOps283();
pathOps284();
pathOps285();
pathOps286();
pathOps287();
pathOps288();
pathOps289();
pathOps290();
pathOps291();
pathOps292();
pathOps293();
pathOps294();
pathOps295();
pathOps296();
pathOps297();
pathOps298();
pathOps299();
pathOps300();
pathOps301();
pathOps302();
pathOps303();
pathOps304();
pathOps305();
pathOps306();
pathOps307();
pathOps308();
pathOps309();
pathOps310();
pathOps311();
pathOps312();
pathOps313();
pathOps314();
pathOps315();
pathOps316();
pathOps317();
pathOps318();
pathOps319();
pathOps320();
pathOps321();
pathOps322();
pathOps323();
pathOps324();
pathOps325();
pathOps326();
pathOps327();
pathOps328();
pathOps329();
pathOps330();
pathOps331();
pathOps332();
pathOps333();
pathOps334();
pathOps335();
pathOps336();
pathOps337();
pathOps338();
pathOps339();
pathOps340();
pathOps341();
pathOps342();
pathOps343();
pathOps344();
pathOps345();
pathOps346();
pathOps347();
pathOps348();
pathOps349();
pathOps350();
pathOps351();
pathOps352();
pathOps353();
pathOps354();
pathOps355();
pathOps356();
pathOps357();
pathOps358();
pathOps359();
pathOps360();
pathOps361();
pathOps362();
pathOps363();
pathOps364();
pathOps365();
pathOps366();
pathOps367();
pathOps368();
pathOps369();
pathOps370();
pathOps371();
pathOps372();
pathOps373();
pathOps374();
pathOps375();
pathOps376();
pathOps377();
pathOps378();
pathOps379();
pathOps380();
pathOps381();
pathOps382();
pathOps383();
pathOps384();
pathOps385();
pathOps386();
pathOps387();
pathOps388();
pathOps389();
pathOps390();
pathOps391();
pathOps392();
pathOps393();
pathOps394();
pathOps395();
pathOps396();
pathOps397();
pathOps398();
pathOps399();
pathOps400();
pathOps401();
pathOps402();
pathOps403();
pathOps404();
pathOps405();
pathOps406();
pathOps407();
pathOps408();
pathOps409();
pathOps410();
pathOps411();
pathOps412();
pathOps413();
pathOps414();
pathOps415();
pathOps416();
pathOps417();
pathOps418();
pathOps419();
pathOps420();
pathOps421();
pathOps422();
pathOps423();
pathOps424();
pathOps425();
pathOps426();
pathOps427();
pathOps428();
pathOps429();
pathOps430();
pathOps431();
pathOps432();
pathOps433();
pathOps434();
pathOps435();
pathOps436();
pathOps437();
pathOps438();
pathOps439();
pathOps440();
pathOps441();
pathOps442();
pathOps443();
pathOps444();
pathOps445();
pathOps446();
pathOps447();
pathOps448();
pathOps449();
pathOps450();
pathOps451();
pathOps452();
pathOps453();
pathOps454();
pathOps455();
pathOps456();
pathOps457();
pathOps458();
pathOps459();
pathOps460();
pathOps461();
pathOps462();
pathOps463();
pathOps464();
pathOps465();
pathOps466();
pathOps467();
pathOps468();
pathOps469();
pathOps470();
pathOps471();
pathOps472();
pathOps473();
pathOps474();
pathOps475();
pathOps476();
pathOps477();
pathOps478();
pathOps479();
pathOps480();
pathOps481();
pathOps482();
pathOps483();
pathOps484();
pathOps485();
pathOps486();
pathOps487();
pathOps488();
pathOps489();
pathOps490();
pathOps491();
pathOps492();
pathOps493();
pathOps494();
pathOps495();
pathOps496();
pathOps497();
pathOps498();
pathOps499();
pathOps500();
pathOps501();
pathOps502();
pathOps503();
pathOps504();
pathOps505();
pathOps506();
pathOps507();
pathOps508();
pathOps509();
pathOps510();
pathOps511();
pathOps512();
pathOps513();
pathOps514();
pathOps515();
pathOps516();
pathOps517();
pathOps518();
pathOps519();
pathOps520();
pathOps521();
pathOps522();
pathOps523();
pathOps524();
pathOps525();
pathOps526();
pathOps527();
pathOps528();
pathOps529();
pathOps530();
pathOps531();
pathOps532();
pathOps533();
pathOps534();
pathOps535();
pathOps536();
pathOps537();
pathOps538();
pathOps539();
pathOps540();
pathOps541();
pathOps542();
pathOps543();
pathOps544();
pathOps545();
pathOps546();
pathOps547();
pathOps548();
pathOps549();
pathOps550();
pathOps551();
pathOps552();
pathOps553();
pathOps554();
pathOps555();
pathOps556();
pathOps557();
pathOps558();
pathOps559();
pathOps560();
pathOps561();
pathOps562();
pathOps563();
pathOps564();
pathOps565();
pathOps566();
pathOps567();
pathOps568();
pathOps569();
pathOps570();
pathOps571();
pathOps572();
pathOps573();
pathOps574();
pathOps575();
pathOps576();
pathOps577();
pathOps578();
pathOps579();
pathOps580();
pathOps581();
pathOps582();
pathOps583();
pathOps584();
pathOps585();
pathOps586();
pathOps587();
pathOps588();
pathOps589();
pathOps590();
pathOps596();
pathOps598();
pathOps600();
pathOps602();
pathOps604();
pathOps605();
pathOps607();
}
void pathOps0() {
final Path path0 = Path();
path0.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(20, 20, 60, 60), const Radius.circular(10)));
gBounds = path0.getBounds();
gBounds = path0.getBounds();
gBounds = path0.getBounds();
_runPathTest(path0);
gBounds = path0.getBounds();
_runPathTest(path0);
allPaths.add(path0);
}
void pathOps1() {
final Path path1 = Path();
path1.addOval(const Rect.fromLTRB(20, 20, 60, 60));
gBounds = path1.getBounds();
gBounds = path1.getBounds();
gBounds = path1.getBounds();
gBounds = path1.getBounds();
_runPathTest(path1);
gFillType = path1.fillType;
_runPathTest(path1);
gFillType = path1.fillType;
_runPathTest(path1);
gFillType = path1.fillType;
_runPathTest(path1);
gFillType = path1.fillType;
allPaths.add(path1);
}
void pathOps2() {
final Path path2 = Path();
path2.moveTo(20, 60);
path2.quadraticBezierTo(60, 20, 60, 60);
path2.close();
path2.moveTo(60, 20);
path2.quadraticBezierTo(60, 60, 20, 60);
gBounds = path2.getBounds();
gBounds = path2.getBounds();
gBounds = path2.getBounds();
gBounds = path2.getBounds();
_runPathTest(path2);
gFillType = path2.fillType;
_runPathTest(path2);
gFillType = path2.fillType;
_runPathTest(path2);
gFillType = path2.fillType;
_runPathTest(path2);
gFillType = path2.fillType;
allPaths.add(path2);
}
void pathOps3() {
final Path path3 = Path();
path3.moveTo(20, 30);
path3.lineTo(40, 20);
path3.lineTo(60, 30);
path3.lineTo(60, 60);
path3.lineTo(20, 60);
path3.close();
gBounds = path3.getBounds();
gBounds = path3.getBounds();
gBounds = path3.getBounds();
gBounds = path3.getBounds();
_runPathTest(path3);
gFillType = path3.fillType;
_runPathTest(path3);
gFillType = path3.fillType;
_runPathTest(path3);
gFillType = path3.fillType;
_runPathTest(path3);
gFillType = path3.fillType;
allPaths.add(path3);
}
void pathOps4() {
final Path path4 = Path();
path4.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(8, 8, 328, 248), const Radius.circular(16)));
_runPathTest(path4);
allPaths.add(path4);
}
void pathOps5() {
final Path path5 = Path();
path5.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(8, 8, 328, 248), const Radius.circular(16)));
_runPathTest(path5);
allPaths.add(path5);
}
void pathOps6() {
final Path path6 = Path();
path6.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 136, 970, 1144), Radius.zero));
gBounds = path6.getBounds();
allPaths.add(path6);
}
void pathOps7() {
final Path path7 = Path();
path7.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 0, 179.5, 200), const Radius.circular(10)));
gFillType = path7.fillType;
path8 = path7.shift(const Offset(15, 8));
gFillType = path7.fillType;
path121 = path7.shift(const Offset(15, 8));
gFillType = path7.fillType;
path210 = path7.shift(const Offset(15, 8));
gFillType = path7.fillType;
path278 = path7.shift(const Offset(15, 8));
gFillType = path7.fillType;
path332 = path7.shift(const Offset(15, 8));
gFillType = path7.fillType;
path359 = path7.shift(const Offset(15, 8));
gFillType = path7.fillType;
path372 = path7.shift(const Offset(15, 8));
gFillType = path7.fillType;
path385 = path7.shift(const Offset(15, 8));
gFillType = path7.fillType;
path398 = path7.shift(const Offset(15, 8));
gFillType = path7.fillType;
path411 = path7.shift(const Offset(15, 8));
gFillType = path7.fillType;
path424 = path7.shift(const Offset(15, 8));
gFillType = path7.fillType;
path437 = path7.shift(const Offset(15, 8));
gFillType = path7.fillType;
path450 = path7.shift(const Offset(15, 8));
gFillType = path7.fillType;
path463 = path7.shift(const Offset(15, 8));
gFillType = path7.fillType;
path476 = path7.shift(const Offset(15, 8));
gFillType = path7.fillType;
path489 = path7.shift(const Offset(15, 8));
gFillType = path7.fillType;
path502 = path7.shift(const Offset(15, 8));
gFillType = path7.fillType;
path515 = path7.shift(const Offset(15, 8));
gFillType = path7.fillType;
path528 = path7.shift(const Offset(15, 8));
gFillType = path7.fillType;
path541 = path7.shift(const Offset(15, 8));
gFillType = path7.fillType;
path554 = path7.shift(const Offset(15, 8));
gFillType = path7.fillType;
path591 = path7.shift(const Offset(15, 8));
allPaths.add(path7);
}
void pathOps8() {
gBounds = path8.getBounds();
allPaths.add(path8);
}
void pathOps9() {
final Path path9 = Path();
path9.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 0, 179.5, 200), const Radius.circular(10)));
gFillType = path9.fillType;
path10 = path9.shift(const Offset(15, 8));
gFillType = path9.fillType;
path120 = path9.shift(const Offset(15, 8));
gFillType = path9.fillType;
path209 = path9.shift(const Offset(15, 8));
gFillType = path9.fillType;
path279 = path9.shift(const Offset(15, 8));
gFillType = path9.fillType;
path331 = path9.shift(const Offset(15, 8));
gFillType = path9.fillType;
path360 = path9.shift(const Offset(15, 8));
gFillType = path9.fillType;
path373 = path9.shift(const Offset(15, 8));
gFillType = path9.fillType;
path386 = path9.shift(const Offset(15, 8));
gFillType = path9.fillType;
path399 = path9.shift(const Offset(15, 8));
gFillType = path9.fillType;
path412 = path9.shift(const Offset(15, 8));
gFillType = path9.fillType;
path425 = path9.shift(const Offset(15, 8));
gFillType = path9.fillType;
path438 = path9.shift(const Offset(15, 8));
gFillType = path9.fillType;
path451 = path9.shift(const Offset(15, 8));
gFillType = path9.fillType;
path464 = path9.shift(const Offset(15, 8));
gFillType = path9.fillType;
path477 = path9.shift(const Offset(15, 8));
gFillType = path9.fillType;
path490 = path9.shift(const Offset(15, 8));
gFillType = path9.fillType;
path503 = path9.shift(const Offset(15, 8));
gFillType = path9.fillType;
path516 = path9.shift(const Offset(15, 8));
gFillType = path9.fillType;
path529 = path9.shift(const Offset(15, 8));
gFillType = path9.fillType;
path542 = path9.shift(const Offset(15, 8));
gFillType = path9.fillType;
path555 = path9.shift(const Offset(15, 8));
gFillType = path9.fillType;
path592 = path9.shift(const Offset(15, 8));
allPaths.add(path9);
}
void pathOps10() {
gBounds = path10.getBounds();
allPaths.add(path10);
}
void pathOps11() {
final Path path11 = Path();
path11.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 0, 179.5, 200), const Radius.circular(10)));
gFillType = path11.fillType;
path12 = path11.shift(const Offset(15, 8));
gFillType = path11.fillType;
path119 = path11.shift(const Offset(15, 8));
gFillType = path11.fillType;
path208 = path11.shift(const Offset(15, 8));
gFillType = path11.fillType;
path280 = path11.shift(const Offset(15, 8));
gFillType = path11.fillType;
path330 = path11.shift(const Offset(15, 8));
gFillType = path11.fillType;
path361 = path11.shift(const Offset(15, 8));
gFillType = path11.fillType;
path374 = path11.shift(const Offset(15, 8));
gFillType = path11.fillType;
path387 = path11.shift(const Offset(15, 8));
gFillType = path11.fillType;
path400 = path11.shift(const Offset(15, 8));
gFillType = path11.fillType;
path413 = path11.shift(const Offset(15, 8));
gFillType = path11.fillType;
path426 = path11.shift(const Offset(15, 8));
gFillType = path11.fillType;
path439 = path11.shift(const Offset(15, 8));
gFillType = path11.fillType;
path452 = path11.shift(const Offset(15, 8));
gFillType = path11.fillType;
path465 = path11.shift(const Offset(15, 8));
gFillType = path11.fillType;
path478 = path11.shift(const Offset(15, 8));
gFillType = path11.fillType;
path491 = path11.shift(const Offset(15, 8));
gFillType = path11.fillType;
path504 = path11.shift(const Offset(15, 8));
gFillType = path11.fillType;
path517 = path11.shift(const Offset(15, 8));
gFillType = path11.fillType;
path530 = path11.shift(const Offset(15, 8));
gFillType = path11.fillType;
path543 = path11.shift(const Offset(15, 8));
gFillType = path11.fillType;
path556 = path11.shift(const Offset(15, 8));
gFillType = path11.fillType;
path593 = path11.shift(const Offset(15, 8));
allPaths.add(path11);
}
void pathOps12() {
gBounds = path12.getBounds();
allPaths.add(path12);
}
void pathOps13() {
final Path path13 = Path();
path13.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 0, 179.5, 200), const Radius.circular(10)));
gFillType = path13.fillType;
path14 = path13.shift(const Offset(15, 8));
gFillType = path13.fillType;
path122 = path13.shift(const Offset(15, 8));
gFillType = path13.fillType;
path211 = path13.shift(const Offset(15, 8));
gFillType = path13.fillType;
path277 = path13.shift(const Offset(15, 8));
gFillType = path13.fillType;
path333 = path13.shift(const Offset(15, 8));
gFillType = path13.fillType;
path362 = path13.shift(const Offset(15, 8));
gFillType = path13.fillType;
path375 = path13.shift(const Offset(15, 8));
gFillType = path13.fillType;
path388 = path13.shift(const Offset(15, 8));
gFillType = path13.fillType;
path401 = path13.shift(const Offset(15, 8));
gFillType = path13.fillType;
path414 = path13.shift(const Offset(15, 8));
gFillType = path13.fillType;
path427 = path13.shift(const Offset(15, 8));
gFillType = path13.fillType;
path440 = path13.shift(const Offset(15, 8));
gFillType = path13.fillType;
path453 = path13.shift(const Offset(15, 8));
gFillType = path13.fillType;
path466 = path13.shift(const Offset(15, 8));
gFillType = path13.fillType;
path479 = path13.shift(const Offset(15, 8));
gFillType = path13.fillType;
path492 = path13.shift(const Offset(15, 8));
gFillType = path13.fillType;
path505 = path13.shift(const Offset(15, 8));
gFillType = path13.fillType;
path518 = path13.shift(const Offset(15, 8));
gFillType = path13.fillType;
path531 = path13.shift(const Offset(15, 8));
gFillType = path13.fillType;
path544 = path13.shift(const Offset(15, 8));
gFillType = path13.fillType;
path557 = path13.shift(const Offset(15, 8));
gFillType = path13.fillType;
path594 = path13.shift(const Offset(15, 8));
allPaths.add(path13);
}
void pathOps14() {
gBounds = path14.getBounds();
allPaths.add(path14);
}
void pathOps15() {
final Path path15 = Path();
path15.addOval(const Rect.fromLTRB(0, 0, 58, 58));
gFillType = path15.fillType;
path16 = path15.shift(const Offset(860, 79));
gFillType = path15.fillType;
path143 = path15.shift(const Offset(860, 79));
gFillType = path15.fillType;
path238 = path15.shift(const Offset(860, 79));
gFillType = path15.fillType;
path301 = path15.shift(const Offset(860, 79));
gFillType = path15.fillType;
path345 = path15.shift(const Offset(860, 79));
allPaths.add(path15);
}
void pathOps16() {
gBounds = path16.getBounds();
allPaths.add(path16);
}
void pathOps17() {
final Path path17 = Path();
path17.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 0, 250.66666666666666, 585), const Radius.circular(10)));
gFillType = path17.fillType;
path18 = path17.shift(const Offset(81, 0));
gFillType = path17.fillType;
path134 = path17.shift(const Offset(81, 0));
gFillType = path17.fillType;
path229 = path17.shift(const Offset(81, 0));
gFillType = path17.fillType;
path292 = path17.shift(const Offset(81, 0));
gFillType = path17.fillType;
path346 = path17.shift(const Offset(81, 0));
gFillType = path17.fillType;
path363 = path17.shift(const Offset(81, 0));
gFillType = path17.fillType;
path376 = path17.shift(const Offset(81, 0));
gFillType = path17.fillType;
path389 = path17.shift(const Offset(81, 0));
gFillType = path17.fillType;
path402 = path17.shift(const Offset(81, 0));
gFillType = path17.fillType;
path415 = path17.shift(const Offset(81, 0));
gFillType = path17.fillType;
path428 = path17.shift(const Offset(81, 0));
gFillType = path17.fillType;
path441 = path17.shift(const Offset(81, 0));
gFillType = path17.fillType;
path454 = path17.shift(const Offset(81, 0));
gFillType = path17.fillType;
path467 = path17.shift(const Offset(81, 0));
gFillType = path17.fillType;
path480 = path17.shift(const Offset(81, 0));
gFillType = path17.fillType;
path493 = path17.shift(const Offset(81, 0));
gFillType = path17.fillType;
path506 = path17.shift(const Offset(81, 0));
gFillType = path17.fillType;
path519 = path17.shift(const Offset(81, 0));
gFillType = path17.fillType;
path532 = path17.shift(const Offset(81, 0));
gFillType = path17.fillType;
path545 = path17.shift(const Offset(81, 0));
gFillType = path17.fillType;
path558 = path17.shift(const Offset(81, 0));
allPaths.add(path17);
}
void pathOps18() {
gBounds = path18.getBounds();
allPaths.add(path18);
}
void pathOps19() {
final Path path19 = Path();
path19.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(81, 0, 331.66666666666663, 84), Radius.zero));
gBounds = path19.getBounds();
allPaths.add(path19);
}
void pathOps20() {
final Path path20 = Path();
path20.reset();
path20.moveTo(331.66666666666663, 86);
path20.lineTo(81, 86);
path20.lineTo(81, 84);
path20.lineTo(331.66666666666663, 84);
gBounds = path20.getBounds();
_runPathTest(path20);
gFillType = path20.fillType;
allPaths.add(path20);
}
void pathOps21() {
final Path path21 = Path();
path21.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 0, 250.66666666666666, 87), Radius.zero));
gBounds = path21.getBounds();
allPaths.add(path21);
}
void pathOps22() {
final Path path22 = Path();
path22.reset();
path22.moveTo(234.66666666666666, 87);
path22.lineTo(96, 87);
path22.lineTo(96, 86);
path22.lineTo(234.66666666666666, 86);
gBounds = path22.getBounds();
_runPathTest(path22);
gFillType = path22.fillType;
allPaths.add(path22);
}
void pathOps23() {
final Path path23 = Path();
path23.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 0, 250.66666666666666, 101), Radius.zero));
gBounds = path23.getBounds();
allPaths.add(path23);
}
void pathOps24() {
final Path path24 = Path();
path24.reset();
path24.moveTo(234.66666666666666, 101);
path24.lineTo(96, 101);
path24.lineTo(96, 100);
path24.lineTo(234.66666666666666, 100);
gBounds = path24.getBounds();
_runPathTest(path24);
gFillType = path24.fillType;
allPaths.add(path24);
}
void pathOps25() {
final Path path25 = Path();
path25.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 0, 250.66666666666666, 101), Radius.zero));
gBounds = path25.getBounds();
allPaths.add(path25);
}
void pathOps26() {
final Path path26 = Path();
path26.reset();
path26.moveTo(234.66666666666666, 101);
path26.lineTo(96, 101);
path26.lineTo(96, 100);
path26.lineTo(234.66666666666666, 100);
gBounds = path26.getBounds();
_runPathTest(path26);
gFillType = path26.fillType;
allPaths.add(path26);
}
void pathOps27() {
final Path path27 = Path();
path27.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 0, 250.66666666666666, 101), Radius.zero));
gBounds = path27.getBounds();
allPaths.add(path27);
}
void pathOps28() {
final Path path28 = Path();
path28.reset();
path28.moveTo(234.66666666666666, 101);
path28.lineTo(96, 101);
path28.lineTo(96, 100);
path28.lineTo(234.66666666666666, 100);
gBounds = path28.getBounds();
_runPathTest(path28);
gFillType = path28.fillType;
allPaths.add(path28);
}
void pathOps29() {
final Path path29 = Path();
path29.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 0, 250.66666666666666, 87), Radius.zero));
gBounds = path29.getBounds();
allPaths.add(path29);
}
void pathOps30() {
final Path path30 = Path();
path30.reset();
path30.moveTo(234.66666666666666, 87);
path30.lineTo(96, 87);
path30.lineTo(96, 86);
path30.lineTo(234.66666666666666, 86);
gBounds = path30.getBounds();
allPaths.add(path30);
}
void pathOps31() {
final Path path31 = Path();
path31.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 0, 250.66666666666666, 87), Radius.zero));
gBounds = path31.getBounds();
allPaths.add(path31);
}
void pathOps32() {
final Path path32 = Path();
path32.reset();
path32.moveTo(234.66666666666666, 87);
path32.lineTo(96, 87);
path32.lineTo(96, 86);
path32.lineTo(234.66666666666666, 86);
gBounds = path32.getBounds();
allPaths.add(path32);
}
void pathOps33() {
final Path path33 = Path();
path33.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 0, 250.66666666666666, 585), const Radius.circular(10)));
gFillType = path33.fillType;
path34 = path33.shift(const Offset(359.66666666666663, 0));
gFillType = path33.fillType;
path137 = path33.shift(const Offset(359.66666666666663, 0));
gFillType = path33.fillType;
path232 = path33.shift(const Offset(359.66666666666663, 0));
gFillType = path33.fillType;
path295 = path33.shift(const Offset(359.66666666666663, 0));
gFillType = path33.fillType;
path349 = path33.shift(const Offset(359.66666666666663, 0));
gFillType = path33.fillType;
path366 = path33.shift(const Offset(359.66666666666663, 0));
gFillType = path33.fillType;
path379 = path33.shift(const Offset(359.66666666666663, 0));
gFillType = path33.fillType;
path392 = path33.shift(const Offset(359.66666666666663, 0));
gFillType = path33.fillType;
path405 = path33.shift(const Offset(359.66666666666663, 0));
gFillType = path33.fillType;
path418 = path33.shift(const Offset(359.66666666666663, 0));
gFillType = path33.fillType;
path431 = path33.shift(const Offset(359.66666666666663, 0));
gFillType = path33.fillType;
path444 = path33.shift(const Offset(359.66666666666663, 0));
gFillType = path33.fillType;
path457 = path33.shift(const Offset(359.66666666666663, 0));
gFillType = path33.fillType;
path470 = path33.shift(const Offset(359.66666666666663, 0));
gFillType = path33.fillType;
path483 = path33.shift(const Offset(359.66666666666663, 0));
gFillType = path33.fillType;
path496 = path33.shift(const Offset(359.66666666666663, 0));
gFillType = path33.fillType;
path509 = path33.shift(const Offset(359.66666666666663, 0));
gFillType = path33.fillType;
path522 = path33.shift(const Offset(359.66666666666663, 0));
gFillType = path33.fillType;
path535 = path33.shift(const Offset(359.66666666666663, 0));
gFillType = path33.fillType;
path548 = path33.shift(const Offset(359.66666666666663, 0));
gFillType = path33.fillType;
path561 = path33.shift(const Offset(359.66666666666663, 0));
allPaths.add(path33);
}
void pathOps34() {
gBounds = path34.getBounds();
allPaths.add(path34);
}
void pathOps35() {
final Path path35 = Path();
path35.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(359.66666666666663, 0, 610.3333333333333, 84), Radius.zero));
gBounds = path35.getBounds();
allPaths.add(path35);
}
void pathOps36() {
final Path path36 = Path();
path36.reset();
path36.moveTo(610.3333333333333, 86);
path36.lineTo(359.66666666666663, 86);
path36.lineTo(359.66666666666663, 84);
path36.lineTo(610.3333333333333, 84);
gBounds = path36.getBounds();
_runPathTest(path36);
gFillType = path36.fillType;
allPaths.add(path36);
}
void pathOps37() {
final Path path37 = Path();
path37.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 0, 250.66666666666666, 87), Radius.zero));
gBounds = path37.getBounds();
allPaths.add(path37);
}
void pathOps38() {
final Path path38 = Path();
path38.reset();
path38.moveTo(234.66666666666666, 87);
path38.lineTo(96, 87);
path38.lineTo(96, 86);
path38.lineTo(234.66666666666666, 86);
gBounds = path38.getBounds();
_runPathTest(path38);
gFillType = path38.fillType;
allPaths.add(path38);
}
void pathOps39() {
final Path path39 = Path();
path39.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 0, 250.66666666666666, 87), Radius.zero));
gBounds = path39.getBounds();
allPaths.add(path39);
}
void pathOps40() {
final Path path40 = Path();
path40.reset();
path40.moveTo(234.66666666666666, 87);
path40.lineTo(96, 87);
path40.lineTo(96, 86);
path40.lineTo(234.66666666666666, 86);
gBounds = path40.getBounds();
_runPathTest(path40);
gFillType = path40.fillType;
allPaths.add(path40);
}
void pathOps41() {
final Path path41 = Path();
path41.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 0, 250.66666666666666, 73), Radius.zero));
gBounds = path41.getBounds();
allPaths.add(path41);
}
void pathOps42() {
final Path path42 = Path();
path42.reset();
path42.moveTo(234.66666666666666, 73);
path42.lineTo(96, 73);
path42.lineTo(96, 72);
path42.lineTo(234.66666666666666, 72);
gBounds = path42.getBounds();
_runPathTest(path42);
gFillType = path42.fillType;
allPaths.add(path42);
}
void pathOps43() {
final Path path43 = Path();
path43.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 0, 250.66666666666666, 87), Radius.zero));
gBounds = path43.getBounds();
allPaths.add(path43);
}
void pathOps44() {
final Path path44 = Path();
path44.reset();
path44.moveTo(234.66666666666666, 87);
path44.lineTo(96, 87);
path44.lineTo(96, 86);
path44.lineTo(234.66666666666666, 86);
gBounds = path44.getBounds();
_runPathTest(path44);
gFillType = path44.fillType;
allPaths.add(path44);
}
void pathOps45() {
final Path path45 = Path();
path45.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 0, 250.66666666666666, 87), Radius.zero));
gBounds = path45.getBounds();
allPaths.add(path45);
}
void pathOps46() {
final Path path46 = Path();
path46.reset();
path46.moveTo(234.66666666666666, 87);
path46.lineTo(96, 87);
path46.lineTo(96, 86);
path46.lineTo(234.66666666666666, 86);
gBounds = path46.getBounds();
_runPathTest(path46);
gFillType = path46.fillType;
allPaths.add(path46);
}
void pathOps47() {
final Path path47 = Path();
path47.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 0, 250.66666666666666, 87), Radius.zero));
gBounds = path47.getBounds();
allPaths.add(path47);
}
void pathOps48() {
final Path path48 = Path();
path48.reset();
path48.moveTo(234.66666666666666, 87);
path48.lineTo(96, 87);
path48.lineTo(96, 86);
path48.lineTo(234.66666666666666, 86);
gBounds = path48.getBounds();
allPaths.add(path48);
}
void pathOps49() {
final Path path49 = Path();
path49.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 0, 250.66666666666669, 585), const Radius.circular(10)));
gFillType = path49.fillType;
path50 = path49.shift(const Offset(638.3333333333333, 0));
gFillType = path49.fillType;
path140 = path49.shift(const Offset(638.3333333333333, 0));
gFillType = path49.fillType;
path235 = path49.shift(const Offset(638.3333333333333, 0));
gFillType = path49.fillType;
path298 = path49.shift(const Offset(638.3333333333333, 0));
gFillType = path49.fillType;
path352 = path49.shift(const Offset(638.3333333333333, 0));
gFillType = path49.fillType;
path369 = path49.shift(const Offset(638.3333333333333, 0));
gFillType = path49.fillType;
path382 = path49.shift(const Offset(638.3333333333333, 0));
gFillType = path49.fillType;
path395 = path49.shift(const Offset(638.3333333333333, 0));
gFillType = path49.fillType;
path408 = path49.shift(const Offset(638.3333333333333, 0));
gFillType = path49.fillType;
path421 = path49.shift(const Offset(638.3333333333333, 0));
gFillType = path49.fillType;
path434 = path49.shift(const Offset(638.3333333333333, 0));
gFillType = path49.fillType;
path447 = path49.shift(const Offset(638.3333333333333, 0));
gFillType = path49.fillType;
path460 = path49.shift(const Offset(638.3333333333333, 0));
gFillType = path49.fillType;
path473 = path49.shift(const Offset(638.3333333333333, 0));
gFillType = path49.fillType;
path486 = path49.shift(const Offset(638.3333333333333, 0));
gFillType = path49.fillType;
path499 = path49.shift(const Offset(638.3333333333333, 0));
gFillType = path49.fillType;
path512 = path49.shift(const Offset(638.3333333333333, 0));
gFillType = path49.fillType;
path525 = path49.shift(const Offset(638.3333333333333, 0));
gFillType = path49.fillType;
path538 = path49.shift(const Offset(638.3333333333333, 0));
gFillType = path49.fillType;
path551 = path49.shift(const Offset(638.3333333333333, 0));
gFillType = path49.fillType;
path564 = path49.shift(const Offset(638.3333333333333, 0));
allPaths.add(path49);
}
void pathOps50() {
gBounds = path50.getBounds();
allPaths.add(path50);
}
void pathOps51() {
final Path path51 = Path();
path51.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(638.3333333333333, 0, 889, 84), Radius.zero));
gBounds = path51.getBounds();
allPaths.add(path51);
}
void pathOps52() {
final Path path52 = Path();
path52.reset();
path52.moveTo(889, 86);
path52.lineTo(638.3333333333333, 86);
path52.lineTo(638.3333333333333, 84);
path52.lineTo(889, 84);
gBounds = path52.getBounds();
_runPathTest(path52);
gFillType = path52.fillType;
allPaths.add(path52);
}
void pathOps53() {
final Path path53 = Path();
path53.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 0, 250.66666666666669, 87), Radius.zero));
gBounds = path53.getBounds();
allPaths.add(path53);
}
void pathOps54() {
final Path path54 = Path();
path54.reset();
path54.moveTo(234.66666666666669, 87);
path54.lineTo(96, 87);
path54.lineTo(96, 86);
path54.lineTo(234.66666666666669, 86);
gBounds = path54.getBounds();
_runPathTest(path54);
gFillType = path54.fillType;
allPaths.add(path54);
}
void pathOps55() {
final Path path55 = Path();
path55.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 0, 250.66666666666669, 87), Radius.zero));
gBounds = path55.getBounds();
allPaths.add(path55);
}
void pathOps56() {
final Path path56 = Path();
path56.reset();
path56.moveTo(234.66666666666669, 87);
path56.lineTo(96, 87);
path56.lineTo(96, 86);
path56.lineTo(234.66666666666669, 86);
gBounds = path56.getBounds();
_runPathTest(path56);
gFillType = path56.fillType;
allPaths.add(path56);
}
void pathOps57() {
final Path path57 = Path();
path57.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 0, 250.66666666666669, 73), Radius.zero));
gBounds = path57.getBounds();
allPaths.add(path57);
}
void pathOps58() {
final Path path58 = Path();
path58.reset();
path58.moveTo(234.66666666666669, 73);
path58.lineTo(96, 73);
path58.lineTo(96, 72);
path58.lineTo(234.66666666666669, 72);
gBounds = path58.getBounds();
_runPathTest(path58);
gFillType = path58.fillType;
allPaths.add(path58);
}
void pathOps59() {
final Path path59 = Path();
path59.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 0, 520, 560), const Radius.circular(40)));
gFillType = path59.fillType;
path60 = path59.shift(const Offset(450, 136));
gFillType = path59.fillType;
path82 = path59.shift(const Offset(450, 136));
gFillType = path59.fillType;
path86 = path59.shift(const Offset(450, 136));
gFillType = path59.fillType;
path145 = path59.shift(const Offset(450, 136));
gFillType = path59.fillType;
path240 = path59.shift(const Offset(450, 136));
gFillType = path59.fillType;
path356 = path59.shift(const Offset(450, 136));
gFillType = path59.fillType;
path606 = path59.shift(const Offset(450, 136));
allPaths.add(path59);
}
void pathOps60() {
gBounds = path60.getBounds();
allPaths.add(path60);
}
void pathOps61() {
final Path path61 = Path();
path61.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(450, 136, 970, 696), Radius.zero));
gBounds = path61.getBounds();
allPaths.add(path61);
}
void pathOps62() {
final Path path62 = Path();
path62.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 0, 456, 52), const Radius.circular(10)));
gFillType = path62.fillType;
path63 = path62.shift(const Offset(32, 0));
gFillType = path62.fillType;
path123 = path62.shift(const Offset(32, 0));
allPaths.add(path62);
}
void pathOps63() {
gBounds = path63.getBounds();
allPaths.add(path63);
}
void pathOps64() {
final Path path64 = Path();
path64.reset();
path64.moveTo(56, 40);
path64.lineTo(56, 40);
path64.lineTo(58, 40);
path64.lineTo(58, 40);
gBounds = path64.getBounds();
allPaths.add(path64);
}
void pathOps65() {
final Path path65 = Path();
path65.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 0, 456, 52), const Radius.circular(10)));
gFillType = path65.fillType;
path66 = path65.shift(const Offset(32, 0));
gFillType = path65.fillType;
path125 = path65.shift(const Offset(32, 0));
allPaths.add(path65);
}
void pathOps66() {
gBounds = path66.getBounds();
allPaths.add(path66);
}
void pathOps67() {
final Path path67 = Path();
path67.reset();
path67.moveTo(56, 40);
path67.lineTo(56, 40);
path67.lineTo(58, 40);
path67.lineTo(58, 40);
gBounds = path67.getBounds();
allPaths.add(path67);
}
void pathOps68() {
final Path path68 = Path();
path68.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 0, 456, 52), const Radius.circular(10)));
gFillType = path68.fillType;
path69 = path68.shift(const Offset(32, 0));
gFillType = path68.fillType;
path127 = path68.shift(const Offset(32, 0));
allPaths.add(path68);
}
void pathOps69() {
gBounds = path69.getBounds();
allPaths.add(path69);
}
void pathOps70() {
final Path path70 = Path();
path70.reset();
path70.moveTo(56, 40);
path70.lineTo(56, 40);
path70.lineTo(58, 40);
path70.lineTo(58, 40);
gBounds = path70.getBounds();
allPaths.add(path70);
}
void pathOps71() {
final Path path71 = Path();
path71.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 0, 456, 52), const Radius.circular(10)));
gFillType = path71.fillType;
path72 = path71.shift(const Offset(32, 0));
gFillType = path71.fillType;
path129 = path71.shift(const Offset(32, 0));
allPaths.add(path71);
}
void pathOps72() {
gBounds = path72.getBounds();
allPaths.add(path72);
}
void pathOps73() {
final Path path73 = Path();
path73.reset();
path73.moveTo(56, 40);
path73.lineTo(56, 40);
path73.lineTo(58, 40);
path73.lineTo(58, 40);
gBounds = path73.getBounds();
allPaths.add(path73);
}
void pathOps74() {
final Path path74 = Path();
path74.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 0, 456, 52), const Radius.circular(10)));
gFillType = path74.fillType;
path75 = path74.shift(const Offset(32, 0));
gFillType = path74.fillType;
path132 = path74.shift(const Offset(32, 0));
allPaths.add(path74);
}
void pathOps75() {
gBounds = path75.getBounds();
allPaths.add(path75);
}
void pathOps76() {
final Path path76 = Path();
path76.reset();
path76.moveTo(56, 40);
path76.lineTo(56, 40);
path76.lineTo(58, 40);
path76.lineTo(58, 40);
gBounds = path76.getBounds();
allPaths.add(path76);
}
void pathOps77() {
final Path path77 = Path();
path77.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 0, 456, 50), const Radius.circular(10)));
gFillType = path77.fillType;
path78 = path77.shift(const Offset(32, 0));
gFillType = path77.fillType;
path131 = path77.shift(const Offset(32, 0));
allPaths.add(path77);
}
void pathOps78() {
gBounds = path78.getBounds();
allPaths.add(path78);
}
void pathOps79() {
final Path path79 = Path();
path79.addRRect(RRect.fromRectAndCorners(const Rect.fromLTRB(0, 0, 64, 56), bottomLeft: const Radius.circular(10), ));
gFillType = path79.fillType;
path80 = path79.shift(const Offset(906, 136));
gFillType = path79.fillType;
path84 = path79.shift(const Offset(906, 136));
gFillType = path79.fillType;
path88 = path79.shift(const Offset(906, 136));
gFillType = path79.fillType;
path147 = path79.shift(const Offset(906, 136));
gFillType = path79.fillType;
path242 = path79.shift(const Offset(906, 136));
gFillType = path79.fillType;
path358 = path79.shift(const Offset(906, 136));
gFillType = path79.fillType;
path608 = path79.shift(const Offset(906, 136));
allPaths.add(path79);
}
void pathOps80() {
gBounds = path80.getBounds();
allPaths.add(path80);
}
void pathOps81() {
final Path path81 = Path();
path81.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 136, 970, 1144), Radius.zero));
gBounds = path81.getBounds();
allPaths.add(path81);
}
void pathOps82() {
gBounds = path82.getBounds();
allPaths.add(path82);
}
void pathOps83() {
final Path path83 = Path();
path83.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(450, 136, 970, 696), Radius.zero));
gBounds = path83.getBounds();
allPaths.add(path83);
}
void pathOps84() {
gBounds = path84.getBounds();
allPaths.add(path84);
}
void pathOps85() {
final Path path85 = Path();
path85.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 136, 970, 1144), Radius.zero));
gBounds = path85.getBounds();
allPaths.add(path85);
}
void pathOps86() {
gBounds = path86.getBounds();
allPaths.add(path86);
}
void pathOps87() {
final Path path87 = Path();
path87.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(450, 136, 970, 696), Radius.zero));
gBounds = path87.getBounds();
allPaths.add(path87);
}
void pathOps88() {
gBounds = path88.getBounds();
allPaths.add(path88);
}
void pathOps89() {
final Path path89 = Path();
path89.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 0, 250.66666666666669, 87), Radius.zero));
gBounds = path89.getBounds();
allPaths.add(path89);
}
void pathOps90() {
final Path path90 = Path();
path90.reset();
path90.moveTo(234.66666666666669, 87);
path90.lineTo(96, 87);
path90.lineTo(96, 86);
path90.lineTo(234.66666666666669, 86);
gBounds = path90.getBounds();
_runPathTest(path90);
gFillType = path90.fillType;
allPaths.add(path90);
}
void pathOps91() {
final Path path91 = Path();
path91.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 0, 250.66666666666669, 73), Radius.zero));
gBounds = path91.getBounds();
allPaths.add(path91);
}
void pathOps92() {
final Path path92 = Path();
path92.reset();
path92.moveTo(234.66666666666669, 73);
path92.lineTo(96, 73);
path92.lineTo(96, 72);
path92.lineTo(234.66666666666669, 72);
gBounds = path92.getBounds();
_runPathTest(path92);
gFillType = path92.fillType;
allPaths.add(path92);
}
void pathOps93() {
final Path path93 = Path();
path93.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 0, 250.66666666666666, 101), Radius.zero));
gBounds = path93.getBounds();
allPaths.add(path93);
}
void pathOps94() {
final Path path94 = Path();
path94.reset();
path94.moveTo(234.66666666666666, 101);
path94.lineTo(96, 101);
path94.lineTo(96, 100);
path94.lineTo(234.66666666666666, 100);
gBounds = path94.getBounds();
_runPathTest(path94);
gFillType = path94.fillType;
allPaths.add(path94);
}
void pathOps95() {
final Path path95 = Path();
path95.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 0, 250.66666666666666, 87), Radius.zero));
gBounds = path95.getBounds();
allPaths.add(path95);
}
void pathOps96() {
final Path path96 = Path();
path96.reset();
path96.moveTo(234.66666666666666, 87);
path96.lineTo(96, 87);
path96.lineTo(96, 86);
path96.lineTo(234.66666666666666, 86);
gBounds = path96.getBounds();
_runPathTest(path96);
gFillType = path96.fillType;
allPaths.add(path96);
}
void pathOps97() {
final Path path97 = Path();
path97.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 0, 250.66666666666666, 101), Radius.zero));
gBounds = path97.getBounds();
allPaths.add(path97);
}
void pathOps98() {
final Path path98 = Path();
path98.reset();
path98.moveTo(234.66666666666666, 101);
path98.lineTo(96, 101);
path98.lineTo(96, 100);
path98.lineTo(234.66666666666666, 100);
gBounds = path98.getBounds();
_runPathTest(path98);
gFillType = path98.fillType;
allPaths.add(path98);
}
void pathOps99() {
final Path path99 = Path();
path99.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 0, 250.66666666666666, 101), Radius.zero));
gBounds = path99.getBounds();
allPaths.add(path99);
}
void pathOps100() {
final Path path100 = Path();
path100.reset();
path100.moveTo(234.66666666666666, 101);
path100.lineTo(96, 101);
path100.lineTo(96, 100);
path100.lineTo(234.66666666666666, 100);
gBounds = path100.getBounds();
_runPathTest(path100);
gFillType = path100.fillType;
allPaths.add(path100);
}
void pathOps101() {
final Path path101 = Path();
path101.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 0, 250.66666666666666, 73), Radius.zero));
gBounds = path101.getBounds();
allPaths.add(path101);
}
void pathOps102() {
final Path path102 = Path();
path102.reset();
path102.moveTo(234.66666666666666, 73);
path102.lineTo(96, 73);
path102.lineTo(96, 72);
path102.lineTo(234.66666666666666, 72);
gBounds = path102.getBounds();
_runPathTest(path102);
gFillType = path102.fillType;
allPaths.add(path102);
}
void pathOps103() {
final Path path103 = Path();
path103.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 0, 250.66666666666666, 87), Radius.zero));
gBounds = path103.getBounds();
allPaths.add(path103);
}
void pathOps104() {
final Path path104 = Path();
path104.reset();
path104.moveTo(234.66666666666666, 87);
path104.lineTo(96, 87);
path104.lineTo(96, 86);
path104.lineTo(234.66666666666666, 86);
gBounds = path104.getBounds();
allPaths.add(path104);
}
void pathOps105() {
final Path path105 = Path();
path105.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 0, 250.66666666666666, 87), Radius.zero));
gBounds = path105.getBounds();
allPaths.add(path105);
}
void pathOps106() {
final Path path106 = Path();
path106.reset();
path106.moveTo(234.66666666666666, 87);
path106.lineTo(96, 87);
path106.lineTo(96, 86);
path106.lineTo(234.66666666666666, 86);
gBounds = path106.getBounds();
allPaths.add(path106);
}
void pathOps107() {
final Path path107 = Path();
path107.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 0, 250.66666666666666, 87), Radius.zero));
gBounds = path107.getBounds();
allPaths.add(path107);
}
void pathOps108() {
final Path path108 = Path();
path108.reset();
path108.moveTo(234.66666666666666, 87);
path108.lineTo(96, 87);
path108.lineTo(96, 86);
path108.lineTo(234.66666666666666, 86);
gBounds = path108.getBounds();
_runPathTest(path108);
gFillType = path108.fillType;
allPaths.add(path108);
}
void pathOps109() {
final Path path109 = Path();
path109.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 0, 250.66666666666666, 87), Radius.zero));
gBounds = path109.getBounds();
allPaths.add(path109);
}
void pathOps110() {
final Path path110 = Path();
path110.reset();
path110.moveTo(234.66666666666666, 87);
path110.lineTo(96, 87);
path110.lineTo(96, 86);
path110.lineTo(234.66666666666666, 86);
gBounds = path110.getBounds();
_runPathTest(path110);
gFillType = path110.fillType;
allPaths.add(path110);
}
void pathOps111() {
final Path path111 = Path();
path111.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 0, 250.66666666666666, 87), Radius.zero));
gBounds = path111.getBounds();
allPaths.add(path111);
}
void pathOps112() {
final Path path112 = Path();
path112.reset();
path112.moveTo(234.66666666666666, 87);
path112.lineTo(96, 87);
path112.lineTo(96, 86);
path112.lineTo(234.66666666666666, 86);
gBounds = path112.getBounds();
_runPathTest(path112);
gFillType = path112.fillType;
allPaths.add(path112);
}
void pathOps113() {
final Path path113 = Path();
path113.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 0, 250.66666666666666, 87), Radius.zero));
gBounds = path113.getBounds();
allPaths.add(path113);
}
void pathOps114() {
final Path path114 = Path();
path114.reset();
path114.moveTo(234.66666666666666, 87);
path114.lineTo(96, 87);
path114.lineTo(96, 86);
path114.lineTo(234.66666666666666, 86);
gBounds = path114.getBounds();
_runPathTest(path114);
gFillType = path114.fillType;
allPaths.add(path114);
}
void pathOps115() {
final Path path115 = Path();
path115.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 0, 250.66666666666666, 87), Radius.zero));
gBounds = path115.getBounds();
allPaths.add(path115);
}
void pathOps116() {
final Path path116 = Path();
path116.reset();
path116.moveTo(234.66666666666666, 87);
path116.lineTo(96, 87);
path116.lineTo(96, 86);
path116.lineTo(234.66666666666666, 86);
gBounds = path116.getBounds();
allPaths.add(path116);
}
void pathOps117() {
final Path path117 = Path();
path117.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 0, 250.66666666666669, 87), Radius.zero));
gBounds = path117.getBounds();
allPaths.add(path117);
}
void pathOps118() {
final Path path118 = Path();
path118.reset();
path118.moveTo(234.66666666666669, 87);
path118.lineTo(96, 87);
path118.lineTo(96, 86);
path118.lineTo(234.66666666666669, 86);
gBounds = path118.getBounds();
_runPathTest(path118);
gFillType = path118.fillType;
allPaths.add(path118);
}
void pathOps119() {
gBounds = path119.getBounds();
allPaths.add(path119);
}
void pathOps120() {
gBounds = path120.getBounds();
allPaths.add(path120);
}
void pathOps121() {
gBounds = path121.getBounds();
allPaths.add(path121);
}
void pathOps122() {
gBounds = path122.getBounds();
allPaths.add(path122);
}
void pathOps123() {
gBounds = path123.getBounds();
allPaths.add(path123);
}
void pathOps124() {
final Path path124 = Path();
path124.reset();
path124.moveTo(56, 40);
path124.lineTo(56, 40);
path124.lineTo(58, 40);
path124.lineTo(58, 40);
gBounds = path124.getBounds();
allPaths.add(path124);
}
void pathOps125() {
gBounds = path125.getBounds();
allPaths.add(path125);
}
void pathOps126() {
final Path path126 = Path();
path126.reset();
path126.moveTo(56, 40);
path126.lineTo(56, 40);
path126.lineTo(58, 40);
path126.lineTo(58, 40);
gBounds = path126.getBounds();
allPaths.add(path126);
}
void pathOps127() {
gBounds = path127.getBounds();
allPaths.add(path127);
}
void pathOps128() {
final Path path128 = Path();
path128.reset();
path128.moveTo(56, 40);
path128.lineTo(56, 40);
path128.lineTo(58, 40);
path128.lineTo(58, 40);
gBounds = path128.getBounds();
allPaths.add(path128);
}
void pathOps129() {
gBounds = path129.getBounds();
allPaths.add(path129);
}
void pathOps130() {
final Path path130 = Path();
path130.reset();
path130.moveTo(56, 40);
path130.lineTo(56, 40);
path130.lineTo(58, 40);
path130.lineTo(58, 40);
gBounds = path130.getBounds();
allPaths.add(path130);
}
void pathOps131() {
gBounds = path131.getBounds();
allPaths.add(path131);
}
void pathOps132() {
gBounds = path132.getBounds();
allPaths.add(path132);
}
void pathOps133() {
final Path path133 = Path();
path133.reset();
path133.moveTo(56, 40);
path133.lineTo(56, 40);
path133.lineTo(58, 40);
path133.lineTo(58, 40);
gBounds = path133.getBounds();
allPaths.add(path133);
}
void pathOps134() {
gBounds = path134.getBounds();
allPaths.add(path134);
}
void pathOps135() {
final Path path135 = Path();
path135.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(81, 0, 331.66666666666663, 84), Radius.zero));
gBounds = path135.getBounds();
allPaths.add(path135);
}
void pathOps136() {
final Path path136 = Path();
path136.reset();
path136.moveTo(331.66666666666663, 86);
path136.lineTo(81, 86);
path136.lineTo(81, 84);
path136.lineTo(331.66666666666663, 84);
gBounds = path136.getBounds();
_runPathTest(path136);
gFillType = path136.fillType;
allPaths.add(path136);
}
void pathOps137() {
gBounds = path137.getBounds();
allPaths.add(path137);
}
void pathOps138() {
final Path path138 = Path();
path138.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(359.66666666666663, 0, 610.3333333333333, 84), Radius.zero));
gBounds = path138.getBounds();
allPaths.add(path138);
}
void pathOps139() {
final Path path139 = Path();
path139.reset();
path139.moveTo(610.3333333333333, 86);
path139.lineTo(359.66666666666663, 86);
path139.lineTo(359.66666666666663, 84);
path139.lineTo(610.3333333333333, 84);
gBounds = path139.getBounds();
_runPathTest(path139);
gFillType = path139.fillType;
allPaths.add(path139);
}
void pathOps140() {
gBounds = path140.getBounds();
allPaths.add(path140);
}
void pathOps141() {
final Path path141 = Path();
path141.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(638.3333333333333, 0, 889, 84), Radius.zero));
gBounds = path141.getBounds();
allPaths.add(path141);
}
void pathOps142() {
final Path path142 = Path();
path142.reset();
path142.moveTo(889, 86);
path142.lineTo(638.3333333333333, 86);
path142.lineTo(638.3333333333333, 84);
path142.lineTo(889, 84);
gBounds = path142.getBounds();
_runPathTest(path142);
gFillType = path142.fillType;
allPaths.add(path142);
}
void pathOps143() {
gBounds = path143.getBounds();
allPaths.add(path143);
}
void pathOps144() {
final Path path144 = Path();
path144.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 136, 970, 1144), Radius.zero));
gBounds = path144.getBounds();
allPaths.add(path144);
}
void pathOps145() {
gBounds = path145.getBounds();
allPaths.add(path145);
}
void pathOps146() {
final Path path146 = Path();
path146.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(450, 136, 970, 696), Radius.zero));
gBounds = path146.getBounds();
allPaths.add(path146);
}
void pathOps147() {
gBounds = path147.getBounds();
allPaths.add(path147);
}
void pathOps149() {
final Path path149 = Path();
path149.reset();
path149.moveTo(-2, 0);
path149.cubicTo(-2, -1.100000023841858, -1.100000023841858, -2, 0, -2);
path149.cubicTo(1.100000023841858, -2, 2, -1.100000023841858, 2, 0);
path149.cubicTo(2, 1.100000023841858, 1.100000023841858, 2, 0, 2);
path149.cubicTo(-1.100000023841858, 2, -2, 1.100000023841858, -2, 0);
allPaths.add(path149);
}
void pathOps150() {
final Path path150 = Path();
path150.reset();
path150.fillType = PathFillType.nonZero;
gBounds = path150.getBounds();
_runPathTest(path150);
gFillType = path150.fillType;
path150.fillType = PathFillType.nonZero;
gBounds = path150.getBounds();
_runPathTest(path150);
gFillType = path150.fillType;
path150.fillType = PathFillType.nonZero;
gBounds = path150.getBounds();
allPaths.add(path150);
}
void pathOps155() {
final Path path155 = Path();
path155.reset();
path155.moveTo(-3, -9);
path155.cubicTo(-3, -10.649999618530273, -1.649999976158142, -12, 0, -12);
path155.cubicTo(0, -12, 0, -12, 0, -12);
path155.cubicTo(1.649999976158142, -12, 3, -10.649999618530273, 3, -9);
path155.cubicTo(3, -9, 3, 9, 3, 9);
path155.cubicTo(3, 10.649999618530273, 1.649999976158142, 12, 0, 12);
path155.cubicTo(0, 12, 0, 12, 0, 12);
path155.cubicTo(-1.649999976158142, 12, -3, 10.649999618530273, -3, 9);
path155.cubicTo(-3, 9, -3, -9, -3, -9);
path155.close();
allPaths.add(path155);
}
void pathOps156() {
final Path path156 = Path();
path156.reset();
path156.fillType = PathFillType.nonZero;
gBounds = path156.getBounds();
_runPathTest(path156);
gFillType = path156.fillType;
path156.fillType = PathFillType.nonZero;
gBounds = path156.getBounds();
_runPathTest(path156);
gFillType = path156.fillType;
path156.fillType = PathFillType.nonZero;
gBounds = path156.getBounds();
allPaths.add(path156);
}
void pathOps161() {
final Path path161 = Path();
path161.reset();
path161.moveTo(-2, -10);
path161.cubicTo(-2, -11.100000381469727, -1.100000023841858, -12, 0, -12);
path161.cubicTo(0, -12, 0, -12, 0, -12);
path161.cubicTo(1.100000023841858, -12, 2, -11.100000381469727, 2, -10);
path161.cubicTo(2, -10, 2, 10, 2, 10);
path161.cubicTo(2, 11.100000381469727, 1.100000023841858, 12, 0, 12);
path161.cubicTo(0, 12, 0, 12, 0, 12);
path161.cubicTo(-1.100000023841858, 12, -2, 11.100000381469727, -2, 10);
path161.cubicTo(-2, 10, -2, -10, -2, -10);
path161.close();
allPaths.add(path161);
}
void pathOps162() {
final Path path162 = Path();
path162.reset();
path162.fillType = PathFillType.nonZero;
gBounds = path162.getBounds();
_runPathTest(path162);
gFillType = path162.fillType;
path162.fillType = PathFillType.nonZero;
gBounds = path162.getBounds();
_runPathTest(path162);
gFillType = path162.fillType;
path162.fillType = PathFillType.nonZero;
gBounds = path162.getBounds();
allPaths.add(path162);
}
void pathOps164() {
final Path path164 = Path();
path164.reset();
path164.moveTo(-3, -9);
path164.cubicTo(-3, -10.649999618530273, -1.649999976158142, -12, 0, -12);
path164.cubicTo(0, -12, 0, -12, 0, -12);
path164.cubicTo(1.649999976158142, -12, 3, -10.649999618530273, 3, -9);
path164.cubicTo(3, -9, 3, 9, 3, 9);
path164.cubicTo(3, 10.649999618530273, 1.649999976158142, 12, 0, 12);
path164.cubicTo(0, 12, 0, 12, 0, 12);
path164.cubicTo(-1.649999976158142, 12, -3, 10.649999618530273, -3, 9);
path164.cubicTo(-3, 9, -3, -9, -3, -9);
path164.close();
allPaths.add(path164);
}
void pathOps165() {
final Path path165 = Path();
path165.reset();
path165.fillType = PathFillType.nonZero;
gBounds = path165.getBounds();
_runPathTest(path165);
gFillType = path165.fillType;
path165.fillType = PathFillType.nonZero;
gBounds = path165.getBounds();
_runPathTest(path165);
gFillType = path165.fillType;
path165.fillType = PathFillType.nonZero;
gBounds = path165.getBounds();
allPaths.add(path165);
}
void pathOps167() {
final Path path167 = Path();
path167.reset();
path167.moveTo(2, 0);
path167.cubicTo(2, 1.1100000143051147, 1.100000023841858, 2, 0, 2);
path167.cubicTo(-1.1100000143051147, 2, -2, 1.1100000143051147, -2, 0);
path167.cubicTo(-2, -1.100000023841858, -1.1100000143051147, -2, 0, -2);
path167.cubicTo(1.100000023841858, -2, 2, -1.100000023841858, 2, 0);
allPaths.add(path167);
}
void pathOps168() {
final Path path168 = Path();
path168.reset();
path168.fillType = PathFillType.nonZero;
gBounds = path168.getBounds();
_runPathTest(path168);
gFillType = path168.fillType;
path168.fillType = PathFillType.nonZero;
gBounds = path168.getBounds();
_runPathTest(path168);
gFillType = path168.fillType;
path168.fillType = PathFillType.nonZero;
gBounds = path168.getBounds();
allPaths.add(path168);
}
void pathOps173() {
final Path path173 = Path();
path173.reset();
path173.moveTo(-2, -10);
path173.cubicTo(-2, -11.100000381469727, -1.100000023841858, -12, 0, -12);
path173.cubicTo(0, -12, 0, -12, 0, -12);
path173.cubicTo(1.100000023841858, -12, 2, -11.100000381469727, 2, -10);
path173.cubicTo(2, -10, 2, 10, 2, 10);
path173.cubicTo(2, 11.100000381469727, 1.100000023841858, 12, 0, 12);
path173.cubicTo(0, 12, 0, 12, 0, 12);
path173.cubicTo(-1.100000023841858, 12, -2, 11.100000381469727, -2, 10);
path173.cubicTo(-2, 10, -2, -10, -2, -10);
path173.close();
allPaths.add(path173);
}
void pathOps174() {
final Path path174 = Path();
path174.reset();
path174.fillType = PathFillType.nonZero;
gBounds = path174.getBounds();
_runPathTest(path174);
gFillType = path174.fillType;
path174.fillType = PathFillType.nonZero;
gBounds = path174.getBounds();
_runPathTest(path174);
gFillType = path174.fillType;
path174.fillType = PathFillType.nonZero;
gBounds = path174.getBounds();
allPaths.add(path174);
}
void pathOps178() {
final Path path178 = Path();
path178.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 0, 250.66666666666669, 105), Radius.zero));
gBounds = path178.getBounds();
allPaths.add(path178);
}
void pathOps179() {
final Path path179 = Path();
path179.reset();
path179.moveTo(234.66666666666669, 105);
path179.lineTo(96, 105);
path179.lineTo(96, 104);
path179.lineTo(234.66666666666669, 104);
gBounds = path179.getBounds();
_runPathTest(path179);
gFillType = path179.fillType;
allPaths.add(path179);
}
void pathOps180() {
final Path path180 = Path();
path180.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 0, 250.66666666666669, 94), Radius.zero));
gBounds = path180.getBounds();
allPaths.add(path180);
}
void pathOps181() {
final Path path181 = Path();
path181.reset();
path181.moveTo(234.66666666666669, 94);
path181.lineTo(96, 94);
path181.lineTo(96, 93);
path181.lineTo(234.66666666666669, 93);
gBounds = path181.getBounds();
_runPathTest(path181);
gFillType = path181.fillType;
allPaths.add(path181);
}
void pathOps182() {
final Path path182 = Path();
path182.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 0, 250.66666666666666, 105), Radius.zero));
gBounds = path182.getBounds();
allPaths.add(path182);
}
void pathOps183() {
final Path path183 = Path();
path183.reset();
path183.moveTo(234.66666666666666, 105);
path183.lineTo(96, 105);
path183.lineTo(96, 104);
path183.lineTo(234.66666666666666, 104);
gBounds = path183.getBounds();
allPaths.add(path183);
}
void pathOps184() {
final Path path184 = Path();
path184.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 0, 250.66666666666666, 105), Radius.zero));
gBounds = path184.getBounds();
allPaths.add(path184);
}
void pathOps185() {
final Path path185 = Path();
path185.reset();
path185.moveTo(234.66666666666666, 105);
path185.lineTo(96, 105);
path185.lineTo(96, 104);
path185.lineTo(234.66666666666666, 104);
gBounds = path185.getBounds();
_runPathTest(path185);
gFillType = path185.fillType;
allPaths.add(path185);
}
void pathOps186() {
final Path path186 = Path();
path186.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 0, 250.66666666666666, 120), Radius.zero));
gBounds = path186.getBounds();
allPaths.add(path186);
}
void pathOps187() {
final Path path187 = Path();
path187.reset();
path187.moveTo(234.66666666666666, 120);
path187.lineTo(96, 120);
path187.lineTo(96, 119);
path187.lineTo(234.66666666666666, 119);
gBounds = path187.getBounds();
_runPathTest(path187);
gFillType = path187.fillType;
allPaths.add(path187);
}
void pathOps188() {
final Path path188 = Path();
path188.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 0, 250.66666666666666, 139), Radius.zero));
gBounds = path188.getBounds();
allPaths.add(path188);
}
void pathOps189() {
final Path path189 = Path();
path189.reset();
path189.moveTo(234.66666666666666, 139);
path189.lineTo(96, 139);
path189.lineTo(96, 138);
path189.lineTo(234.66666666666666, 138);
gBounds = path189.getBounds();
_runPathTest(path189);
gFillType = path189.fillType;
allPaths.add(path189);
}
void pathOps190() {
final Path path190 = Path();
path190.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 0, 250.66666666666666, 75), Radius.zero));
gBounds = path190.getBounds();
allPaths.add(path190);
}
void pathOps191() {
final Path path191 = Path();
path191.reset();
path191.moveTo(234.66666666666666, 75);
path191.lineTo(96, 75);
path191.lineTo(96, 74);
path191.lineTo(234.66666666666666, 74);
gBounds = path191.getBounds();
_runPathTest(path191);
gFillType = path191.fillType;
allPaths.add(path191);
}
void pathOps192() {
final Path path192 = Path();
path192.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 0, 250.66666666666666, 90), Radius.zero));
gBounds = path192.getBounds();
allPaths.add(path192);
}
void pathOps193() {
final Path path193 = Path();
path193.reset();
path193.moveTo(234.66666666666666, 90);
path193.lineTo(96, 90);
path193.lineTo(96, 89);
path193.lineTo(234.66666666666666, 89);
gBounds = path193.getBounds();
allPaths.add(path193);
}
void pathOps194() {
final Path path194 = Path();
path194.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 0, 250.66666666666666, 105), Radius.zero));
allPaths.add(path194);
}
void pathOps195() {
final Path path195 = Path();
path195.reset();
path195.moveTo(234.66666666666666, 105);
path195.lineTo(96, 105);
path195.lineTo(96, 104);
path195.lineTo(234.66666666666666, 104);
gBounds = path195.getBounds();
allPaths.add(path195);
}
void pathOps196() {
final Path path196 = Path();
path196.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 0, 250.66666666666666, 90), Radius.zero));
gBounds = path196.getBounds();
allPaths.add(path196);
}
void pathOps197() {
final Path path197 = Path();
path197.reset();
path197.moveTo(234.66666666666666, 90);
path197.lineTo(96, 90);
path197.lineTo(96, 89);
path197.lineTo(234.66666666666666, 89);
gBounds = path197.getBounds();
_runPathTest(path197);
gFillType = path197.fillType;
allPaths.add(path197);
}
void pathOps198() {
final Path path198 = Path();
path198.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 0, 250.66666666666666, 90), Radius.zero));
gBounds = path198.getBounds();
allPaths.add(path198);
}
void pathOps199() {
final Path path199 = Path();
path199.reset();
path199.moveTo(234.66666666666666, 90);
path199.lineTo(96, 90);
path199.lineTo(96, 89);
path199.lineTo(234.66666666666666, 89);
gBounds = path199.getBounds();
_runPathTest(path199);
gFillType = path199.fillType;
allPaths.add(path199);
}
void pathOps200() {
final Path path200 = Path();
path200.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 0, 250.66666666666666, 90), Radius.zero));
gBounds = path200.getBounds();
allPaths.add(path200);
}
void pathOps201() {
final Path path201 = Path();
path201.reset();
path201.moveTo(234.66666666666666, 90);
path201.lineTo(96, 90);
path201.lineTo(96, 89);
path201.lineTo(234.66666666666666, 89);
gBounds = path201.getBounds();
_runPathTest(path201);
gFillType = path201.fillType;
allPaths.add(path201);
}
void pathOps202() {
final Path path202 = Path();
path202.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 0, 250.66666666666666, 90), Radius.zero));
gBounds = path202.getBounds();
allPaths.add(path202);
}
void pathOps203() {
final Path path203 = Path();
path203.reset();
path203.moveTo(234.66666666666666, 90);
path203.lineTo(96, 90);
path203.lineTo(96, 89);
path203.lineTo(234.66666666666666, 89);
gBounds = path203.getBounds();
_runPathTest(path203);
gFillType = path203.fillType;
allPaths.add(path203);
}
void pathOps204() {
final Path path204 = Path();
path204.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 0, 250.66666666666666, 90), Radius.zero));
gBounds = path204.getBounds();
allPaths.add(path204);
}
void pathOps205() {
final Path path205 = Path();
path205.reset();
path205.moveTo(234.66666666666666, 90);
path205.lineTo(96, 90);
path205.lineTo(96, 89);
path205.lineTo(234.66666666666666, 89);
gBounds = path205.getBounds();
allPaths.add(path205);
}
void pathOps206() {
final Path path206 = Path();
path206.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 0, 250.66666666666669, 90), Radius.zero));
gBounds = path206.getBounds();
allPaths.add(path206);
}
void pathOps207() {
final Path path207 = Path();
path207.reset();
path207.moveTo(234.66666666666669, 90);
path207.lineTo(96, 90);
path207.lineTo(96, 89);
path207.lineTo(234.66666666666669, 89);
gBounds = path207.getBounds();
_runPathTest(path207);
gFillType = path207.fillType;
allPaths.add(path207);
}
void pathOps208() {
gBounds = path208.getBounds();
allPaths.add(path208);
}
void pathOps209() {
gBounds = path209.getBounds();
allPaths.add(path209);
}
void pathOps210() {
gBounds = path210.getBounds();
allPaths.add(path210);
}
void pathOps211() {
gBounds = path211.getBounds();
allPaths.add(path211);
}
void pathOps212() {
final Path path212 = Path();
path212.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 0, 456, 54), const Radius.circular(10)));
gFillType = path212.fillType;
path213 = path212.shift(const Offset(32, 0));
gFillType = path212.fillType;
path290 = path212.shift(const Offset(32, 0));
gFillType = path212.fillType;
path334 = path212.shift(const Offset(32, 0));
gFillType = path212.fillType;
path595 = path212.shift(const Offset(32, 0));
allPaths.add(path212);
}
void pathOps213() {
gBounds = path213.getBounds();
allPaths.add(path213);
}
void pathOps214() {
final Path path214 = Path();
path214.reset();
path214.moveTo(56, 42);
path214.lineTo(56, 42);
path214.lineTo(58, 42);
path214.lineTo(58, 42);
gBounds = path214.getBounds();
allPaths.add(path214);
}
void pathOps215() {
final Path path215 = Path();
path215.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 0, 456, 54), const Radius.circular(10)));
gFillType = path215.fillType;
path216 = path215.shift(const Offset(32, 0));
gFillType = path215.fillType;
path288 = path215.shift(const Offset(32, 0));
gFillType = path215.fillType;
path336 = path215.shift(const Offset(32, 0));
gFillType = path215.fillType;
path597 = path215.shift(const Offset(32, 0));
allPaths.add(path215);
}
void pathOps216() {
gBounds = path216.getBounds();
allPaths.add(path216);
}
void pathOps217() {
final Path path217 = Path();
path217.reset();
path217.moveTo(56, 42);
path217.lineTo(56, 42);
path217.lineTo(58, 42);
path217.lineTo(58, 42);
gBounds = path217.getBounds();
allPaths.add(path217);
}
void pathOps218() {
final Path path218 = Path();
path218.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 0, 456, 54), const Radius.circular(10)));
gFillType = path218.fillType;
path219 = path218.shift(const Offset(32, 0));
gFillType = path218.fillType;
path286 = path218.shift(const Offset(32, 0));
gFillType = path218.fillType;
path338 = path218.shift(const Offset(32, 0));
gFillType = path218.fillType;
path599 = path218.shift(const Offset(32, 0));
allPaths.add(path218);
}
void pathOps219() {
gBounds = path219.getBounds();
allPaths.add(path219);
}
void pathOps220() {
final Path path220 = Path();
path220.reset();
path220.moveTo(56, 42);
path220.lineTo(56, 42);
path220.lineTo(58, 42);
path220.lineTo(58, 42);
gBounds = path220.getBounds();
allPaths.add(path220);
}
void pathOps221() {
final Path path221 = Path();
path221.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 0, 456, 54), const Radius.circular(10)));
gFillType = path221.fillType;
path222 = path221.shift(const Offset(32, 0));
gFillType = path221.fillType;
path284 = path221.shift(const Offset(32, 0));
gFillType = path221.fillType;
path340 = path221.shift(const Offset(32, 0));
gFillType = path221.fillType;
path601 = path221.shift(const Offset(32, 0));
allPaths.add(path221);
}
void pathOps222() {
gBounds = path222.getBounds();
allPaths.add(path222);
}
void pathOps223() {
final Path path223 = Path();
path223.reset();
path223.moveTo(56, 42);
path223.lineTo(56, 42);
path223.lineTo(58, 42);
path223.lineTo(58, 42);
gBounds = path223.getBounds();
allPaths.add(path223);
}
void pathOps224() {
final Path path224 = Path();
path224.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 0, 456, 51), const Radius.circular(10)));
gFillType = path224.fillType;
path225 = path224.shift(const Offset(32, 0));
gFillType = path224.fillType;
path281 = path224.shift(const Offset(32, 0));
gFillType = path224.fillType;
path344 = path224.shift(const Offset(32, 0));
allPaths.add(path224);
}
void pathOps225() {
gBounds = path225.getBounds();
allPaths.add(path225);
}
void pathOps226() {
final Path path226 = Path();
path226.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 0, 456, 54), const Radius.circular(10)));
gFillType = path226.fillType;
path227 = path226.shift(const Offset(32, 0));
gFillType = path226.fillType;
path282 = path226.shift(const Offset(32, 0));
gFillType = path226.fillType;
path342 = path226.shift(const Offset(32, 0));
gFillType = path226.fillType;
path603 = path226.shift(const Offset(32, 0));
allPaths.add(path226);
}
void pathOps227() {
gBounds = path227.getBounds();
allPaths.add(path227);
}
void pathOps228() {
final Path path228 = Path();
path228.reset();
path228.moveTo(56, 42);
path228.lineTo(56, 42);
path228.lineTo(58, 42);
path228.lineTo(58, 42);
gBounds = path228.getBounds();
allPaths.add(path228);
}
void pathOps229() {
gBounds = path229.getBounds();
allPaths.add(path229);
}
void pathOps230() {
final Path path230 = Path();
path230.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(81, 0, 331.66666666666663, 84), Radius.zero));
gBounds = path230.getBounds();
allPaths.add(path230);
}
void pathOps231() {
final Path path231 = Path();
path231.reset();
path231.moveTo(331.66666666666663, 86);
path231.lineTo(81, 86);
path231.lineTo(81, 84);
path231.lineTo(331.66666666666663, 84);
gBounds = path231.getBounds();
_runPathTest(path231);
gFillType = path231.fillType;
allPaths.add(path231);
}
void pathOps232() {
gBounds = path232.getBounds();
allPaths.add(path232);
}
void pathOps233() {
final Path path233 = Path();
path233.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(359.66666666666663, 0, 610.3333333333333, 84), Radius.zero));
gBounds = path233.getBounds();
allPaths.add(path233);
}
void pathOps234() {
final Path path234 = Path();
path234.reset();
path234.moveTo(610.3333333333333, 86);
path234.lineTo(359.66666666666663, 86);
path234.lineTo(359.66666666666663, 84);
path234.lineTo(610.3333333333333, 84);
gBounds = path234.getBounds();
_runPathTest(path234);
gFillType = path234.fillType;
allPaths.add(path234);
}
void pathOps235() {
gBounds = path235.getBounds();
allPaths.add(path235);
}
void pathOps236() {
final Path path236 = Path();
path236.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(638.3333333333333, 0, 889, 84), Radius.zero));
gBounds = path236.getBounds();
allPaths.add(path236);
}
void pathOps237() {
final Path path237 = Path();
path237.reset();
path237.moveTo(889, 86);
path237.lineTo(638.3333333333333, 86);
path237.lineTo(638.3333333333333, 84);
path237.lineTo(889, 84);
gBounds = path237.getBounds();
_runPathTest(path237);
gFillType = path237.fillType;
allPaths.add(path237);
}
void pathOps238() {
gBounds = path238.getBounds();
allPaths.add(path238);
}
void pathOps239() {
final Path path239 = Path();
path239.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 136, 970, 1144), Radius.zero));
gBounds = path239.getBounds();
gBounds = path239.getBounds();
gBounds = path239.getBounds();
allPaths.add(path239);
}
void pathOps240() {
gBounds = path240.getBounds();
gBounds = path240.getBounds();
gBounds = path240.getBounds();
allPaths.add(path240);
}
void pathOps241() {
final Path path241 = Path();
path241.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(450, 136, 970, 696), Radius.zero));
gBounds = path241.getBounds();
gBounds = path241.getBounds();
gBounds = path241.getBounds();
allPaths.add(path241);
}
void pathOps242() {
gBounds = path242.getBounds();
allPaths.add(path242);
}
void pathOps243() {
final Path path243 = Path();
path243.moveTo(-3.0000008960834634, -8.999999251003146);
path243.cubicTo(-3.0000008960834634, -10.64999886953342, -1.6500008722416055, -11.999999251003146, -8.960834634308412e-7, -11.999999251003146);
path243.cubicTo(-8.960834634308412e-7, -11.999999251003146, -8.960834634308412e-7, -11.999999251003146, -8.960834634308412e-7, -11.999999251003146);
path243.cubicTo(1.6499990800746787, -11.999999251003146, 2.9999991039165366, -10.64999886953342, 2.9999991039165366, -8.999999251003146);
path243.cubicTo(2.9999991039165366, -8.999999251003146, 2.9999991039165366, 9.000000748996854, 2.9999991039165366, 9.000000748996854);
path243.cubicTo(2.9999991039165366, 10.650000367527127, 1.6499990800746787, 12.000000748996854, -8.960834634308412e-7, 12.000000748996854);
path243.cubicTo(-8.960834634308412e-7, 12.000000748996854, -8.960834634308412e-7, 12.000000748996854, -8.960834634308412e-7, 12.000000748996854);
path243.cubicTo(-1.6500008722416055, 12.000000748996854, -3.0000008960834634, 10.650000367527127, -3.0000008960834634, 9.000000748996854);
path243.cubicTo(-3.0000008960834634, 9.000000748996854, -3.0000008960834634, -8.999999251003146, -3.0000008960834634, -8.999999251003146);
path243.close();
allPaths.add(path243);
}
void pathOps244() {
final Path path244 = Path();
path244.moveTo(-2.0000008960834634, -9.999999251003146);
path244.cubicTo(-2.0000008960834634, -11.099999632472873, -1.1000009199253213, -11.999999251003146, -8.960834634308412e-7, -11.999999251003146);
path244.cubicTo(-8.960834634308412e-7, -11.999999251003146, -8.960834634308412e-7, -11.999999251003146, -8.960834634308412e-7, -11.999999251003146);
path244.cubicTo(1.0999991277583945, -11.999999251003146, 1.9999991039165366, -11.099999632472873, 1.9999991039165366, -9.999999251003146);
path244.cubicTo(1.9999991039165366, -9.999999251003146, 1.9999991039165366, 10.000000748996854, 1.9999991039165366, 10.000000748996854);
path244.cubicTo(1.9999991039165366, 11.10000113046658, 1.0999991277583945, 12.000000748996854, -8.960834634308412e-7, 12.000000748996854);
path244.cubicTo(-8.960834634308412e-7, 12.000000748996854, -8.960834634308412e-7, 12.000000748996854, -8.960834634308412e-7, 12.000000748996854);
path244.cubicTo(-1.1000009199253213, 12.000000748996854, -2.0000008960834634, 11.10000113046658, -2.0000008960834634, 10.000000748996854);
path244.cubicTo(-2.0000008960834634, 10.000000748996854, -2.0000008960834634, -9.999999251003146, -2.0000008960834634, -9.999999251003146);
path244.close();
allPaths.add(path244);
}
void pathOps245() {
final Path path245 = Path();
path245.moveTo(2.0000006178626677, 7.489968538720859e-7);
path245.cubicTo(2.0000006178626677, 1.1100007633019686, 1.1000006417045256, 2.000000748996854, 6.178626676955901e-7, 2.000000748996854);
path245.cubicTo(-1.109999396442447, 2.000000748996854, -1.9999993821373323, 1.1100007633019686, -1.9999993821373323, 7.489968538720859e-7);
path245.cubicTo(-1.9999993821373323, -1.099999274845004, -1.109999396442447, -1.9999992510031461, 6.178626676955901e-7, -1.9999992510031461);
path245.cubicTo(1.1000006417045256, -1.9999992510031461, 2.0000006178626677, -1.099999274845004, 2.0000006178626677, 7.489968538720859e-7);
allPaths.add(path245);
}
void pathOps246() {
final Path path246 = Path();
path246.moveTo(-3.0000008960834634, -9.000000721237882);
path246.cubicTo(-3.0000008960834634, -10.650000339768155, -1.6500008722416055, -12.000000721237882, -8.960834634308412e-7, -12.000000721237882);
path246.cubicTo(-8.960834634308412e-7, -12.000000721237882, -8.960834634308412e-7, -12.000000721237882, -8.960834634308412e-7, -12.000000721237882);
path246.cubicTo(1.6499990800746787, -12.000000721237882, 2.9999991039165366, -10.650000339768155, 2.9999991039165366, -9.000000721237882);
path246.cubicTo(2.9999991039165366, -9.000000721237882, 2.9999991039165366, 8.999999278762118, 2.9999991039165366, 8.999999278762118);
path246.cubicTo(2.9999991039165366, 10.649998897292392, 1.6499990800746787, 11.999999278762118, -8.960834634308412e-7, 11.999999278762118);
path246.cubicTo(-8.960834634308412e-7, 11.999999278762118, -8.960834634308412e-7, 11.999999278762118, -8.960834634308412e-7, 11.999999278762118);
path246.cubicTo(-1.6500008722416055, 11.999999278762118, -3.0000008960834634, 10.649998897292392, -3.0000008960834634, 8.999999278762118);
path246.cubicTo(-3.0000008960834634, 8.999999278762118, -3.0000008960834634, -9.000000721237882, -3.0000008960834634, -9.000000721237882);
path246.close();
allPaths.add(path246);
}
void pathOps247() {
final Path path247 = Path();
path247.moveTo(-2.0000008960834634, -10.000000721237882);
path247.cubicTo(-2.0000008960834634, -11.100001102707608, -1.1000009199253213, -12.000000721237882, -8.960834634308412e-7, -12.000000721237882);
path247.cubicTo(-8.960834634308412e-7, -12.000000721237882, -8.960834634308412e-7, -12.000000721237882, -8.960834634308412e-7, -12.000000721237882);
path247.cubicTo(1.0999991277583945, -12.000000721237882, 1.9999991039165366, -11.100001102707608, 1.9999991039165366, -10.000000721237882);
path247.cubicTo(1.9999991039165366, -10.000000721237882, 1.9999991039165366, 9.999999278762118, 1.9999991039165366, 9.999999278762118);
path247.cubicTo(1.9999991039165366, 11.099999660231845, 1.0999991277583945, 11.999999278762118, -8.960834634308412e-7, 11.999999278762118);
path247.cubicTo(-8.960834634308412e-7, 11.999999278762118, -8.960834634308412e-7, 11.999999278762118, -8.960834634308412e-7, 11.999999278762118);
path247.cubicTo(-1.1000009199253213, 11.999999278762118, -2.0000008960834634, 11.099999660231845, -2.0000008960834634, 9.999999278762118);
path247.cubicTo(-2.0000008960834634, 9.999999278762118, -2.0000008960834634, -10.000000721237882, -2.0000008960834634, -10.000000721237882);
path247.close();
allPaths.add(path247);
}
void pathOps248() {
final Path path248 = Path();
path248.moveTo(-2.0000005026809617, 2.324364061223605e-7);
path248.cubicTo(-2.0000005026809617, -1.0999997914054518, -1.1000005265228197, -1.9999997675635939, -5.026809617447725e-7, -1.9999997675635939);
path248.cubicTo(1.0999995211608962, -1.9999997675635939, 1.9999994973190383, -1.0999997914054518, 1.9999994973190383, 2.324364061223605e-7);
path248.cubicTo(1.9999994973190383, 1.100000256278264, 1.0999995211608962, 2.000000232436406, -5.026809617447725e-7, 2.000000232436406);
path248.cubicTo(-1.1000005265228197, 2.000000232436406, -2.0000005026809617, 1.100000256278264, -2.0000005026809617, 2.324364061223605e-7);
allPaths.add(path248);
}
void pathOps249() {
final Path path249 = Path();
path249.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 0, 250.66666666666666, 90), Radius.zero));
gBounds = path249.getBounds();
allPaths.add(path249);
}
void pathOps250() {
final Path path250 = Path();
path250.reset();
path250.moveTo(234.66666666666666, 90);
path250.lineTo(96, 90);
path250.lineTo(96, 89);
path250.lineTo(234.66666666666666, 89);
gBounds = path250.getBounds();
allPaths.add(path250);
}
void pathOps251() {
final Path path251 = Path();
path251.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 0, 250.66666666666669, 105), Radius.zero));
gBounds = path251.getBounds();
allPaths.add(path251);
}
void pathOps252() {
final Path path252 = Path();
path252.reset();
path252.moveTo(234.66666666666669, 105);
path252.lineTo(96, 105);
path252.lineTo(96, 104);
path252.lineTo(234.66666666666669, 104);
gBounds = path252.getBounds();
_runPathTest(path252);
gFillType = path252.fillType;
allPaths.add(path252);
}
void pathOps253() {
final Path path253 = Path();
path253.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 0, 250.66666666666669, 90), Radius.zero));
gBounds = path253.getBounds();
allPaths.add(path253);
}
void pathOps254() {
final Path path254 = Path();
path254.reset();
path254.moveTo(234.66666666666669, 90);
path254.lineTo(96, 90);
path254.lineTo(96, 89);
path254.lineTo(234.66666666666669, 89);
gBounds = path254.getBounds();
_runPathTest(path254);
gFillType = path254.fillType;
allPaths.add(path254);
}
void pathOps255() {
final Path path255 = Path();
path255.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 0, 250.66666666666666, 90), Radius.zero));
gBounds = path255.getBounds();
allPaths.add(path255);
}
void pathOps256() {
final Path path256 = Path();
path256.reset();
path256.moveTo(234.66666666666666, 90);
path256.lineTo(96, 90);
path256.lineTo(96, 89);
path256.lineTo(234.66666666666666, 89);
gBounds = path256.getBounds();
allPaths.add(path256);
}
void pathOps257() {
final Path path257 = Path();
path257.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 0, 250.66666666666666, 90), Radius.zero));
gBounds = path257.getBounds();
allPaths.add(path257);
}
void pathOps258() {
final Path path258 = Path();
path258.reset();
path258.moveTo(234.66666666666666, 90);
path258.lineTo(96, 90);
path258.lineTo(96, 89);
path258.lineTo(234.66666666666666, 89);
gBounds = path258.getBounds();
_runPathTest(path258);
gFillType = path258.fillType;
allPaths.add(path258);
}
void pathOps259() {
final Path path259 = Path();
path259.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 0, 250.66666666666666, 105), Radius.zero));
gBounds = path259.getBounds();
allPaths.add(path259);
}
void pathOps260() {
final Path path260 = Path();
path260.reset();
path260.moveTo(234.66666666666666, 105);
path260.lineTo(96, 105);
path260.lineTo(96, 104);
path260.lineTo(234.66666666666666, 104);
gBounds = path260.getBounds();
_runPathTest(path260);
gFillType = path260.fillType;
allPaths.add(path260);
}
void pathOps261() {
final Path path261 = Path();
path261.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 0, 250.66666666666666, 90), Radius.zero));
gBounds = path261.getBounds();
allPaths.add(path261);
}
void pathOps262() {
final Path path262 = Path();
path262.reset();
path262.moveTo(234.66666666666666, 90);
path262.lineTo(96, 90);
path262.lineTo(96, 89);
path262.lineTo(234.66666666666666, 89);
gBounds = path262.getBounds();
_runPathTest(path262);
gFillType = path262.fillType;
allPaths.add(path262);
}
void pathOps263() {
final Path path263 = Path();
path263.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 0, 250.66666666666666, 90), Radius.zero));
gBounds = path263.getBounds();
allPaths.add(path263);
}
void pathOps264() {
final Path path264 = Path();
path264.reset();
path264.moveTo(234.66666666666666, 90);
path264.lineTo(96, 90);
path264.lineTo(96, 89);
path264.lineTo(234.66666666666666, 89);
gBounds = path264.getBounds();
_runPathTest(path264);
gFillType = path264.fillType;
allPaths.add(path264);
}
void pathOps265() {
final Path path265 = Path();
path265.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 0, 250.66666666666666, 90), Radius.zero));
gBounds = path265.getBounds();
allPaths.add(path265);
}
void pathOps266() {
final Path path266 = Path();
path266.reset();
path266.moveTo(234.66666666666666, 90);
path266.lineTo(96, 90);
path266.lineTo(96, 89);
path266.lineTo(234.66666666666666, 89);
gBounds = path266.getBounds();
_runPathTest(path266);
gFillType = path266.fillType;
allPaths.add(path266);
}
void pathOps267() {
final Path path267 = Path();
path267.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 0, 250.66666666666666, 75), Radius.zero));
gBounds = path267.getBounds();
allPaths.add(path267);
}
void pathOps268() {
final Path path268 = Path();
path268.reset();
path268.moveTo(234.66666666666666, 75);
path268.lineTo(96, 75);
path268.lineTo(96, 74);
path268.lineTo(234.66666666666666, 74);
gBounds = path268.getBounds();
_runPathTest(path268);
gFillType = path268.fillType;
allPaths.add(path268);
}
void pathOps269() {
final Path path269 = Path();
path269.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 0, 250.66666666666666, 105), Radius.zero));
gBounds = path269.getBounds();
allPaths.add(path269);
}
void pathOps270() {
final Path path270 = Path();
path270.reset();
path270.moveTo(234.66666666666666, 105);
path270.lineTo(96, 105);
path270.lineTo(96, 104);
path270.lineTo(234.66666666666666, 104);
gBounds = path270.getBounds();
allPaths.add(path270);
}
void pathOps271() {
final Path path271 = Path();
path271.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 0, 250.66666666666666, 139), Radius.zero));
gBounds = path271.getBounds();
allPaths.add(path271);
}
void pathOps272() {
final Path path272 = Path();
path272.reset();
path272.moveTo(234.66666666666666, 139);
path272.lineTo(96, 139);
path272.lineTo(96, 138);
path272.lineTo(234.66666666666666, 138);
gBounds = path272.getBounds();
_runPathTest(path272);
gFillType = path272.fillType;
allPaths.add(path272);
}
void pathOps273() {
final Path path273 = Path();
path273.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 0, 250.66666666666666, 120), Radius.zero));
gBounds = path273.getBounds();
allPaths.add(path273);
}
void pathOps274() {
final Path path274 = Path();
path274.reset();
path274.moveTo(234.66666666666666, 120);
path274.lineTo(96, 120);
path274.lineTo(96, 119);
path274.lineTo(234.66666666666666, 119);
gBounds = path274.getBounds();
_runPathTest(path274);
gFillType = path274.fillType;
allPaths.add(path274);
}
void pathOps275() {
final Path path275 = Path();
path275.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 0, 250.66666666666669, 94), Radius.zero));
gBounds = path275.getBounds();
allPaths.add(path275);
}
void pathOps276() {
final Path path276 = Path();
path276.reset();
path276.moveTo(234.66666666666669, 94);
path276.lineTo(96, 94);
path276.lineTo(96, 93);
path276.lineTo(234.66666666666669, 93);
gBounds = path276.getBounds();
_runPathTest(path276);
gFillType = path276.fillType;
allPaths.add(path276);
}
void pathOps277() {
gBounds = path277.getBounds();
allPaths.add(path277);
}
void pathOps278() {
gBounds = path278.getBounds();
allPaths.add(path278);
}
void pathOps279() {
gBounds = path279.getBounds();
allPaths.add(path279);
}
void pathOps280() {
gBounds = path280.getBounds();
allPaths.add(path280);
}
void pathOps281() {
gBounds = path281.getBounds();
allPaths.add(path281);
}
void pathOps282() {
gBounds = path282.getBounds();
allPaths.add(path282);
}
void pathOps283() {
final Path path283 = Path();
path283.reset();
path283.moveTo(56, 42);
path283.lineTo(56, 42);
path283.lineTo(58, 42);
path283.lineTo(58, 42);
gBounds = path283.getBounds();
allPaths.add(path283);
}
void pathOps284() {
gBounds = path284.getBounds();
allPaths.add(path284);
}
void pathOps285() {
final Path path285 = Path();
path285.reset();
path285.moveTo(56, 42);
path285.lineTo(56, 42);
path285.lineTo(58, 42);
path285.lineTo(58, 42);
gBounds = path285.getBounds();
allPaths.add(path285);
}
void pathOps286() {
gBounds = path286.getBounds();
allPaths.add(path286);
}
void pathOps287() {
final Path path287 = Path();
path287.reset();
path287.moveTo(56, 42);
path287.lineTo(56, 42);
path287.lineTo(58, 42);
path287.lineTo(58, 42);
gBounds = path287.getBounds();
allPaths.add(path287);
}
void pathOps288() {
gBounds = path288.getBounds();
allPaths.add(path288);
}
void pathOps289() {
final Path path289 = Path();
path289.reset();
path289.moveTo(56, 42);
path289.lineTo(56, 42);
path289.lineTo(58, 42);
path289.lineTo(58, 42);
gBounds = path289.getBounds();
allPaths.add(path289);
}
void pathOps290() {
gBounds = path290.getBounds();
allPaths.add(path290);
}
void pathOps291() {
final Path path291 = Path();
path291.reset();
path291.moveTo(56, 42);
path291.lineTo(56, 42);
path291.lineTo(58, 42);
path291.lineTo(58, 42);
gBounds = path291.getBounds();
allPaths.add(path291);
}
void pathOps292() {
gBounds = path292.getBounds();
allPaths.add(path292);
}
void pathOps293() {
final Path path293 = Path();
path293.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(81, 0, 331.66666666666663, 84), Radius.zero));
gBounds = path293.getBounds();
allPaths.add(path293);
}
void pathOps294() {
final Path path294 = Path();
path294.reset();
path294.moveTo(331.66666666666663, 86);
path294.lineTo(81, 86);
path294.lineTo(81, 84);
path294.lineTo(331.66666666666663, 84);
gBounds = path294.getBounds();
_runPathTest(path294);
gFillType = path294.fillType;
allPaths.add(path294);
}
void pathOps295() {
gBounds = path295.getBounds();
allPaths.add(path295);
}
void pathOps296() {
final Path path296 = Path();
path296.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(359.66666666666663, 0, 610.3333333333333, 84), Radius.zero));
gBounds = path296.getBounds();
allPaths.add(path296);
}
void pathOps297() {
final Path path297 = Path();
path297.reset();
path297.moveTo(610.3333333333333, 86);
path297.lineTo(359.66666666666663, 86);
path297.lineTo(359.66666666666663, 84);
path297.lineTo(610.3333333333333, 84);
gBounds = path297.getBounds();
_runPathTest(path297);
gFillType = path297.fillType;
allPaths.add(path297);
}
void pathOps298() {
gBounds = path298.getBounds();
allPaths.add(path298);
}
void pathOps299() {
final Path path299 = Path();
path299.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(638.3333333333333, 0, 889, 84), Radius.zero));
gBounds = path299.getBounds();
allPaths.add(path299);
}
void pathOps300() {
final Path path300 = Path();
path300.reset();
path300.moveTo(889, 86);
path300.lineTo(638.3333333333333, 86);
path300.lineTo(638.3333333333333, 84);
path300.lineTo(889, 84);
gBounds = path300.getBounds();
_runPathTest(path300);
gFillType = path300.fillType;
allPaths.add(path300);
}
void pathOps301() {
gBounds = path301.getBounds();
allPaths.add(path301);
}
void pathOps302() {
final Path path302 = Path();
path302.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 0, 250.66666666666669, 94), Radius.zero));
gBounds = path302.getBounds();
allPaths.add(path302);
}
void pathOps303() {
final Path path303 = Path();
path303.reset();
path303.moveTo(234.66666666666669, 94);
path303.lineTo(96, 94);
path303.lineTo(96, 93);
path303.lineTo(234.66666666666669, 93);
gBounds = path303.getBounds();
_runPathTest(path303);
gFillType = path303.fillType;
allPaths.add(path303);
}
void pathOps304() {
final Path path304 = Path();
path304.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 0, 250.66666666666666, 105), Radius.zero));
gBounds = path304.getBounds();
allPaths.add(path304);
}
void pathOps305() {
final Path path305 = Path();
path305.reset();
path305.moveTo(234.66666666666666, 105);
path305.lineTo(96, 105);
path305.lineTo(96, 104);
path305.lineTo(234.66666666666666, 104);
gBounds = path305.getBounds();
allPaths.add(path305);
}
void pathOps306() {
final Path path306 = Path();
path306.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 0, 250.66666666666669, 105), Radius.zero));
gBounds = path306.getBounds();
allPaths.add(path306);
}
void pathOps307() {
final Path path307 = Path();
path307.reset();
path307.moveTo(234.66666666666669, 105);
path307.lineTo(96, 105);
path307.lineTo(96, 104);
path307.lineTo(234.66666666666669, 104);
gBounds = path307.getBounds();
_runPathTest(path307);
gFillType = path307.fillType;
allPaths.add(path307);
}
void pathOps308() {
final Path path308 = Path();
path308.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 0, 250.66666666666666, 105), Radius.zero));
gBounds = path308.getBounds();
allPaths.add(path308);
}
void pathOps309() {
final Path path309 = Path();
path309.reset();
path309.moveTo(234.66666666666666, 105);
path309.lineTo(96, 105);
path309.lineTo(96, 104);
path309.lineTo(234.66666666666666, 104);
gBounds = path309.getBounds();
_runPathTest(path309);
gFillType = path309.fillType;
allPaths.add(path309);
}
void pathOps310() {
final Path path310 = Path();
path310.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 0, 250.66666666666666, 120), Radius.zero));
gBounds = path310.getBounds();
allPaths.add(path310);
}
void pathOps311() {
final Path path311 = Path();
path311.reset();
path311.moveTo(234.66666666666666, 120);
path311.lineTo(96, 120);
path311.lineTo(96, 119);
path311.lineTo(234.66666666666666, 119);
gBounds = path311.getBounds();
_runPathTest(path311);
gFillType = path311.fillType;
allPaths.add(path311);
}
void pathOps312() {
final Path path312 = Path();
path312.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 0, 250.66666666666666, 139), Radius.zero));
gBounds = path312.getBounds();
allPaths.add(path312);
}
void pathOps313() {
final Path path313 = Path();
path313.reset();
path313.moveTo(234.66666666666666, 139);
path313.lineTo(96, 139);
path313.lineTo(96, 138);
path313.lineTo(234.66666666666666, 138);
gBounds = path313.getBounds();
_runPathTest(path313);
gFillType = path313.fillType;
allPaths.add(path313);
}
void pathOps314() {
final Path path314 = Path();
path314.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 0, 250.66666666666666, 75), Radius.zero));
gBounds = path314.getBounds();
allPaths.add(path314);
}
void pathOps315() {
final Path path315 = Path();
path315.reset();
path315.moveTo(234.66666666666666, 75);
path315.lineTo(96, 75);
path315.lineTo(96, 74);
path315.lineTo(234.66666666666666, 74);
gBounds = path315.getBounds();
_runPathTest(path315);
gFillType = path315.fillType;
allPaths.add(path315);
}
void pathOps316() {
final Path path316 = Path();
path316.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 0, 250.66666666666666, 90), Radius.zero));
gBounds = path316.getBounds();
allPaths.add(path316);
}
void pathOps317() {
final Path path317 = Path();
path317.reset();
path317.moveTo(234.66666666666666, 90);
path317.lineTo(96, 90);
path317.lineTo(96, 89);
path317.lineTo(234.66666666666666, 89);
gBounds = path317.getBounds();
allPaths.add(path317);
}
void pathOps318() {
final Path path318 = Path();
path318.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 0, 250.66666666666666, 90), Radius.zero));
gBounds = path318.getBounds();
allPaths.add(path318);
}
void pathOps319() {
final Path path319 = Path();
path319.reset();
path319.moveTo(234.66666666666666, 90);
path319.lineTo(96, 90);
path319.lineTo(96, 89);
path319.lineTo(234.66666666666666, 89);
gBounds = path319.getBounds();
_runPathTest(path319);
gFillType = path319.fillType;
allPaths.add(path319);
}
void pathOps320() {
final Path path320 = Path();
path320.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 0, 250.66666666666666, 90), Radius.zero));
gBounds = path320.getBounds();
allPaths.add(path320);
}
void pathOps321() {
final Path path321 = Path();
path321.reset();
path321.moveTo(234.66666666666666, 90);
path321.lineTo(96, 90);
path321.lineTo(96, 89);
path321.lineTo(234.66666666666666, 89);
gBounds = path321.getBounds();
_runPathTest(path321);
gFillType = path321.fillType;
allPaths.add(path321);
}
void pathOps322() {
final Path path322 = Path();
path322.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 0, 250.66666666666666, 90), Radius.zero));
gBounds = path322.getBounds();
allPaths.add(path322);
}
void pathOps323() {
final Path path323 = Path();
path323.reset();
path323.moveTo(234.66666666666666, 90);
path323.lineTo(96, 90);
path323.lineTo(96, 89);
path323.lineTo(234.66666666666666, 89);
gBounds = path323.getBounds();
_runPathTest(path323);
gFillType = path323.fillType;
allPaths.add(path323);
}
void pathOps324() {
final Path path324 = Path();
path324.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 0, 250.66666666666666, 90), Radius.zero));
gBounds = path324.getBounds();
allPaths.add(path324);
}
void pathOps325() {
final Path path325 = Path();
path325.reset();
path325.moveTo(234.66666666666666, 90);
path325.lineTo(96, 90);
path325.lineTo(96, 89);
path325.lineTo(234.66666666666666, 89);
gBounds = path325.getBounds();
_runPathTest(path325);
gFillType = path325.fillType;
allPaths.add(path325);
}
void pathOps326() {
final Path path326 = Path();
path326.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 0, 250.66666666666666, 90), Radius.zero));
gBounds = path326.getBounds();
allPaths.add(path326);
}
void pathOps327() {
final Path path327 = Path();
path327.reset();
path327.moveTo(234.66666666666666, 90);
path327.lineTo(96, 90);
path327.lineTo(96, 89);
path327.lineTo(234.66666666666666, 89);
gBounds = path327.getBounds();
allPaths.add(path327);
}
void pathOps328() {
final Path path328 = Path();
path328.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 0, 250.66666666666669, 90), Radius.zero));
gBounds = path328.getBounds();
allPaths.add(path328);
}
void pathOps329() {
final Path path329 = Path();
path329.reset();
path329.moveTo(234.66666666666669, 90);
path329.lineTo(96, 90);
path329.lineTo(96, 89);
path329.lineTo(234.66666666666669, 89);
gBounds = path329.getBounds();
_runPathTest(path329);
gFillType = path329.fillType;
allPaths.add(path329);
}
void pathOps330() {
gBounds = path330.getBounds();
allPaths.add(path330);
}
void pathOps331() {
gBounds = path331.getBounds();
allPaths.add(path331);
}
void pathOps332() {
gBounds = path332.getBounds();
allPaths.add(path332);
}
void pathOps333() {
gBounds = path333.getBounds();
allPaths.add(path333);
}
void pathOps334() {
gBounds = path334.getBounds();
allPaths.add(path334);
}
void pathOps335() {
final Path path335 = Path();
path335.reset();
path335.moveTo(56, 42);
path335.lineTo(56, 42);
path335.lineTo(58, 42);
path335.lineTo(58, 42);
gBounds = path335.getBounds();
allPaths.add(path335);
}
void pathOps336() {
gBounds = path336.getBounds();
allPaths.add(path336);
}
void pathOps337() {
final Path path337 = Path();
path337.reset();
path337.moveTo(56, 42);
path337.lineTo(56, 42);
path337.lineTo(58, 42);
path337.lineTo(58, 42);
gBounds = path337.getBounds();
allPaths.add(path337);
}
void pathOps338() {
gBounds = path338.getBounds();
allPaths.add(path338);
}
void pathOps339() {
final Path path339 = Path();
path339.reset();
path339.moveTo(56, 42);
path339.lineTo(56, 42);
path339.lineTo(58, 42);
path339.lineTo(58, 42);
gBounds = path339.getBounds();
allPaths.add(path339);
}
void pathOps340() {
gBounds = path340.getBounds();
allPaths.add(path340);
}
void pathOps341() {
final Path path341 = Path();
path341.reset();
path341.moveTo(56, 42);
path341.lineTo(56, 42);
path341.lineTo(58, 42);
path341.lineTo(58, 42);
gBounds = path341.getBounds();
allPaths.add(path341);
}
void pathOps342() {
gBounds = path342.getBounds();
allPaths.add(path342);
}
void pathOps343() {
final Path path343 = Path();
path343.reset();
path343.moveTo(56, 42);
path343.lineTo(56, 42);
path343.lineTo(58, 42);
path343.lineTo(58, 42);
gBounds = path343.getBounds();
allPaths.add(path343);
}
void pathOps344() {
gBounds = path344.getBounds();
allPaths.add(path344);
}
void pathOps345() {
gBounds = path345.getBounds();
allPaths.add(path345);
}
void pathOps346() {
gBounds = path346.getBounds();
allPaths.add(path346);
}
void pathOps347() {
final Path path347 = Path();
path347.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(81, 0, 331.66666666666663, 84), Radius.zero));
gBounds = path347.getBounds();
allPaths.add(path347);
}
void pathOps348() {
final Path path348 = Path();
path348.reset();
path348.moveTo(331.66666666666663, 86);
path348.lineTo(81, 86);
path348.lineTo(81, 84);
path348.lineTo(331.66666666666663, 84);
gBounds = path348.getBounds();
_runPathTest(path348);
gFillType = path348.fillType;
allPaths.add(path348);
}
void pathOps349() {
gBounds = path349.getBounds();
allPaths.add(path349);
}
void pathOps350() {
final Path path350 = Path();
path350.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(359.66666666666663, 0, 610.3333333333333, 84), Radius.zero));
gBounds = path350.getBounds();
allPaths.add(path350);
}
void pathOps351() {
final Path path351 = Path();
path351.reset();
path351.moveTo(610.3333333333333, 86);
path351.lineTo(359.66666666666663, 86);
path351.lineTo(359.66666666666663, 84);
path351.lineTo(610.3333333333333, 84);
gBounds = path351.getBounds();
_runPathTest(path351);
gFillType = path351.fillType;
allPaths.add(path351);
}
void pathOps352() {
gBounds = path352.getBounds();
allPaths.add(path352);
}
void pathOps353() {
final Path path353 = Path();
path353.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(638.3333333333333, 0, 889, 84), Radius.zero));
gBounds = path353.getBounds();
allPaths.add(path353);
}
void pathOps354() {
final Path path354 = Path();
path354.reset();
path354.moveTo(889, 86);
path354.lineTo(638.3333333333333, 86);
path354.lineTo(638.3333333333333, 84);
path354.lineTo(889, 84);
gBounds = path354.getBounds();
_runPathTest(path354);
gFillType = path354.fillType;
allPaths.add(path354);
}
void pathOps355() {
final Path path355 = Path();
path355.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 136, 970, 1144), Radius.zero));
gBounds = path355.getBounds();
gBounds = path355.getBounds();
gBounds = path355.getBounds();
gBounds = path355.getBounds();
gBounds = path355.getBounds();
gBounds = path355.getBounds();
gBounds = path355.getBounds();
gBounds = path355.getBounds();
gBounds = path355.getBounds();
gBounds = path355.getBounds();
gBounds = path355.getBounds();
gBounds = path355.getBounds();
gBounds = path355.getBounds();
gBounds = path355.getBounds();
gBounds = path355.getBounds();
gBounds = path355.getBounds();
gBounds = path355.getBounds();
gBounds = path355.getBounds();
gBounds = path355.getBounds();
gBounds = path355.getBounds();
gBounds = path355.getBounds();
gBounds = path355.getBounds();
gBounds = path355.getBounds();
gBounds = path355.getBounds();
allPaths.add(path355);
}
void pathOps356() {
gBounds = path356.getBounds();
allPaths.add(path356);
}
void pathOps357() {
final Path path357 = Path();
path357.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(450, 136, 970, 696), Radius.zero));
gBounds = path357.getBounds();
allPaths.add(path357);
}
void pathOps358() {
gBounds = path358.getBounds();
allPaths.add(path358);
}
void pathOps359() {
gBounds = path359.getBounds();
allPaths.add(path359);
}
void pathOps360() {
gBounds = path360.getBounds();
allPaths.add(path360);
}
void pathOps361() {
gBounds = path361.getBounds();
allPaths.add(path361);
}
void pathOps362() {
gBounds = path362.getBounds();
allPaths.add(path362);
}
void pathOps363() {
gBounds = path363.getBounds();
allPaths.add(path363);
}
void pathOps364() {
final Path path364 = Path();
path364.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(81, 0, 331.66666666666663, 84), Radius.zero));
gBounds = path364.getBounds();
allPaths.add(path364);
}
void pathOps365() {
final Path path365 = Path();
path365.reset();
path365.moveTo(331.66666666666663, 86);
path365.lineTo(81, 86);
path365.lineTo(81, 84);
path365.lineTo(331.66666666666663, 84);
gBounds = path365.getBounds();
_runPathTest(path365);
gFillType = path365.fillType;
allPaths.add(path365);
}
void pathOps366() {
gBounds = path366.getBounds();
allPaths.add(path366);
}
void pathOps367() {
final Path path367 = Path();
path367.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(359.66666666666663, 0, 610.3333333333333, 84), Radius.zero));
gBounds = path367.getBounds();
allPaths.add(path367);
}
void pathOps368() {
final Path path368 = Path();
path368.reset();
path368.moveTo(610.3333333333333, 86);
path368.lineTo(359.66666666666663, 86);
path368.lineTo(359.66666666666663, 84);
path368.lineTo(610.3333333333333, 84);
gBounds = path368.getBounds();
_runPathTest(path368);
gFillType = path368.fillType;
allPaths.add(path368);
}
void pathOps369() {
gBounds = path369.getBounds();
allPaths.add(path369);
}
void pathOps370() {
final Path path370 = Path();
path370.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(638.3333333333333, 0, 889, 84), Radius.zero));
gBounds = path370.getBounds();
allPaths.add(path370);
}
void pathOps371() {
final Path path371 = Path();
path371.reset();
path371.moveTo(889, 86);
path371.lineTo(638.3333333333333, 86);
path371.lineTo(638.3333333333333, 84);
path371.lineTo(889, 84);
gBounds = path371.getBounds();
_runPathTest(path371);
gFillType = path371.fillType;
allPaths.add(path371);
}
void pathOps372() {
gBounds = path372.getBounds();
allPaths.add(path372);
}
void pathOps373() {
gBounds = path373.getBounds();
allPaths.add(path373);
}
void pathOps374() {
gBounds = path374.getBounds();
allPaths.add(path374);
}
void pathOps375() {
gBounds = path375.getBounds();
allPaths.add(path375);
}
void pathOps376() {
gBounds = path376.getBounds();
allPaths.add(path376);
}
void pathOps377() {
final Path path377 = Path();
path377.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(81, 0, 331.66666666666663, 84), Radius.zero));
gBounds = path377.getBounds();
allPaths.add(path377);
}
void pathOps378() {
final Path path378 = Path();
path378.reset();
path378.moveTo(331.66666666666663, 86);
path378.lineTo(81, 86);
path378.lineTo(81, 84);
path378.lineTo(331.66666666666663, 84);
gBounds = path378.getBounds();
_runPathTest(path378);
gFillType = path378.fillType;
allPaths.add(path378);
}
void pathOps379() {
gBounds = path379.getBounds();
allPaths.add(path379);
}
void pathOps380() {
final Path path380 = Path();
path380.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(359.66666666666663, 0, 610.3333333333333, 84), Radius.zero));
gBounds = path380.getBounds();
allPaths.add(path380);
}
void pathOps381() {
final Path path381 = Path();
path381.reset();
path381.moveTo(610.3333333333333, 86);
path381.lineTo(359.66666666666663, 86);
path381.lineTo(359.66666666666663, 84);
path381.lineTo(610.3333333333333, 84);
gBounds = path381.getBounds();
_runPathTest(path381);
gFillType = path381.fillType;
allPaths.add(path381);
}
void pathOps382() {
gBounds = path382.getBounds();
allPaths.add(path382);
}
void pathOps383() {
final Path path383 = Path();
path383.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(638.3333333333333, 0, 889, 84), Radius.zero));
gBounds = path383.getBounds();
allPaths.add(path383);
}
void pathOps384() {
final Path path384 = Path();
path384.reset();
path384.moveTo(889, 86);
path384.lineTo(638.3333333333333, 86);
path384.lineTo(638.3333333333333, 84);
path384.lineTo(889, 84);
gBounds = path384.getBounds();
_runPathTest(path384);
gFillType = path384.fillType;
allPaths.add(path384);
}
void pathOps385() {
gBounds = path385.getBounds();
allPaths.add(path385);
}
void pathOps386() {
gBounds = path386.getBounds();
allPaths.add(path386);
}
void pathOps387() {
gBounds = path387.getBounds();
allPaths.add(path387);
}
void pathOps388() {
gBounds = path388.getBounds();
allPaths.add(path388);
}
void pathOps389() {
gBounds = path389.getBounds();
allPaths.add(path389);
}
void pathOps390() {
final Path path390 = Path();
path390.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(81, 0, 331.66666666666663, 84), Radius.zero));
gBounds = path390.getBounds();
allPaths.add(path390);
}
void pathOps391() {
final Path path391 = Path();
path391.reset();
path391.moveTo(331.66666666666663, 86);
path391.lineTo(81, 86);
path391.lineTo(81, 84);
path391.lineTo(331.66666666666663, 84);
gBounds = path391.getBounds();
_runPathTest(path391);
gFillType = path391.fillType;
allPaths.add(path391);
}
void pathOps392() {
gBounds = path392.getBounds();
allPaths.add(path392);
}
void pathOps393() {
final Path path393 = Path();
path393.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(359.66666666666663, 0, 610.3333333333333, 84), Radius.zero));
gBounds = path393.getBounds();
allPaths.add(path393);
}
void pathOps394() {
final Path path394 = Path();
path394.reset();
path394.moveTo(610.3333333333333, 86);
path394.lineTo(359.66666666666663, 86);
path394.lineTo(359.66666666666663, 84);
path394.lineTo(610.3333333333333, 84);
gBounds = path394.getBounds();
_runPathTest(path394);
gFillType = path394.fillType;
allPaths.add(path394);
}
void pathOps395() {
gBounds = path395.getBounds();
allPaths.add(path395);
}
void pathOps396() {
final Path path396 = Path();
path396.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(638.3333333333333, 0, 889, 84), Radius.zero));
gBounds = path396.getBounds();
allPaths.add(path396);
}
void pathOps397() {
final Path path397 = Path();
path397.reset();
path397.moveTo(889, 86);
path397.lineTo(638.3333333333333, 86);
path397.lineTo(638.3333333333333, 84);
path397.lineTo(889, 84);
gBounds = path397.getBounds();
_runPathTest(path397);
gFillType = path397.fillType;
allPaths.add(path397);
}
void pathOps398() {
gBounds = path398.getBounds();
allPaths.add(path398);
}
void pathOps399() {
gBounds = path399.getBounds();
allPaths.add(path399);
}
void pathOps400() {
gBounds = path400.getBounds();
allPaths.add(path400);
}
void pathOps401() {
gBounds = path401.getBounds();
allPaths.add(path401);
}
void pathOps402() {
gBounds = path402.getBounds();
allPaths.add(path402);
}
void pathOps403() {
final Path path403 = Path();
path403.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(81, 0, 331.66666666666663, 84), Radius.zero));
gBounds = path403.getBounds();
allPaths.add(path403);
}
void pathOps404() {
final Path path404 = Path();
path404.reset();
path404.moveTo(331.66666666666663, 86);
path404.lineTo(81, 86);
path404.lineTo(81, 84);
path404.lineTo(331.66666666666663, 84);
gBounds = path404.getBounds();
_runPathTest(path404);
gFillType = path404.fillType;
allPaths.add(path404);
}
void pathOps405() {
gBounds = path405.getBounds();
allPaths.add(path405);
}
void pathOps406() {
final Path path406 = Path();
path406.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(359.66666666666663, 0, 610.3333333333333, 84), Radius.zero));
gBounds = path406.getBounds();
allPaths.add(path406);
}
void pathOps407() {
final Path path407 = Path();
path407.reset();
path407.moveTo(610.3333333333333, 86);
path407.lineTo(359.66666666666663, 86);
path407.lineTo(359.66666666666663, 84);
path407.lineTo(610.3333333333333, 84);
gBounds = path407.getBounds();
_runPathTest(path407);
gFillType = path407.fillType;
allPaths.add(path407);
}
void pathOps408() {
gBounds = path408.getBounds();
allPaths.add(path408);
}
void pathOps409() {
final Path path409 = Path();
path409.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(638.3333333333333, 0, 889, 84), Radius.zero));
gBounds = path409.getBounds();
allPaths.add(path409);
}
void pathOps410() {
final Path path410 = Path();
path410.reset();
path410.moveTo(889, 86);
path410.lineTo(638.3333333333333, 86);
path410.lineTo(638.3333333333333, 84);
path410.lineTo(889, 84);
gBounds = path410.getBounds();
_runPathTest(path410);
gFillType = path410.fillType;
allPaths.add(path410);
}
void pathOps411() {
gBounds = path411.getBounds();
allPaths.add(path411);
}
void pathOps412() {
gBounds = path412.getBounds();
allPaths.add(path412);
}
void pathOps413() {
gBounds = path413.getBounds();
allPaths.add(path413);
}
void pathOps414() {
gBounds = path414.getBounds();
allPaths.add(path414);
}
void pathOps415() {
gBounds = path415.getBounds();
allPaths.add(path415);
}
void pathOps416() {
final Path path416 = Path();
path416.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(81, 0, 331.66666666666663, 84), Radius.zero));
gBounds = path416.getBounds();
allPaths.add(path416);
}
void pathOps417() {
final Path path417 = Path();
path417.reset();
path417.moveTo(331.66666666666663, 86);
path417.lineTo(81, 86);
path417.lineTo(81, 84);
path417.lineTo(331.66666666666663, 84);
gBounds = path417.getBounds();
_runPathTest(path417);
gFillType = path417.fillType;
allPaths.add(path417);
}
void pathOps418() {
gBounds = path418.getBounds();
allPaths.add(path418);
}
void pathOps419() {
final Path path419 = Path();
path419.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(359.66666666666663, 0, 610.3333333333333, 84), Radius.zero));
gBounds = path419.getBounds();
allPaths.add(path419);
}
void pathOps420() {
final Path path420 = Path();
path420.reset();
path420.moveTo(610.3333333333333, 86);
path420.lineTo(359.66666666666663, 86);
path420.lineTo(359.66666666666663, 84);
path420.lineTo(610.3333333333333, 84);
gBounds = path420.getBounds();
_runPathTest(path420);
gFillType = path420.fillType;
allPaths.add(path420);
}
void pathOps421() {
gBounds = path421.getBounds();
allPaths.add(path421);
}
void pathOps422() {
final Path path422 = Path();
path422.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(638.3333333333333, 0, 889, 84), Radius.zero));
gBounds = path422.getBounds();
allPaths.add(path422);
}
void pathOps423() {
final Path path423 = Path();
path423.reset();
path423.moveTo(889, 86);
path423.lineTo(638.3333333333333, 86);
path423.lineTo(638.3333333333333, 84);
path423.lineTo(889, 84);
gBounds = path423.getBounds();
_runPathTest(path423);
gFillType = path423.fillType;
allPaths.add(path423);
}
void pathOps424() {
gBounds = path424.getBounds();
allPaths.add(path424);
}
void pathOps425() {
gBounds = path425.getBounds();
allPaths.add(path425);
}
void pathOps426() {
gBounds = path426.getBounds();
allPaths.add(path426);
}
void pathOps427() {
gBounds = path427.getBounds();
allPaths.add(path427);
}
void pathOps428() {
gBounds = path428.getBounds();
allPaths.add(path428);
}
void pathOps429() {
final Path path429 = Path();
path429.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(81, 0, 331.66666666666663, 84), Radius.zero));
gBounds = path429.getBounds();
allPaths.add(path429);
}
void pathOps430() {
final Path path430 = Path();
path430.reset();
path430.moveTo(331.66666666666663, 86);
path430.lineTo(81, 86);
path430.lineTo(81, 84);
path430.lineTo(331.66666666666663, 84);
gBounds = path430.getBounds();
_runPathTest(path430);
gFillType = path430.fillType;
allPaths.add(path430);
}
void pathOps431() {
gBounds = path431.getBounds();
allPaths.add(path431);
}
void pathOps432() {
final Path path432 = Path();
path432.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(359.66666666666663, 0, 610.3333333333333, 84), Radius.zero));
gBounds = path432.getBounds();
allPaths.add(path432);
}
void pathOps433() {
final Path path433 = Path();
path433.reset();
path433.moveTo(610.3333333333333, 86);
path433.lineTo(359.66666666666663, 86);
path433.lineTo(359.66666666666663, 84);
path433.lineTo(610.3333333333333, 84);
gBounds = path433.getBounds();
_runPathTest(path433);
gFillType = path433.fillType;
allPaths.add(path433);
}
void pathOps434() {
gBounds = path434.getBounds();
allPaths.add(path434);
}
void pathOps435() {
final Path path435 = Path();
path435.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(638.3333333333333, 0, 889, 84), Radius.zero));
gBounds = path435.getBounds();
allPaths.add(path435);
}
void pathOps436() {
final Path path436 = Path();
path436.reset();
path436.moveTo(889, 86);
path436.lineTo(638.3333333333333, 86);
path436.lineTo(638.3333333333333, 84);
path436.lineTo(889, 84);
gBounds = path436.getBounds();
_runPathTest(path436);
gFillType = path436.fillType;
allPaths.add(path436);
}
void pathOps437() {
gBounds = path437.getBounds();
allPaths.add(path437);
}
void pathOps438() {
gBounds = path438.getBounds();
allPaths.add(path438);
}
void pathOps439() {
gBounds = path439.getBounds();
allPaths.add(path439);
}
void pathOps440() {
gBounds = path440.getBounds();
allPaths.add(path440);
}
void pathOps441() {
gBounds = path441.getBounds();
allPaths.add(path441);
}
void pathOps442() {
final Path path442 = Path();
path442.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(81, 0, 331.66666666666663, 84), Radius.zero));
gBounds = path442.getBounds();
allPaths.add(path442);
}
void pathOps443() {
final Path path443 = Path();
path443.reset();
path443.moveTo(331.66666666666663, 86);
path443.lineTo(81, 86);
path443.lineTo(81, 84);
path443.lineTo(331.66666666666663, 84);
gBounds = path443.getBounds();
_runPathTest(path443);
gFillType = path443.fillType;
allPaths.add(path443);
}
void pathOps444() {
gBounds = path444.getBounds();
allPaths.add(path444);
}
void pathOps445() {
final Path path445 = Path();
path445.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(359.66666666666663, 0, 610.3333333333333, 84), Radius.zero));
gBounds = path445.getBounds();
allPaths.add(path445);
}
void pathOps446() {
final Path path446 = Path();
path446.reset();
path446.moveTo(610.3333333333333, 86);
path446.lineTo(359.66666666666663, 86);
path446.lineTo(359.66666666666663, 84);
path446.lineTo(610.3333333333333, 84);
gBounds = path446.getBounds();
_runPathTest(path446);
gFillType = path446.fillType;
allPaths.add(path446);
}
void pathOps447() {
gBounds = path447.getBounds();
allPaths.add(path447);
}
void pathOps448() {
final Path path448 = Path();
path448.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(638.3333333333333, 0, 889, 84), Radius.zero));
gBounds = path448.getBounds();
allPaths.add(path448);
}
void pathOps449() {
final Path path449 = Path();
path449.reset();
path449.moveTo(889, 86);
path449.lineTo(638.3333333333333, 86);
path449.lineTo(638.3333333333333, 84);
path449.lineTo(889, 84);
gBounds = path449.getBounds();
_runPathTest(path449);
gFillType = path449.fillType;
allPaths.add(path449);
}
void pathOps450() {
gBounds = path450.getBounds();
allPaths.add(path450);
}
void pathOps451() {
gBounds = path451.getBounds();
allPaths.add(path451);
}
void pathOps452() {
gBounds = path452.getBounds();
allPaths.add(path452);
}
void pathOps453() {
gBounds = path453.getBounds();
allPaths.add(path453);
}
void pathOps454() {
gBounds = path454.getBounds();
allPaths.add(path454);
}
void pathOps455() {
final Path path455 = Path();
path455.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(81, 0, 331.66666666666663, 84), Radius.zero));
gBounds = path455.getBounds();
allPaths.add(path455);
}
void pathOps456() {
final Path path456 = Path();
path456.reset();
path456.moveTo(331.66666666666663, 86);
path456.lineTo(81, 86);
path456.lineTo(81, 84);
path456.lineTo(331.66666666666663, 84);
gBounds = path456.getBounds();
_runPathTest(path456);
gFillType = path456.fillType;
allPaths.add(path456);
}
void pathOps457() {
gBounds = path457.getBounds();
allPaths.add(path457);
}
void pathOps458() {
final Path path458 = Path();
path458.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(359.66666666666663, 0, 610.3333333333333, 84), Radius.zero));
gBounds = path458.getBounds();
allPaths.add(path458);
}
void pathOps459() {
final Path path459 = Path();
path459.reset();
path459.moveTo(610.3333333333333, 86);
path459.lineTo(359.66666666666663, 86);
path459.lineTo(359.66666666666663, 84);
path459.lineTo(610.3333333333333, 84);
gBounds = path459.getBounds();
_runPathTest(path459);
gFillType = path459.fillType;
allPaths.add(path459);
}
void pathOps460() {
gBounds = path460.getBounds();
allPaths.add(path460);
}
void pathOps461() {
final Path path461 = Path();
path461.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(638.3333333333333, 0, 889, 84), Radius.zero));
gBounds = path461.getBounds();
allPaths.add(path461);
}
void pathOps462() {
final Path path462 = Path();
path462.reset();
path462.moveTo(889, 86);
path462.lineTo(638.3333333333333, 86);
path462.lineTo(638.3333333333333, 84);
path462.lineTo(889, 84);
gBounds = path462.getBounds();
_runPathTest(path462);
gFillType = path462.fillType;
allPaths.add(path462);
}
void pathOps463() {
gBounds = path463.getBounds();
allPaths.add(path463);
}
void pathOps464() {
gBounds = path464.getBounds();
allPaths.add(path464);
}
void pathOps465() {
gBounds = path465.getBounds();
allPaths.add(path465);
}
void pathOps466() {
gBounds = path466.getBounds();
allPaths.add(path466);
}
void pathOps467() {
gBounds = path467.getBounds();
allPaths.add(path467);
}
void pathOps468() {
final Path path468 = Path();
path468.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(81, 0, 331.66666666666663, 84), Radius.zero));
gBounds = path468.getBounds();
allPaths.add(path468);
}
void pathOps469() {
final Path path469 = Path();
path469.reset();
path469.moveTo(331.66666666666663, 86);
path469.lineTo(81, 86);
path469.lineTo(81, 84);
path469.lineTo(331.66666666666663, 84);
gBounds = path469.getBounds();
_runPathTest(path469);
gFillType = path469.fillType;
allPaths.add(path469);
}
void pathOps470() {
gBounds = path470.getBounds();
allPaths.add(path470);
}
void pathOps471() {
final Path path471 = Path();
path471.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(359.66666666666663, 0, 610.3333333333333, 84), Radius.zero));
gBounds = path471.getBounds();
allPaths.add(path471);
}
void pathOps472() {
final Path path472 = Path();
path472.reset();
path472.moveTo(610.3333333333333, 86);
path472.lineTo(359.66666666666663, 86);
path472.lineTo(359.66666666666663, 84);
path472.lineTo(610.3333333333333, 84);
gBounds = path472.getBounds();
_runPathTest(path472);
gFillType = path472.fillType;
allPaths.add(path472);
}
void pathOps473() {
gBounds = path473.getBounds();
allPaths.add(path473);
}
void pathOps474() {
final Path path474 = Path();
path474.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(638.3333333333333, 0, 889, 84), Radius.zero));
gBounds = path474.getBounds();
allPaths.add(path474);
}
void pathOps475() {
final Path path475 = Path();
path475.reset();
path475.moveTo(889, 86);
path475.lineTo(638.3333333333333, 86);
path475.lineTo(638.3333333333333, 84);
path475.lineTo(889, 84);
gBounds = path475.getBounds();
_runPathTest(path475);
gFillType = path475.fillType;
allPaths.add(path475);
}
void pathOps476() {
gBounds = path476.getBounds();
allPaths.add(path476);
}
void pathOps477() {
gBounds = path477.getBounds();
allPaths.add(path477);
}
void pathOps478() {
gBounds = path478.getBounds();
allPaths.add(path478);
}
void pathOps479() {
gBounds = path479.getBounds();
allPaths.add(path479);
}
void pathOps480() {
gBounds = path480.getBounds();
allPaths.add(path480);
}
void pathOps481() {
final Path path481 = Path();
path481.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(81, 0, 331.66666666666663, 84), Radius.zero));
gBounds = path481.getBounds();
allPaths.add(path481);
}
void pathOps482() {
final Path path482 = Path();
path482.reset();
path482.moveTo(331.66666666666663, 86);
path482.lineTo(81, 86);
path482.lineTo(81, 84);
path482.lineTo(331.66666666666663, 84);
gBounds = path482.getBounds();
_runPathTest(path482);
gFillType = path482.fillType;
allPaths.add(path482);
}
void pathOps483() {
gBounds = path483.getBounds();
allPaths.add(path483);
}
void pathOps484() {
final Path path484 = Path();
path484.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(359.66666666666663, 0, 610.3333333333333, 84), Radius.zero));
gBounds = path484.getBounds();
allPaths.add(path484);
}
void pathOps485() {
final Path path485 = Path();
path485.reset();
path485.moveTo(610.3333333333333, 86);
path485.lineTo(359.66666666666663, 86);
path485.lineTo(359.66666666666663, 84);
path485.lineTo(610.3333333333333, 84);
gBounds = path485.getBounds();
_runPathTest(path485);
gFillType = path485.fillType;
allPaths.add(path485);
}
void pathOps486() {
gBounds = path486.getBounds();
allPaths.add(path486);
}
void pathOps487() {
final Path path487 = Path();
path487.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(638.3333333333333, 0, 889, 84), Radius.zero));
gBounds = path487.getBounds();
allPaths.add(path487);
}
void pathOps488() {
final Path path488 = Path();
path488.reset();
path488.moveTo(889, 86);
path488.lineTo(638.3333333333333, 86);
path488.lineTo(638.3333333333333, 84);
path488.lineTo(889, 84);
gBounds = path488.getBounds();
_runPathTest(path488);
gFillType = path488.fillType;
allPaths.add(path488);
}
void pathOps489() {
gBounds = path489.getBounds();
allPaths.add(path489);
}
void pathOps490() {
gBounds = path490.getBounds();
allPaths.add(path490);
}
void pathOps491() {
gBounds = path491.getBounds();
allPaths.add(path491);
}
void pathOps492() {
gBounds = path492.getBounds();
allPaths.add(path492);
}
void pathOps493() {
gBounds = path493.getBounds();
allPaths.add(path493);
}
void pathOps494() {
final Path path494 = Path();
path494.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(81, 0, 331.66666666666663, 84), Radius.zero));
gBounds = path494.getBounds();
allPaths.add(path494);
}
void pathOps495() {
final Path path495 = Path();
path495.reset();
path495.moveTo(331.66666666666663, 86);
path495.lineTo(81, 86);
path495.lineTo(81, 84);
path495.lineTo(331.66666666666663, 84);
gBounds = path495.getBounds();
_runPathTest(path495);
gFillType = path495.fillType;
allPaths.add(path495);
}
void pathOps496() {
gBounds = path496.getBounds();
allPaths.add(path496);
}
void pathOps497() {
final Path path497 = Path();
path497.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(359.66666666666663, 0, 610.3333333333333, 84), Radius.zero));
gBounds = path497.getBounds();
allPaths.add(path497);
}
void pathOps498() {
final Path path498 = Path();
path498.reset();
path498.moveTo(610.3333333333333, 86);
path498.lineTo(359.66666666666663, 86);
path498.lineTo(359.66666666666663, 84);
path498.lineTo(610.3333333333333, 84);
gBounds = path498.getBounds();
_runPathTest(path498);
gFillType = path498.fillType;
allPaths.add(path498);
}
void pathOps499() {
gBounds = path499.getBounds();
allPaths.add(path499);
}
void pathOps500() {
final Path path500 = Path();
path500.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(638.3333333333333, 0, 889, 84), Radius.zero));
gBounds = path500.getBounds();
allPaths.add(path500);
}
void pathOps501() {
final Path path501 = Path();
path501.reset();
path501.moveTo(889, 86);
path501.lineTo(638.3333333333333, 86);
path501.lineTo(638.3333333333333, 84);
path501.lineTo(889, 84);
gBounds = path501.getBounds();
_runPathTest(path501);
gFillType = path501.fillType;
allPaths.add(path501);
}
void pathOps502() {
gBounds = path502.getBounds();
allPaths.add(path502);
}
void pathOps503() {
gBounds = path503.getBounds();
allPaths.add(path503);
}
void pathOps504() {
gBounds = path504.getBounds();
allPaths.add(path504);
}
void pathOps505() {
gBounds = path505.getBounds();
allPaths.add(path505);
}
void pathOps506() {
gBounds = path506.getBounds();
allPaths.add(path506);
}
void pathOps507() {
final Path path507 = Path();
path507.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(81, 0, 331.66666666666663, 84), Radius.zero));
gBounds = path507.getBounds();
allPaths.add(path507);
}
void pathOps508() {
final Path path508 = Path();
path508.reset();
path508.moveTo(331.66666666666663, 86);
path508.lineTo(81, 86);
path508.lineTo(81, 84);
path508.lineTo(331.66666666666663, 84);
gBounds = path508.getBounds();
_runPathTest(path508);
gFillType = path508.fillType;
allPaths.add(path508);
}
void pathOps509() {
gBounds = path509.getBounds();
allPaths.add(path509);
}
void pathOps510() {
final Path path510 = Path();
path510.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(359.66666666666663, 0, 610.3333333333333, 84), Radius.zero));
gBounds = path510.getBounds();
allPaths.add(path510);
}
void pathOps511() {
final Path path511 = Path();
path511.reset();
path511.moveTo(610.3333333333333, 86);
path511.lineTo(359.66666666666663, 86);
path511.lineTo(359.66666666666663, 84);
path511.lineTo(610.3333333333333, 84);
gBounds = path511.getBounds();
_runPathTest(path511);
gFillType = path511.fillType;
allPaths.add(path511);
}
void pathOps512() {
gBounds = path512.getBounds();
allPaths.add(path512);
}
void pathOps513() {
final Path path513 = Path();
path513.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(638.3333333333333, 0, 889, 84), Radius.zero));
gBounds = path513.getBounds();
allPaths.add(path513);
}
void pathOps514() {
final Path path514 = Path();
path514.reset();
path514.moveTo(889, 86);
path514.lineTo(638.3333333333333, 86);
path514.lineTo(638.3333333333333, 84);
path514.lineTo(889, 84);
gBounds = path514.getBounds();
_runPathTest(path514);
gFillType = path514.fillType;
allPaths.add(path514);
}
void pathOps515() {
gBounds = path515.getBounds();
allPaths.add(path515);
}
void pathOps516() {
gBounds = path516.getBounds();
allPaths.add(path516);
}
void pathOps517() {
gBounds = path517.getBounds();
allPaths.add(path517);
}
void pathOps518() {
gBounds = path518.getBounds();
allPaths.add(path518);
}
void pathOps519() {
gBounds = path519.getBounds();
allPaths.add(path519);
}
void pathOps520() {
final Path path520 = Path();
path520.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(81, 0, 331.66666666666663, 84), Radius.zero));
gBounds = path520.getBounds();
allPaths.add(path520);
}
void pathOps521() {
final Path path521 = Path();
path521.reset();
path521.moveTo(331.66666666666663, 86);
path521.lineTo(81, 86);
path521.lineTo(81, 84);
path521.lineTo(331.66666666666663, 84);
gBounds = path521.getBounds();
_runPathTest(path521);
gFillType = path521.fillType;
allPaths.add(path521);
}
void pathOps522() {
gBounds = path522.getBounds();
allPaths.add(path522);
}
void pathOps523() {
final Path path523 = Path();
path523.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(359.66666666666663, 0, 610.3333333333333, 84), Radius.zero));
gBounds = path523.getBounds();
allPaths.add(path523);
}
void pathOps524() {
final Path path524 = Path();
path524.reset();
path524.moveTo(610.3333333333333, 86);
path524.lineTo(359.66666666666663, 86);
path524.lineTo(359.66666666666663, 84);
path524.lineTo(610.3333333333333, 84);
gBounds = path524.getBounds();
_runPathTest(path524);
gFillType = path524.fillType;
allPaths.add(path524);
}
void pathOps525() {
gBounds = path525.getBounds();
allPaths.add(path525);
}
void pathOps526() {
final Path path526 = Path();
path526.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(638.3333333333333, 0, 889, 84), Radius.zero));
gBounds = path526.getBounds();
allPaths.add(path526);
}
void pathOps527() {
final Path path527 = Path();
path527.reset();
path527.moveTo(889, 86);
path527.lineTo(638.3333333333333, 86);
path527.lineTo(638.3333333333333, 84);
path527.lineTo(889, 84);
gBounds = path527.getBounds();
_runPathTest(path527);
gFillType = path527.fillType;
allPaths.add(path527);
}
void pathOps528() {
gBounds = path528.getBounds();
allPaths.add(path528);
}
void pathOps529() {
gBounds = path529.getBounds();
allPaths.add(path529);
}
void pathOps530() {
gBounds = path530.getBounds();
allPaths.add(path530);
}
void pathOps531() {
gBounds = path531.getBounds();
allPaths.add(path531);
}
void pathOps532() {
gBounds = path532.getBounds();
allPaths.add(path532);
}
void pathOps533() {
final Path path533 = Path();
path533.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(81, 0, 331.66666666666663, 84), Radius.zero));
gBounds = path533.getBounds();
allPaths.add(path533);
}
void pathOps534() {
final Path path534 = Path();
path534.reset();
path534.moveTo(331.66666666666663, 86);
path534.lineTo(81, 86);
path534.lineTo(81, 84);
path534.lineTo(331.66666666666663, 84);
gBounds = path534.getBounds();
_runPathTest(path534);
gFillType = path534.fillType;
allPaths.add(path534);
}
void pathOps535() {
gBounds = path535.getBounds();
allPaths.add(path535);
}
void pathOps536() {
final Path path536 = Path();
path536.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(359.66666666666663, 0, 610.3333333333333, 84), Radius.zero));
gBounds = path536.getBounds();
allPaths.add(path536);
}
void pathOps537() {
final Path path537 = Path();
path537.reset();
path537.moveTo(610.3333333333333, 86);
path537.lineTo(359.66666666666663, 86);
path537.lineTo(359.66666666666663, 84);
path537.lineTo(610.3333333333333, 84);
gBounds = path537.getBounds();
_runPathTest(path537);
gFillType = path537.fillType;
allPaths.add(path537);
}
void pathOps538() {
gBounds = path538.getBounds();
allPaths.add(path538);
}
void pathOps539() {
final Path path539 = Path();
path539.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(638.3333333333333, 0, 889, 84), Radius.zero));
gBounds = path539.getBounds();
allPaths.add(path539);
}
void pathOps540() {
final Path path540 = Path();
path540.reset();
path540.moveTo(889, 86);
path540.lineTo(638.3333333333333, 86);
path540.lineTo(638.3333333333333, 84);
path540.lineTo(889, 84);
gBounds = path540.getBounds();
_runPathTest(path540);
gFillType = path540.fillType;
allPaths.add(path540);
}
void pathOps541() {
gBounds = path541.getBounds();
allPaths.add(path541);
}
void pathOps542() {
gBounds = path542.getBounds();
allPaths.add(path542);
}
void pathOps543() {
gBounds = path543.getBounds();
allPaths.add(path543);
}
void pathOps544() {
gBounds = path544.getBounds();
allPaths.add(path544);
}
void pathOps545() {
gBounds = path545.getBounds();
allPaths.add(path545);
}
void pathOps546() {
final Path path546 = Path();
path546.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(81, 0, 331.66666666666663, 84), Radius.zero));
gBounds = path546.getBounds();
allPaths.add(path546);
}
void pathOps547() {
final Path path547 = Path();
path547.reset();
path547.moveTo(331.66666666666663, 86);
path547.lineTo(81, 86);
path547.lineTo(81, 84);
path547.lineTo(331.66666666666663, 84);
gBounds = path547.getBounds();
_runPathTest(path547);
gFillType = path547.fillType;
allPaths.add(path547);
}
void pathOps548() {
gBounds = path548.getBounds();
allPaths.add(path548);
}
void pathOps549() {
final Path path549 = Path();
path549.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(359.66666666666663, 0, 610.3333333333333, 84), Radius.zero));
gBounds = path549.getBounds();
allPaths.add(path549);
}
void pathOps550() {
final Path path550 = Path();
path550.reset();
path550.moveTo(610.3333333333333, 86);
path550.lineTo(359.66666666666663, 86);
path550.lineTo(359.66666666666663, 84);
path550.lineTo(610.3333333333333, 84);
gBounds = path550.getBounds();
_runPathTest(path550);
gFillType = path550.fillType;
allPaths.add(path550);
}
void pathOps551() {
gBounds = path551.getBounds();
allPaths.add(path551);
}
void pathOps552() {
final Path path552 = Path();
path552.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(638.3333333333333, 0, 889, 84), Radius.zero));
gBounds = path552.getBounds();
allPaths.add(path552);
}
void pathOps553() {
final Path path553 = Path();
path553.reset();
path553.moveTo(889, 86);
path553.lineTo(638.3333333333333, 86);
path553.lineTo(638.3333333333333, 84);
path553.lineTo(889, 84);
gBounds = path553.getBounds();
_runPathTest(path553);
gFillType = path553.fillType;
allPaths.add(path553);
}
void pathOps554() {
gBounds = path554.getBounds();
allPaths.add(path554);
}
void pathOps555() {
gBounds = path555.getBounds();
allPaths.add(path555);
}
void pathOps556() {
gBounds = path556.getBounds();
allPaths.add(path556);
}
void pathOps557() {
gBounds = path557.getBounds();
allPaths.add(path557);
}
void pathOps558() {
gBounds = path558.getBounds();
gBounds = path558.getBounds();
gBounds = path558.getBounds();
gBounds = path558.getBounds();
gBounds = path558.getBounds();
gBounds = path558.getBounds();
gBounds = path558.getBounds();
gBounds = path558.getBounds();
allPaths.add(path558);
}
void pathOps559() {
final Path path559 = Path();
path559.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(81, 0, 331.66666666666663, 84), Radius.zero));
gBounds = path559.getBounds();
allPaths.add(path559);
}
void pathOps560() {
final Path path560 = Path();
path560.reset();
path560.moveTo(331.66666666666663, 86);
path560.lineTo(81, 86);
path560.lineTo(81, 84);
path560.lineTo(331.66666666666663, 84);
gBounds = path560.getBounds();
_runPathTest(path560);
gFillType = path560.fillType;
allPaths.add(path560);
}
void pathOps561() {
gBounds = path561.getBounds();
allPaths.add(path561);
}
void pathOps562() {
final Path path562 = Path();
path562.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(359.66666666666663, 0, 610.3333333333333, 84), Radius.zero));
gBounds = path562.getBounds();
allPaths.add(path562);
}
void pathOps563() {
final Path path563 = Path();
path563.reset();
path563.moveTo(610.3333333333333, 86);
path563.lineTo(359.66666666666663, 86);
path563.lineTo(359.66666666666663, 84);
path563.lineTo(610.3333333333333, 84);
gBounds = path563.getBounds();
_runPathTest(path563);
gFillType = path563.fillType;
allPaths.add(path563);
}
void pathOps564() {
gBounds = path564.getBounds();
allPaths.add(path564);
}
void pathOps565() {
final Path path565 = Path();
path565.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(638.3333333333333, 0, 889, 84), Radius.zero));
gBounds = path565.getBounds();
allPaths.add(path565);
}
void pathOps566() {
final Path path566 = Path();
path566.reset();
path566.moveTo(889, 86);
path566.lineTo(638.3333333333333, 86);
path566.lineTo(638.3333333333333, 84);
path566.lineTo(889, 84);
gBounds = path566.getBounds();
_runPathTest(path566);
gFillType = path566.fillType;
allPaths.add(path566);
}
void pathOps567() {
final Path path567 = Path();
path567.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 0, 250.66666666666666, 120), Radius.zero));
gBounds = path567.getBounds();
allPaths.add(path567);
}
void pathOps568() {
final Path path568 = Path();
path568.reset();
path568.moveTo(234.66666666666666, 120);
path568.lineTo(96, 120);
path568.lineTo(96, 119);
path568.lineTo(234.66666666666666, 119);
gBounds = path568.getBounds();
_runPathTest(path568);
gFillType = path568.fillType;
allPaths.add(path568);
}
void pathOps569() {
final Path path569 = Path();
path569.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 0, 250.66666666666666, 120), Radius.zero));
gBounds = path569.getBounds();
allPaths.add(path569);
}
void pathOps570() {
final Path path570 = Path();
path570.reset();
path570.moveTo(234.66666666666666, 120);
path570.lineTo(96, 120);
path570.lineTo(96, 119);
path570.lineTo(234.66666666666666, 119);
gBounds = path570.getBounds();
_runPathTest(path570);
gFillType = path570.fillType;
allPaths.add(path570);
}
void pathOps571() {
final Path path571 = Path();
path571.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(116.39999999999999, 136, 853.6, 1144), Radius.zero));
gBounds = path571.getBounds();
allPaths.add(path571);
}
void pathOps572() {
final Path path572 = Path();
path572.addRRect(RRect.fromRectAndCorners(const Rect.fromLTRB(0, 0, 312.6, 880), topLeft: const Radius.circular(10), topRight: const Radius.circular(10), bottomLeft: const Radius.circular(2), bottomRight: const Radius.circular(2), ));
gFillType = path572.fillType;
path573 = path572.shift(const Offset(525, 248));
allPaths.add(path572);
}
void pathOps573() {
gBounds = path573.getBounds();
allPaths.add(path573);
}
void pathOps574() {
final Path path574 = Path();
path574.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(525, 248, 837.6, 1128), Radius.zero));
gBounds = path574.getBounds();
allPaths.add(path574);
}
void pathOps575() {
final Path path575 = Path();
path575.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(525, 248, 837.6, 304), Radius.zero));
gBounds = path575.getBounds();
allPaths.add(path575);
}
void pathOps576() {
final Path path576 = Path();
path576.moveTo(0, 0);
path576.lineTo(220.60000000000002, 0);
path576.quadraticBezierTo(235.60000000000002, 0, 237.569696969697, 7.817946907441011);
path576.arcToPoint(const Offset(299.630303030303, 7.817946907441011), radius: const Radius.circular(32), clockwise: false);
path576.quadraticBezierTo(301.6, 0, 316.6, 0);
path576.lineTo(312.6, 0);
path576.lineTo(312.6, 48);
path576.lineTo(0, 48);
path576.close();
gFillType = path576.fillType;
path577 = path576.shift(const Offset(525, 1080));
allPaths.add(path576);
}
void pathOps577() {
gBounds = path577.getBounds();
allPaths.add(path577);
}
void pathOps578() {
final Path path578 = Path();
path578.addOval(const Rect.fromLTRB(0, 0, 56, 56));
gFillType = path578.fillType;
path579 = path578.shift(const Offset(765.6, 1052));
allPaths.add(path578);
}
void pathOps579() {
gBounds = path579.getBounds();
allPaths.add(path579);
}
void pathOps580() {
final Path path580 = Path();
path580.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(116.39999999999999, 136, 853.6, 192), Radius.zero));
gBounds = path580.getBounds();
allPaths.add(path580);
}
void pathOps581() {
final Path path581 = Path();
path581.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 0, 250.66666666666666, 120), Radius.zero));
gBounds = path581.getBounds();
allPaths.add(path581);
}
void pathOps582() {
final Path path582 = Path();
path582.reset();
path582.moveTo(234.66666666666666, 120);
path582.lineTo(96, 120);
path582.lineTo(96, 119);
path582.lineTo(234.66666666666666, 119);
gBounds = path582.getBounds();
_runPathTest(path582);
gFillType = path582.fillType;
allPaths.add(path582);
}
void pathOps583() {
final Path path583 = Path();
path583.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 0, 250.66666666666666, 120), Radius.zero));
gBounds = path583.getBounds();
allPaths.add(path583);
}
void pathOps584() {
final Path path584 = Path();
path584.reset();
path584.moveTo(234.66666666666666, 120);
path584.lineTo(96, 120);
path584.lineTo(96, 119);
path584.lineTo(234.66666666666666, 119);
gBounds = path584.getBounds();
_runPathTest(path584);
gFillType = path584.fillType;
allPaths.add(path584);
}
void pathOps585() {
final Path path585 = Path();
path585.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 0, 250.66666666666666, 120), Radius.zero));
gBounds = path585.getBounds();
allPaths.add(path585);
}
void pathOps586() {
final Path path586 = Path();
path586.reset();
path586.moveTo(234.66666666666666, 120);
path586.lineTo(96, 120);
path586.lineTo(96, 119);
path586.lineTo(234.66666666666666, 119);
gBounds = path586.getBounds();
_runPathTest(path586);
gFillType = path586.fillType;
allPaths.add(path586);
}
void pathOps587() {
final Path path587 = Path();
path587.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 0, 250.66666666666666, 120), Radius.zero));
gBounds = path587.getBounds();
allPaths.add(path587);
}
void pathOps588() {
final Path path588 = Path();
path588.reset();
path588.moveTo(234.66666666666666, 120);
path588.lineTo(96, 120);
path588.lineTo(96, 119);
path588.lineTo(234.66666666666666, 119);
gBounds = path588.getBounds();
_runPathTest(path588);
gFillType = path588.fillType;
allPaths.add(path588);
}
void pathOps589() {
final Path path589 = Path();
path589.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 0, 250.66666666666666, 120), Radius.zero));
gBounds = path589.getBounds();
allPaths.add(path589);
}
void pathOps590() {
final Path path590 = Path();
path590.reset();
path590.moveTo(234.66666666666666, 120);
path590.lineTo(96, 120);
path590.lineTo(96, 119);
path590.lineTo(234.66666666666666, 119);
gBounds = path590.getBounds();
_runPathTest(path590);
gFillType = path590.fillType;
allPaths.add(path590);
}
void pathOps596() {
final Path path596 = Path();
path596.reset();
path596.moveTo(56, 42);
path596.lineTo(56, 42);
path596.lineTo(58, 42);
path596.lineTo(58, 42);
gBounds = path596.getBounds();
allPaths.add(path596);
}
void pathOps598() {
final Path path598 = Path();
path598.reset();
path598.moveTo(56, 42);
path598.lineTo(56, 42);
path598.lineTo(58, 42);
path598.lineTo(58, 42);
gBounds = path598.getBounds();
allPaths.add(path598);
}
void pathOps600() {
final Path path600 = Path();
path600.reset();
path600.moveTo(56, 42);
path600.lineTo(56, 42);
path600.lineTo(58, 42);
path600.lineTo(58, 42);
gBounds = path600.getBounds();
allPaths.add(path600);
}
void pathOps602() {
final Path path602 = Path();
path602.reset();
path602.moveTo(56, 42);
path602.lineTo(56, 42);
path602.lineTo(58, 42);
path602.lineTo(58, 42);
gBounds = path602.getBounds();
allPaths.add(path602);
}
void pathOps604() {
final Path path604 = Path();
path604.reset();
path604.moveTo(56, 42);
path604.lineTo(56, 42);
path604.lineTo(58, 42);
path604.lineTo(58, 42);
gBounds = path604.getBounds();
allPaths.add(path604);
}
void pathOps605() {
final Path path605 = Path();
path605.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(0, 136, 970, 1144), Radius.zero));
allPaths.add(path605);
}
void pathOps607() {
final Path path607 = Path();
path607.addRRect(RRect.fromRectAndRadius(const Rect.fromLTRB(450, 136, 970, 696), Radius.zero));
allPaths.add(path607);
}
void _runPathTest(Path path) {
}
| flutter/dev/benchmarks/macrobenchmarks/lib/src/web/bench_paths_recording.dart/0 | {
"file_path": "flutter/dev/benchmarks/macrobenchmarks/lib/src/web/bench_paths_recording.dart",
"repo_id": "flutter",
"token_count": 62314
} | 75 |
// 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_driver/flutter_driver.dart';
import 'package:test/test.dart' hide TypeMatcher, isInstanceOf;
Future<void> main() async {
const String fileName = 'animated_image';
test('Animate for 250 frames', () async {
final FlutterDriver driver = await FlutterDriver.connect();
await driver.forceGC();
final Timeline timeline = await driver.traceAction(() async {
await driver.requestData('waitForAnimation');
});
final TimelineSummary summary = TimelineSummary.summarize(timeline);
await summary.writeTimelineToFile(fileName, pretty: true);
await driver.close();
}, timeout: Timeout.none);
}
| flutter/dev/benchmarks/macrobenchmarks/test_driver/animated_image_test.dart/0 | {
"file_path": "flutter/dev/benchmarks/macrobenchmarks/test_driver/animated_image_test.dart",
"repo_id": "flutter",
"token_count": 243
} | 76 |
// 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_driver/flutter_driver.dart';
import 'package:test/test.dart' hide TypeMatcher, isInstanceOf;
Future<void> main() async {
const String fileName = 'large_image_changer';
test('Animate for 20 seconds', () async {
final FlutterDriver driver = await FlutterDriver.connect();
await driver.forceGC();
final String targetPlatform = await driver.requestData('getTargetPlatform');
Timeline? timeline;
switch (targetPlatform) {
case 'TargetPlatform.iOS':
{
timeline = await driver.traceAction(() async {
await Future<void>.delayed(const Duration(seconds: 20));
});
}
case 'TargetPlatform.android':
{
// Just run for 20 seconds to collect memory usage. The widget itself
// animates during this time.
await Future<void>.delayed(const Duration(seconds: 20));
}
default:
throw UnsupportedError('Unsupported platform $targetPlatform');
}
if (timeline != null) {
final TimelineSummary summary = TimelineSummary.summarize(timeline);
await summary.writeTimelineToFile(fileName, pretty: true);
}
await driver.close();
}, timeout: Timeout.none);
}
| flutter/dev/benchmarks/macrobenchmarks/test_driver/large_image_changer_test.dart/0 | {
"file_path": "flutter/dev/benchmarks/macrobenchmarks/test_driver/large_image_changer_test.dart",
"repo_id": "flutter",
"token_count": 484
} | 77 |
#include "Generated.xcconfig"
| flutter/dev/benchmarks/microbenchmarks/ios/Flutter/Debug.xcconfig/0 | {
"file_path": "flutter/dev/benchmarks/microbenchmarks/ios/Flutter/Debug.xcconfig",
"repo_id": "flutter",
"token_count": 12
} | 78 |
// 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/foundation.dart';
import '../common.dart';
const int _kNumIterations = 65536;
const int _kNumWarmUp = 100;
const int _kScale = 1000;
void main() {
assert(false, "Don't run benchmarks in debug mode! Use 'flutter run --release'.");
// In the following benchmarks, we won't remove the listeners when we don't
// want to measure removeListener because we know that everything will be
// GC'ed in the end.
// Not removing listeners would cause memory leaks in a real application.
final BenchmarkResultPrinter printer = BenchmarkResultPrinter();
void runAddListenerBenchmark(int iteration, {bool addResult = true}) {
const String name = 'add';
for (int listenerCount = 1; listenerCount <= 5; listenerCount += 1) {
final List<_Notifier> notifiers = List<_Notifier>.generate(
iteration,
(_) => _Notifier(),
growable: false,
);
final Stopwatch watch = Stopwatch();
watch.start();
for (int i = 0; i < iteration; i += 1) {
for (int l = 0; l < listenerCount; l += 1) {
notifiers[i].addListener(() {});
}
}
watch.stop();
final int elapsed = watch.elapsedMicroseconds;
final double averagePerIteration = elapsed / iteration;
if (addResult) {
printer.addResult(
description: '$name ($listenerCount listeners)',
value: averagePerIteration * _kScale,
unit: 'ns per iteration',
name: '$name$listenerCount',
);
}
}
}
void runNotifyListenerBenchmark(int iteration, {bool addResult = true}) {
const String name = 'notify';
for (int listenerCount = 0; listenerCount <= 5; listenerCount += 1) {
final _Notifier notifier = _Notifier();
for (int i = 1; i <= listenerCount; i += 1) {
notifier.addListener(() {});
}
final Stopwatch watch = Stopwatch();
watch.start();
for (int i = 0; i < iteration; i += 1) {
notifier.notify();
}
watch.stop();
final int elapsed = watch.elapsedMicroseconds;
final double averagePerIteration = elapsed / iteration;
if (addResult) {
printer.addResult(
description: '$name ($listenerCount listeners)',
value: averagePerIteration * _kScale,
unit: 'ns per iteration',
name: '$name$listenerCount',
);
}
}
}
void runRemoveListenerBenchmark(int iteration, {bool addResult = true}) {
const String name = 'remove';
final List<VoidCallback> listeners = <VoidCallback>[
() {},
() {},
() {},
() {},
() {},
];
for (int listenerCount = 1; listenerCount <= 5; listenerCount += 1) {
final List<_Notifier> notifiers = List<_Notifier>.generate(
iteration,
(_) {
final _Notifier notifier = _Notifier();
for (int l = 0; l < listenerCount; l += 1) {
notifier.addListener(listeners[l]);
}
return notifier;
},
growable: false,
);
final Stopwatch watch = Stopwatch();
watch.start();
for (int i = 0; i < iteration; i += 1) {
for (int l = 0; l < listenerCount; l += 1) {
notifiers[i].removeListener(listeners[l]);
}
}
watch.stop();
final int elapsed = watch.elapsedMicroseconds;
final double averagePerIteration = elapsed / iteration;
if (addResult) {
printer.addResult(
description: '$name ($listenerCount listeners)',
value: averagePerIteration * _kScale,
unit: 'ns per iteration',
name: '$name$listenerCount',
);
}
}
}
void runRemoveListenerWhileNotifyingBenchmark(int iteration,
{bool addResult = true}) {
const String name = 'removeWhileNotify';
final List<VoidCallback> listeners = <VoidCallback>[
() {},
() {},
() {},
() {},
() {},
];
for (int listenerCount = 1; listenerCount <= 5; listenerCount += 1) {
final List<_Notifier> notifiers = List<_Notifier>.generate(
iteration,
(_) {
final _Notifier notifier = _Notifier();
notifier.addListener(() {
// This listener will remove all other listeners. So that only this
// one is called and measured.
for (int l = 0; l < listenerCount; l += 1) {
notifier.removeListener(listeners[l]);
}
});
for (int l = 0; l < listenerCount; l += 1) {
notifier.addListener(listeners[l]);
}
return notifier;
},
growable: false,
);
final Stopwatch watch = Stopwatch();
watch.start();
for (int i = 0; i < iteration; i += 1) {
notifiers[i].notify();
}
watch.stop();
final int elapsed = watch.elapsedMicroseconds;
final double averagePerIteration = elapsed / iteration;
if (addResult) {
printer.addResult(
description: '$name ($listenerCount listeners)',
value: averagePerIteration * _kScale,
unit: 'ns per iteration',
name: '$name$listenerCount',
);
}
}
}
runAddListenerBenchmark(_kNumWarmUp, addResult: false);
runAddListenerBenchmark(_kNumIterations);
runNotifyListenerBenchmark(_kNumWarmUp, addResult: false);
runNotifyListenerBenchmark(_kNumIterations);
runRemoveListenerBenchmark(_kNumWarmUp, addResult: false);
runRemoveListenerBenchmark(_kNumIterations);
runRemoveListenerWhileNotifyingBenchmark(_kNumWarmUp, addResult: false);
runRemoveListenerWhileNotifyingBenchmark(_kNumIterations);
printer.printToStdout();
}
class _Notifier extends ChangeNotifier {
void notify() => notifyListeners();
}
| flutter/dev/benchmarks/microbenchmarks/lib/foundation/change_notifier_bench.dart/0 | {
"file_path": "flutter/dev/benchmarks/microbenchmarks/lib/foundation/change_notifier_bench.dart",
"repo_id": "flutter",
"token_count": 2402
} | 79 |
// 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 '../common.dart';
const int _kNumIterations = 1000;
const int _kNumWarmUp = 100;
void main() {
final List<String> words = 'Lorem Ipsum is simply dummy text of the printing and'
" typesetting industry. Lorem Ipsum has been the industry's"
' standard dummy text ever since the 1500s, when an unknown'
' printer took a galley of type and scrambled it to make a'
' type specimen book'.split(' ');
final List<InlineSpanSemanticsInformation> data = <InlineSpanSemanticsInformation>[];
for (int i = 0; i < words.length; i++) {
if (i.isEven) {
data.add(
InlineSpanSemanticsInformation(words[i]),
);
} else if (i.isEven) {
data.add(
InlineSpanSemanticsInformation(words[i], isPlaceholder: true),
);
}
}
print(words);
// Warm up lap
for (int i = 0; i < _kNumWarmUp; i += 1) {
combineSemanticsInfoSyncStar(data);
combineSemanticsInfoList(data);
}
final Stopwatch watch = Stopwatch();
watch.start();
for (int i = 0; i < _kNumIterations; i += 1) {
consumeSpan(combineSemanticsInfoSyncStar(data));
}
final int combineSemanticsInfoSyncStarTime = watch.elapsedMicroseconds;
watch
..reset()
..start();
for (int i = 0; i < _kNumIterations; i += 1) {
consumeSpan(combineSemanticsInfoList(data));
}
final int combineSemanticsInfoListTime = watch.elapsedMicroseconds;
watch
..reset()
..start();
final BenchmarkResultPrinter printer = BenchmarkResultPrinter();
const double scale = 1000.0 / _kNumIterations;
printer.addResult(
description: 'combineSemanticsInfoSyncStar',
value: combineSemanticsInfoSyncStarTime * scale,
unit: 'ns per iteration',
name: 'combineSemanticsInfoSyncStar_iteration',
);
printer.addResult(
description: 'combineSemanticsInfoList',
value: combineSemanticsInfoListTime * scale,
unit: 'ns per iteration',
name: 'combineSemanticsInfoList_iteration',
);
printer.printToStdout();
}
String consumeSpan(Iterable<InlineSpanSemanticsInformation> items) {
String result = '';
for (final InlineSpanSemanticsInformation span in items) {
result += span.text;
}
return result;
}
Iterable<InlineSpanSemanticsInformation> combineSemanticsInfoSyncStar(List<InlineSpanSemanticsInformation> inputs) sync* {
String workingText = '';
String? workingLabel;
for (final InlineSpanSemanticsInformation info in inputs) {
if (info.requiresOwnNode) {
yield InlineSpanSemanticsInformation(workingText, semanticsLabel: workingLabel ?? workingText);
workingText = '';
workingLabel = null;
yield info;
} else {
workingText += info.text;
workingLabel ??= '';
final String? infoSemanticsLabel = info.semanticsLabel;
workingLabel += infoSemanticsLabel ?? info.text;
}
}
assert(workingLabel != null);
}
Iterable<InlineSpanSemanticsInformation> combineSemanticsInfoList(List<InlineSpanSemanticsInformation> inputs) {
String workingText = '';
String? workingLabel;
final List<InlineSpanSemanticsInformation> result = <InlineSpanSemanticsInformation>[];
for (final InlineSpanSemanticsInformation info in inputs) {
if (info.requiresOwnNode) {
result.add(InlineSpanSemanticsInformation(workingText, semanticsLabel: workingLabel ?? workingText));
workingText = '';
workingLabel = null;
result.add(info);
} else {
workingText += info.text;
workingLabel ??= '';
final String? infoSemanticsLabel = info.semanticsLabel;
workingLabel += infoSemanticsLabel ?? info.text;
}
}
assert(workingLabel != null);
return result;
}
| flutter/dev/benchmarks/microbenchmarks/lib/language/sync_star_semantics_bench.dart/0 | {
"file_path": "flutter/dev/benchmarks/microbenchmarks/lib/language/sync_star_semantics_bench.dart",
"repo_id": "flutter",
"token_count": 1313
} | 80 |
<!-- 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. -->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z">
<aapt:attr name="android:fillColor">
<gradient
android:endX="85.84757"
android:endY="92.4963"
android:startX="42.9492"
android:startY="49.59793"
android:type="linear">
<item
android:color="#44000000"
android:offset="0.0" />
<item
android:color="#00000000"
android:offset="1.0" />
</gradient>
</aapt:attr>
</path>
<path
android:fillColor="#FFFFFF"
android:fillType="nonZero"
android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z"
android:strokeWidth="1"
android:strokeColor="#00000000" />
</vector> | flutter/dev/benchmarks/multiple_flutters/android/app/src/main/res/drawable-v24/ic_launcher_foreground.xml/0 | {
"file_path": "flutter/dev/benchmarks/multiple_flutters/android/app/src/main/res/drawable-v24/ic_launcher_foreground.xml",
"repo_id": "flutter",
"token_count": 1103
} | 81 |
// 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.
package com.example.platform_channels_benchmarks
import io.flutter.embedding.android.FlutterActivity
import io.flutter.embedding.engine.FlutterEngine
import io.flutter.plugin.common.BasicMessageChannel
import io.flutter.plugin.common.BinaryCodec
import io.flutter.plugin.common.StandardMessageCodec
import java.nio.ByteBuffer
class MainActivity : FlutterActivity() {
// We allow for the caching of a response in the binary channel case since
// the reply requires a direct buffer, but the input is not a direct buffer.
// We can't directly send the input back to the reply currently.
private var byteBufferCache: ByteBuffer? = null
override fun configureFlutterEngine(flutterEngine: FlutterEngine) {
val reset = BasicMessageChannel(flutterEngine.dartExecutor, "dev.flutter.echo.reset", StandardMessageCodec.INSTANCE)
reset.setMessageHandler { message, reply ->
run {
byteBufferCache = null
}
}
val basicStandard =
BasicMessageChannel(flutterEngine.dartExecutor, "dev.flutter.echo.basic.standard", StandardMessageCodec.INSTANCE)
basicStandard.setMessageHandler { message, reply -> reply.reply(message) }
val basicBinary = BasicMessageChannel(flutterEngine.dartExecutor, "dev.flutter.echo.basic.binary", BinaryCodec.INSTANCE_DIRECT)
basicBinary.setMessageHandler { message, reply ->
run {
if (byteBufferCache == null) {
byteBufferCache = ByteBuffer.allocateDirect(message!!.capacity())
byteBufferCache!!.put(message)
}
reply.reply(byteBufferCache)
}
}
val taskQueue = flutterEngine.dartExecutor.getBinaryMessenger().makeBackgroundTaskQueue()
val backgroundStandard =
BasicMessageChannel(
flutterEngine.dartExecutor,
"dev.flutter.echo.background.standard",
StandardMessageCodec.INSTANCE,
taskQueue
)
backgroundStandard.setMessageHandler { message, reply -> reply.reply(message) }
super.configureFlutterEngine(flutterEngine)
}
}
| flutter/dev/benchmarks/platform_channels_benchmarks/android/app/src/main/kotlin/com/example/platform_channels_benchmarks/MainActivity.kt/0 | {
"file_path": "flutter/dev/benchmarks/platform_channels_benchmarks/android/app/src/main/kotlin/com/example/platform_channels_benchmarks/MainActivity.kt",
"repo_id": "flutter",
"token_count": 899
} | 82 |
// 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_driver/flutter_driver.dart';
import 'package:test/test.dart' hide TypeMatcher, isInstanceOf;
void main() {
group('scrolling performance test', () {
late FlutterDriver driver;
setUpAll(() async {
driver = await FlutterDriver.connect();
await driver.waitUntilFirstFrameRasterized();
});
tearDownAll(() async {
driver.close();
});
Future<void> testScrollPerf(String listKey, String summaryName) async {
// The slight initial delay avoids starting the timing during a
// period of increased load on the device. Without this delay, the
// benchmark has greater noise.
// See: https://github.com/flutter/flutter/issues/19434
await Future<void>.delayed(const Duration(milliseconds: 250));
final Timeline timeline = await driver.traceAction(() async {
// Find the scrollable stock list
final SerializableFinder list = find.byValueKey(listKey);
for (int j = 0; j < 5; j += 1) {
// Scroll down
for (int i = 0; i < 5; i += 1) {
await driver.scroll(list, 0.0, -300.0, const Duration(milliseconds: 300));
await Future<void>.delayed(const Duration(milliseconds: 500));
}
// Scroll up
for (int i = 0; i < 5; i += 1) {
await driver.scroll(list, 0.0, 300.0, const Duration(milliseconds: 300));
await Future<void>.delayed(const Duration(milliseconds: 500));
}
}
});
final TimelineSummary summary = TimelineSummary.summarize(timeline);
await summary.writeTimelineToFile(summaryName, pretty: true);
}
test('platform_views_scroll_perf', () async {
// Disable frame sync, since there are ongoing animations.
await driver.runUnsynchronized(() async {
await testScrollPerf('platform-views-scroll', 'platform_views_scroll_perf_ad_banners');
});
}, timeout: Timeout.none);
});
}
| flutter/dev/benchmarks/platform_views_layout/test_driver/scroll_perf_ad_banners_test.dart/0 | {
"file_path": "flutter/dev/benchmarks/platform_views_layout/test_driver/scroll_perf_ad_banners_test.dart",
"repo_id": "flutter",
"token_count": 791
} | 83 |
{
"title": "Stocks",
"market": "MARKET",
"portfolio": "PORTFOLIO"
}
| flutter/dev/benchmarks/test_apps/stocks/lib/i18n/stocks_en_US.arb/0 | {
"file_path": "flutter/dev/benchmarks/test_apps/stocks/lib/i18n/stocks_en_US.arb",
"repo_id": "flutter",
"token_count": 35
} | 84 |
// 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:analyzer/dart/analysis/results.dart';
import 'package:analyzer/dart/ast/ast.dart';
import 'package:analyzer/dart/ast/visitor.dart';
import 'package:analyzer/dart/element/element.dart';
import 'package:analyzer/dart/element/type.dart';
import '../utils.dart';
import 'analyze.dart';
/// Verify that no RenderBox subclasses call compute* instead of get* for
/// computing the intrinsic dimensions. The full list of RenderBox intrinsic
/// methods checked by this rule is listed in [candidates].
final AnalyzeRule renderBoxIntrinsicCalculation = _RenderBoxIntrinsicCalculationRule();
const Map<String, String> candidates = <String, String> {
'computeDryBaseline': 'getDryBaseline',
'computeDryLayout': 'getDryLayout',
'computeDistanceToActualBaseline': 'getDistanceToBaseline, or getDistanceToActualBaseline',
'computeMaxIntrinsicHeight': 'getMaxIntrinsicHeight',
'computeMinIntrinsicHeight': 'getMinIntrinsicHeight',
'computeMaxIntrinsicWidth': 'getMaxIntrinsicWidth',
'computeMinIntrinsicWidth': 'getMinIntrinsicWidth'
};
class _RenderBoxIntrinsicCalculationRule implements AnalyzeRule {
final Map<ResolvedUnitResult, List<(AstNode, String)>> _errors = <ResolvedUnitResult, List<(AstNode, String)>>{};
@override
void applyTo(ResolvedUnitResult unit) {
final _RenderBoxSubclassVisitor visitor = _RenderBoxSubclassVisitor();
unit.unit.visitChildren(visitor);
final List<(AstNode, String)> violationsInUnit = visitor.violationNodes;
if (violationsInUnit.isNotEmpty) {
_errors.putIfAbsent(unit, () => <(AstNode, String)>[]).addAll(violationsInUnit);
}
}
@override
void reportViolations(String workingDirectory) {
if (_errors.isEmpty) {
return;
}
foundError(<String>[
for (final MapEntry<ResolvedUnitResult, List<(AstNode, String)>> entry in _errors.entries)
for (final (AstNode node, String suggestion) in entry.value)
'${locationInFile(entry.key, node, workingDirectory)}: ${node.parent}. Consider calling $suggestion instead.',
'\n${bold}Typically the get* methods should be used to obtain the intrinsics of a RenderBox.$reset',
]);
}
@override
String toString() => 'RenderBox subclass intrinsic calculation best practices';
}
class _RenderBoxSubclassVisitor extends RecursiveAstVisitor<void> {
final List<(AstNode, String)> violationNodes = <(AstNode, String)>[];
static final Map<InterfaceElement, bool> _isRenderBoxClassElementCache = <InterfaceElement, bool>{};
// The cached version, call this method instead of _checkIfImplementsRenderBox.
static bool _implementsRenderBox(InterfaceElement interfaceElement) {
// Framework naming convention: a RenderObject subclass names have "Render" in its name.
if (!interfaceElement.name.contains('Render')) {
return false;
}
return interfaceElement.name == 'RenderBox'
|| _isRenderBoxClassElementCache.putIfAbsent(interfaceElement, () => _checkIfImplementsRenderBox(interfaceElement));
}
static bool _checkIfImplementsRenderBox(InterfaceElement element) {
return element.allSupertypes.any((InterfaceType interface) => _implementsRenderBox(interface.element));
}
// We don't care about directives, comments, or asserts.
@override
void visitImportDirective(ImportDirective node) { }
@override
void visitExportDirective(ExportDirective node) { }
@override
void visitComment(Comment node) { }
@override
void visitAssertStatement(AssertStatement node) { }
@override
void visitClassDeclaration(ClassDeclaration node) {
// Ignore the RenderBox class implementation: that's the only place the
// compute* methods are supposed to be called.
if (node.name.lexeme != 'RenderBox') {
super.visitClassDeclaration(node);
}
}
@override
void visitSimpleIdentifier(SimpleIdentifier node) {
final String? correctMethodName = candidates[node.name];
if (correctMethodName == null) {
return;
}
final bool isCallingSuperImplementation = switch (node.parent) {
PropertyAccess(target: SuperExpression()) ||
MethodInvocation(target: SuperExpression()) => true,
_ => false,
};
if (isCallingSuperImplementation) {
return;
}
final Element? declaredInClassElement = node.staticElement?.declaration?.enclosingElement;
if (declaredInClassElement is InterfaceElement && _implementsRenderBox(declaredInClassElement)) {
violationNodes.add((node, correctMethodName));
}
}
}
| flutter/dev/bots/custom_rules/render_box_intrinsics.dart/0 | {
"file_path": "flutter/dev/bots/custom_rules/render_box_intrinsics.dart",
"repo_id": "flutter",
"token_count": 1493
} | 85 |
// 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 '../run_command.dart';
import '../utils.dart';
Future<void> docsRunner() async {
printProgress('${green}Running flutter doc tests$reset');
await runCommand(
'./dev/bots/docs.sh',
const <String>[
'--output',
'dev/docs/api_docs.zip',
'--keep-staging',
'--staging-dir',
'dev/docs',
],
workingDirectory: flutterRoot,
);}
| flutter/dev/bots/suite_runners/run_docs_tests.dart/0 | {
"file_path": "flutter/dev/bots/suite_runners/run_docs_tests.dart",
"repo_id": "flutter",
"token_count": 201
} | 86 |
// 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.
// @dart = 2.12
/// This is a dummy dart:ui package for the sample code analyzer tests to use.
library dart.ui;
/// Bla bla bla bla bla bla bla bla bla.
///
/// ```dart
/// class MyStringBuffer {
/// error; // error (prefer_typing_uninitialized_variables, inference_failure_on_uninitialized_variable, missing_const_final_var_or_type)
///
/// StringBuffer _buffer = StringBuffer(); // error (prefer_final_fields, unused_field)
/// }
/// ```
class Foo {
const Foo();
}
| flutter/dev/bots/test/analyze-snippet-code-test-dart-ui/ui.dart/0 | {
"file_path": "flutter/dev/bots/test/analyze-snippet-code-test-dart-ui/ui.dart",
"repo_id": "flutter",
"token_count": 206
} | 87 |
// THIS FILE HAS NO LICENSE.
// IT IS PART OF A TEST FOR MISSING LICENSES.
| flutter/dev/bots/test/analyze-test-input/root/packages/foo/foo.dart/0 | {
"file_path": "flutter/dev/bots/test/analyze-test-input/root/packages/foo/foo.dart",
"repo_id": "flutter",
"token_count": 24
} | 88 |
// 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 'dart:convert';
import 'dart:io' show ProcessResult;
import 'dart:typed_data';
import 'package:file/file.dart';
import 'package:file/memory.dart';
import 'package:path/path.dart' as path;
import 'package:platform/platform.dart' show FakePlatform, Platform;
import '../../../packages/flutter_tools/test/src/fake_process_manager.dart';
import '../prepare_package/archive_creator.dart';
import '../prepare_package/archive_publisher.dart';
import '../prepare_package/common.dart';
import '../prepare_package/process_runner.dart';
import 'common.dart';
void main() {
const String testRef = 'deadbeefdeadbeefdeadbeefdeadbeefdeadbeef';
test('Throws on missing executable', () async {
// Uses a *real* process manager, since we want to know what happens if
// it can't find an executable.
final ProcessRunner processRunner = ProcessRunner(subprocessOutput: false);
expect(
expectAsync1((List<String> commandLine) async {
return processRunner.runProcess(commandLine);
})(<String>['this_executable_better_not_exist_2857632534321']),
throwsA(isA<PreparePackageException>()));
await expectLater(
() => processRunner.runProcess(<String>['this_executable_better_not_exist_2857632534321']),
throwsA(isA<PreparePackageException>().having(
(PreparePackageException error) => error.message,
'message',
contains('ProcessException: Failed to find "this_executable_better_not_exist_2857632534321" in the search path'),
)),
);
});
for (final String platformName in <String>[Platform.macOS, Platform.linux, Platform.windows]) {
final FakePlatform platform = FakePlatform(
operatingSystem: platformName,
environment: <String, String>{
'DEPOT_TOOLS': platformName == Platform.windows ? path.join('D:', 'depot_tools'): '/depot_tools',
},
);
group('ProcessRunner for $platform', () {
test('Returns stdout', () async {
final FakeProcessManager fakeProcessManager = FakeProcessManager.list(<FakeCommand>[
const FakeCommand(
command: <String>['echo', 'test',],
stdout: 'output',
stderr: 'error',
),
]);
final ProcessRunner processRunner = ProcessRunner(
subprocessOutput: false, platform: platform, processManager: fakeProcessManager);
final String output = await processRunner.runProcess(<String>['echo', 'test']);
expect(output, equals('output'));
});
test('Throws on process failure', () async {
final FakeProcessManager fakeProcessManager = FakeProcessManager.list(<FakeCommand>[
const FakeCommand(
command: <String>['echo', 'test',],
stdout: 'output',
stderr: 'error',
exitCode: -1,
),
]);
final ProcessRunner processRunner = ProcessRunner(
subprocessOutput: false, platform: platform, processManager: fakeProcessManager);
expect(
expectAsync1((List<String> commandLine) async {
return processRunner.runProcess(commandLine);
})(<String>['echo', 'test']),
throwsA(isA<PreparePackageException>()));
});
});
group('ArchiveCreator for $platformName', () {
late ArchiveCreator creator;
late Directory tempDir;
Directory flutterDir;
Directory cacheDir;
late FakeProcessManager processManager;
late FileSystem fs;
final List<List<String>> args = <List<String>>[];
final List<Map<Symbol, dynamic>> namedArgs = <Map<Symbol, dynamic>>[];
late String flutter;
late String dart;
Future<Uint8List> fakeHttpReader(Uri url, {Map<String, String>? headers}) {
return Future<Uint8List>.value(Uint8List(0));
}
setUp(() async {
processManager = FakeProcessManager.list(<FakeCommand>[]);
args.clear();
namedArgs.clear();
fs = MemoryFileSystem.test();
tempDir = fs.systemTempDirectory;
flutterDir = fs.directory(path.join(tempDir.path, 'flutter'));
flutterDir.createSync(recursive: true);
cacheDir = fs.directory(path.join(flutterDir.path, 'bin', 'cache'));
cacheDir.createSync(recursive: true);
creator = ArchiveCreator(
tempDir,
tempDir,
testRef,
Branch.beta,
fs: fs,
processManager: processManager,
subprocessOutput: false,
platform: platform,
httpReader: fakeHttpReader,
);
flutter = path.join(creator.flutterRoot.absolute.path,
'bin', 'flutter');
dart = path.join(creator.flutterRoot.absolute.path,
'bin', 'cache', 'dart-sdk', 'bin', 'dart');
});
tearDown(() async {
tryToDelete(tempDir);
});
test('sets PUB_CACHE properly', () async {
final String createBase = path.join(tempDir.absolute.path, 'create_');
final String archiveName = path.join(tempDir.absolute.path,
'flutter_${platformName}_v1.2.3-beta${platform.isLinux ? '.tar.xz' : '.zip'}');
processManager.addCommands(convertResults(<String, List<ProcessResult>?>{
'git clone -b beta https://flutter.googlesource.com/mirrors/flutter': null,
'git reset --hard $testRef': null,
'git remote set-url origin https://github.com/flutter/flutter.git': null,
'git gc --prune=now --aggressive': null,
'git describe --tags --exact-match $testRef': <ProcessResult>[ProcessResult(0, 0, 'v1.2.3', '')],
'$flutter --version --machine': <ProcessResult>[
ProcessResult(0, 0, '{"dartSdkVersion": "3.2.1"}', ''),
ProcessResult(0, 0, '{"dartSdkVersion": "3.2.1"}', ''),
],
'$dart --version': <ProcessResult>[
ProcessResult(0, 0, 'Dart SDK version: 2.17.0-63.0.beta (beta) (Wed Jan 26 03:48:52 2022 -0800) on "${platformName}_x64"', ''),
],
if (platform.isWindows) '7za x ${path.join(tempDir.path, 'mingit.zip')}': null,
'$flutter doctor': null,
'$flutter update-packages': null,
'$flutter precache': null,
'$flutter ide-config': null,
'$flutter create --template=app ${createBase}app': null,
'$flutter create --template=package ${createBase}package': null,
'$flutter create --template=plugin ${createBase}plugin': null,
'$flutter pub cache list': <ProcessResult>[ProcessResult(0,0,'{"packages":{}}','')],
'git clean -f -x -- **/.packages': null,
'git clean -f -x -- **/.dart_tool/': null,
if (platform.isMacOS) 'codesign -vvvv --check-notarization ${path.join(tempDir.path, 'flutter', 'bin', 'cache', 'dart-sdk', 'bin', 'dart')}': null,
if (platform.isWindows) 'attrib -h .git': null,
if (platform.isWindows) '7za a -tzip -mx=9 $archiveName flutter': null
else if (platform.isMacOS) 'zip -r -9 --symlinks $archiveName flutter': null
else if (platform.isLinux) 'tar cJf $archiveName --verbose flutter': null,
}));
await creator.initializeRepo();
await creator.createArchive();
});
test('calls the right commands for archive output', () async {
final String createBase = path.join(tempDir.absolute.path, 'create_');
final String archiveName = path.join(tempDir.absolute.path,
'flutter_${platformName}_v1.2.3-beta${platform.isLinux ? '.tar.xz' : '.zip'}');
final Map<String, List<ProcessResult>?> calls = <String, List<ProcessResult>?>{
'git clone -b beta https://flutter.googlesource.com/mirrors/flutter': null,
'git reset --hard $testRef': null,
'git remote set-url origin https://github.com/flutter/flutter.git': null,
'git gc --prune=now --aggressive': null,
'git describe --tags --exact-match $testRef': <ProcessResult>[ProcessResult(0, 0, 'v1.2.3', '')],
'$flutter --version --machine': <ProcessResult>[
ProcessResult(0, 0, '{"dartSdkVersion": "3.2.1"}', ''),
ProcessResult(0, 0, '{"dartSdkVersion": "3.2.1"}', ''),
],
'$dart --version': <ProcessResult>[
ProcessResult(0, 0, 'Dart SDK version: 2.17.0-63.0.beta (beta) (Wed Jan 26 03:48:52 2022 -0800) on "${platformName}_x64"', ''),
],
if (platform.isWindows) '7za x ${path.join(tempDir.path, 'mingit.zip')}': null,
'$flutter doctor': null,
'$flutter update-packages': null,
'$flutter precache': null,
'$flutter ide-config': null,
'$flutter create --template=app ${createBase}app': null,
'$flutter create --template=package ${createBase}package': null,
'$flutter create --template=plugin ${createBase}plugin': null,
'$flutter pub cache list': <ProcessResult>[ProcessResult(0,0,'{"packages":{}}','')],
'git clean -f -x -- **/.packages': null,
'git clean -f -x -- **/.dart_tool/': null,
if (platform.isMacOS) 'codesign -vvvv --check-notarization ${path.join(tempDir.path, 'flutter', 'bin', 'cache', 'dart-sdk', 'bin', 'dart')}': null,
if (platform.isWindows) 'attrib -h .git': null,
if (platform.isWindows) '7za a -tzip -mx=9 $archiveName flutter': null
else if (platform.isMacOS) 'zip -r -9 --symlinks $archiveName flutter': null
else if (platform.isLinux) 'tar cJf $archiveName --verbose flutter': null,
};
processManager.addCommands(convertResults(calls));
creator = ArchiveCreator(
tempDir,
tempDir,
testRef,
Branch.beta,
fs: fs,
processManager: processManager,
subprocessOutput: false,
platform: platform,
httpReader: fakeHttpReader,
);
await creator.initializeRepo();
await creator.createArchive();
});
test('adds the arch name to the archive for non-x64', () async {
final String createBase = path.join(tempDir.absolute.path, 'create_');
final String archiveName = path.join(tempDir.absolute.path,
'flutter_${platformName}_arm64_v1.2.3-beta${platform.isLinux ? '.tar.xz' : '.zip'}');
final Map<String, List<ProcessResult>?> calls = <String, List<ProcessResult>?>{
'git clone -b beta https://flutter.googlesource.com/mirrors/flutter': null,
'git reset --hard $testRef': null,
'git remote set-url origin https://github.com/flutter/flutter.git': null,
'git gc --prune=now --aggressive': null,
'git describe --tags --exact-match $testRef': <ProcessResult>[ProcessResult(0, 0, 'v1.2.3', '')],
'$flutter --version --machine': <ProcessResult>[
ProcessResult(0, 0, '{"dartSdkVersion": "3.2.1"}', ''),
ProcessResult(0, 0, '{"dartSdkVersion": "3.2.1"}', ''),
],
'$dart --version': <ProcessResult>[
ProcessResult(0, 0, 'Dart SDK version: 2.17.0-63.0.beta (beta) (Wed Jan 26 03:48:52 2022 -0800) on "${platformName}_arm64"', ''),
],
if (platform.isWindows) '7za x ${path.join(tempDir.path, 'mingit.zip')}': null,
'$flutter doctor': null,
'$flutter update-packages': null,
'$flutter precache': null,
'$flutter ide-config': null,
'$flutter create --template=app ${createBase}app': null,
'$flutter create --template=package ${createBase}package': null,
'$flutter create --template=plugin ${createBase}plugin': null,
'$flutter pub cache list': <ProcessResult>[ProcessResult(0,0,'{"packages":{}}','')],
'git clean -f -x -- **/.packages': null,
'git clean -f -x -- **/.dart_tool/': null,
if (platform.isMacOS) 'codesign -vvvv --check-notarization ${path.join(tempDir.path, 'flutter', 'bin', 'cache', 'dart-sdk', 'bin', 'dart')}': null,
if (platform.isWindows) 'attrib -h .git': null,
if (platform.isWindows) '7za a -tzip -mx=9 $archiveName flutter': null
else if (platform.isMacOS) 'zip -r -9 --symlinks $archiveName flutter': null
else if (platform.isLinux) 'tar cJf $archiveName --verbose flutter': null,
};
processManager.addCommands(convertResults(calls));
creator = ArchiveCreator(
tempDir,
tempDir,
testRef,
Branch.beta,
fs: fs,
processManager: processManager,
subprocessOutput: false,
platform: platform,
httpReader: fakeHttpReader,
);
await creator.initializeRepo();
await creator.createArchive();
});
test('throws when a command errors out', () async {
final Map<String, List<ProcessResult>> calls = <String, List<ProcessResult>>{
'git clone -b beta https://flutter.googlesource.com/mirrors/flutter':
<ProcessResult>[ProcessResult(0, 0, 'output1', '')],
'git reset --hard $testRef': <ProcessResult>[ProcessResult(0, -1, 'output2', '')],
};
processManager.addCommands(convertResults(calls));
expect(expectAsync0(creator.initializeRepo), throwsA(isA<PreparePackageException>()));
});
test('non-strict mode calls the right commands', () async {
final String createBase = path.join(tempDir.absolute.path, 'create_');
final String archiveName = path.join(tempDir.absolute.path,
'flutter_${platformName}_v1.2.3-beta${platform.isLinux ? '.tar.xz' : '.zip'}');
final Map<String, List<ProcessResult>?> calls = <String, List<ProcessResult>?>{
'git clone -b beta https://flutter.googlesource.com/mirrors/flutter': null,
'git reset --hard $testRef': null,
'git remote set-url origin https://github.com/flutter/flutter.git': null,
'git gc --prune=now --aggressive': null,
'git describe --tags --abbrev=0 $testRef': <ProcessResult>[ProcessResult(0, 0, 'v1.2.3', '')],
'$flutter --version --machine': <ProcessResult>[
ProcessResult(0, 0, '{"dartSdkVersion": "3.2.1"}', ''),
ProcessResult(0, 0, '{"dartSdkVersion": "3.2.1"}', ''),
],
'$dart --version': <ProcessResult>[
ProcessResult(0, 0, 'Dart SDK version: 2.17.0-63.0.beta (beta) (Wed Jan 26 03:48:52 2022 -0800) on "${platformName}_x64"', ''),
],
if (platform.isWindows) '7za x ${path.join(tempDir.path, 'mingit.zip')}': null,
'$flutter doctor': null,
'$flutter update-packages': null,
'$flutter precache': null,
'$flutter ide-config': null,
'$flutter create --template=app ${createBase}app': null,
'$flutter create --template=package ${createBase}package': null,
'$flutter create --template=plugin ${createBase}plugin': null,
'$flutter pub cache list': <ProcessResult>[ProcessResult(0,0,'{"packages":{}}','')],
'git clean -f -x -- **/.packages': null,
'git clean -f -x -- **/.dart_tool/': null,
if (platform.isWindows) 'attrib -h .git': null,
if (platform.isWindows) '7za a -tzip -mx=9 $archiveName flutter': null
else if (platform.isMacOS) 'zip -r -9 --symlinks $archiveName flutter': null
else if (platform.isLinux) 'tar cJf $archiveName --verbose flutter': null,
};
processManager.addCommands(convertResults(calls));
creator = ArchiveCreator(
tempDir,
tempDir,
testRef,
Branch.beta,
fs: fs,
strict: false,
processManager: processManager,
subprocessOutput: false,
platform: platform,
httpReader: fakeHttpReader,
);
await creator.initializeRepo();
await creator.createArchive();
});
test('fails if binary is not codesigned', () async {
final String createBase = path.join(tempDir.absolute.path, 'create_');
final String archiveName = path.join(tempDir.absolute.path,
'flutter_${platformName}_v1.2.3-beta${platform.isLinux ? '.tar.xz' : '.zip'}');
final ProcessResult codesignFailure = ProcessResult(1, 1, '', 'code object is not signed at all');
final String binPath = path.join(tempDir.path, 'flutter', 'bin', 'cache', 'dart-sdk', 'bin', 'dart');
final Map<String, List<ProcessResult>?> calls = <String, List<ProcessResult>?>{
'git clone -b beta https://flutter.googlesource.com/mirrors/flutter': null,
'git reset --hard $testRef': null,
'git remote set-url origin https://github.com/flutter/flutter.git': null,
'git gc --prune=now --aggressive': null,
'git describe --tags --exact-match $testRef': <ProcessResult>[ProcessResult(0, 0, 'v1.2.3', '')],
'$flutter --version --machine': <ProcessResult>[
ProcessResult(0, 0, '{"dartSdkVersion": "3.2.1"}', ''),
ProcessResult(0, 0, '{"dartSdkVersion": "3.2.1"}', ''),
],
'$dart --version': <ProcessResult>[
ProcessResult(0, 0, 'Dart SDK version: 2.17.0-63.0.beta (beta) (Wed Jan 26 03:48:52 2022 -0800) on "${platformName}_x64"', ''),
],
if (platform.isWindows) '7za x ${path.join(tempDir.path, 'mingit.zip')}': null,
'$flutter doctor': null,
'$flutter update-packages': null,
'$flutter precache': null,
'$flutter ide-config': null,
'$flutter create --template=app ${createBase}app': null,
'$flutter create --template=package ${createBase}package': null,
'$flutter create --template=plugin ${createBase}plugin': null,
'$flutter pub cache list': <ProcessResult>[ProcessResult(0,0,'{"packages":{}}','')],
'git clean -f -x -- **/.packages': null,
'git clean -f -x -- **/.dart_tool/': null,
if (platform.isMacOS) 'codesign -vvvv --check-notarization $binPath': <ProcessResult>[codesignFailure],
if (platform.isWindows) 'attrib -h .git': null,
if (platform.isWindows) '7za a -tzip -mx=9 $archiveName flutter': null
else if (platform.isMacOS) 'zip -r -9 --symlinks $archiveName flutter': null
else if (platform.isLinux) 'tar cJf $archiveName flutter': null,
};
processManager.addCommands(convertResults(calls));
creator = ArchiveCreator(
tempDir,
tempDir,
testRef,
Branch.beta,
fs: fs,
processManager: processManager,
subprocessOutput: false,
platform: platform,
httpReader: fakeHttpReader,
);
await creator.initializeRepo();
await expectLater(
() => creator.createArchive(),
throwsA(isA<PreparePackageException>().having(
(PreparePackageException exception) => exception.message,
'message',
contains('The binary $binPath was not codesigned!'),
)),
);
}, skip: !platform.isMacOS); // [intended] codesign is only available on macOS
});
group('ArchivePublisher for $platformName', () {
late FakeProcessManager processManager;
late Directory tempDir;
late FileSystem fs;
final String gsutilCall = platform.isWindows
? 'python3 ${path.join("D:", "depot_tools", "gsutil.py")}'
: 'python3 ${path.join("/", "depot_tools", "gsutil.py")}';
final String releasesName = 'releases_$platformName.json';
final String archiveName = platform.isLinux ? 'archive.tar.xz' : 'archive.zip';
final String archiveMime = platform.isLinux ? 'application/x-gtar' : 'application/zip';
final String gsArchivePath = 'gs://flutter_infra_release/releases/stable/$platformName/$archiveName';
setUp(() async {
fs = MemoryFileSystem.test(style: platform.isWindows ? FileSystemStyle.windows : FileSystemStyle.posix);
processManager = FakeProcessManager.list(<FakeCommand>[]);
tempDir = fs.systemTempDirectory.createTempSync('flutter_prepage_package_test.');
});
tearDown(() async {
tryToDelete(tempDir);
});
test('calls the right processes', () async {
final String archivePath = path.join(tempDir.absolute.path, archiveName);
final String jsonPath = path.join(tempDir.absolute.path, releasesName);
final String gsJsonPath = 'gs://flutter_infra_release/releases/$releasesName';
final String releasesJson = '''
{
"base_url": "https://storage.googleapis.com/flutter_infra_release/releases",
"current_release": {
"beta": "3ea4d06340a97a1e9d7cae97567c64e0569dcaa2",
"beta": "5a58b36e36b8d7aace89d3950e6deb307956a6a0"
},
"releases": [
{
"hash": "5a58b36e36b8d7aace89d3950e6deb307956a6a0",
"channel": "beta",
"version": "v0.2.3",
"release_date": "2018-03-20T01:47:02.851729Z",
"archive": "beta/$platformName/flutter_${platformName}_v0.2.3-beta.zip",
"sha256": "4fe85a822093e81cb5a66c7fc263f68de39b5797b294191b6d75e7afcc86aff8",
"dart_sdk_arch": "x64"
},
{
"hash": "b9bd51cc36b706215915711e580851901faebb40",
"channel": "beta",
"version": "v0.2.2",
"release_date": "2018-03-16T18:48:13.375013Z",
"archive": "beta/$platformName/flutter_${platformName}_v0.2.2-beta.zip",
"sha256": "6073331168cdb37a4637a5dc073d6a7ef4e466321effa2c529fa27d2253a4d4b",
"dart_sdk_arch": "x64"
},
{
"hash": "$testRef",
"channel": "stable",
"version": "v0.0.0",
"release_date": "2018-03-20T01:47:02.851729Z",
"archive": "stable/$platformName/flutter_${platformName}_v0.0.0-beta.zip",
"sha256": "5dd34873b3a3e214a32fd30c2c319a0f46e608afb72f0d450b2d621a6d02aebd",
"dart_sdk_arch": "x64"
}
]
}
''';
fs.file(jsonPath).writeAsStringSync(releasesJson);
fs.file(archivePath).writeAsStringSync('archive contents');
final Map<String, List<ProcessResult>?> calls = <String, List<ProcessResult>?>{
// This process fails because the file does NOT already exist
'$gsutilCall -- cp $gsJsonPath $jsonPath': null,
'$gsutilCall -- stat $gsArchivePath': <ProcessResult>[ProcessResult(0, 1, '', '')],
'$gsutilCall -- rm $gsArchivePath': null,
'$gsutilCall -- -h Content-Type:$archiveMime cp $archivePath $gsArchivePath': null,
'$gsutilCall -- rm $gsJsonPath': null,
'$gsutilCall -- -h Content-Type:application/json -h Cache-Control:max-age=60 cp $jsonPath $gsJsonPath': null,
};
processManager.addCommands(convertResults(calls));
final File outputFile = fs.file(path.join(tempDir.absolute.path, archiveName));
outputFile.createSync();
assert(tempDir.existsSync());
final ArchivePublisher publisher = ArchivePublisher(
tempDir,
testRef,
Branch.stable,
<String, String>{
'frameworkVersionFromGit': 'v1.2.3',
'dartSdkVersion': '3.2.1',
'dartTargetArch': 'x64',
},
outputFile,
false,
fs: fs,
processManager: processManager,
subprocessOutput: false,
platform: platform,
);
assert(tempDir.existsSync());
await publisher.generateLocalMetadata();
await publisher.publishArchive();
final File releaseFile = fs.file(jsonPath);
expect(releaseFile.existsSync(), isTrue);
final String contents = releaseFile.readAsStringSync();
// Make sure new data is added.
expect(contents, contains('"hash": "$testRef"'));
expect(contents, contains('"channel": "stable"'));
expect(contents, contains('"archive": "stable/$platformName/$archiveName"'));
expect(contents, contains('"sha256": "f69f4865f861193a91d1c5544a894167a7137b788d10bac8edbf5d095f45cb4d"'));
// Make sure existing entries are preserved.
expect(contents, contains('"hash": "5a58b36e36b8d7aace89d3950e6deb307956a6a0"'));
expect(contents, contains('"hash": "b9bd51cc36b706215915711e580851901faebb40"'));
expect(contents, contains('"channel": "beta"'));
expect(contents, contains('"channel": "beta"'));
// Make sure old matching entries are removed.
expect(contents, isNot(contains('v0.0.0')));
final Map<String, dynamic> jsonData = json.decode(contents) as Map<String, dynamic>;
final List<dynamic> releases = jsonData['releases'] as List<dynamic>;
expect(releases.length, equals(3));
// Make sure the new entry is first (and hopefully it takes less than a
// minute to go from publishArchive above to this line!).
expect(
DateTime.now().difference(DateTime.parse((releases[0] as Map<String, dynamic>)['release_date'] as String)),
lessThan(const Duration(minutes: 1)),
);
const JsonEncoder encoder = JsonEncoder.withIndent(' ');
expect(contents, equals(encoder.convert(jsonData)));
});
test('contains Dart SDK version info', () async {
final String archivePath = path.join(tempDir.absolute.path, archiveName);
final String jsonPath = path.join(tempDir.absolute.path, releasesName);
final String gsJsonPath = 'gs://flutter_infra_release/releases/$releasesName';
final String releasesJson = '''
{
"base_url": "https://storage.googleapis.com/flutter_infra_release/releases",
"current_release": {
"beta": "3ea4d06340a97a1e9d7cae97567c64e0569dcaa2",
"beta": "5a58b36e36b8d7aace89d3950e6deb307956a6a0"
},
"releases": [
{
"hash": "5a58b36e36b8d7aace89d3950e6deb307956a6a0",
"channel": "beta",
"version": "v0.2.3",
"release_date": "2018-03-20T01:47:02.851729Z",
"archive": "beta/$platformName/flutter_${platformName}_v0.2.3-beta.zip",
"sha256": "4fe85a822093e81cb5a66c7fc263f68de39b5797b294191b6d75e7afcc86aff8"
},
{
"hash": "b9bd51cc36b706215915711e580851901faebb40",
"channel": "beta",
"version": "v0.2.2",
"release_date": "2018-03-16T18:48:13.375013Z",
"archive": "beta/$platformName/flutter_${platformName}_v0.2.2-beta.zip",
"sha256": "6073331168cdb37a4637a5dc073d6a7ef4e466321effa2c529fa27d2253a4d4b"
},
{
"hash": "$testRef",
"channel": "stable",
"version": "v0.0.0",
"release_date": "2018-03-20T01:47:02.851729Z",
"archive": "stable/$platformName/flutter_${platformName}_v0.0.0-beta.zip",
"sha256": "5dd34873b3a3e214a32fd30c2c319a0f46e608afb72f0d450b2d621a6d02aebd"
}
]
}
''';
fs.file(jsonPath).writeAsStringSync(releasesJson);
fs.file(archivePath).writeAsStringSync('archive contents');
final Map<String, List<ProcessResult>?> calls = <String, List<ProcessResult>?>{
// This process fails because the file does NOT already exist
'$gsutilCall -- cp $gsJsonPath $jsonPath': null,
'$gsutilCall -- stat $gsArchivePath': <ProcessResult>[ProcessResult(0, 1, '', '')],
'$gsutilCall -- rm $gsArchivePath': null,
'$gsutilCall -- -h Content-Type:$archiveMime cp $archivePath $gsArchivePath': null,
'$gsutilCall -- rm $gsJsonPath': null,
'$gsutilCall -- -h Content-Type:application/json -h Cache-Control:max-age=60 cp $jsonPath $gsJsonPath': null,
};
processManager.addCommands(convertResults(calls));
final File outputFile = fs.file(path.join(tempDir.absolute.path, archiveName));
outputFile.createSync();
assert(tempDir.existsSync());
final ArchivePublisher publisher = ArchivePublisher(
tempDir,
testRef,
Branch.stable,
<String, String>{
'frameworkVersionFromGit': 'v1.2.3',
'dartSdkVersion': '3.2.1',
'dartTargetArch': 'x64',
},
outputFile,
false,
fs: fs,
processManager: processManager,
subprocessOutput: false,
platform: platform,
);
assert(tempDir.existsSync());
await publisher.generateLocalMetadata();
await publisher.publishArchive();
final File releaseFile = fs.file(jsonPath);
expect(releaseFile.existsSync(), isTrue);
final String contents = releaseFile.readAsStringSync();
expect(contents, contains('"dart_sdk_version": "3.2.1"'));
expect(contents, contains('"dart_sdk_arch": "x64"'));
});
test('Supports multiple architectures', () async {
final String archivePath = path.join(tempDir.absolute.path, archiveName);
final String jsonPath = path.join(tempDir.absolute.path, releasesName);
final String gsJsonPath = 'gs://flutter_infra_release/releases/$releasesName';
final String releasesJson = '''
{
"base_url": "https://storage.googleapis.com/flutter_infra_release/releases",
"current_release": {
"beta": "3ea4d06340a97a1e9d7cae97567c64e0569dcaa2",
"beta": "5a58b36e36b8d7aace89d3950e6deb307956a6a0"
},
"releases": [
{
"hash": "deadbeefdeadbeefdeadbeefdeadbeefdeadbeef",
"channel": "stable",
"version": "v1.2.3",
"release_date": "2018-03-20T01:47:02.851729Z",
"archive": "beta/$platformName/flutter_${platformName}_v0.2.3-beta.zip",
"sha256": "4fe85a822093e81cb5a66c7fc263f68de39b5797b294191b6d75e7afcc86aff8",
"dart_sdk_arch": "x64"
}
]
}
''';
fs.file(jsonPath).writeAsStringSync(releasesJson);
fs.file(archivePath).writeAsStringSync('archive contents');
final Map<String, List<ProcessResult>?> calls = <String, List<ProcessResult>?>{
// This process fails because the file does NOT already exist
'$gsutilCall -- cp $gsJsonPath $jsonPath': null,
'$gsutilCall -- stat $gsArchivePath': <ProcessResult>[ProcessResult(0, 1, '', '')],
'$gsutilCall -- rm $gsArchivePath': null,
'$gsutilCall -- -h Content-Type:$archiveMime cp $archivePath $gsArchivePath': null,
'$gsutilCall -- rm $gsJsonPath': null,
'$gsutilCall -- -h Content-Type:application/json -h Cache-Control:max-age=60 cp $jsonPath $gsJsonPath': null,
};
processManager.addCommands(convertResults(calls));
final File outputFile = fs.file(path.join(tempDir.absolute.path, archiveName));
outputFile.createSync();
assert(tempDir.existsSync());
final ArchivePublisher publisher = ArchivePublisher(
tempDir,
testRef,
Branch.stable,
<String, String>{
'frameworkVersionFromGit': 'v1.2.3',
'dartSdkVersion': '3.2.1',
'dartTargetArch': 'arm64',
},
outputFile,
false,
fs: fs,
processManager: processManager,
subprocessOutput: false,
platform: platform,
);
assert(tempDir.existsSync());
await publisher.generateLocalMetadata();
await publisher.publishArchive();
final File releaseFile = fs.file(jsonPath);
expect(releaseFile.existsSync(), isTrue);
final String contents = releaseFile.readAsStringSync();
final Map<String, dynamic> releases = jsonDecode(contents) as Map<String, dynamic>;
expect((releases['releases'] as List<dynamic>).length, equals(2));
});
test('updates base_url from old bucket to new bucket', () async {
final String archivePath = path.join(tempDir.absolute.path, archiveName);
final String jsonPath = path.join(tempDir.absolute.path, releasesName);
final String gsJsonPath = 'gs://flutter_infra_release/releases/$releasesName';
final String releasesJson = '''
{
"base_url": "https://storage.googleapis.com/flutter_infra_release/releases",
"current_release": {
"beta": "3ea4d06340a97a1e9d7cae97567c64e0569dcaa2",
"beta": "5a58b36e36b8d7aace89d3950e6deb307956a6a0"
},
"releases": [
{
"hash": "5a58b36e36b8d7aace89d3950e6deb307956a6a0",
"channel": "beta",
"version": "v0.2.3",
"release_date": "2018-03-20T01:47:02.851729Z",
"archive": "beta/$platformName/flutter_${platformName}_v0.2.3-beta.zip",
"sha256": "4fe85a822093e81cb5a66c7fc263f68de39b5797b294191b6d75e7afcc86aff8"
},
{
"hash": "b9bd51cc36b706215915711e580851901faebb40",
"channel": "beta",
"version": "v0.2.2",
"release_date": "2018-03-16T18:48:13.375013Z",
"archive": "beta/$platformName/flutter_${platformName}_v0.2.2-beta.zip",
"sha256": "6073331168cdb37a4637a5dc073d6a7ef4e466321effa2c529fa27d2253a4d4b"
},
{
"hash": "$testRef",
"channel": "stable",
"version": "v0.0.0",
"release_date": "2018-03-20T01:47:02.851729Z",
"archive": "stable/$platformName/flutter_${platformName}_v0.0.0-beta.zip",
"sha256": "5dd34873b3a3e214a32fd30c2c319a0f46e608afb72f0d450b2d621a6d02aebd"
}
]
}
''';
fs.file(jsonPath).writeAsStringSync(releasesJson);
fs.file(archivePath).writeAsStringSync('archive contents');
final Map<String, List<ProcessResult>?> calls = <String, List<ProcessResult>?>{
// This process fails because the file does NOT already exist
'$gsutilCall -- cp $gsJsonPath $jsonPath': null,
'$gsutilCall -- stat $gsArchivePath': <ProcessResult>[ProcessResult(0, 1, '', '')],
'$gsutilCall -- rm $gsArchivePath': null,
'$gsutilCall -- -h Content-Type:$archiveMime cp $archivePath $gsArchivePath': null,
'$gsutilCall -- rm $gsJsonPath': null,
'$gsutilCall -- -h Content-Type:application/json -h Cache-Control:max-age=60 cp $jsonPath $gsJsonPath': null,
};
processManager.addCommands(convertResults(calls));
final File outputFile = fs.file(path.join(tempDir.absolute.path, archiveName));
outputFile.createSync();
assert(tempDir.existsSync());
final ArchivePublisher publisher = ArchivePublisher(
tempDir,
testRef,
Branch.stable,
<String, String>{
'frameworkVersionFromGit': 'v1.2.3',
'dartSdkVersion': '3.2.1',
'dartTargetArch': 'x64',
},
outputFile,
false,
fs: fs,
processManager: processManager,
subprocessOutput: false,
platform: platform,
);
assert(tempDir.existsSync());
await publisher.generateLocalMetadata();
await publisher.publishArchive();
final File releaseFile = fs.file(jsonPath);
expect(releaseFile.existsSync(), isTrue);
final String contents = releaseFile.readAsStringSync();
final Map<String, dynamic> jsonData = json.decode(contents) as Map<String, dynamic>;
expect(jsonData['base_url'], 'https://storage.googleapis.com/flutter_infra_release/releases');
});
test('publishArchive throws if forceUpload is false and artifact already exists on cloud storage', () async {
final String archiveName = platform.isLinux ? 'archive.tar.xz' : 'archive.zip';
final File outputFile = fs.file(path.join(tempDir.absolute.path, archiveName));
final ArchivePublisher publisher = ArchivePublisher(
tempDir,
testRef,
Branch.stable,
<String, String>{
'frameworkVersionFromGit': 'v1.2.3',
'dartSdkVersion': '3.2.1',
'dartTargetArch': 'x64',
},
outputFile,
false,
fs: fs,
processManager: processManager,
subprocessOutput: false,
platform: platform,
);
final Map<String, List<ProcessResult>> calls = <String, List<ProcessResult>>{
// This process returns 0 because file already exists
'$gsutilCall -- stat $gsArchivePath': <ProcessResult>[ProcessResult(0, 0, '', '')],
};
processManager.addCommands(convertResults(calls));
expect(() async => publisher.publishArchive(), throwsException);
});
test('publishArchive does not throw if forceUpload is true and artifact already exists on cloud storage', () async {
final String archiveName = platform.isLinux ? 'archive.tar.xz' : 'archive.zip';
final File outputFile = fs.file(path.join(tempDir.absolute.path, archiveName));
final ArchivePublisher publisher = ArchivePublisher(
tempDir,
testRef,
Branch.stable,
<String, String>{
'frameworkVersionFromGit': 'v1.2.3',
'dartSdkVersion': '3.2.1',
'dartTargetArch': 'x64',
},
outputFile,
false,
fs: fs,
processManager: processManager,
subprocessOutput: false,
platform: platform,
);
final String archivePath = path.join(tempDir.absolute.path, archiveName);
final String jsonPath = path.join(tempDir.absolute.path, releasesName);
final String gsJsonPath = 'gs://flutter_infra_release/releases/$releasesName';
final String releasesJson = '''
{
"base_url": "https://storage.googleapis.com/flutter_infra_release/releases",
"current_release": {
"beta": "3ea4d06340a97a1e9d7cae97567c64e0569dcaa2",
"beta": "5a58b36e36b8d7aace89d3950e6deb307956a6a0"
},
"releases": [
{
"hash": "5a58b36e36b8d7aace89d3950e6deb307956a6a0",
"channel": "beta",
"version": "v0.2.3",
"release_date": "2018-03-20T01:47:02.851729Z",
"archive": "beta/$platformName/flutter_${platformName}_v0.2.3-beta.zip",
"sha256": "4fe85a822093e81cb5a66c7fc263f68de39b5797b294191b6d75e7afcc86aff8"
},
{
"hash": "b9bd51cc36b706215915711e580851901faebb40",
"channel": "beta",
"version": "v0.2.2",
"release_date": "2018-03-16T18:48:13.375013Z",
"archive": "beta/$platformName/flutter_${platformName}_v0.2.2-beta.zip",
"sha256": "6073331168cdb37a4637a5dc073d6a7ef4e466321effa2c529fa27d2253a4d4b"
},
{
"hash": "$testRef",
"channel": "stable",
"version": "v0.0.0",
"release_date": "2018-03-20T01:47:02.851729Z",
"archive": "stable/$platformName/flutter_${platformName}_v0.0.0-beta.zip",
"sha256": "5dd34873b3a3e214a32fd30c2c319a0f46e608afb72f0d450b2d621a6d02aebd"
}
]
}
''';
fs.file(jsonPath).writeAsStringSync(releasesJson);
fs.file(archivePath).writeAsStringSync('archive contents');
final Map<String, List<ProcessResult>?> calls = <String, List<ProcessResult>?>{
'$gsutilCall -- cp $gsJsonPath $jsonPath': null,
'$gsutilCall -- rm $gsArchivePath': null,
'$gsutilCall -- -h Content-Type:$archiveMime cp $archivePath $gsArchivePath': null,
'$gsutilCall -- rm $gsJsonPath': null,
'$gsutilCall -- -h Content-Type:application/json -h Cache-Control:max-age=60 cp $jsonPath $gsJsonPath': null,
};
processManager.addCommands(convertResults(calls));
assert(tempDir.existsSync());
await publisher.generateLocalMetadata();
await publisher.publishArchive(true);
});
});
}
}
List<FakeCommand> convertResults(Map<String, List<ProcessResult>?> results) {
final List<FakeCommand> commands = <FakeCommand>[];
for (final String key in results.keys) {
final List<ProcessResult>? candidates = results[key];
final List<String> args = key.split(' ');
if (candidates == null) {
commands.add(FakeCommand(
command: args,
));
} else {
for (final ProcessResult result in candidates) {
commands.add(FakeCommand(
command: args,
exitCode: result.exitCode,
stderr: result.stderr.toString(),
stdout: result.stdout.toString(),
));
}
}
}
return commands;
}
| flutter/dev/bots/test/prepare_package_test.dart/0 | {
"file_path": "flutter/dev/bots/test/prepare_package_test.dart",
"repo_id": "flutter",
"token_count": 17734
} | 89 |
// 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:conductor_core/src/proto/conductor_state.pb.dart' as pb;
import 'package:conductor_core/src/state.dart';
import 'package:file/file.dart';
import 'package:file/memory.dart';
import './common.dart';
void main() {
test('writeStateToFile() pretty-prints JSON with 2 spaces', () {
final MemoryFileSystem fileSystem = MemoryFileSystem.test();
final File stateFile = fileSystem.file('/path/to/statefile.json')
..createSync(recursive: true);
const String candidateBranch = 'flutter-2.3-candidate.0';
final pb.ConductorState state = pb.ConductorState.create()
..releaseChannel = 'stable'
..releaseVersion = '2.3.4'
..engine = (pb.Repository.create()
..candidateBranch = candidateBranch
..upstream = (pb.Remote.create()
..name = 'upstream'
..url = 'git@github.com:flutter/engine.git'
)
)
..framework = (pb.Repository.create()
..candidateBranch = candidateBranch
..upstream = (pb.Remote.create()
..name = 'upstream'
..url = 'git@github.com:flutter/flutter.git'
)
);
writeStateToFile(
stateFile,
state,
<String>['[status] hello world'],
);
final String serializedState = stateFile.readAsStringSync();
const String expectedString = '''
{
"releaseChannel": "stable",
"releaseVersion": "2.3.4",
"engine": {
"candidateBranch": "flutter-2.3-candidate.0",
"upstream": {
"name": "upstream",
"url": "git@github.com:flutter/engine.git"
}
},
"framework": {
"candidateBranch": "flutter-2.3-candidate.0",
"upstream": {
"name": "upstream",
"url": "git@github.com:flutter/flutter.git"
}
},
"logs": [
"[status] hello world"
]
}''';
expect(serializedState, expectedString);
});
}
| flutter/dev/conductor/core/test/state_test.dart/0 | {
"file_path": "flutter/dev/conductor/core/test/state_test.dart",
"repo_id": "flutter",
"token_count": 813
} | 90 |
// 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 'dart:io';
import 'dart:typed_data';
import 'package:collection/collection.dart';
import 'package:flutter_devicelab/framework/devices.dart';
import 'package:flutter_devicelab/framework/framework.dart';
import 'package:flutter_devicelab/framework/task_result.dart';
import 'package:flutter_devicelab/framework/utils.dart';
import 'package:flutter_devicelab/tasks/integration_tests.dart';
import 'package:path/path.dart' as path;
import 'package:standard_message_codec/standard_message_codec.dart';
Future<void> main() async {
deviceOperatingSystem = DeviceOperatingSystem.ios;
await task(() async {
await createFlavorsTest().call();
await createIntegrationTestFlavorsTest().call();
// test install and uninstall of flavors app
final String projectDir = '${flutterDirectory.path}/dev/integration_tests/flavors';
final TaskResult installTestsResult = await inDirectory(
projectDir,
() async {
final List<TaskResult> testResults = <TaskResult>[
await _testInstallDebugPaidFlavor(projectDir),
await _testInstallBogusFlavor(),
];
final TaskResult? firstInstallFailure = testResults
.firstWhereOrNull((TaskResult element) => element.failed);
return firstInstallFailure ?? TaskResult.success(null);
},
);
return installTestsResult;
});
}
Future<TaskResult> _testInstallDebugPaidFlavor(String projectDir) async {
await evalFlutter(
'install',
options: <String>['--flavor', 'paid'],
);
final Uint8List assetManifestFileData = File(
path.join(
projectDir,
'build',
'ios',
'iphoneos',
'Paid App.app',
'Frameworks',
'App.framework',
'flutter_assets',
'AssetManifest.bin',
),
).readAsBytesSync();
final Map<Object?, Object?> assetManifest = const StandardMessageCodec()
.decodeMessage(ByteData.sublistView(assetManifestFileData)) as Map<Object?, Object?>;
if (assetManifest.containsKey('assets/free/free.txt')) {
return TaskResult.failure('Expected the asset "assets/free/free.txt", which '
' was declared with a flavor of "free" to not be included in the asset bundle '
' because the --flavor was set to "paid".');
}
if (!assetManifest.containsKey('assets/paid/paid.txt')) {
return TaskResult.failure('Expected the asset "assets/paid/paid.txt", which '
' was declared with a flavor of "paid" to be included in the asset bundle '
' because the --flavor was set to "paid".');
}
await flutter(
'install',
options: <String>['--flavor', 'paid', '--uninstall-only'],
);
return TaskResult.success(null);
}
Future<TaskResult> _testInstallBogusFlavor() async {
final StringBuffer stderr = StringBuffer();
await evalFlutter(
'install',
canFail: true,
stderr: stderr,
options: <String>['--flavor', 'bogus'],
);
final String stderrString = stderr.toString();
if (!stderrString.contains('The Xcode project defines schemes: free, paid')) {
print(stderrString);
return TaskResult.failure('Should not succeed with bogus flavor');
}
return TaskResult.success(null);
}
| flutter/dev/devicelab/bin/tasks/flavors_test_ios.dart/0 | {
"file_path": "flutter/dev/devicelab/bin/tasks/flavors_test_ios.dart",
"repo_id": "flutter",
"token_count": 1178
} | 91 |
// 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_devicelab/framework/devices.dart';
import 'package:flutter_devicelab/framework/framework.dart';
import 'package:flutter_devicelab/framework/utils.dart';
import 'package:flutter_devicelab/tasks/perf_tests.dart';
Future<void> main() async {
deviceOperatingSystem = DeviceOperatingSystem.ios;
await task(PerfTest(
'${flutterDirectory.path}/dev/benchmarks/macrobenchmarks',
'test_driver/large_image_changer.dart',
'large_image_changer',
// This benchmark doesn't care about frame times, frame times will be heavily
// impacted by IO time for loading the image initially.
benchmarkScoreKeys: <String>[
'average_cpu_usage',
'average_gpu_usage',
'average_memory_usage',
'90th_percentile_memory_usage',
'99th_percentile_memory_usage',
'new_gen_gc_count',
'old_gen_gc_count',
],
).run);
}
| flutter/dev/devicelab/bin/tasks/large_image_changer_perf_ios.dart/0 | {
"file_path": "flutter/dev/devicelab/bin/tasks/large_image_changer_perf_ios.dart",
"repo_id": "flutter",
"token_count": 373
} | 92 |
// 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_devicelab/framework/framework.dart';
import 'package:flutter_devicelab/framework/ios.dart';
import 'package:flutter_devicelab/framework/task_result.dart';
import 'package:flutter_devicelab/framework/utils.dart';
import 'package:path/path.dart' as path;
Future<void> main() async {
await task(() async {
final String projectDirectory = '${flutterDirectory.path}/dev/integration_tests/flutter_gallery';
await inDirectory(projectDirectory, () async {
section('Build gallery app');
await flutter(
'build',
options: <String>[
'macos',
'-v',
'--debug',
],
);
});
section('Run platform unit tests');
if (!await runXcodeTests(
platformDirectory: path.join(projectDirectory, 'macos'),
destination: 'platform=macOS',
testName: 'native_ui_tests_macos',
skipCodesign: true,
)) {
return TaskResult.failure('Platform unit tests failed');
}
return TaskResult.success(null);
});
}
| flutter/dev/devicelab/bin/tasks/native_ui_tests_macos.dart/0 | {
"file_path": "flutter/dev/devicelab/bin/tasks/native_ui_tests_macos.dart",
"repo_id": "flutter",
"token_count": 447
} | 93 |
// 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_devicelab/framework/framework.dart';
import 'package:flutter_devicelab/framework/task_result.dart';
/// Smoke test of a task that fails by returning an unsuccessful response.
Future<void> main() async {
await task(() async {
return TaskResult.failure('Failed');
});
}
| flutter/dev/devicelab/bin/tasks/smoke_test_failure.dart/0 | {
"file_path": "flutter/dev/devicelab/bin/tasks/smoke_test_failure.dart",
"repo_id": "flutter",
"token_count": 136
} | 94 |
// 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:file/file.dart';
import 'package:file/local.dart';
import 'package:meta/meta.dart';
import 'package:platform/platform.dart';
/// The current host machine running the tests.
HostAgent get hostAgent => HostAgent(platform: const LocalPlatform(), fileSystem: const LocalFileSystem());
/// Host machine running the tests.
class HostAgent {
HostAgent({required Platform platform, required FileSystem fileSystem})
: _platform = platform,
_fileSystem = fileSystem;
final Platform _platform;
final FileSystem _fileSystem;
/// Creates a directory to dump file artifacts.
Directory? get dumpDirectory {
if (_dumpDirectory == null) {
// Set in LUCI recipe.
final String? directoryPath = _platform.environment['FLUTTER_LOGS_DIR'];
if (directoryPath != null) {
_dumpDirectory = _fileSystem.directory(directoryPath)..createSync(recursive: true);
print('Found FLUTTER_LOGS_DIR dump directory ${_dumpDirectory?.path}');
}
}
return _dumpDirectory;
}
static Directory? _dumpDirectory;
@visibleForTesting
void resetDumpDirectory() {
_dumpDirectory = null;
}
}
| flutter/dev/devicelab/lib/framework/host_agent.dart/0 | {
"file_path": "flutter/dev/devicelab/lib/framework/host_agent.dart",
"repo_id": "flutter",
"token_count": 407
} | 95 |
// 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 'dart:async';
import 'dart:convert';
import 'dart:io' show Directory, File, Process, ProcessSignal;
import '../framework/devices.dart';
import '../framework/framework.dart';
import '../framework/task_result.dart';
import '../framework/utils.dart';
const String _messagePrefix = 'entrypoint:';
const String _entrypointName = 'entrypoint';
const String _dartCode = '''
import 'package:flutter/widgets.dart';
@pragma('vm:entry-point')
void main() {
print('$_messagePrefix main');
runApp(const ColoredBox(color: Color(0xffcc0000)));
}
@pragma('vm:entry-point')
void $_entrypointName() {
print('$_messagePrefix $_entrypointName');
runApp(const ColoredBox(color: Color(0xff00cc00)));
}
''';
const String _kotlinCode = '''
package com.example.entrypoint_dart_registrant
import io.flutter.embedding.android.FlutterActivity
class MainActivity: FlutterActivity() {
override fun getDartEntrypointFunctionName(): String {
return "$_entrypointName"
}
}
''';
Future<TaskResult> _runWithTempDir(Directory tempDir) async {
const String testDirName = 'entrypoint_dart_registrant';
final String testPath = '${tempDir.path}/$testDirName';
await inDirectory(tempDir, () async {
await flutter('create', options: <String>[
'--platforms',
'android',
testDirName,
]);
});
final String mainPath = '${tempDir.path}/$testDirName/lib/main.dart';
print(mainPath);
File(mainPath).writeAsStringSync(_dartCode);
final String activityPath =
'${tempDir.path}/$testDirName/android/app/src/main/kotlin/com/example/entrypoint_dart_registrant/MainActivity.kt';
File(activityPath).writeAsStringSync(_kotlinCode);
final Device device = await devices.workingDevice;
await device.unlock();
final String entrypoint = await inDirectory(testPath, () async {
// The problem only manifested when the dart plugin registrant was used
// (which path_provider has).
await flutter('pub', options: <String>['add', 'path_provider:2.0.9']);
// The problem only manifested on release builds, so we test release.
final Process process =
await startFlutter('run', options: <String>['--release']);
final Completer<String> completer = Completer<String>();
final StreamSubscription<String> stdoutSub = process.stdout
.transform<String>(const Utf8Decoder())
.transform<String>(const LineSplitter())
.listen((String line) async {
print(line);
if (line.contains(_messagePrefix)) {
completer.complete(line);
}
});
final String entrypoint = await completer.future;
await stdoutSub.cancel();
process.stdin.write('q');
await process.stdin.flush();
process.kill(ProcessSignal.sigint);
return entrypoint;
});
if (entrypoint.contains('$_messagePrefix $_entrypointName')) {
return TaskResult.success(null);
} else {
return TaskResult.failure('expected entrypoint:"$_entrypointName" but found:"$entrypoint"');
}
}
/// Asserts that the custom entrypoint works in the presence of the dart plugin
/// registrant.
TaskFunction entrypointDartRegistrant() {
return () async {
final Directory tempDir =
Directory.systemTemp.createTempSync('entrypoint_dart_registrant.');
try {
return await _runWithTempDir(tempDir);
} finally {
rmTree(tempDir);
}
};
}
| flutter/dev/devicelab/lib/tasks/entrypoint_dart_registrant.dart/0 | {
"file_path": "flutter/dev/devicelab/lib/tasks/entrypoint_dart_registrant.dart",
"repo_id": "flutter",
"token_count": 1203
} | 96 |
// 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:collection/collection.dart' show ListEquality, MapEquality;
import 'package:flutter_devicelab/framework/devices.dart';
import 'package:meta/meta.dart';
import 'common.dart';
void main() {
group('device', () {
late Device device;
setUp(() {
FakeDevice.resetLog();
device = FakeDevice(deviceId: 'fakeDeviceId');
});
tearDown(() {
});
group('cpu check', () {
test('arm64', () async {
FakeDevice.pretendArm64();
final AndroidDevice androidDevice = device as AndroidDevice;
expect(await androidDevice.isArm64(), isTrue);
expectLog(<CommandArgs>[
cmd(command: 'getprop', arguments: <String>['ro.bootimage.build.fingerprint', ';', 'getprop', 'ro.build.version.release', ';', 'getprop', 'ro.build.version.sdk']),
cmd(command: 'getprop', arguments: <String>['ro.product.cpu.abi']),
]);
});
});
group('isAwake/isAsleep', () {
test('reads Awake', () async {
FakeDevice.pretendAwake();
expect(await device.isAwake(), isTrue);
expect(await device.isAsleep(), isFalse);
});
test('reads Awake - samsung devices', () async {
FakeDevice.pretendAwakeSamsung();
expect(await device.isAwake(), isTrue);
expect(await device.isAsleep(), isFalse);
});
test('reads Asleep', () async {
FakeDevice.pretendAsleep();
expect(await device.isAwake(), isFalse);
expect(await device.isAsleep(), isTrue);
});
});
group('togglePower', () {
test('sends power event', () async {
await device.togglePower();
expectLog(<CommandArgs>[
cmd(command: 'getprop', arguments: <String>['ro.bootimage.build.fingerprint', ';', 'getprop', 'ro.build.version.release', ';', 'getprop', 'ro.build.version.sdk']),
cmd(command: 'input', arguments: <String>['keyevent', '26']),
]);
});
});
group('wakeUp', () {
test('when awake', () async {
FakeDevice.pretendAwake();
await device.wakeUp();
expectLog(<CommandArgs>[
cmd(command: 'getprop', arguments: <String>['ro.bootimage.build.fingerprint', ';', 'getprop', 'ro.build.version.release', ';', 'getprop', 'ro.build.version.sdk']),
cmd(command: 'dumpsys', arguments: <String>['power']),
]);
});
test('when asleep', () async {
FakeDevice.pretendAsleep();
await device.wakeUp();
expectLog(<CommandArgs>[
cmd(command: 'getprop', arguments: <String>['ro.bootimage.build.fingerprint', ';', 'getprop', 'ro.build.version.release', ';', 'getprop', 'ro.build.version.sdk']),
cmd(command: 'dumpsys', arguments: <String>['power']),
cmd(command: 'input', arguments: <String>['keyevent', '26']),
]);
});
});
group('sendToSleep', () {
test('when asleep', () async {
FakeDevice.pretendAsleep();
await device.sendToSleep();
expectLog(<CommandArgs>[
cmd(command: 'getprop', arguments: <String>['ro.bootimage.build.fingerprint', ';', 'getprop', 'ro.build.version.release', ';', 'getprop', 'ro.build.version.sdk']),
cmd(command: 'dumpsys', arguments: <String>['power']),
]);
});
test('when awake', () async {
FakeDevice.pretendAwake();
await device.sendToSleep();
expectLog(<CommandArgs>[
cmd(command: 'getprop', arguments: <String>['ro.bootimage.build.fingerprint', ';', 'getprop', 'ro.build.version.release', ';', 'getprop', 'ro.build.version.sdk']),
cmd(command: 'dumpsys', arguments: <String>['power']),
cmd(command: 'input', arguments: <String>['keyevent', '26']),
]);
});
});
group('unlock', () {
test('sends unlock event', () async {
FakeDevice.pretendAwake();
await device.unlock();
expectLog(<CommandArgs>[
cmd(command: 'getprop', arguments: <String>['ro.bootimage.build.fingerprint', ';', 'getprop', 'ro.build.version.release', ';', 'getprop', 'ro.build.version.sdk']),
cmd(command: 'dumpsys', arguments: <String>['power']),
cmd(command: 'input', arguments: <String>['keyevent', '82']),
]);
});
});
group('adb', () {
test('tap', () async {
await device.tap(100, 200);
expectLog(<CommandArgs>[
cmd(command: 'getprop', arguments: <String>['ro.bootimage.build.fingerprint', ';', 'getprop', 'ro.build.version.release', ';', 'getprop', 'ro.build.version.sdk']),
cmd(command: 'input', arguments: <String>['tap', '100', '200']),
]);
});
});
});
}
void expectLog(List<CommandArgs> log) {
expect(FakeDevice.commandLog, log);
}
CommandArgs cmd({
required String command,
List<String>? arguments,
Map<String, String>? environment,
}) {
return CommandArgs(
command: command,
arguments: arguments,
environment: environment,
);
}
@immutable
class CommandArgs {
const CommandArgs({ required this.command, this.arguments, this.environment });
final String command;
final List<String>? arguments;
final Map<String, String>? environment;
@override
String toString() => 'CommandArgs(command: $command, arguments: $arguments, environment: $environment)';
@override
bool operator==(Object other) {
if (other.runtimeType != CommandArgs) {
return false;
}
return other is CommandArgs
&& other.command == command
&& const ListEquality<String>().equals(other.arguments, arguments)
&& const MapEquality<String, String>().equals(other.environment, environment);
}
@override
int get hashCode {
return Object.hash(
command,
Object.hashAll(arguments ?? const <String>[]),
Object.hashAllUnordered(environment?.keys ?? const <String>[]),
Object.hashAllUnordered(environment?.values ?? const <String>[]),
);
}
}
class FakeDevice extends AndroidDevice {
FakeDevice({required super.deviceId});
static String output = '';
static List<CommandArgs> commandLog = <CommandArgs>[];
static void resetLog() {
commandLog.clear();
}
static void pretendAwake() {
output = '''
mWakefulness=Awake
''';
}
static void pretendAwakeSamsung() {
output = '''
getWakefulnessLocked()=Awake
''';
}
static void pretendAsleep() {
output = '''
mWakefulness=Asleep
''';
}
static void pretendArm64() {
output = '''
arm64
''';
}
@override
Future<String> shellEval(String command, List<String> arguments, { Map<String, String>? environment, bool silent = false }) async {
commandLog.add(CommandArgs(
command: command,
arguments: arguments,
environment: environment,
));
return output;
}
@override
Future<void> shellExec(String command, List<String> arguments, { Map<String, String>? environment, bool silent = false }) async {
commandLog.add(CommandArgs(
command: command,
arguments: arguments,
environment: environment,
));
}
}
| flutter/dev/devicelab/test/adb_test.dart/0 | {
"file_path": "flutter/dev/devicelab/test/adb_test.dart",
"repo_id": "flutter",
"token_count": 2864
} | 97 |
# Welcome to the Flutter API reference documentation!
Flutter is Google's SDK for crafting beautiful, fast user experiences for
mobile, web, and desktop from a single codebase. Flutter works with existing
code, is used by developers and organizations around the world, and is free
and open source.
This API reference covers all libraries that are exported by the Flutter
SDK.
## More Documentation
This site hosts Flutter's API documentation. Other documentation can be found at
the following locations:
* [flutter.dev](https://flutter.dev) (main Flutter site)
* [Stable channel API Docs](https://api.flutter.dev)
* [Main channel API Docs](https://main-api.flutter.dev)
* Engine Embedder API documentation:
* [Android Embedder](../javadoc/index.html)
* [iOS Embedder](../ios-embedder/index.html)
* [macOS Embedder](../macos-embedder/index.html)
* [Linux Embedder](../linux-embedder/index.html)
* [Windows Embedder](../windows-embedder/index.html)
* [Web Embedder](dart-ui_web/dart-ui_web-library.html)
* [Installation](https://flutter.dev/docs/get-started/install)
* [Codelabs](https://flutter.dev/docs/codelabs)
* [Contributing to Flutter](https://github.com/flutter/flutter/blob/main/CONTRIBUTING.md)
## Offline Documentation
In addition to the online sites above, Flutter's documentation can be downloaded
as an HTML documentation ZIP file for use when offline or when you have a poor
internet connection.
**Warning: the offline documentation files are quite large, approximately 700 MB
to 900 MB.**
Offline HTML documentation ZIP bundles:
* [Stable channel](https://api.flutter.dev/offline/flutter.docs.zip)
* [Main channel](https://main-api.flutter.dev/offline/flutter.docs.zip)
Or, you can add Flutter to the open-source [Zeal](https://zealdocs.org/) app
using the following XML configurations. Follow the instructions in the
application for adding a feed.
* Stable channel Zeal XML configuration URL:
<https://api.flutter.dev/offline/flutter.xml>
* Main channel Zeal XML configuration URL:
<https://main-api.flutter.dev/offline/flutter.xml>
## Importing a Library
### Framework Libraries
Libraries in the "Libraries" section below (or in the left navigation) are part
of the core Flutter framework and are imported using
`'package:flutter/<library>.dart'`, like so:
```dart
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
```
### Dart Libraries
Libraries in the "Dart" section exist in the `dart:` namespace and are imported
using `'dart:<library>'`, like so:
```dart
import 'dart:async';
import 'dart:ui';
```
Except for `'dart:core'`, you must import a Dart library before you can use it.
### Supporting Libraries
Libraries in other sections are supporting libraries that ship with Flutter.
They are organized by package and are imported using
`'package:<package>/<library>.dart'`, like so:
```dart
import 'package:flutter_test/flutter_test.dart';
import 'package:file/local.dart';
```
## Packages on pub.dev
Flutter has a rich ecosystem of packages that have been contributed by the
Flutter team and the broader open source community to a central repository.
Among the thousands of packages, you'll find support for Firebase, Google
Fonts, hardware services like Bluetooth and camera, new widgets and
animations, and integration with other popular web services. You can browse
those packages at [pub.dev](https://pub.dev).
| flutter/dev/docs/README.md/0 | {
"file_path": "flutter/dev/docs/README.md",
"repo_id": "flutter",
"token_count": 995
} | 98 |
<!-- 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. -->
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<!-- ${applicationName} is used by the Flutter tool to select the Application
class to use. For most apps, this is the default Android application.
In most cases you can leave this as-is, but you if you want to provide
additional functionality it is fine to subclass or reimplement
Application and put your custom class here. -->
<application
android:name="${applicationName}"
android:label="abstract_method_smoke_test">
<activity
android:name=".MainActivity"
android:exported="true"
android:launchMode="singleTop"
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="stateVisible|adjustResize">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<!-- Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
<meta-data
android:name="flutterEmbedding"
android:value="2" />
</application>
<!-- Required to query activities that can process text, see:
https://developer.android.com/training/package-visibility and
https://developer.android.com/reference/android/content/Intent#ACTION_PROCESS_TEXT.
In particular, this is used by the Flutter engine in io.flutter.plugin.text.ProcessTextPlugin. -->
<queries>
<intent>
<action android:name="android.intent.action.PROCESS_TEXT"/>
<data android:mimeType="text/plain"/>
</intent>
</queries>
</manifest>
| flutter/dev/integration_tests/abstract_method_smoke_test/android/app/src/main/AndroidManifest.xml/0 | {
"file_path": "flutter/dev/integration_tests/abstract_method_smoke_test/android/app/src/main/AndroidManifest.xml",
"repo_id": "flutter",
"token_count": 826
} | 99 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.