format with dart format
This commit is contained in:
@@ -35,10 +35,7 @@ class _CustomNavigationBarState extends State<CustomNavigationBar>
|
||||
centerTitle: true,
|
||||
title: Text(
|
||||
_currentTabTitle(),
|
||||
style: const TextStyle(
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
style: const TextStyle(fontSize: 20, fontWeight: FontWeight.bold),
|
||||
),
|
||||
backgroundColor: CustomTheme.backgroundColor,
|
||||
scrolledUnderElevation: 0,
|
||||
@@ -114,6 +111,7 @@ class _CustomNavigationBarState extends State<CustomNavigationBar>
|
||||
currentIndex = index;
|
||||
});
|
||||
}
|
||||
|
||||
String _currentTabTitle() {
|
||||
switch (currentIndex) {
|
||||
case 0:
|
||||
|
||||
@@ -134,9 +134,7 @@ class _GameHistoryViewState extends State<GameHistoryView> {
|
||||
children: [
|
||||
Column(
|
||||
children: [
|
||||
Container(
|
||||
margin: EdgeInsets.only(bottom: 75),
|
||||
),
|
||||
Container(margin: EdgeInsets.only(bottom: 75)),
|
||||
Expanded(
|
||||
child: gameHistoryListView(allGameData, suggestedGameData),
|
||||
),
|
||||
@@ -146,7 +144,7 @@ class _GameHistoryViewState extends State<GameHistoryView> {
|
||||
margin: EdgeInsets.only(top: 10, bottom: 10, left: 10, right: 10),
|
||||
child: SearchBar(
|
||||
leading: Icon(Icons.search),
|
||||
onChanged:(value) {
|
||||
onChanged: (value) {
|
||||
if (value.isEmpty) {
|
||||
setState(() {
|
||||
suggestedGameData.clear();
|
||||
@@ -155,9 +153,15 @@ class _GameHistoryViewState extends State<GameHistoryView> {
|
||||
return;
|
||||
}
|
||||
final suggestions = allGameData.where((currentGame) {
|
||||
return currentGame['game'].toString().toLowerCase().contains(value.toLowerCase()) ||
|
||||
currentGame['title'].toString().toLowerCase().contains(value.toLowerCase()) ||
|
||||
currentGame['group'].toString().toLowerCase().contains(value.toLowerCase());
|
||||
return currentGame['game'].toString().toLowerCase().contains(
|
||||
value.toLowerCase(),
|
||||
) ||
|
||||
currentGame['title'].toString().toLowerCase().contains(
|
||||
value.toLowerCase(),
|
||||
) ||
|
||||
currentGame['group'].toString().toLowerCase().contains(
|
||||
value.toLowerCase(),
|
||||
);
|
||||
});
|
||||
setState(() {
|
||||
suggestedGameData.clear();
|
||||
@@ -183,6 +187,6 @@ Widget gameHistoryListView(allGameData, suggestedGameData) {
|
||||
itemBuilder: (context, index) {
|
||||
final currentGame = suggestedGameData[index];
|
||||
return GameHistoryListTile(currentGame);
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:game_tracker/core/custom_theme.dart';
|
||||
|
||||
Widget GameHistoryListTile(Map<String, dynamic> currentGame){
|
||||
Widget GameHistoryListTile(Map<String, dynamic> currentGame) {
|
||||
return Container(
|
||||
margin: EdgeInsets.only(top: 5, bottom: 5, left: 10, right: 10),
|
||||
padding: EdgeInsets.all(10),
|
||||
@@ -16,14 +16,17 @@ Widget GameHistoryListTile(Map<String, dynamic> currentGame){
|
||||
Text("${currentGame['game']}: ", style: TextStyle(fontSize: 20)),
|
||||
Text("${currentGame['title']}", style: TextStyle(fontSize: 20)),
|
||||
Spacer(),
|
||||
Text("${currentGame['players']} Spieler", style: TextStyle(fontSize: 20))
|
||||
Text(
|
||||
"${currentGame['players']} Spieler",
|
||||
style: TextStyle(fontSize: 20),
|
||||
),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Text("${currentGame['group']}", style: TextStyle(fontSize: 20)),
|
||||
Spacer(),
|
||||
Text("${currentGame['date']}", style: TextStyle(fontSize: 20))
|
||||
Text("${currentGame['date']}", style: TextStyle(fontSize: 20)),
|
||||
],
|
||||
),
|
||||
],
|
||||
|
||||
@@ -2,13 +2,13 @@ import 'package:flutter/material.dart';
|
||||
|
||||
Widget TopCenteredMessage(String message) {
|
||||
return Container(
|
||||
padding: EdgeInsets.only(top:100),
|
||||
padding: EdgeInsets.only(top: 100),
|
||||
margin: EdgeInsets.only(left: 10, right: 10),
|
||||
alignment: Alignment.topCenter,
|
||||
child: Text(
|
||||
"$message",
|
||||
style: TextStyle(fontSize: 20),
|
||||
textAlign: TextAlign.center,
|
||||
)
|
||||
),
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user