-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[path_parsing] Initial import (#7908)
Imports https://github.com/dnfield/dart_path_parsing into this repository, with history, and updates it to follow repository conventions: - Updates minimum SDK support to match our minimum - Switches to repository analysis options, fixing or suppressing all resulting warnings - Standardizes pubspec.yaml to follow our style/conventions - Removes the use of pubspec.lock, per repo conventions
- Loading branch information
Showing
17 changed files
with
1,546 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
.DS_Store | ||
.dart_tool/ | ||
|
||
.packages | ||
.pub/ | ||
.idea/ | ||
|
||
build/ | ||
|
||
.flutter-plugins |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
## 1.0.2 | ||
|
||
* Transfers the package source from https://github.com/google/process.dart to | ||
https://github.com/dnfield/dart_path_parsing. | ||
|
||
## 1.0.1 | ||
|
||
* Fix [bug in arc decomposition](https://github.com/dnfield/flutter_svg/issues/742). | ||
* Minor code cleanup for analysis warnings. | ||
|
||
## 1.0.0 | ||
|
||
* Stable release. | ||
|
||
## 0.2.1 | ||
|
||
* Performance improvements to parsing. | ||
|
||
## 0.2.0 | ||
|
||
* Stable nullsafe release | ||
|
||
## 0.2.0-nullsafety.0 | ||
|
||
* Nullsafety migration. | ||
|
||
## 0.1.4 | ||
|
||
* Fix implementation of `_PathOffset`'s `==` operator. | ||
|
||
## 0.1.3 | ||
|
||
* Fix a bug in decompose cubic curve - avoid trying to call `toInt()` on `double.infinity` | ||
* Bump test dependency. | ||
|
||
## 0.1.2 | ||
|
||
* Fix bug with smooth curve commands | ||
* Add deep testing | ||
|
||
## 0.1.1 | ||
|
||
* Fix link to homepage in pubspec, add example | ||
|
||
## 0.1.0 | ||
|
||
* Initial release, based on the 0.2.4 release of path_drawing |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
Copyright (c) 2018 Dan Field | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: "path_parsing" | ||
description: | ||
"A pure Dart parsing library for SVG paths." | ||
|
||
third_party { | ||
identifier { | ||
type: "Git" | ||
value: "https://github.com/dnfield/dart_path_parsing/" | ||
primary_source: true | ||
version: "6785396f6c5528c720adb14833b196e529e78998" | ||
} | ||
version: "6785396f6c5528c720adb14833b196e529e78998" | ||
last_upgrade_date { year: 2024 month: 10 day: 24 } | ||
license_type: NOTICE | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# path_parsing | ||
|
||
Split from the Flutter path drawing library to create a pure Dart parsing | ||
library for SVG paths and code generation (without dependencies on Flutter | ||
runtime). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// ignore_for_file: avoid_print | ||
|
||
import 'package:path_parsing/path_parsing.dart'; | ||
|
||
/// A [PathProxy] that dumps Flutter `Path` commands to the console. | ||
class PathPrinter extends PathProxy { | ||
@override | ||
void close() { | ||
print('Path.close();'); | ||
} | ||
|
||
@override | ||
void cubicTo( | ||
double x1, | ||
double y1, | ||
double x2, | ||
double y2, | ||
double x3, | ||
double y3, | ||
) { | ||
print('Path.cubicTo($x1, $y1, $x2, $y2, $x3, $y3);'); | ||
} | ||
|
||
@override | ||
void lineTo(double x, double y) { | ||
print('Path.lineTo($x, $y);'); | ||
} | ||
|
||
@override | ||
void moveTo(double x, double y) { | ||
print('Path.moveTo($x, $y);'); | ||
} | ||
} | ||
|
||
void main() { | ||
const String pathData = | ||
'M22.1595 3.80852C19.6789 1.35254 16.3807 -4.80966e-07 12.8727 ' | ||
'-4.80966e-07C9.36452 -4.80966e-07 6.06642 1.35254 3.58579 ' | ||
'3.80852C1.77297 5.60333 0.53896 7.8599 0.0171889 10.3343C-0.0738999 ' | ||
'10.7666 0.206109 11.1901 0.64265 11.2803C1.07908 11.3706 1.50711 11.0934 ' | ||
'1.5982 10.661C2.05552 8.49195 3.13775 6.51338 4.72783 4.9391C9.21893 ' | ||
'0.492838 16.5262 0.492728 21.0173 4.9391C25.5082 9.38548 25.5082 16.6202 ' | ||
'21.0173 21.0667C16.5265 25.5132 9.21893 25.5133 4.72805 21.0669C3.17644 ' | ||
'19.5307 2.10538 17.6035 1.63081 15.4937C1.53386 15.0627 1.10252 14.7908 ' | ||
'0.66697 14.887C0.231645 14.983 -0.0427272 15.4103 0.0542205 ' | ||
'15.8413C0.595668 18.2481 1.81686 20.4461 3.5859 22.1976C6.14623 ' | ||
'24.7325 9.50955 26 12.8727 26C16.236 26 19.5991 24.7326 22.1595 ' | ||
'22.1976C27.2802 17.1277 27.2802 8.87841 22.1595 3.80852Z'; | ||
|
||
writeSvgPathDataToPath(pathData, PathPrinter()); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
name: path_parsing_example | ||
publish_to: none | ||
|
||
environment: | ||
sdk: ^3.3.0 | ||
|
||
dependencies: | ||
path_parsing: | ||
path: ../ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export 'src/path_parsing.dart'; |
Oops, something went wrong.