fixed warnings (super.key, etc)
This commit is contained in:
@@ -6,7 +6,7 @@ import 'package:filcnaplo_mobile_ui/premium/supporters_screen.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class SupportersButton extends StatelessWidget {
|
||||
const SupportersButton({Key? key, required this.supporters}) : super(key: key);
|
||||
const SupportersButton({super.key, required this.supporters});
|
||||
|
||||
final Future<Supporters?> supporters;
|
||||
|
||||
@@ -19,7 +19,8 @@ class SupportersButton extends StatelessWidget {
|
||||
customBorder: const StadiumBorder(),
|
||||
onTap: () {
|
||||
Navigator.of(context).push(
|
||||
MaterialPageRoute(builder: (context) => SupportersScreen(supporters: supporters)),
|
||||
MaterialPageRoute(
|
||||
builder: (context) => SupportersScreen(supporters: supporters)),
|
||||
);
|
||||
},
|
||||
child: Container(
|
||||
@@ -38,24 +39,35 @@ class SupportersButton extends StatelessWidget {
|
||||
if (!snapshot.hasData) {
|
||||
return const SizedBox();
|
||||
}
|
||||
final sponsors = snapshot.data!.github.where((e) => e.type == DonationType.monthly).toList();
|
||||
sponsors.shuffle(Random((DateTime.now().millisecondsSinceEpoch / 1000 / 60 / 60 / 24).floor()));
|
||||
final sponsors = snapshot.data!.github
|
||||
.where((e) => e.type == DonationType.monthly)
|
||||
.toList();
|
||||
sponsors.shuffle(Random(
|
||||
(DateTime.now().millisecondsSinceEpoch /
|
||||
1000 /
|
||||
60 /
|
||||
60 /
|
||||
24)
|
||||
.floor()));
|
||||
return AvatarStack(
|
||||
children: [
|
||||
// ignore: prefer_is_empty
|
||||
if (sponsors.length > 0 && sponsors[0].avatar != "")
|
||||
CircleAvatar(
|
||||
backgroundColor: Theme.of(context).colorScheme.secondary,
|
||||
backgroundColor:
|
||||
Theme.of(context).colorScheme.secondary,
|
||||
backgroundImage: NetworkImage(sponsors[0].avatar),
|
||||
),
|
||||
if (sponsors.length > 1 && sponsors[1].avatar != "")
|
||||
CircleAvatar(
|
||||
backgroundColor: Theme.of(context).colorScheme.secondary,
|
||||
backgroundColor:
|
||||
Theme.of(context).colorScheme.secondary,
|
||||
backgroundImage: NetworkImage(sponsors[1].avatar),
|
||||
),
|
||||
if (sponsors.length > 2 && sponsors[2].avatar != "")
|
||||
CircleAvatar(
|
||||
backgroundColor: Theme.of(context).colorScheme.secondary,
|
||||
backgroundColor:
|
||||
Theme.of(context).colorScheme.secondary,
|
||||
backgroundImage: NetworkImage(sponsors[2].avatar),
|
||||
),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user