refactor: Update to Dart 3.10 with . shorthands

This commit is contained in:
Christian Kußowski 2025-11-30 12:54:06 +01:00
commit 1ea649f01e
No known key found for this signature in database
GPG key ID: E067ECD60F1A0652
167 changed files with 3351 additions and 3912 deletions

View file

@ -25,9 +25,7 @@ class BlurHash extends StatefulWidget {
class _BlurHashState extends State<BlurHash> {
Uint8List? _data;
static Future<Uint8List> getBlurhashData(
BlurhashData blurhashData,
) async {
static Future<Uint8List> getBlurhashData(BlurhashData blurhashData) async {
final blurhash = b.BlurHash.decode(blurhashData.hsh);
final img = blurhash.toImage(blurhashData.w, blurhashData.h);
return Uint8List.fromList(image.encodePng(img));
@ -46,11 +44,7 @@ class _BlurHashState extends State<BlurHash> {
return _data ??= await compute(
getBlurhashData,
BlurhashData(
hsh: widget.blurhash,
w: width,
h: height,
),
BlurhashData(hsh: widget.blurhash, w: width, h: height),
);
}
@ -84,21 +78,10 @@ class BlurhashData {
final int w;
final int h;
const BlurhashData({
required this.hsh,
required this.w,
required this.h,
});
const BlurhashData({required this.hsh, required this.w, required this.h});
factory BlurhashData.fromJson(Map<String, dynamic> json) => BlurhashData(
hsh: json['hsh'],
w: json['w'],
h: json['h'],
);
factory BlurhashData.fromJson(Map<String, dynamic> json) =>
BlurhashData(hsh: json['hsh'], w: json['w'], h: json['h']);
Map<String, dynamic> toJson() => {
'hsh': hsh,
'w': w,
'h': h,
};
Map<String, dynamic> toJson() => {'hsh': hsh, 'w': w, 'h': h};
}