1
+ import 'dart:ui' ;
2
+
1
3
import 'package:flutter/material.dart' ;
2
4
import 'package:wger/helpers/misc.dart' ;
3
5
import 'package:wger/l10n/generated/app_localizations.dart' ;
@@ -10,13 +12,62 @@ Widget ingredientImage(String url, BuildContext context) {
10
12
final height = MediaQuery .sizeOf (context).height;
11
13
final width = MediaQuery .sizeOf (context).width;
12
14
final smallest = height < width ? height : width;
13
- if (smallest < 400 ) {
14
- radius = smallest / 4 ;
15
+ if (smallest > 400 ) {
16
+ radius = smallest / 2.5 ;
15
17
}
18
+
19
+ final imageProvider = NetworkImage (url);
20
+
16
21
return Padding (
17
22
padding: const EdgeInsets .only (bottom: 12 ),
18
- child: CircleAvatar (backgroundImage: NetworkImage (url), radius: radius),
23
+ child: ClipRRect (
24
+ borderRadius: BorderRadius .circular (15 ),
25
+ child: Container (
26
+ height: radius,
27
+ width: width,
28
+ decoration: BoxDecoration (
29
+ borderRadius: BorderRadius .circular (15 ),
30
+ ),
31
+ child: Stack (
32
+ children: [
33
+ Image (
34
+ image: imageProvider,
35
+ height: radius,
36
+ width: width,
37
+ fit: BoxFit .cover,
38
+ ),
39
+ BackdropFilter (
40
+ filter: ImageFilter .blur (
41
+ sigmaY: 5 ,
42
+ sigmaX: 5 ,
43
+ ),
44
+ child: Container (
45
+ height: radius,
46
+ width: width,
47
+ color: Colors .transparent,
48
+ ),
49
+ ),
50
+ Center (
51
+ child: Padding (
52
+ padding: const EdgeInsets .all (10 ),
53
+ child: Container (
54
+ clipBehavior: Clip .hardEdge,
55
+ decoration: const BoxDecoration (shape: BoxShape .circle),
56
+ child: Image (
57
+ image: imageProvider,
58
+ height: radius,
59
+ width: width,
60
+ fit: BoxFit .contain,
61
+ ),
62
+ ),
63
+ ),
64
+ )
65
+ ],
66
+ ),
67
+ ),
68
+ ),
19
69
);
70
+ // CircleAvatar(backgroundImage: NetworkImage(url), radius: radius)
20
71
}
21
72
22
73
class IngredientDetails extends StatelessWidget {
0 commit comments