This commit is contained in:
agra
2025-02-02 15:05:11 +02:00
parent 8626e8c2c6
commit 2777b5f746
16 changed files with 216 additions and 330 deletions

View File

@@ -15,7 +15,10 @@ class _BendBoxPainter extends CustomPainter {
final EdgeInsets inward;
final Color color;
_BendBoxPainter({this.inward, this.color});
_BendBoxPainter({
required this.inward,
required this.color,
});
void paint(Canvas canvas, Size size) {
final paint = Paint()

View File

@@ -2,7 +2,7 @@ import 'dart:math';
import 'dart:ui';
double bezierLength(Bezier bezier, [double steps = 10]) {
assert(bezier != null && steps != 0);
assert(steps != 0);
final step = 1 / steps;
var c = bezier.point(0);
var length = 0.0;

View File

@@ -1,11 +1,11 @@
typedef T _JsonConvert<T>(Map<String, dynamic> json);
class Json {
static List<T> list<T>(List json, _JsonConvert<T> fromJson) => json == null
static List<T> list<T>(List? json, _JsonConvert<T> fromJson) => json == null
? []
: json.cast<Map<String, dynamic>>().map(fromJson).toList();
static Map<String, T> map<T>(Map json, _JsonConvert<T> fromJson) => json == null
static Map<String, T> map<T>(Map? json, _JsonConvert<T> fromJson) => json == null
? {}
: Map.fromEntries(
json.entries.map((e) => MapEntry(e.key, fromJson(e.value))));