added leaderboards (without clickthrough to filtered by author - later)
This commit is contained in:
@@ -21,18 +21,9 @@ class AddPage extends StatelessWidget {
|
||||
padding: const EdgeInsets.all(Constants.edgeInset),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
Strings.createQuote,
|
||||
style: const TextStyle(
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
|
||||
const SizedBox(height: 12),
|
||||
|
||||
TextField(
|
||||
autofocus: true,
|
||||
controller: bodyController,
|
||||
|
||||
@@ -1,10 +1,48 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:frontend/provider/quote_provider.dart';
|
||||
import 'package:frontend/values/constants.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class LeaderboardPage extends StatelessWidget {
|
||||
const LeaderboardPage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return const Center(child: Text('top 3!'));
|
||||
final provider = context.watch<QuoteProvider>();
|
||||
return Center(
|
||||
child: Column(
|
||||
children: [
|
||||
Expanded(
|
||||
child: ListView.builder(
|
||||
padding: EdgeInsets.all(Constants.edgeInset),
|
||||
itemCount: provider.filteredQuotes.length,
|
||||
itemBuilder: (context, index) {
|
||||
return
|
||||
Card(
|
||||
color: provider.getLeaderboardEntryBgColor(context, index),
|
||||
child: ListTile(
|
||||
contentPadding: EdgeInsets.symmetric(
|
||||
vertical: 0,
|
||||
horizontal: Constants.edgeInset,
|
||||
),
|
||||
title: Text(provider.sortedAuthorCounts[index].key,
|
||||
style: TextStyle(
|
||||
color: provider.getLeaderboardEntryFgColor(context, index)
|
||||
),
|
||||
),
|
||||
trailing: Text(provider.sortedAuthorCounts[index].value.toString(),
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
color: provider.getLeaderboardEntryFgColor(context, index),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user