This repository was archived by the owner on Feb 22, 2023. It is now read-only.
File tree 1 file changed +6
-8
lines changed
packages/google_sign_in/lib/src 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change 5
5
/// image, and "`c` " indicates we want the image cropped.
6
6
final RegExp sizeDirective = RegExp (r'^s[0-9]{1,5}(-c)?$' );
7
7
8
- /// Adds sizing information to [photoUrl] , inserted as the last path segment
9
- /// before the image filename. The format is described in [sizeDirective] .
8
+ /// Adds [size] directive to [photoUrl] .
10
9
///
11
- /// Falls back to the default profile photo if [photoUrl] is [null] .
10
+ /// Depending on the format of photoUrl, this might:
11
+ /// * Insert information as the last path segment (old style URLs), before
12
+ /// the image filename. The format is described in [sizeDirective].
13
+ /// * Insert information at the end of the URL, after an = sign. The format
14
+ /// is described within this method.
12
15
String addSizeDirectiveToUrl (String photoUrl, double size) {
13
- if (photoUrl == null ) {
14
- // If the user has no profile photo and no display name, fall back to
15
- // the default profile photo as a last resort.
16
- return 'https://lh3.googleusercontent.com/a/default-user=s${size .round ()}-c' ;
17
- }
18
16
final Uri profileUri = Uri .parse (photoUrl);
19
17
final List <String > pathSegments = List <String >.from (profileUri.pathSegments);
20
18
if (pathSegments.length <= 2 ) {
You can’t perform that action at this time.
0 commit comments