-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Adds cover image to profile page. Adds optional border for avatars. Updates profile page to show username with and without instance info. Clicking on username with instance info copies to clipboard. * Adds default image for avatars * Restrict user banner's height, add successful copy indicator
- Loading branch information
Showing
2 changed files
with
176 additions
and
105 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,23 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
class Avatar extends StatelessWidget { | ||
final String url; | ||
final String? url; | ||
final double? radius; | ||
final double? borderRadius; | ||
|
||
const Avatar(this.url, {super.key, this.radius}); | ||
const Avatar(this.url, {super.key, this.radius, this.borderRadius}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return CircleAvatar( | ||
backgroundColor: Colors.transparent, | ||
backgroundImage: NetworkImage(url), | ||
radius: radius, | ||
radius: radius != null && borderRadius != null ? radius! + borderRadius! : radius, | ||
backgroundColor: radius == null || borderRadius == null ? Colors.transparent : null, | ||
child: CircleAvatar( | ||
backgroundColor: Colors.transparent, | ||
foregroundImage: url != null ? NetworkImage(url!) : null, | ||
backgroundImage: url == null ? const AssetImage('assets/icons/logo.png') : null, | ||
radius: radius, | ||
) | ||
); | ||
} | ||
} |