Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

Commit 1b15fe4

Browse files
🐛 Use a transparent image as a placeholder
1 parent f63395d commit 1b15fe4

File tree

1 file changed

+50
-1
lines changed

1 file changed

+50
-1
lines changed

packages/google_sign_in/google_sign_in/lib/widgets.dart

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,59 @@ class GoogleUserCircleAvatar extends StatelessWidget {
106106
FadeInImage.memoryNetwork(
107107
// This creates a transparent placeholder image, so that
108108
// [placeholder] shows through.
109-
placeholder: Uint8List((size.round() * size.round())),
109+
placeholder: _kTransparentImage,
110110
image: sizedPhotoUrl,
111111
)
112112
]),
113113
));
114114
}
115115
}
116+
117+
/// This is an transparent 1x1 gif image
118+
final _kTransparentImage = Uint8List.fromList(
119+
[
120+
71,
121+
73,
122+
70,
123+
56,
124+
57,
125+
97,
126+
1,
127+
0,
128+
1,
129+
0,
130+
128,
131+
0,
132+
0,
133+
255,
134+
255,
135+
255,
136+
0,
137+
0,
138+
0,
139+
33,
140+
249,
141+
4,
142+
1,
143+
0,
144+
0,
145+
0,
146+
0,
147+
44,
148+
0,
149+
0,
150+
0,
151+
0,
152+
1,
153+
0,
154+
1,
155+
0,
156+
0,
157+
2,
158+
2,
159+
68,
160+
1,
161+
0,
162+
59,
163+
],
164+
);

0 commit comments

Comments
 (0)