fixed warnings (super.key, etc)

This commit is contained in:
Kima
2023-12-12 22:57:16 +01:00
parent fc3f538e6b
commit 6bac82f7d6
46 changed files with 349 additions and 228 deletions

View File

@@ -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),
),
],