1.0.0
This commit is contained in:
410
test/chart/candlestick_chart/candlestick_chart_data_test.dart
Normal file
410
test/chart/candlestick_chart/candlestick_chart_data_test.dart
Normal file
@@ -0,0 +1,410 @@
|
||||
import 'package:fl_chart/fl_chart.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
import '../data_pool.dart';
|
||||
|
||||
void main() {
|
||||
group('Candlestick data equality check', () {
|
||||
test('CandlestickChartData equality test', () {
|
||||
expect(candleStickChartData1 == candleStickChartData1Clone, true);
|
||||
expect(
|
||||
candleStickChartData1 ==
|
||||
candleStickChartData1Clone.copyWith(showingTooltipIndicators: []),
|
||||
false,
|
||||
);
|
||||
expect(
|
||||
candleStickChartData1 ==
|
||||
candleStickChartData1Clone.copyWith(
|
||||
borderData: FlBorderData(
|
||||
show: true,
|
||||
border: Border.all(color: Colors.red),
|
||||
),
|
||||
),
|
||||
false,
|
||||
);
|
||||
expect(
|
||||
candleStickChartData1 ==
|
||||
candleStickChartData1Clone.copyWith(
|
||||
borderData: FlBorderData(
|
||||
show: true,
|
||||
border: Border.all(color: Colors.green),
|
||||
),
|
||||
),
|
||||
true,
|
||||
);
|
||||
expect(
|
||||
candleStickChartData1 == candleStickChartData1Clone.copyWith(maxX: 444),
|
||||
false,
|
||||
);
|
||||
expect(
|
||||
candleStickChartData1 ==
|
||||
candleStickChartData1Clone.copyWith(
|
||||
candlestickSpots: [
|
||||
CandlestickSpot(
|
||||
x: 0,
|
||||
open: 10,
|
||||
high: 100,
|
||||
low: 0,
|
||||
close: 20,
|
||||
),
|
||||
CandlestickSpot(
|
||||
x: 10,
|
||||
open: 30,
|
||||
high: 110,
|
||||
low: 10,
|
||||
close: 20,
|
||||
),
|
||||
CandlestickSpot(
|
||||
x: 20,
|
||||
open: 30,
|
||||
high: 120,
|
||||
low: 20,
|
||||
close: 40,
|
||||
),
|
||||
CandlestickSpot(
|
||||
x: 30,
|
||||
open: 40,
|
||||
high: 130,
|
||||
low: 30,
|
||||
close: 50,
|
||||
),
|
||||
],
|
||||
),
|
||||
true,
|
||||
);
|
||||
expect(
|
||||
candleStickChartData1 ==
|
||||
candleStickChartData1Clone.copyWith(
|
||||
candlestickSpots: [
|
||||
CandlestickSpot(x: 5, open: 10, high: 100, low: 0, close: 20),
|
||||
CandlestickSpot(x: 10, open: 20, high: 110, low: 10, close: 30),
|
||||
CandlestickSpot(x: 20, open: 30, high: 120, low: 20, close: 40),
|
||||
CandlestickSpot(x: 30, open: 40, high: 130, low: 30, close: 50),
|
||||
],
|
||||
),
|
||||
false,
|
||||
);
|
||||
expect(
|
||||
candleStickChartData1 ==
|
||||
candleStickChartData1Clone.copyWith(
|
||||
clipData: const FlClipData.all(),
|
||||
),
|
||||
false,
|
||||
);
|
||||
expect(
|
||||
candleStickChartData1 ==
|
||||
candleStickChartData1Clone.copyWith(
|
||||
gridData: const FlGridData(
|
||||
verticalInterval: 12,
|
||||
horizontalInterval: 22,
|
||||
drawVerticalLine: false,
|
||||
checkToShowVerticalLine: checkToShowLine,
|
||||
getDrawingHorizontalLine: getDrawingLine,
|
||||
),
|
||||
),
|
||||
true,
|
||||
);
|
||||
expect(
|
||||
candleStickChartData1 ==
|
||||
candleStickChartData1Clone.copyWith(
|
||||
gridData: const FlGridData(
|
||||
getDrawingHorizontalLine: gridGetDrawingLine,
|
||||
getDrawingVerticalLine: gridGetDrawingLine,
|
||||
checkToShowHorizontalLine: gridCheckToShowLine,
|
||||
checkToShowVerticalLine: gridCheckToShowLine,
|
||||
drawVerticalLine: false,
|
||||
horizontalInterval: 33,
|
||||
verticalInterval: 1,
|
||||
),
|
||||
),
|
||||
false,
|
||||
);
|
||||
expect(
|
||||
candleStickChartData1 ==
|
||||
candleStickChartData1Clone.copyWith(
|
||||
gridData: FlGridData(
|
||||
show: false,
|
||||
getDrawingHorizontalLine: (value) => const FlLine(
|
||||
color: Colors.green,
|
||||
strokeWidth: 12,
|
||||
dashArray: [1, 2],
|
||||
),
|
||||
getDrawingVerticalLine: (value) => const FlLine(
|
||||
color: Colors.yellow,
|
||||
strokeWidth: 33,
|
||||
dashArray: [0, 1],
|
||||
),
|
||||
checkToShowHorizontalLine: (value) => false,
|
||||
checkToShowVerticalLine: (value) => true,
|
||||
drawVerticalLine: false,
|
||||
horizontalInterval: 32,
|
||||
verticalInterval: 1,
|
||||
),
|
||||
),
|
||||
false,
|
||||
);
|
||||
expect(
|
||||
candleStickChartData1 ==
|
||||
candleStickChartData1Clone.copyWith(
|
||||
titlesData: MockData.flTitlesData1,
|
||||
),
|
||||
true,
|
||||
);
|
||||
expect(
|
||||
candleStickChartData1 ==
|
||||
candleStickChartData1Clone.copyWith(
|
||||
titlesData: const FlTitlesData(
|
||||
leftTitles: AxisTitles(
|
||||
axisNameSize: 332,
|
||||
axisNameWidget: Text('title 1'),
|
||||
),
|
||||
rightTitles: AxisTitles(
|
||||
axisNameSize: 1326,
|
||||
axisNameWidget: Text('title 3'),
|
||||
sideTitles: SideTitles(reservedSize: 500, showTitles: true),
|
||||
),
|
||||
topTitles: AxisTitles(
|
||||
axisNameSize: 34,
|
||||
axisNameWidget: Text('title 4'),
|
||||
),
|
||||
bottomTitles: AxisTitles(
|
||||
axisNameSize: 22,
|
||||
axisNameWidget: Text('title 2'),
|
||||
),
|
||||
),
|
||||
),
|
||||
false,
|
||||
);
|
||||
expect(
|
||||
candleStickChartData1 ==
|
||||
candleStickChartData1Clone.copyWith(
|
||||
titlesData: const FlTitlesData(
|
||||
leftTitles: AxisTitles(
|
||||
axisNameSize: 33,
|
||||
axisNameWidget: Text('title 1'),
|
||||
),
|
||||
rightTitles: AxisTitles(
|
||||
axisNameSize: 1326,
|
||||
axisNameWidget: Text('title 3'),
|
||||
sideTitles: SideTitles(reservedSize: 500, showTitles: true),
|
||||
),
|
||||
topTitles: AxisTitles(
|
||||
axisNameSize: 34,
|
||||
axisNameWidget: Text('title 4'),
|
||||
),
|
||||
bottomTitles: AxisTitles(
|
||||
axisNameSize: 22,
|
||||
axisNameWidget: Text('title 2'),
|
||||
sideTitles: SideTitles(showTitles: true),
|
||||
),
|
||||
),
|
||||
),
|
||||
false,
|
||||
);
|
||||
expect(
|
||||
candleStickChartData1 ==
|
||||
candleStickChartData1Clone.copyWith(
|
||||
titlesData: const FlTitlesData(
|
||||
leftTitles: AxisTitles(
|
||||
axisNameSize: 33,
|
||||
axisNameWidget: Text('title 1'),
|
||||
),
|
||||
rightTitles: AxisTitles(
|
||||
axisNameSize: 1326,
|
||||
axisNameWidget: Text('title 1'),
|
||||
sideTitles: SideTitles(reservedSize: 500, showTitles: true),
|
||||
),
|
||||
topTitles: AxisTitles(
|
||||
axisNameSize: 34,
|
||||
axisNameWidget: Text('title 4'),
|
||||
),
|
||||
bottomTitles: AxisTitles(
|
||||
axisNameSize: 22,
|
||||
axisNameWidget: Text('title 2'),
|
||||
),
|
||||
),
|
||||
),
|
||||
false,
|
||||
);
|
||||
expect(
|
||||
candleStickChartData1 ==
|
||||
candleStickChartData1Clone.copyWith(
|
||||
titlesData: const FlTitlesData(
|
||||
leftTitles: AxisTitles(
|
||||
axisNameSize: 33,
|
||||
axisNameWidget: Text('title 1'),
|
||||
),
|
||||
rightTitles: AxisTitles(
|
||||
axisNameSize: 13262,
|
||||
axisNameWidget: Text('title 3'),
|
||||
sideTitles: SideTitles(reservedSize: 500, showTitles: true),
|
||||
),
|
||||
topTitles: AxisTitles(
|
||||
axisNameSize: 34,
|
||||
axisNameWidget: Text('title 4'),
|
||||
),
|
||||
bottomTitles: AxisTitles(
|
||||
axisNameSize: 22,
|
||||
axisNameWidget: Text('title 2'),
|
||||
),
|
||||
),
|
||||
),
|
||||
false,
|
||||
);
|
||||
|
||||
expect(
|
||||
candleStickChartData1 ==
|
||||
candleStickChartData1Clone.copyWith(showingTooltipIndicators: []),
|
||||
false,
|
||||
);
|
||||
|
||||
expect(
|
||||
candleStickChartData1 ==
|
||||
candleStickChartData1Clone
|
||||
.copyWith(showingTooltipIndicators: [2, 1, 0]),
|
||||
false,
|
||||
);
|
||||
|
||||
expect(
|
||||
candleStickChartData1 ==
|
||||
candleStickChartData1Clone.copyWith(
|
||||
candlestickPainter: DefaultCandlestickPainter(),
|
||||
),
|
||||
false,
|
||||
);
|
||||
});
|
||||
|
||||
test('CandlestickSpot equality test', () {
|
||||
expect(candlestickSpot1 == candlestickSpot1Clone, true);
|
||||
expect(candlestickSpot1 == candlestickSpot2, false);
|
||||
expect(candlestickSpot2 == candlestickSpot2.copyWith(), true);
|
||||
expect(candlestickSpot2 == candlestickSpot3, false);
|
||||
expect(candlestickSpot3 == candlestickSpot4, false);
|
||||
expect(
|
||||
candlestickSpot3 ==
|
||||
candlestickSpot3.copyWith(
|
||||
show: false,
|
||||
),
|
||||
false,
|
||||
);
|
||||
expect(
|
||||
candlestickSpot3 ==
|
||||
candlestickSpot3.copyWith(
|
||||
show: true,
|
||||
),
|
||||
true,
|
||||
);
|
||||
});
|
||||
|
||||
test('CandlestickTouchData equality test', () {
|
||||
final sample = CandlestickTouchData(
|
||||
touchTooltipData: CandlestickTouchTooltipData(
|
||||
maxContentWidth: 2,
|
||||
getTooltipColor: candlestickChartGetTooltipRedColor,
|
||||
tooltipPadding: const EdgeInsets.all(11),
|
||||
),
|
||||
handleBuiltInTouches: false,
|
||||
touchSpotThreshold: 23,
|
||||
enabled: false,
|
||||
);
|
||||
final sampleClone = CandlestickTouchData(
|
||||
touchTooltipData: CandlestickTouchTooltipData(
|
||||
maxContentWidth: 2,
|
||||
getTooltipColor: candlestickChartGetTooltipRedColor,
|
||||
tooltipPadding: const EdgeInsets.all(11),
|
||||
),
|
||||
handleBuiltInTouches: false,
|
||||
touchSpotThreshold: 23,
|
||||
enabled: false,
|
||||
);
|
||||
expect(sample == sampleClone, true);
|
||||
|
||||
expect(
|
||||
sample ==
|
||||
sampleClone.copyWith(
|
||||
touchCallback: (event, response) {},
|
||||
),
|
||||
false,
|
||||
);
|
||||
expect(
|
||||
sample ==
|
||||
sampleClone.copyWith(
|
||||
enabled: true,
|
||||
),
|
||||
false,
|
||||
);
|
||||
expect(
|
||||
sample ==
|
||||
sampleClone.copyWith(
|
||||
touchSpotThreshold: 22,
|
||||
),
|
||||
false,
|
||||
);
|
||||
expect(
|
||||
sample ==
|
||||
sampleClone.copyWith(
|
||||
handleBuiltInTouches: true,
|
||||
),
|
||||
false,
|
||||
);
|
||||
expect(
|
||||
sample ==
|
||||
sampleClone.copyWith(
|
||||
longPressDuration: Duration.zero,
|
||||
),
|
||||
false,
|
||||
);
|
||||
});
|
||||
|
||||
test('CandlestickTouchTooltipData equality test', () {
|
||||
expect(
|
||||
candlestickTouchTooltipData1 == candlestickTouchTooltipData1Clone,
|
||||
true,
|
||||
);
|
||||
expect(
|
||||
candlestickTouchTooltipData1 == candlestickTouchTooltipData2,
|
||||
false,
|
||||
);
|
||||
expect(
|
||||
candlestickTouchTooltipData1 == candlestickTouchTooltipData3,
|
||||
false,
|
||||
);
|
||||
});
|
||||
|
||||
test('CandlestickTooltipItem equality test', () {
|
||||
final sample1 = CandlestickTooltipItem(
|
||||
'aa',
|
||||
textStyle: const TextStyle(color: Colors.red),
|
||||
bottomMargin: 23,
|
||||
);
|
||||
final sample2 = CandlestickTooltipItem(
|
||||
'aa',
|
||||
textStyle: const TextStyle(color: Colors.red),
|
||||
bottomMargin: 23,
|
||||
);
|
||||
expect(sample1 == sample2, true);
|
||||
|
||||
var changed = CandlestickTooltipItem(
|
||||
'a3a',
|
||||
textStyle: const TextStyle(color: Colors.red),
|
||||
bottomMargin: 23,
|
||||
);
|
||||
expect(sample1 == changed, false);
|
||||
|
||||
changed = CandlestickTooltipItem(
|
||||
'aa',
|
||||
textStyle: const TextStyle(color: Colors.green),
|
||||
bottomMargin: 23,
|
||||
);
|
||||
expect(sample1 == changed, false);
|
||||
|
||||
changed = CandlestickTooltipItem(
|
||||
'aa',
|
||||
textStyle: const TextStyle(color: Colors.red),
|
||||
bottomMargin: 0,
|
||||
);
|
||||
expect(sample1 == changed, false);
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
import 'package:fl_chart/fl_chart.dart';
|
||||
import 'package:fl_chart/src/chart/candlestick_chart/candlestick_chart_helper.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
import '../data_pool.dart';
|
||||
|
||||
void main() {
|
||||
group('Check CandlestickChartHelper.calculateMaxAxisValues', () {
|
||||
test('Test validity 1', () {
|
||||
final candlestickSpots = [
|
||||
candlestickSpot1,
|
||||
candlestickSpot2,
|
||||
candlestickSpot3,
|
||||
candlestickSpot4,
|
||||
];
|
||||
final (minX, maxX, minY, maxY) =
|
||||
CandlestickChartHelper.calculateMaxAxisValues(candlestickSpots);
|
||||
expect(minX, 0);
|
||||
expect(maxX, 30);
|
||||
expect(minY, 0);
|
||||
expect(maxY, 130);
|
||||
});
|
||||
|
||||
test('Test validity 2', () {
|
||||
final scatterSpots = [
|
||||
CandlestickSpot(
|
||||
x: 0,
|
||||
open: 100,
|
||||
close: 200,
|
||||
high: 400,
|
||||
low: 4,
|
||||
),
|
||||
CandlestickSpot(
|
||||
x: 1,
|
||||
open: 500,
|
||||
close: 200,
|
||||
high: 800,
|
||||
low: 40,
|
||||
),
|
||||
];
|
||||
final (minX, maxX, minY, maxY) =
|
||||
CandlestickChartHelper.calculateMaxAxisValues(scatterSpots);
|
||||
expect(minX, 0);
|
||||
expect(maxX, 1);
|
||||
expect(minY, 4);
|
||||
expect(maxY, 800);
|
||||
});
|
||||
|
||||
test('Test validity 3', () {
|
||||
final candlestickSpots = <CandlestickSpot>[];
|
||||
final (minX, maxX, minY, maxY) =
|
||||
CandlestickChartHelper.calculateMaxAxisValues(candlestickSpots);
|
||||
expect(minX, 0);
|
||||
expect(maxX, 0);
|
||||
expect(minY, 0);
|
||||
expect(maxY, 0);
|
||||
});
|
||||
|
||||
test('Test validity 4', () {
|
||||
final candlestickSpots = [
|
||||
candlestickSpot1,
|
||||
candlestickSpot2,
|
||||
candlestickSpot3,
|
||||
candlestickSpot4,
|
||||
candlestickSpot5,
|
||||
];
|
||||
final (minX, maxX, minY, maxY) =
|
||||
CandlestickChartHelper.calculateMaxAxisValues(candlestickSpots);
|
||||
expect(minX, -50);
|
||||
expect(maxX, 30);
|
||||
expect(minY, -30);
|
||||
expect(maxY, 130);
|
||||
});
|
||||
|
||||
test('Test equality', () {
|
||||
final candlestickSpots = [
|
||||
candlestickSpot1,
|
||||
candlestickSpot2,
|
||||
candlestickSpot3,
|
||||
];
|
||||
final candlestickSpotsClone = [
|
||||
candlestickSpot1Clone,
|
||||
candlestickSpot2Clone,
|
||||
candlestickSpot3,
|
||||
];
|
||||
final result1 =
|
||||
CandlestickChartHelper.calculateMaxAxisValues(candlestickSpots);
|
||||
final result2 =
|
||||
CandlestickChartHelper.calculateMaxAxisValues(candlestickSpotsClone);
|
||||
expect(result1, result2);
|
||||
});
|
||||
});
|
||||
}
|
||||
1070
test/chart/candlestick_chart/candlestick_chart_painter_test.dart
Normal file
1070
test/chart/candlestick_chart/candlestick_chart_painter_test.dart
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,924 @@
|
||||
// Mocks generated by Mockito 5.4.5 from annotations
|
||||
// in fl_chart/test/chart/candlestick_chart/candlestick_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: must_be_immutable
|
||||
// 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 drawErrorIndicator(
|
||||
_i7.FlSpotErrorRangePainter? painter,
|
||||
_i7.FlSpot? origin,
|
||||
_i2.Offset? offset,
|
||||
_i2.Rect? errorRelativeRect,
|
||||
_i7.AxisChartData? axisData,
|
||||
) => super.noSuchMethod(
|
||||
Invocation.method(#drawErrorIndicator, [
|
||||
painter,
|
||||
origin,
|
||||
offset,
|
||||
errorRelativeRect,
|
||||
axisData,
|
||||
]),
|
||||
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
|
||||
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);
|
||||
}
|
||||
@@ -0,0 +1,150 @@
|
||||
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/candlestick_chart/candlestick_chart_painter.dart';
|
||||
import 'package:fl_chart/src/chart/candlestick_chart/candlestick_chart_renderer.dart';
|
||||
import 'package:fl_chart/src/utils/canvas_wrapper.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:mockito/annotations.dart';
|
||||
import 'package:mockito/mockito.dart';
|
||||
|
||||
import '../data_pool.dart';
|
||||
import 'candlestick_chart_renderer_test.mocks.dart';
|
||||
|
||||
@GenerateMocks([Canvas, PaintingContext, BuildContext, CandlestickChartPainter])
|
||||
void main() {
|
||||
group('CandlestickChartRenderer', () {
|
||||
final data = CandlestickChartData(
|
||||
candlestickSpots: [candlestickSpot1, candlestickSpot2],
|
||||
);
|
||||
|
||||
final targetData = CandlestickChartData(
|
||||
candlestickSpots: [candlestickSpot3],
|
||||
);
|
||||
|
||||
const textScaler = TextScaler.linear(4);
|
||||
|
||||
final mockBuildContext = MockBuildContext();
|
||||
final renderCandlestickChart = RenderCandlestickChart(
|
||||
mockBuildContext,
|
||||
data,
|
||||
targetData,
|
||||
textScaler,
|
||||
null,
|
||||
canBeScaled: false,
|
||||
);
|
||||
|
||||
final mockPainter = MockCandlestickChartPainter();
|
||||
final mockPaintingContext = MockPaintingContext();
|
||||
final mockCanvas = MockCanvas();
|
||||
const mockSize = Size(44, 44);
|
||||
when(mockPaintingContext.canvas).thenAnswer((realInvocation) => mockCanvas);
|
||||
renderCandlestickChart
|
||||
..mockTestSize = mockSize
|
||||
..painter = mockPainter;
|
||||
|
||||
test('test 1 correct data set', () {
|
||||
expect(renderCandlestickChart.data == data, true);
|
||||
expect(renderCandlestickChart.data == targetData, false);
|
||||
expect(renderCandlestickChart.targetData == targetData, true);
|
||||
expect(renderCandlestickChart.textScaler == textScaler, true);
|
||||
expect(renderCandlestickChart.paintHolder.data == data, true);
|
||||
expect(renderCandlestickChart.paintHolder.targetData == targetData, true);
|
||||
expect(renderCandlestickChart.paintHolder.textScaler == textScaler, true);
|
||||
});
|
||||
|
||||
test('test 2 check paint function', () {
|
||||
renderCandlestickChart.paint(mockPaintingContext, const Offset(10, 10));
|
||||
verify(mockCanvas.save()).called(1);
|
||||
verify(mockCanvas.translate(10, 10)).called(1);
|
||||
final result = verify(mockPainter.paint(any, captureAny, captureAny));
|
||||
expect(result.callCount, 1);
|
||||
|
||||
final canvasWrapper = result.captured[0] as CanvasWrapper;
|
||||
expect(canvasWrapper.size, const Size(44, 44));
|
||||
expect(canvasWrapper.canvas, mockCanvas);
|
||||
|
||||
final paintHolder = result.captured[1] as PaintHolder;
|
||||
expect(paintHolder.data, data);
|
||||
expect(paintHolder.targetData, targetData);
|
||||
expect(paintHolder.textScaler, textScaler);
|
||||
|
||||
verify(mockCanvas.restore()).called(1);
|
||||
});
|
||||
|
||||
test('test 3 check getResponseAtLocation function', () {
|
||||
final results = <Map<String, dynamic>>[];
|
||||
when(mockPainter.handleTouch(captureAny, captureAny, captureAny))
|
||||
.thenAnswer((inv) {
|
||||
results.add({
|
||||
'local_position': inv.positionalArguments[0] as Offset,
|
||||
'size': inv.positionalArguments[1] as Size,
|
||||
'paint_holder': inv.positionalArguments[2] as PaintHolder,
|
||||
});
|
||||
return candlestickTouchedSpot1;
|
||||
});
|
||||
|
||||
when(mockPainter.getChartCoordinateFromPixel(any, any, any))
|
||||
.thenAnswer((_) => const Offset(10, 10));
|
||||
|
||||
final touchResponse =
|
||||
renderCandlestickChart.getResponseAtLocation(MockData.offset1);
|
||||
expect(touchResponse.touchedSpot, candlestickTouchedSpot1);
|
||||
expect(touchResponse.touchChartCoordinate, const Offset(10, 10));
|
||||
expect(results[0]['local_position'] as Offset, MockData.offset1);
|
||||
expect(results[0]['size'] as Size, mockSize);
|
||||
final paintHolder = results[0]['paint_holder'] as PaintHolder;
|
||||
expect(paintHolder.data, data);
|
||||
expect(paintHolder.targetData, targetData);
|
||||
expect(paintHolder.textScaler, textScaler);
|
||||
});
|
||||
|
||||
test('test 4 check setters', () {
|
||||
renderCandlestickChart
|
||||
..data = targetData
|
||||
..targetData = data
|
||||
..textScaler = const TextScaler.linear(22);
|
||||
|
||||
expect(renderCandlestickChart.data, targetData);
|
||||
expect(renderCandlestickChart.targetData, data);
|
||||
expect(renderCandlestickChart.textScaler, const TextScaler.linear(22));
|
||||
});
|
||||
|
||||
test('passes chart virtual rect to paint holder', () {
|
||||
final rect1 = Offset.zero & const Size(100, 100);
|
||||
final renderCandlestickChart = RenderCandlestickChart(
|
||||
mockBuildContext,
|
||||
data,
|
||||
targetData,
|
||||
textScaler,
|
||||
null,
|
||||
canBeScaled: false,
|
||||
);
|
||||
|
||||
expect(renderCandlestickChart.chartVirtualRect, isNull);
|
||||
expect(renderCandlestickChart.paintHolder.chartVirtualRect, isNull);
|
||||
|
||||
renderCandlestickChart.chartVirtualRect = rect1;
|
||||
|
||||
expect(renderCandlestickChart.chartVirtualRect, rect1);
|
||||
expect(renderCandlestickChart.paintHolder.chartVirtualRect, rect1);
|
||||
});
|
||||
|
||||
test('uses canBeScaled', () {
|
||||
final renderCandlestickChart = RenderCandlestickChart(
|
||||
mockBuildContext,
|
||||
data,
|
||||
targetData,
|
||||
textScaler,
|
||||
null,
|
||||
canBeScaled: false,
|
||||
);
|
||||
|
||||
expect(renderCandlestickChart.canBeScaled, false);
|
||||
|
||||
renderCandlestickChart.canBeScaled = true;
|
||||
|
||||
expect(renderCandlestickChart.canBeScaled, true);
|
||||
});
|
||||
});
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
843
test/chart/candlestick_chart/candlestick_chart_test.dart
Normal file
843
test/chart/candlestick_chart/candlestick_chart_test.dart
Normal file
@@ -0,0 +1,843 @@
|
||||
import 'package:fl_chart/src/chart/base/axis_chart/axis_chart_scaffold_widget.dart';
|
||||
import 'package:fl_chart/src/chart/base/axis_chart/scale_axis.dart';
|
||||
import 'package:fl_chart/src/chart/base/axis_chart/transformation_config.dart';
|
||||
import 'package:fl_chart/src/chart/candlestick_chart/candlestick_chart.dart';
|
||||
import 'package:fl_chart/src/chart/candlestick_chart/candlestick_chart_data.dart';
|
||||
import 'package:fl_chart/src/chart/candlestick_chart/candlestick_chart_renderer.dart';
|
||||
import 'package:flutter/gestures.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
void main() {
|
||||
Widget createTestWidget({
|
||||
required CandlestickChart chart,
|
||||
}) {
|
||||
return MaterialApp(
|
||||
home: chart,
|
||||
);
|
||||
}
|
||||
|
||||
group('CandlestickChart', () {
|
||||
testWidgets('has correct default values', (WidgetTester tester) async {
|
||||
await tester.pumpWidget(
|
||||
createTestWidget(
|
||||
chart: CandlestickChart(
|
||||
CandlestickChartData(),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
final candlestickChart = tester.widget<CandlestickChart>(
|
||||
find.byType(CandlestickChart),
|
||||
);
|
||||
expect(
|
||||
candlestickChart.transformationConfig,
|
||||
const FlTransformationConfig(),
|
||||
);
|
||||
});
|
||||
|
||||
testWidgets('passes interaction parameters to AxisChartScaffoldWidget',
|
||||
(WidgetTester tester) async {
|
||||
await tester.pumpWidget(
|
||||
createTestWidget(
|
||||
chart: CandlestickChart(
|
||||
CandlestickChartData(),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
final axisChartScaffoldWidget = tester.widget<AxisChartScaffoldWidget>(
|
||||
find.byType(AxisChartScaffoldWidget),
|
||||
);
|
||||
|
||||
expect(
|
||||
axisChartScaffoldWidget.transformationConfig,
|
||||
const FlTransformationConfig(),
|
||||
);
|
||||
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
final transformationConfig = FlTransformationConfig(
|
||||
scaleAxis: FlScaleAxis.free,
|
||||
trackpadScrollCausesScale: true,
|
||||
maxScale: 10,
|
||||
minScale: 1.5,
|
||||
transformationController: TransformationController(),
|
||||
);
|
||||
await tester.pumpWidget(
|
||||
createTestWidget(
|
||||
chart: CandlestickChart(
|
||||
CandlestickChartData(),
|
||||
transformationConfig: transformationConfig,
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
final axisChartScaffoldWidget1 = tester.widget<AxisChartScaffoldWidget>(
|
||||
find.byType(AxisChartScaffoldWidget),
|
||||
);
|
||||
|
||||
expect(
|
||||
axisChartScaffoldWidget1.transformationConfig,
|
||||
transformationConfig,
|
||||
);
|
||||
});
|
||||
|
||||
for (final scaleAxis in FlScaleAxis.scalingEnabledAxis) {
|
||||
testWidgets('passes canBeScaled true for $scaleAxis',
|
||||
(WidgetTester tester) async {
|
||||
await tester.pumpWidget(
|
||||
createTestWidget(
|
||||
chart: CandlestickChart(
|
||||
CandlestickChartData(),
|
||||
transformationConfig: FlTransformationConfig(
|
||||
scaleAxis: scaleAxis,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
final candlestickChartLeaf = tester.widget<CandlestickChartLeaf>(
|
||||
find.byType(CandlestickChartLeaf),
|
||||
);
|
||||
expect(candlestickChartLeaf.canBeScaled, true);
|
||||
});
|
||||
}
|
||||
|
||||
testWidgets('passes canBeScaled false for FlScaleAxis.none',
|
||||
(WidgetTester tester) async {
|
||||
await tester.pumpWidget(
|
||||
createTestWidget(
|
||||
chart: CandlestickChart(
|
||||
CandlestickChartData(),
|
||||
// This is for test
|
||||
// ignore: avoid_redundant_argument_values
|
||||
transformationConfig: const FlTransformationConfig(
|
||||
// This is for test
|
||||
// ignore: avoid_redundant_argument_values
|
||||
scaleAxis: FlScaleAxis.none,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
final candlestickChartLeaf = tester.widget<CandlestickChartLeaf>(
|
||||
find.byType(CandlestickChartLeaf),
|
||||
);
|
||||
expect(candlestickChartLeaf.canBeScaled, false);
|
||||
});
|
||||
|
||||
group('touch gesture', () {
|
||||
testWidgets('does not scale with FlScaleAxis.none',
|
||||
(WidgetTester tester) async {
|
||||
await tester.pumpWidget(
|
||||
createTestWidget(
|
||||
chart: CandlestickChart(
|
||||
CandlestickChartData(),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
final candlestickChartCenterOffset =
|
||||
tester.getCenter(find.byType(CandlestickChartLeaf));
|
||||
final scaleStart1 = candlestickChartCenterOffset;
|
||||
final scaleStart2 = candlestickChartCenterOffset;
|
||||
final scaleEnd1 = candlestickChartCenterOffset + const Offset(100, 100);
|
||||
final scaleEnd2 = candlestickChartCenterOffset - const Offset(100, 100);
|
||||
|
||||
final gesture1 = await tester.startGesture(scaleStart1);
|
||||
final gesture2 = await tester.startGesture(scaleStart2);
|
||||
await tester.pump();
|
||||
await gesture1.moveTo(scaleEnd1);
|
||||
await gesture2.moveTo(scaleEnd2);
|
||||
await tester.pump();
|
||||
await gesture1.up();
|
||||
await gesture2.up();
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
final candlestickChartLeaf = tester.widget<CandlestickChartLeaf>(
|
||||
find.byType(CandlestickChartLeaf),
|
||||
);
|
||||
|
||||
expect(candlestickChartLeaf.chartVirtualRect, isNull);
|
||||
});
|
||||
|
||||
testWidgets('scales freely with FlScaleAxis.free',
|
||||
(WidgetTester tester) async {
|
||||
await tester.pumpWidget(
|
||||
createTestWidget(
|
||||
chart: CandlestickChart(
|
||||
CandlestickChartData(),
|
||||
transformationConfig: const FlTransformationConfig(
|
||||
scaleAxis: FlScaleAxis.free,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
final candlestickChartCenterOffset =
|
||||
tester.getCenter(find.byType(CandlestickChartLeaf));
|
||||
final scaleStart1 = candlestickChartCenterOffset;
|
||||
final scaleStart2 = candlestickChartCenterOffset;
|
||||
final scaleEnd1 = candlestickChartCenterOffset + const Offset(100, 100);
|
||||
final scaleEnd2 = candlestickChartCenterOffset - const Offset(100, 100);
|
||||
|
||||
final gesture1 = await tester.startGesture(scaleStart1);
|
||||
final gesture2 = await tester.startGesture(scaleStart2);
|
||||
await tester.pump();
|
||||
await gesture1.moveTo(scaleEnd1);
|
||||
await gesture2.moveTo(scaleEnd2);
|
||||
await tester.pump();
|
||||
await gesture1.up();
|
||||
await gesture2.up();
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
final candlestickChartLeaf = tester.widget<CandlestickChartLeaf>(
|
||||
find.byType(CandlestickChartLeaf),
|
||||
);
|
||||
final renderBox = tester.renderObject<RenderBox>(
|
||||
find.byType(CandlestickChartLeaf),
|
||||
);
|
||||
final chartVirtualRect = candlestickChartLeaf.chartVirtualRect!;
|
||||
|
||||
expect(chartVirtualRect.size, greaterThan(renderBox.size));
|
||||
expect(chartVirtualRect.left, isNegative);
|
||||
expect(chartVirtualRect.top, isNegative);
|
||||
});
|
||||
|
||||
testWidgets('scales horizontally with FlScaleAxis.horizontal',
|
||||
(WidgetTester tester) async {
|
||||
await tester.pumpWidget(
|
||||
createTestWidget(
|
||||
chart: CandlestickChart(
|
||||
CandlestickChartData(),
|
||||
transformationConfig: const FlTransformationConfig(
|
||||
scaleAxis: FlScaleAxis.horizontal,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
final chartCenterOffset =
|
||||
tester.getCenter(find.byType(CandlestickChartLeaf));
|
||||
final scaleStart1 = chartCenterOffset;
|
||||
final scaleStart2 = chartCenterOffset;
|
||||
final scaleEnd1 = chartCenterOffset + const Offset(100, 100);
|
||||
final scaleEnd2 = chartCenterOffset - const Offset(100, 100);
|
||||
|
||||
final gesture1 = await tester.startGesture(scaleStart1);
|
||||
final gesture2 = await tester.startGesture(scaleStart2);
|
||||
await tester.pump();
|
||||
await gesture1.moveTo(scaleEnd1);
|
||||
await gesture2.moveTo(scaleEnd2);
|
||||
await tester.pump();
|
||||
await gesture1.up();
|
||||
await gesture2.up();
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
final candlestickChartLeaf = tester.widget<CandlestickChartLeaf>(
|
||||
find.byType(CandlestickChartLeaf),
|
||||
);
|
||||
final renderBox = tester.renderObject<RenderBox>(
|
||||
find.byType(CandlestickChartLeaf),
|
||||
);
|
||||
final chartVirtualRect = candlestickChartLeaf.chartVirtualRect!;
|
||||
|
||||
expect(chartVirtualRect.size.height, renderBox.size.height);
|
||||
expect(chartVirtualRect.size.width, greaterThan(renderBox.size.width));
|
||||
expect(chartVirtualRect.left, isNegative);
|
||||
expect(chartVirtualRect.top, 0);
|
||||
});
|
||||
|
||||
testWidgets('scales vertically with FlScaleAxis.vertical',
|
||||
(WidgetTester tester) async {
|
||||
await tester.pumpWidget(
|
||||
createTestWidget(
|
||||
chart: CandlestickChart(
|
||||
CandlestickChartData(),
|
||||
transformationConfig: const FlTransformationConfig(
|
||||
scaleAxis: FlScaleAxis.vertical,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
final chartCenterOffset =
|
||||
tester.getCenter(find.byType(CandlestickChartLeaf));
|
||||
final scaleStart1 = chartCenterOffset;
|
||||
final scaleStart2 = chartCenterOffset;
|
||||
final scaleEnd1 = chartCenterOffset + const Offset(100, 100);
|
||||
final scaleEnd2 = chartCenterOffset - const Offset(100, 100);
|
||||
|
||||
final gesture1 = await tester.startGesture(scaleStart1);
|
||||
final gesture2 = await tester.startGesture(scaleStart2);
|
||||
await tester.pump();
|
||||
await gesture1.moveTo(scaleEnd1);
|
||||
await gesture2.moveTo(scaleEnd2);
|
||||
await tester.pump();
|
||||
await gesture1.up();
|
||||
await gesture2.up();
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
final candlestickChartLeaf = tester.widget<CandlestickChartLeaf>(
|
||||
find.byType(CandlestickChartLeaf),
|
||||
);
|
||||
final renderBox = tester.renderObject<RenderBox>(
|
||||
find.byType(CandlestickChartLeaf),
|
||||
);
|
||||
final chartVirtualRect = candlestickChartLeaf.chartVirtualRect!;
|
||||
|
||||
expect(
|
||||
chartVirtualRect.size.height,
|
||||
greaterThan(renderBox.size.height),
|
||||
);
|
||||
expect(chartVirtualRect.size.width, renderBox.size.width);
|
||||
expect(chartVirtualRect.left, 0);
|
||||
expect(chartVirtualRect.top, isNegative);
|
||||
});
|
||||
|
||||
group('pans', () {
|
||||
testWidgets('only horizontally with FlScaleAxis.horizontal',
|
||||
(WidgetTester tester) async {
|
||||
await tester.pumpWidget(
|
||||
createTestWidget(
|
||||
chart: CandlestickChart(
|
||||
CandlestickChartData(),
|
||||
transformationConfig: const FlTransformationConfig(
|
||||
scaleAxis: FlScaleAxis.horizontal,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
final chartCenterOffset =
|
||||
tester.getCenter(find.byType(CandlestickChartLeaf));
|
||||
final scaleStart1 = chartCenterOffset;
|
||||
final scaleStart2 = chartCenterOffset;
|
||||
final scaleEnd1 = chartCenterOffset + const Offset(100, 100);
|
||||
final scaleEnd2 = chartCenterOffset - const Offset(100, 100);
|
||||
|
||||
final gesture1 = await tester.startGesture(scaleStart1);
|
||||
final gesture2 = await tester.startGesture(scaleStart2);
|
||||
await gesture1.moveTo(scaleEnd1);
|
||||
await gesture2.moveTo(scaleEnd2);
|
||||
await gesture1.up();
|
||||
await gesture2.up();
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
final candlestickChartLeafBeforePan =
|
||||
tester.widget<CandlestickChartLeaf>(
|
||||
find.byType(CandlestickChartLeaf),
|
||||
);
|
||||
final chartVirtualRectBeforePan =
|
||||
candlestickChartLeafBeforePan.chartVirtualRect!;
|
||||
expect(chartVirtualRectBeforePan.top, 0);
|
||||
|
||||
const panOffset = Offset(100, 100);
|
||||
await tester.dragFrom(chartCenterOffset, panOffset);
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
final candlestickChartLeafAfterPan =
|
||||
tester.widget<CandlestickChartLeaf>(
|
||||
find.byType(CandlestickChartLeaf),
|
||||
);
|
||||
final chartVirtualRectAfterPan =
|
||||
candlestickChartLeafAfterPan.chartVirtualRect!;
|
||||
|
||||
expect(chartVirtualRectBeforePan.size, chartVirtualRectAfterPan.size);
|
||||
expect(
|
||||
chartVirtualRectAfterPan.left,
|
||||
greaterThan(chartVirtualRectBeforePan.left),
|
||||
);
|
||||
expect(chartVirtualRectAfterPan.top, 0);
|
||||
});
|
||||
|
||||
testWidgets('only vertically with FlScaleAxis.vertical',
|
||||
(WidgetTester tester) async {
|
||||
await tester.pumpWidget(
|
||||
createTestWidget(
|
||||
chart: CandlestickChart(
|
||||
CandlestickChartData(),
|
||||
transformationConfig: const FlTransformationConfig(
|
||||
scaleAxis: FlScaleAxis.vertical,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
final chartCenterOffset =
|
||||
tester.getCenter(find.byType(CandlestickChartLeaf));
|
||||
final scaleStart1 = chartCenterOffset;
|
||||
final scaleStart2 = chartCenterOffset;
|
||||
final scaleEnd1 = chartCenterOffset + const Offset(100, 100);
|
||||
final scaleEnd2 = chartCenterOffset - const Offset(100, 100);
|
||||
|
||||
final gesture1 = await tester.startGesture(scaleStart1);
|
||||
final gesture2 = await tester.startGesture(scaleStart2);
|
||||
await gesture1.moveTo(scaleEnd1);
|
||||
await gesture2.moveTo(scaleEnd2);
|
||||
await gesture1.up();
|
||||
await gesture2.up();
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
final candlestickChartLeafBeforePan =
|
||||
tester.widget<CandlestickChartLeaf>(
|
||||
find.byType(CandlestickChartLeaf),
|
||||
);
|
||||
final chartVirtualRectBeforePan =
|
||||
candlestickChartLeafBeforePan.chartVirtualRect!;
|
||||
expect(chartVirtualRectBeforePan.left, 0);
|
||||
|
||||
const panOffset = Offset(100, 100);
|
||||
await tester.dragFrom(chartCenterOffset, panOffset);
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
final candlestickChartLeafAfterPan =
|
||||
tester.widget<CandlestickChartLeaf>(
|
||||
find.byType(CandlestickChartLeaf),
|
||||
);
|
||||
final chartVirtualRectAfterPan =
|
||||
candlestickChartLeafAfterPan.chartVirtualRect!;
|
||||
|
||||
expect(chartVirtualRectAfterPan.left, 0);
|
||||
expect(
|
||||
chartVirtualRectAfterPan.top,
|
||||
greaterThan(chartVirtualRectBeforePan.top),
|
||||
);
|
||||
});
|
||||
|
||||
testWidgets('freely with FlScaleAxis.free',
|
||||
(WidgetTester tester) async {
|
||||
await tester.pumpWidget(
|
||||
createTestWidget(
|
||||
chart: CandlestickChart(
|
||||
CandlestickChartData(),
|
||||
transformationConfig: const FlTransformationConfig(
|
||||
scaleAxis: FlScaleAxis.free,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
final chartCenterOffset =
|
||||
tester.getCenter(find.byType(CandlestickChartLeaf));
|
||||
final scaleStart1 = chartCenterOffset;
|
||||
final scaleStart2 = chartCenterOffset;
|
||||
final scaleEnd1 = chartCenterOffset + const Offset(100, 100);
|
||||
final scaleEnd2 = chartCenterOffset - const Offset(100, 100);
|
||||
|
||||
final gesture1 = await tester.startGesture(scaleStart1);
|
||||
final gesture2 = await tester.startGesture(scaleStart2);
|
||||
await gesture1.moveTo(scaleEnd1);
|
||||
await gesture2.moveTo(scaleEnd2);
|
||||
await gesture1.up();
|
||||
await gesture2.up();
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
final candlestickChartLeafBeforePan =
|
||||
tester.widget<CandlestickChartLeaf>(
|
||||
find.byType(CandlestickChartLeaf),
|
||||
);
|
||||
final chartVirtualRectBeforePan =
|
||||
candlestickChartLeafBeforePan.chartVirtualRect!;
|
||||
expect(chartVirtualRectBeforePan.top, isNegative);
|
||||
expect(chartVirtualRectBeforePan.left, isNegative);
|
||||
|
||||
const panOffset = Offset(100, 100);
|
||||
await tester.dragFrom(chartCenterOffset, panOffset);
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
final candlestickChartLeafAfterPan =
|
||||
tester.widget<CandlestickChartLeaf>(
|
||||
find.byType(CandlestickChartLeaf),
|
||||
);
|
||||
final chartVirtualRectAfterPan =
|
||||
candlestickChartLeafAfterPan.chartVirtualRect!;
|
||||
|
||||
expect(
|
||||
chartVirtualRectAfterPan.left,
|
||||
greaterThan(chartVirtualRectBeforePan.left),
|
||||
);
|
||||
expect(
|
||||
chartVirtualRectAfterPan.top,
|
||||
greaterThan(chartVirtualRectBeforePan.top),
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
group('trackpad scroll', () {
|
||||
group('pans', () {
|
||||
testWidgets('only horizontally with FlScaleAxis.horizontal',
|
||||
(WidgetTester tester) async {
|
||||
await tester.pumpWidget(
|
||||
createTestWidget(
|
||||
chart: CandlestickChart(
|
||||
CandlestickChartData(),
|
||||
transformationConfig: const FlTransformationConfig(
|
||||
scaleAxis: FlScaleAxis.horizontal,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
final chartCenterOffset =
|
||||
tester.getCenter(find.byType(CandlestickChartLeaf));
|
||||
final scaleStart1 = chartCenterOffset;
|
||||
final scaleStart2 = chartCenterOffset;
|
||||
final scaleEnd1 = chartCenterOffset + const Offset(100, 100);
|
||||
final scaleEnd2 = chartCenterOffset - const Offset(100, 100);
|
||||
|
||||
final gesture1 = await tester.startGesture(scaleStart1);
|
||||
final gesture2 = await tester.startGesture(scaleStart2);
|
||||
await tester.pump();
|
||||
await gesture1.moveTo(scaleEnd1);
|
||||
await gesture2.moveTo(scaleEnd2);
|
||||
await tester.pump();
|
||||
await gesture1.up();
|
||||
await gesture2.up();
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
final candlestickChartLeafBeforePan =
|
||||
tester.widget<CandlestickChartLeaf>(
|
||||
find.byType(CandlestickChartLeaf),
|
||||
);
|
||||
|
||||
final chartVirtualRectBeforePan =
|
||||
candlestickChartLeafBeforePan.chartVirtualRect!;
|
||||
expect(chartVirtualRectBeforePan.top, 0);
|
||||
|
||||
final pointer = TestPointer(1, PointerDeviceKind.trackpad);
|
||||
const leftAndUp = Offset(-100, -100);
|
||||
await tester.sendEventToBinding(pointer.hover(chartCenterOffset));
|
||||
await tester.pump();
|
||||
await tester.sendEventToBinding(pointer.scroll(leftAndUp));
|
||||
await tester.pump();
|
||||
|
||||
final candlestickChartLeafAfterPan =
|
||||
tester.widget<CandlestickChartLeaf>(
|
||||
find.byType(CandlestickChartLeaf),
|
||||
);
|
||||
final chartVirtualRectAfterPan =
|
||||
candlestickChartLeafAfterPan.chartVirtualRect!;
|
||||
|
||||
expect(
|
||||
chartVirtualRectAfterPan.left,
|
||||
greaterThan(chartVirtualRectBeforePan.left),
|
||||
);
|
||||
expect(chartVirtualRectAfterPan.top, 0);
|
||||
});
|
||||
|
||||
testWidgets('vertically with FlScaleAxis.vertical',
|
||||
(WidgetTester tester) async {
|
||||
await tester.pumpWidget(
|
||||
createTestWidget(
|
||||
chart: CandlestickChart(
|
||||
CandlestickChartData(),
|
||||
transformationConfig: const FlTransformationConfig(
|
||||
scaleAxis: FlScaleAxis.vertical,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
final chartCenterOffset =
|
||||
tester.getCenter(find.byType(CandlestickChartLeaf));
|
||||
final scaleStart1 = chartCenterOffset;
|
||||
final scaleStart2 = chartCenterOffset;
|
||||
final scaleEnd1 = chartCenterOffset + const Offset(100, 100);
|
||||
final scaleEnd2 = chartCenterOffset - const Offset(100, 100);
|
||||
|
||||
final gesture1 = await tester.startGesture(scaleStart1);
|
||||
final gesture2 = await tester.startGesture(scaleStart2);
|
||||
await tester.pump();
|
||||
await gesture1.moveTo(scaleEnd1);
|
||||
await gesture2.moveTo(scaleEnd2);
|
||||
await tester.pump();
|
||||
await gesture1.up();
|
||||
await gesture2.up();
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
final candlestickChartLeafBeforePan =
|
||||
tester.widget<CandlestickChartLeaf>(
|
||||
find.byType(CandlestickChartLeaf),
|
||||
);
|
||||
|
||||
final chartVirtualRectBeforePan =
|
||||
candlestickChartLeafBeforePan.chartVirtualRect!;
|
||||
expect(chartVirtualRectBeforePan.left, 0);
|
||||
|
||||
final pointer = TestPointer(1, PointerDeviceKind.trackpad);
|
||||
const leftAndUp = Offset(-100, -100);
|
||||
await tester.sendEventToBinding(pointer.hover(chartCenterOffset));
|
||||
await tester.pump();
|
||||
await tester.sendEventToBinding(pointer.scroll(leftAndUp));
|
||||
await tester.pump();
|
||||
|
||||
final candlestickChartLeafAfterPan =
|
||||
tester.widget<CandlestickChartLeaf>(
|
||||
find.byType(CandlestickChartLeaf),
|
||||
);
|
||||
final chartVirtualRectAfterPan =
|
||||
candlestickChartLeafAfterPan.chartVirtualRect!;
|
||||
|
||||
expect(chartVirtualRectAfterPan.left, 0);
|
||||
expect(
|
||||
chartVirtualRectAfterPan.top,
|
||||
greaterThan(chartVirtualRectBeforePan.top),
|
||||
);
|
||||
});
|
||||
|
||||
testWidgets('freely with FlScaleAxis.free',
|
||||
(WidgetTester tester) async {
|
||||
await tester.pumpWidget(
|
||||
createTestWidget(
|
||||
chart: CandlestickChart(
|
||||
CandlestickChartData(),
|
||||
transformationConfig: const FlTransformationConfig(
|
||||
scaleAxis: FlScaleAxis.free,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
final chartCenterOffset =
|
||||
tester.getCenter(find.byType(CandlestickChartLeaf));
|
||||
final scaleStart1 = chartCenterOffset;
|
||||
final scaleStart2 = chartCenterOffset;
|
||||
final scaleEnd1 = chartCenterOffset + const Offset(100, 100);
|
||||
final scaleEnd2 = chartCenterOffset - const Offset(100, 100);
|
||||
|
||||
final gesture1 = await tester.startGesture(scaleStart1);
|
||||
final gesture2 = await tester.startGesture(scaleStart2);
|
||||
await tester.pump();
|
||||
await gesture1.moveTo(scaleEnd1);
|
||||
await gesture2.moveTo(scaleEnd2);
|
||||
await tester.pump();
|
||||
await gesture1.up();
|
||||
await gesture2.up();
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
final candlestickChartLeafBeforePan =
|
||||
tester.widget<CandlestickChartLeaf>(
|
||||
find.byType(CandlestickChartLeaf),
|
||||
);
|
||||
|
||||
final chartVirtualRectBeforePan =
|
||||
candlestickChartLeafBeforePan.chartVirtualRect!;
|
||||
|
||||
final pointer = TestPointer(1, PointerDeviceKind.trackpad);
|
||||
const leftAndUp = Offset(-100, -100);
|
||||
await tester.sendEventToBinding(pointer.hover(chartCenterOffset));
|
||||
await tester.pump();
|
||||
await tester.sendEventToBinding(pointer.scroll(leftAndUp));
|
||||
await tester.pump();
|
||||
|
||||
final candlestickChartLeafAfterPan =
|
||||
tester.widget<CandlestickChartLeaf>(
|
||||
find.byType(CandlestickChartLeaf),
|
||||
);
|
||||
final chartVirtualRectAfterPan =
|
||||
candlestickChartLeafAfterPan.chartVirtualRect!;
|
||||
|
||||
expect(
|
||||
chartVirtualRectAfterPan.left,
|
||||
greaterThan(chartVirtualRectBeforePan.left),
|
||||
);
|
||||
expect(
|
||||
chartVirtualRectAfterPan.top,
|
||||
greaterThan(chartVirtualRectBeforePan.top),
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
testWidgets(
|
||||
'does not scale with FlScaleAxis.none when '
|
||||
'trackpadScrollCausesScale is true',
|
||||
(WidgetTester tester) async {
|
||||
await tester.pumpWidget(
|
||||
createTestWidget(
|
||||
chart: CandlestickChart(
|
||||
CandlestickChartData(),
|
||||
transformationConfig: const FlTransformationConfig(
|
||||
// This is for test
|
||||
// ignore: avoid_redundant_argument_values
|
||||
scaleAxis: FlScaleAxis.none,
|
||||
trackpadScrollCausesScale: true,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
final pointer = TestPointer(1, PointerDeviceKind.trackpad);
|
||||
final chartCenterOffset =
|
||||
tester.getCenter(find.byType(CandlestickChartLeaf));
|
||||
const scrollAmount = Offset(0, -100);
|
||||
|
||||
await tester.sendEventToBinding(pointer.hover(chartCenterOffset));
|
||||
await tester.pump();
|
||||
await tester.sendEventToBinding(pointer.scroll(scrollAmount));
|
||||
await tester.pump();
|
||||
|
||||
final candlestickChartLeaf = tester.widget<CandlestickChartLeaf>(
|
||||
find.byType(CandlestickChartLeaf),
|
||||
);
|
||||
expect(candlestickChartLeaf.chartVirtualRect, null);
|
||||
},
|
||||
);
|
||||
|
||||
for (final scaleAxis in FlScaleAxis.scalingEnabledAxis) {
|
||||
testWidgets(
|
||||
'does not scale when trackpadScrollCausesScale is false '
|
||||
'for $scaleAxis',
|
||||
(WidgetTester tester) async {
|
||||
await tester.pumpWidget(
|
||||
createTestWidget(
|
||||
chart: CandlestickChart(
|
||||
CandlestickChartData(),
|
||||
transformationConfig: FlTransformationConfig(
|
||||
scaleAxis: scaleAxis,
|
||||
// This is for test
|
||||
// ignore: avoid_redundant_argument_values
|
||||
trackpadScrollCausesScale: false,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
final pointer = TestPointer(1, PointerDeviceKind.trackpad);
|
||||
final chartCenterOffset = tester.getCenter(
|
||||
find.byType(CandlestickChartLeaf),
|
||||
);
|
||||
const scrollAmount = Offset(0, -100);
|
||||
|
||||
await tester.sendEventToBinding(pointer.hover(chartCenterOffset));
|
||||
await tester.pump();
|
||||
await tester.sendEventToBinding(pointer.scroll(scrollAmount));
|
||||
await tester.pump();
|
||||
|
||||
final candlestickChartLeaf = tester.widget<CandlestickChartLeaf>(
|
||||
find.byType(CandlestickChartLeaf),
|
||||
);
|
||||
expect(candlestickChartLeaf.chartVirtualRect, null);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
testWidgets('scales horizontally with FlScaleAxis.horizontal',
|
||||
(WidgetTester tester) async {
|
||||
await tester.pumpWidget(
|
||||
createTestWidget(
|
||||
chart: CandlestickChart(
|
||||
CandlestickChartData(),
|
||||
transformationConfig: const FlTransformationConfig(
|
||||
scaleAxis: FlScaleAxis.horizontal,
|
||||
trackpadScrollCausesScale: true,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
final pointer = TestPointer(1, PointerDeviceKind.trackpad);
|
||||
final chartCenterOffset =
|
||||
tester.getCenter(find.byType(CandlestickChartLeaf));
|
||||
const scrollAmount = Offset(0, -100);
|
||||
|
||||
await tester.sendEventToBinding(pointer.hover(chartCenterOffset));
|
||||
await tester.pump();
|
||||
await tester.sendEventToBinding(pointer.scroll(scrollAmount));
|
||||
await tester.pump();
|
||||
|
||||
final candlestickChartLeaf = tester.widget<CandlestickChartLeaf>(
|
||||
find.byType(CandlestickChartLeaf),
|
||||
);
|
||||
final renderBox = tester.renderObject<RenderBox>(
|
||||
find.byType(CandlestickChartLeaf),
|
||||
);
|
||||
final chartVirtualRect = candlestickChartLeaf.chartVirtualRect!;
|
||||
|
||||
expect(chartVirtualRect.size.height, renderBox.size.height);
|
||||
expect(chartVirtualRect.size.width, greaterThan(renderBox.size.width));
|
||||
expect(chartVirtualRect.left, isNegative);
|
||||
expect(chartVirtualRect.top, 0);
|
||||
});
|
||||
|
||||
testWidgets('scales vertically with FlScaleAxis.vertical',
|
||||
(WidgetTester tester) async {
|
||||
await tester.pumpWidget(
|
||||
createTestWidget(
|
||||
chart: CandlestickChart(
|
||||
CandlestickChartData(),
|
||||
transformationConfig: const FlTransformationConfig(
|
||||
scaleAxis: FlScaleAxis.vertical,
|
||||
trackpadScrollCausesScale: true,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
final pointer = TestPointer(1, PointerDeviceKind.trackpad);
|
||||
final chartCenterOffset =
|
||||
tester.getCenter(find.byType(CandlestickChartLeaf));
|
||||
const scrollAmount = Offset(0, -100);
|
||||
|
||||
await tester.sendEventToBinding(pointer.hover(chartCenterOffset));
|
||||
await tester.pump();
|
||||
await tester.sendEventToBinding(pointer.scroll(scrollAmount));
|
||||
await tester.pump();
|
||||
|
||||
final candlestickChartLeaf = tester.widget<CandlestickChartLeaf>(
|
||||
find.byType(CandlestickChartLeaf),
|
||||
);
|
||||
final renderBox = tester.renderObject<RenderBox>(
|
||||
find.byType(CandlestickChartLeaf),
|
||||
);
|
||||
final chartVirtualRect = candlestickChartLeaf.chartVirtualRect!;
|
||||
|
||||
expect(
|
||||
chartVirtualRect.size.height,
|
||||
greaterThan(renderBox.size.height),
|
||||
);
|
||||
expect(chartVirtualRect.size.width, renderBox.size.width);
|
||||
expect(chartVirtualRect.left, 0);
|
||||
expect(chartVirtualRect.top, isNegative);
|
||||
});
|
||||
|
||||
testWidgets('scales freely with FlScaleAxis.free',
|
||||
(WidgetTester tester) async {
|
||||
await tester.pumpWidget(
|
||||
createTestWidget(
|
||||
chart: CandlestickChart(
|
||||
CandlestickChartData(),
|
||||
transformationConfig: const FlTransformationConfig(
|
||||
scaleAxis: FlScaleAxis.free,
|
||||
trackpadScrollCausesScale: true,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
final pointer = TestPointer(1, PointerDeviceKind.trackpad);
|
||||
final chartCenterOffset =
|
||||
tester.getCenter(find.byType(CandlestickChartLeaf));
|
||||
const scrollAmount = Offset(0, -100);
|
||||
|
||||
await tester.sendEventToBinding(pointer.hover(chartCenterOffset));
|
||||
await tester.pump();
|
||||
await tester.sendEventToBinding(pointer.scroll(scrollAmount));
|
||||
await tester.pump();
|
||||
|
||||
final candlestickChartLeaf = tester
|
||||
.widget<CandlestickChartLeaf>(find.byType(CandlestickChartLeaf));
|
||||
final renderBox = tester.renderObject<RenderBox>(
|
||||
find.byType(CandlestickChartLeaf),
|
||||
);
|
||||
final chartVirtualRect = candlestickChartLeaf.chartVirtualRect!;
|
||||
|
||||
expect(chartVirtualRect.size, greaterThan(renderBox.size));
|
||||
expect(chartVirtualRect.left, isNegative);
|
||||
expect(chartVirtualRect.top, isNegative);
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user