Skip to content

Commit

Permalink
feat: Replace cache network image with the Image.network.
Browse files Browse the repository at this point in the history
  • Loading branch information
divyanshub024 committed Dec 28, 2024
1 parent 9fc5a30 commit e5ccf5e
Showing 1 changed file with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import 'dart:io';

import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/cupertino.dart';
import 'package:mirai/src/parsers/mirai_image/mirai_image.dart';
import 'package:mirai/src/utils/color_utils.dart';
Expand Down Expand Up @@ -28,17 +27,13 @@ class MiraiImageParser extends MiraiParser<MiraiImage> {
}
}

Widget _networkImage(MiraiImage model, BuildContext context) =>
CachedNetworkImage(
imageUrl: model.src,
Widget _networkImage(MiraiImage model, BuildContext context) => Image.network(
model.src,
alignment: model.alignment.value,
color: model.color?.toColor(context),
width: model.width,
height: model.height,
fit: model.fit,
errorWidget: (context, error, stackTrace) {
return const SizedBox();
},
);
Widget _fileImage(MiraiImage model, BuildContext context) => Image.file(
File(model.src),
Expand Down

0 comments on commit e5ccf5e

Please sign in to comment.