This commit is contained in:
Juan Felipe Duarte
2023-06-06 17:15:49 -05:00
parent cca8c87e7c
commit ebcc95d06a
6 changed files with 128 additions and 28 deletions
+17
View File
@@ -0,0 +1,17 @@
import 'package:flutter/cupertino.dart';
import 'package:http/http.dart' as http;
class NetworkUtility {
static Future<String?> fetchUrl(Uri uri,
{Map<String, String>? headers}) async {
try {
final response = await http.get(uri, headers: headers);
if (response.statusCode == 200) {
return response.body;
}
} catch (e) {
debugPrint('error - ${e.toString()}');
}
return null;
}
}
+12
View File
@@ -1,6 +1,7 @@
import 'dart:io';
import 'package:firebase_storage/firebase_storage.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_animate/flutter_animate.dart';
@@ -101,6 +102,17 @@ class LocalPhoto extends StatelessWidget {
@override
Widget build(BuildContext context) {
if (kIsWeb) {
return ClipOval(
child: Image.network(
file.path,
width: photoSize,
height: photoSize,
fit: BoxFit.cover,
),
);
}
return ClipOval(
child: Image.file(
file,