Skip to content

Commit

Permalink
Fix Web app crash
Browse files Browse the repository at this point in the history
  • Loading branch information
cp-sneha-s committed Dec 18, 2024
1 parent 697f7af commit a0b2bb5
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/ui/widget/user_profile_image.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:projectunity/data/core/extensions/context_extension.dart';

// ignore: depend_on_referenced_packages
import 'package:cached_network_image_platform_interface/cached_network_image_platform_interface.dart';

class ImageProfile extends StatelessWidget {
final String? imageUrl;
final double radius;
Expand All @@ -23,6 +20,9 @@ class ImageProfile extends StatelessWidget {
this.iconColor});

Widget setCachedImage(BuildContext context) {
if(kIsWeb){
return Image.network(imageUrl?? pickedImage??'',fit: BoxFit.cover,);
}
if (imageUrl != null) {
return cachedNetworkImage(imageUrl!);
} else if (pickedImage != null) {
Expand All @@ -45,7 +45,6 @@ class ImageProfile extends StatelessWidget {
return CachedNetworkImage(
fit: BoxFit.cover,
imageUrl: imageUrl,
imageRenderMethodForWeb: ImageRenderMethodForWeb.HttpGet,
placeholder: (context, string) {
return Icon(Icons.person,
size: radius, color: iconColor ?? context.colorScheme.textDisable);
Expand Down

0 comments on commit a0b2bb5

Please sign in to comment.