mirror of
https://github.com/revanced/revanced-manager.git
synced 2025-04-30 05:54:26 +02:00
fix: Improve display of contributors avatars using cache
This commit is contained in:
parent
0c5c3b32f1
commit
e22b643375
@ -1,4 +1,6 @@
|
|||||||
import 'package:flutter/material.dart';
|
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:revanced_manager/ui/widgets/shared/custom_card.dart';
|
||||||
import 'package:url_launcher/url_launcher.dart';
|
import 'package:url_launcher/url_launcher.dart';
|
||||||
|
|
||||||
@ -51,11 +53,25 @@ class _ContributorsCardState extends State<ContributorsCard> {
|
|||||||
borderRadius: BorderRadius.circular(100),
|
borderRadius: BorderRadius.circular(100),
|
||||||
child: GestureDetector(
|
child: GestureDetector(
|
||||||
onTap: () => launchUrl(
|
onTap: () => launchUrl(
|
||||||
Uri.parse(widget.contributors[index]['html_url'])),
|
Uri.parse(
|
||||||
child: Image.network(
|
widget.contributors[index]['html_url'],
|
||||||
widget.contributors[index]['avatar_url'],
|
),
|
||||||
height: 40,
|
),
|
||||||
width: 40,
|
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…
x
Reference in New Issue
Block a user