first commit

This commit is contained in:
2026-02-07 15:57:09 +07:00
commit 157096f164
1153 changed files with 415766 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
import 'package:http/http.dart' as http;
import 'package:image/image.dart' as img;
Future<img.Image?> getNetworkImage(
String? url, {
int width = 250,
int height = 250,
}) async {
if (url == null) return null;
try {
final response = await http.get(Uri.parse(url));
if (response.statusCode != 200) return null;
final _image = img.decodeImage(response.bodyBytes);
if (_image == null) return null;
return _image;
return img.copyResize(
_image,
width: width,
height: height,
interpolation: img.Interpolation.average,
);
// final img.Image grayscaleImage = img.grayscale(resizedImage);
} catch (e) {
return null;
}
}