mirror of
https://github.com/ReVanced/revanced-manager.git
synced 2025-05-11 13:05:37 +02:00
fix: Improve display of contributors avatars using cache
This commit is contained in:
parent
0c5c3b32f1
commit
e22b643375
1 changed files with 21 additions and 5 deletions
|
@ -1,4 +1,6 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_cache_manager/file.dart';
|
||||
import 'package:flutter_cache_manager/flutter_cache_manager.dart';
|
||||
import 'package:revanced_manager/ui/widgets/shared/custom_card.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
|
||||
|
@ -51,11 +53,25 @@ class _ContributorsCardState extends State<ContributorsCard> {
|
|||
borderRadius: BorderRadius.circular(100),
|
||||
child: GestureDetector(
|
||||
onTap: () => launchUrl(
|
||||
Uri.parse(widget.contributors[index]['html_url'])),
|
||||
child: Image.network(
|
||||
widget.contributors[index]['avatar_url'],
|
||||
height: 40,
|
||||
width: 40,
|
||||
Uri.parse(
|
||||
widget.contributors[index]['html_url'],
|
||||
),
|
||||
),
|
||||
child: FutureBuilder<File?>(
|
||||
future: DefaultCacheManager().getSingleFile(
|
||||
widget.contributors[index]['avatar_url'],
|
||||
),
|
||||
builder: (context, snapshot) => snapshot.hasData
|
||||
? Image.file(
|
||||
snapshot.data!,
|
||||
height: 40,
|
||||
width: 40,
|
||||
)
|
||||
: Image.network(
|
||||
widget.contributors[index]['avatar_url'],
|
||||
height: 40,
|
||||
width: 40,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue