treewide: dart format + analyze + some other fixes

This commit is contained in:
2025-08-04 21:11:37 +02:00
parent 9f9757d710
commit c83821fa38
10 changed files with 863 additions and 844 deletions

View File

@@ -3,7 +3,8 @@
import 'package:flutter_test/flutter_test.dart';
import 'package:kanimaji/common/point.dart';
import 'package:kanimaji/svg/parser.dart' show Command, Token, commandifyPath, parsePath, tokenizePath;
import 'package:kanimaji/svg/parser.dart'
show Command, Token, commandifyPath, parsePath, tokenizePath;
class TokenizerTest {
final String pathdef;
@@ -30,7 +31,7 @@ final List<TokenizerTest> tokenizerTests = [
Token(command: "M", args: [Point(100, 100)]),
Token(command: "L", args: [Point(300, 100)]),
Token(command: "L", args: [Point(200, 300)]),
Token(command: "z", args: [])
Token(command: "z", args: []),
],
),
const TokenizerTest(
@@ -42,17 +43,22 @@ final List<TokenizerTest> tokenizerTests = [
Command(command: "M", args: "5 1"),
Command(command: "v", args: "7.344"),
Command(
command: "A", args: "3.574 3.574 0 003.5 8 3.515 3.515 0 000 11.5"),
command: "A",
args: "3.574 3.574 0 003.5 8 3.515 3.515 0 000 11.5",
),
Command(command: "C", args: "0 13.421 1.579 15 3.5 15"),
Command(command: "A", args: "3.517 3.517 0 007 11.531"),
Command(command: "v", args: "-7.53"),
Command(command: "h", args: "6"),
Command(command: "v", args: "4.343"),
Command(
command: "A", args: "3.574 3.574 0 0011.5 8 3.515 3.515 0 008 11.5"),
command: "A",
args: "3.574 3.574 0 0011.5 8 3.515 3.515 0 008 11.5",
),
Command(
command: "c",
args: "0 1.921 1.579 3.5 3.5 3.5 1.9 0 3.465 -1.546 3.5 -3.437"),
command: "c",
args: "0 1.921 1.579 3.5 3.5 3.5 1.9 0 3.465 -1.546 3.5 -3.437",
),
Command(command: "V", args: "1"),
Command(command: "z", args: ""),
],
@@ -61,26 +67,36 @@ final List<TokenizerTest> tokenizerTests = [
Token(command: "v", args: [7.344]),
Token(command: "A", args: [3.574, 3.574, 0, false, false, Point(3.5, 8)]),
Token(
command: "A", args: [3.515, 3.515, 0, false, false, Point(0, 11.5)]),
command: "A",
args: [3.515, 3.515, 0, false, false, Point(0, 11.5)],
),
Token(
command: "C",
args: [Point(0, 13.421), Point(1.579, 15), Point(3.5, 15)]),
command: "C",
args: [Point(0, 13.421), Point(1.579, 15), Point(3.5, 15)],
),
Token(
command: "A",
args: [3.517, 3.517, 0, false, false, Point(7, 11.531)]),
command: "A",
args: [3.517, 3.517, 0, false, false, Point(7, 11.531)],
),
Token(command: "v", args: [-7.53]),
Token(command: "h", args: [6]),
Token(command: "v", args: [4.343]),
Token(
command: "A", args: [3.574, 3.574, 0, false, false, Point(11.5, 8)]),
command: "A",
args: [3.574, 3.574, 0, false, false, Point(11.5, 8)],
),
Token(
command: "A", args: [3.515, 3.515, 0, false, false, Point(8, 11.5)]),
command: "A",
args: [3.515, 3.515, 0, false, false, Point(8, 11.5)],
),
Token(
command: "c",
args: [Point(0, 1.921), Point(1.579, 3.5), Point(3.5, 3.5)]),
command: "c",
args: [Point(0, 1.921), Point(1.579, 3.5), Point(3.5, 3.5)],
),
Token(
command: "c",
args: [Point(1.9, 0), Point(3.465, -1.546), Point(3.5, -3.437)]),
command: "c",
args: [Point(1.9, 0), Point(3.465, -1.546), Point(3.5, -3.437)],
),
Token(command: "V", args: [1]),
Token(command: "z", args: []),
],
@@ -120,4 +136,4 @@ void main() {
parsePath(tokenizerTest.pathdef);
}
});
}
}