Some `TextStyle`s was moved into themes, button fully animated

Also some bugfix and plans on animating Default Nickname setting
This commit is contained in:
dan63047 2024-10-22 01:38:41 +03:00
parent bf87f3a8e5
commit c12d450884
11 changed files with 134 additions and 74 deletions

View File

@ -32,6 +32,12 @@ ThemeData theme = ThemeData(
surface: Color.fromARGB(255, 10, 10, 10),
secondary: Color(0xFF00838F),
),
textTheme: TextTheme(
titleLarge: TextStyle(fontFamily: "Eurostile Round Extended", fontSize: 42),
titleSmall: TextStyle(fontFamily: "Eurostile Round Extended", fontSize: 28, height: 0.9, fontWeight: FontWeight.w200),
headlineMedium: TextStyle(fontFamily: "Eurostile Round Extended", fontSize: 36),
displayLarge: TextStyle(fontSize: 18),
),
cardTheme: const CardTheme(surfaceTintColor: Color.fromARGB(255, 10, 10, 10)),
drawerTheme: const DrawerThemeData(surfaceTintColor: Color.fromARGB(255, 10, 10, 10)),
searchBarTheme: const SearchBarThemeData(
@ -56,6 +62,7 @@ ThemeData theme = ThemeData(
expansionAnimationStyle: AnimationStyle(curve: Easing.standard, reverseCurve: Easing.standard),
expandedAlignment: Alignment.bottomCenter,
),
dropdownMenuTheme: DropdownMenuThemeData(textStyle: TextStyle(fontFamily: "Eurostile Round", fontSize: 18)),
scaffoldBackgroundColor: Colors.black
);

View File

@ -188,7 +188,7 @@ class _DestinationCalculatorState extends State<DestinationCalculator> {
padding: const EdgeInsets.only(bottom: 8.0),
child: Column(
children: [
Text("Stats Calucator", style: const TextStyle(fontFamily: "Eurostile Round Extended", fontSize: 42)),
Text("Stats Calucator", style: Theme.of(context).textTheme.titleLarge),
],
),
)),
@ -281,7 +281,7 @@ class _DestinationCalculatorState extends State<DestinationCalculator> {
decoration: InputDecoration(hintText: "5"),
onChanged: (value) => customClearsChoice[key] = int.parse(value),
)),
Text(" Lines", style: TextStyle(fontSize: 18)),
Text(" Lines", style: Theme.of(context).textTheme.displayLarge),
Icon(Icons.arrow_forward_ios)
],
),
@ -353,7 +353,7 @@ class _DestinationCalculatorState extends State<DestinationCalculator> {
padding: const EdgeInsets.only(bottom: 8.0),
child: Column(
children: [
Text("Damage Calucator", style: const TextStyle(fontFamily: "Eurostile Round Extended", fontSize: 42)),
Text("Damage Calucator", style: Theme.of(context).textTheme.titleLarge),
],
),
)),

View File

@ -75,7 +75,7 @@ class _DestinationCutoffsState extends State<DestinationCutoffs> {
padding: const EdgeInsets.only(bottom: 8.0),
child: Column(
children: [
Text("Tetra League State", style: const TextStyle(fontFamily: "Eurostile Round Extended", fontSize: 42)),
Text("Tetra League State", style: Theme.of(context).textTheme.titleLarge),
Text("as of ${timestamp(snapshot.data!.timestamp)}"),
],
),

View File

@ -145,7 +145,7 @@ class LeagueCard extends StatelessWidget{
crossAxisAlignment: CrossAxisAlignment.baseline,
textBaseline: TextBaseline.alphabetic,
children: [
Text("Season ${league.season}", style: TextStyle(fontFamily: "Eurostile Round Extended", fontSize: 28, height: 0.9)),
Text("Season ${league.season}", style: Theme.of(context).textTheme.titleSmall),
Spacer(),
Text(
"${seasonStarts.elementAtOrNull(league.season - 1) != null ? timestamp(seasonStarts[league.season - 1]) : "---"}${seasonEnds.elementAtOrNull(league.season - 1) != null ? timestamp(seasonEnds[league.season - 1]) : "---"}",
@ -153,7 +153,7 @@ class LeagueCard extends StatelessWidget{
style: TextStyle(color: Colors.grey)),
],
)
else Text("Tetra League", style: TextStyle(fontFamily: "Eurostile Round Extended", fontSize: 28, height: 0.9)),
else Text("Tetra League", style: Theme.of(context).textTheme.titleSmall),
const Divider(),
TLRatingThingy(userID: "", tlData: league, showPositions: true),
const Divider(),
@ -209,7 +209,7 @@ class _DestinationHomeState extends State<DestinationHome> with SingleTickerProv
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
const Text("40 Lines", style: TextStyle(fontFamily: "Eurostile Round Extended", fontSize: 28, height: 0.9)),
Text("40 Lines", style: Theme.of(context).textTheme.titleSmall),
const Divider(),
RecordSummary(record: summaries.sprint, betterThanClosestAverage: sprintBetterThanClosestAverage, betterThanRankAverage: sprintBetterThanRankAverage, closestAverage: closestAverageSprint, rank: summaries.league.percentileRank),
const Divider(),
@ -226,7 +226,7 @@ class _DestinationHomeState extends State<DestinationHome> with SingleTickerProv
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
const Text("Blitz", style: TextStyle(fontFamily: "Eurostile Round Extended", fontSize: 28, height: 0.9)),
Text("Blitz", style: Theme.of(context).textTheme.titleSmall),
const Divider(),
RecordSummary(record: summaries.blitz, betterThanClosestAverage: blitzBetterThanClosestAverage, betterThanRankAverage: blitzBetterThanRankAverage, closestAverage: closestAverageBlitz, rank: summaries.league.percentileRank),
const Divider(),
@ -248,7 +248,7 @@ class _DestinationHomeState extends State<DestinationHome> with SingleTickerProv
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
const Text("QP", style: TextStyle(fontFamily: "Eurostile Round Extended", fontSize: 28, height: 0.9)),
Text("QP", style: Theme.of(context).textTheme.titleSmall),
const Divider(),
RecordSummary(record: summaries.zenith, hideRank: true),
const Divider(),
@ -265,7 +265,7 @@ class _DestinationHomeState extends State<DestinationHome> with SingleTickerProv
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
const Text("QP Expert", style: TextStyle(fontFamily: "Eurostile Round Extended", fontSize: 28, height: 0.9)),
Text("QP Expert", style: Theme.of(context).textTheme.titleSmall),
const Divider(),
RecordSummary(record: summaries.zenithEx, hideRank: true,),
const Divider(),
@ -287,7 +287,7 @@ class _DestinationHomeState extends State<DestinationHome> with SingleTickerProv
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
const Text("Zen", style: TextStyle(fontFamily: "Eurostile Round Extended", fontSize: 28, height: 0.9)),
Text("Zen", style: Theme.of(context).textTheme.titleSmall),
Text("Level ${intf.format(summaries.zen.level)}", style: const TextStyle(fontFamily: "Eurostile Round", fontSize: 36, fontWeight: FontWeight.w500, color: Colors.white)),
Text("Score ${intf.format(summaries.zen.score)}"),
Text("Level up requirement: ${intf.format(summaries.zen.scoreRequirement)}", style: const TextStyle(color: Colors.grey))
@ -386,7 +386,7 @@ class _DestinationHomeState extends State<DestinationHome> with SingleTickerProv
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(t.tetraLeague, style: const TextStyle(fontFamily: "Eurostile Round Extended", fontSize: 42)),
Text(t.tetraLeague, style: Theme.of(context).textTheme.titleLarge),
//Text("${states.last.timestamp} ${states.last.tr}", textAlign: TextAlign.center)
],
),
@ -400,7 +400,7 @@ class _DestinationHomeState extends State<DestinationHome> with SingleTickerProv
mainAxisSize: MainAxisSize.min,
children: [
const Spacer(),
Text(t.nerdStats, style: const TextStyle(fontFamily: "Eurostile Round Extended", fontSize: 42)),
Text(t.nerdStats, style: Theme.of(context).textTheme.titleLarge),
const Spacer()
],
),
@ -422,7 +422,7 @@ class _DestinationHomeState extends State<DestinationHome> with SingleTickerProv
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text("Previous Seasons", style: const TextStyle(fontFamily: "Eurostile Round Extended", fontSize: 42)),
Text("Previous Seasons", style: Theme.of(context).textTheme.titleLarge),
//Text("${t.seasonStarts} ${countdown(postSeasonLeft)}", textAlign: TextAlign.center)
],
),
@ -504,7 +504,7 @@ class _DestinationHomeState extends State<DestinationHome> with SingleTickerProv
"zenithex" => "${f2.format(snapshot.data!.records[i].stats.zenith!.altitude)} m${(snapshot.data!.records[i].extras as ZenithExtras).mods.isNotEmpty ? " (${t.withModsPlural(n: (snapshot.data!.records[i].extras as ZenithExtras).mods.length)})" : ""}",
String() => "huh",
},
style: const TextStyle(fontSize: 18)),
style: Theme.of(context).textTheme.displayLarge),
subtitle: Text(timestamp(snapshot.data!.records[i].timestamp), style: const TextStyle(color: Colors.grey, height: 0.85)),
trailing: SpTrailingStats(snapshot.data!.records[i], snapshot.data!.records[i].gamemode)
)
@ -543,7 +543,7 @@ class _DestinationHomeState extends State<DestinationHome> with SingleTickerProv
"zenithex" => "${f2.format(snapshot.data!.records[i].stats.zenith!.altitude)} m${(snapshot.data!.records[i].extras as ZenithExtras).mods.isNotEmpty ? " (${t.withModsPlural(n: (snapshot.data!.records[i].extras as ZenithExtras).mods.length)})" : ""}",
String() => "huh",
},
style: const TextStyle(fontSize: 18)),
style: Theme.of(context).textTheme.displayLarge),
subtitle: Text(timestamp(snapshot.data!.records[i].timestamp), style: const TextStyle(color: Colors.grey, height: 0.85)),
trailing: SpTrailingStats(snapshot.data!.records[i], snapshot.data!.records[i].gamemode)
)
@ -577,7 +577,7 @@ class _DestinationHomeState extends State<DestinationHome> with SingleTickerProv
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(t.recent, style: const TextStyle(fontFamily: "Eurostile Round Extended", fontSize: 42)),
Text(t.recent, style: Theme.of(context).textTheme.titleLarge),
],
),
),
@ -618,7 +618,7 @@ class _DestinationHomeState extends State<DestinationHome> with SingleTickerProv
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(t.quickPlay, style: const TextStyle(fontFamily: "Eurostile Round Extended", fontSize: 42)),
Text(t.quickPlay, style: Theme.of(context).textTheme.titleLarge),
//Text("Leaderboard reset in ${countdown(postSeasonLeft)}", textAlign: TextAlign.center),
],
),
@ -704,7 +704,7 @@ class _DestinationHomeState extends State<DestinationHome> with SingleTickerProv
mainAxisSize: MainAxisSize.min,
children: [
const Spacer(),
Text(t.nerdStats, style: const TextStyle(fontFamily: "Eurostile Round Extended", fontSize: 42)),
Text(t.nerdStats, style: Theme.of(context).textTheme.titleLarge),
const Spacer()
],
),
@ -736,7 +736,7 @@ class _DestinationHomeState extends State<DestinationHome> with SingleTickerProv
"blitz" => t.blitz,
"5mblast" => "5,000,000 Blast",
_ => record.gamemode
}, style: const TextStyle(fontFamily: "Eurostile Round Extended", fontSize: 42))
}, style: Theme.of(context).textTheme.titleLarge)
],
),
),
@ -986,10 +986,16 @@ class _DestinationHomeState extends State<DestinationHome> with SingleTickerProv
if (snapshot.data!.summaries!.sprint != null) {
closestAverageSprint = sprintAverages.entries.singleWhere((element) => element.value == sprintAverages.values.reduce((a, b) => (a-snapshot.data!.summaries!.sprint!.stats.finalTime).abs() < (b -snapshot.data!.summaries!.sprint!.stats.finalTime).abs() ? a : b));
sprintBetterThanClosestAverage = snapshot.data!.summaries!.sprint!.stats.finalTime < closestAverageSprint!.value;
} else {
closestAverageSprint = sprintAverages.entries.last;
sprintBetterThanClosestAverage = false;
}
if (snapshot.data!.summaries!.blitz != null){
closestAverageBlitz = blitzAverages.entries.singleWhere((element) => element.value == blitzAverages.values.reduce((a, b) => (a-snapshot.data!.summaries!.blitz!.stats.score).abs() < (b -snapshot.data!.summaries!.blitz!.stats.score).abs() ? a : b));
blitzBetterThanClosestAverage = snapshot.data!.summaries!.blitz!.stats.score > closestAverageBlitz!.value;
} else {
closestAverageBlitz = blitzAverages.entries.last;
blitzBetterThanClosestAverage = false;
}
return TweenAnimationBuilder(
duration: Durations.long4,

View File

@ -114,12 +114,12 @@ class _DestinationLeaderboardsState extends State<DestinationLeaderboards> {
height: widget.constraints.maxHeight,
child: Column(
children: [
const Card(
Card(
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Spacer(),
Text("Leaderboards", style: TextStyle(fontFamily: "Eurostile Round Extended", fontSize: 36)),
Text("Leaderboards", style: Theme.of(context).textTheme.headlineMedium),
Spacer()
],
),
@ -162,7 +162,7 @@ class _DestinationLeaderboardsState extends State<DestinationLeaderboards> {
if (snapshot.hasData){
return Column(
children: [
Text(leaderboards[_currentLb]!, style: TextStyle(fontFamily: "Eurostile Round Extended", fontSize: 28, height: 0.9)),
Text(leaderboards[_currentLb]!, style: Theme.of(context).textTheme.titleSmall),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [

View File

@ -75,12 +75,12 @@ class _DestinationSavedData extends State<DestinationSavedData> {
width: 450,
child: Column(
children: [
const Card(
Card(
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Spacer(),
Text("Saved Data", style: TextStyle(fontFamily: "Eurostile Round Extended", fontSize: 36)),
Text("Saved Data", style: Theme.of(context).textTheme.headlineMedium),
Spacer()
],
),

View File

@ -1220,7 +1220,7 @@ class _TwoRecordsThingy extends StatelessWidget {
onTap: () => Navigator.push(context, MaterialPageRoute(builder: (context) => SingleplayerRecordView(record: sprintStream.records[i]))),
leading: Text("#${i+1}", style: const TextStyle(fontFamily: "Eurostile Round", fontSize: 28, shadows: textShadow, height: 0.9) ),
title: Text(get40lTime(sprintStream.records[i].stats.finalTime.inMicroseconds),
style: const TextStyle(fontSize: 18)),
style: Theme.of(context).textTheme.displayLarge),
subtitle: Text(timestamp(sprintStream.records[i].timestamp), style: const TextStyle(color: Colors.grey, height: 0.85)),
trailing: SpTrailingStats(sprintStream.records[i], sprintStream.records[i].gamemode)
)
@ -1306,7 +1306,7 @@ class _TwoRecordsThingy extends StatelessWidget {
onTap: () => Navigator.push(context, MaterialPageRoute(builder: (context) => SingleplayerRecordView(record: blitzStream.records[i]))),
leading: Text("#${i+1}", style: const TextStyle(fontFamily: "Eurostile Round", fontSize: 28, shadows: textShadow, height: 0.9) ),
title: Text("${NumberFormat.decimalPattern().format(blitzStream.records[i].stats.score)} points",
style: const TextStyle(fontSize: 18)),
style: Theme.of(context).textTheme.displayLarge),
subtitle: Text(timestamp(blitzStream.records[i].timestamp), style: const TextStyle(color: Colors.grey, height: 0.85)),
trailing: SpTrailingStats(blitzStream.records[i], blitzStream.records[i].gamemode)
)
@ -1558,7 +1558,7 @@ class _OtherThingy extends StatelessWidget {
children: getDistinguishmentTitle(distinguishment?.header),
),
),
Text(getDistinguishmentSubtitle(distinguishment?.footer), style: const TextStyle(fontSize: 18), textAlign: TextAlign.center),
Text(getDistinguishmentSubtitle(distinguishment?.footer), style: Theme.of(context).textTheme.displayLarge, textAlign: TextAlign.center),
],
),
),
@ -1568,7 +1568,7 @@ class _OtherThingy extends StatelessWidget {
child: Column(
children: [
Text(t.bio, style: TextStyle(fontFamily: "Eurostile Round Extended",fontSize: bigScreen ? 42 : 28)),
MarkdownBody(data: bio!, styleSheet: MarkdownStyleSheet(textScaler: TextScaler.linear(1.5), textAlign: WrapAlignment.center)) // Text(bio!, style: const TextStyle(fontSize: 18)),
MarkdownBody(data: bio!, styleSheet: MarkdownStyleSheet(textScaler: TextScaler.linear(1.5), textAlign: WrapAlignment.center)) // Text(bio!, style: const Theme.of(context).textTheme.displayLarge),
],
),
),
@ -1579,7 +1579,7 @@ class _OtherThingy extends StatelessWidget {
children: [
Text(t.zen, style: TextStyle(fontFamily: "Eurostile Round Extended", fontSize: bigScreen ? 42 : 28)),
Text("${t.statCellNum.level} ${NumberFormat.decimalPattern().format(zen!.level)}", style: const TextStyle(fontSize: 28, fontWeight: FontWeight.bold)),
Text("${t.statCellNum.score} ${NumberFormat.decimalPattern().format(zen!.score)}", style: const TextStyle(fontSize: 18)),
Text("${t.statCellNum.score} ${NumberFormat.decimalPattern().format(zen!.score)}", style: Theme.of(context).textTheme.displayLarge),
Container(
constraints: const BoxConstraints(maxWidth: 300.0),
child: Row(children: [
@ -1609,7 +1609,7 @@ class _OtherThingy extends StatelessWidget {
physics: const AlwaysScrollableScrollPhysics(),
itemCount: newsletter!.news.length+1,
itemBuilder: (BuildContext context, int index) {
return index == 0 ? Center(child: Text(t.news, style: const TextStyle(fontFamily: "Eurostile Round Extended", fontSize: 42))) : getNewsTile(newsletter!.news[index-1]);
return index == 0 ? Center(child: Text(t.news, style: Theme.of(context).textTheme.titleLarge)) : getNewsTile(newsletter!.news[index-1]);
}
))
]

View File

@ -236,10 +236,9 @@ enum SettingsCardMod{
final String title;
}
const TextStyle settingsTitlesStyle = TextStyle(fontSize: 18);
const EdgeInsets descriptionPadding = EdgeInsets.fromLTRB(12.0, 0.0, 12.0, 8.0);
class _DestinationSettings extends State<DestinationSettings> {
class _DestinationSettings extends State<DestinationSettings> with SingleTickerProviderStateMixin {
SettingsCardMod mod = SettingsCardMod.general;
List<DropdownMenuItem<AppLocale>> locales = <DropdownMenuItem<AppLocale>>[];
String defaultNickname = "Checking...";
@ -251,6 +250,8 @@ class _DestinationSettings extends State<DestinationSettings> {
late bool showAverages;
late bool updateInBG;
final TextEditingController _playertext = TextEditingController();
late AnimationController _defaultNicknameAnimController;
late Animation _defaultNicknameAnim;
@override
void initState() {
@ -258,6 +259,18 @@ class _DestinationSettings extends State<DestinationSettings> {
// windowManager.getTitle().then((value) => oldWindowTitle = value);
// windowManager.setTitle("Tetra Stats: ${t.settings}");
// }
_defaultNicknameAnimController = AnimationController(
duration: Durations.extralong4,
vsync: this,
);
_defaultNicknameAnim = new Tween(
begin: 0.0,
end: 1.0,
).animate(new CurvedAnimation(
parent: _defaultNicknameAnimController,
curve: Cubic(.15,-0.40,.86,-0.39),
reverseCurve: Cubic(0,.99,.99,1.01)
));
_getPreferences();
super.initState();
}
@ -279,22 +292,26 @@ class _DestinationSettings extends State<DestinationSettings> {
_setDefaultNickname(prefs.getString("player"));
}
Future<void> _setDefaultNickname(String? n) async {
Future<bool> _setDefaultNickname(String? n) async {
if (n != null) {
try {
defaultNickname = await teto.getNicknameByID(n);
return true;
} on TetrioPlayerNotExist {
defaultNickname = n;
return false;
}
} else {
defaultNickname = "dan63047";
return true;
}
setState(() {});
//setState(() {});
}
Future<void> _setPlayer(String player) async {
await prefs.setString('player', player);
await _setDefaultNickname(player);
Future<bool> _setPlayer(String player) async {
bool success = await _setDefaultNickname(player);
if (success) await prefs.setString('player', player);
return success;
}
Future<void> _removePlayer() async {
@ -310,7 +327,7 @@ class _DestinationSettings extends State<DestinationSettings> {
padding: const EdgeInsets.only(bottom: 8.0),
child: Column(
children: [
Text(SettingsCardMod.general.title, style: const TextStyle(fontFamily: "Eurostile Round Extended", fontSize: 42)),
Text(SettingsCardMod.general.title, style: Theme.of(context).textTheme.titleLarge),
],
),
)),
@ -320,11 +337,21 @@ class _DestinationSettings extends State<DestinationSettings> {
mainAxisSize: MainAxisSize.min,
children: [
ListTile(
title: Text("Your account in TETR.IO", style: settingsTitlesStyle),
trailing: SizedBox(width: 150.0, child: TextField(
keyboardType: TextInputType.text,
decoration: InputDecoration(hintText: defaultNickname),
//onChanged: (value) => setState((){rules.surgeInitAtB2b = int.parse(value);}),
title: Text("Your account in TETR.IO", style: Theme.of(context).textTheme.displayLarge),
trailing: SizedBox(width: 150.0, child: AnimatedBuilder(
animation: _defaultNicknameAnim,
builder: (context, child) {
return TextField(
keyboardType: TextInputType.text,
decoration: InputDecoration(
hintText: defaultNickname,
helper: Text("Press Enter to submit", style: TextStyle(color: Colors.grey, height: 0.2)),
),
onChanged: (value) {
_setPlayer(value).then((v) {});
},
);
},
)),
),
Divider(),
@ -340,7 +367,7 @@ class _DestinationSettings extends State<DestinationSettings> {
mainAxisSize: MainAxisSize.min,
children: [
ListTile(
title: Text("Language", style: settingsTitlesStyle),
title: Text("Language", style: Theme.of(context).textTheme.displayLarge),
trailing: DropdownButton(
items: locales,
value: LocaleSettings.currentLocale,
@ -367,7 +394,7 @@ class _DestinationSettings extends State<DestinationSettings> {
mainAxisSize: MainAxisSize.min,
children: [
ListTile(
title: Text("Update data in the background", style: settingsTitlesStyle),
title: Text("Update data in the background", style: Theme.of(context).textTheme.displayLarge),
trailing: Switch(value: updateInBG, onChanged: (bool value){
prefs.setBool("updateInBG", value);
setState(() {
@ -388,7 +415,7 @@ class _DestinationSettings extends State<DestinationSettings> {
mainAxisSize: MainAxisSize.min,
children: [
ListTile(
title: Text("Show leaderboard based stats", style: settingsTitlesStyle),
title: Text("Show leaderboard based stats", style: Theme.of(context).textTheme.displayLarge),
trailing: Switch(value: showAverages, onChanged: (bool value){
prefs.setBool("showAverages", value);
setState(() {
@ -410,7 +437,7 @@ class _DestinationSettings extends State<DestinationSettings> {
mainAxisSize: MainAxisSize.min,
children: [
ListTile(
title: Text("Show position on leaderboard by stats", style: settingsTitlesStyle),
title: Text("Show position on leaderboard by stats", style: Theme.of(context).textTheme.displayLarge),
trailing: Switch(value: showPositions, onChanged: (bool value){
prefs.setBool("showPositions", value);
setState(() {
@ -438,7 +465,7 @@ class _DestinationSettings extends State<DestinationSettings> {
padding: const EdgeInsets.only(bottom: 8.0),
child: Column(
children: [
Text(SettingsCardMod.customization.title, style: const TextStyle(fontFamily: "Eurostile Round Extended", fontSize: 42)),
Text(SettingsCardMod.customization.title, style: Theme.of(context).textTheme.titleLarge),
],
),
)),
@ -448,7 +475,7 @@ class _DestinationSettings extends State<DestinationSettings> {
mainAxisSize: MainAxisSize.min,
children: [
ListTile(
title: Text("Accent color", style: settingsTitlesStyle),
title: Text("Accent color", style: Theme.of(context).textTheme.displayLarge),
trailing: ColorIndicator(HSVColor.fromColor(Theme.of(context).colorScheme.primary), width: 25, height: 25),
),
Divider(),
@ -465,7 +492,7 @@ class _DestinationSettings extends State<DestinationSettings> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
ListTile(
title: Text("Timestamps format", style: settingsTitlesStyle),
title: Text("Timestamps format", style: Theme.of(context).textTheme.displayLarge),
trailing: DropdownButton(
value: timestampMode,
items: <DropdownMenuItem>[
@ -498,7 +525,7 @@ class _DestinationSettings extends State<DestinationSettings> {
mainAxisSize: MainAxisSize.min,
children: [
ListTile(
title: Text("Sheetbot-like behavior for radar graphs", style: settingsTitlesStyle),
title: Text("Sheetbot-like behavior for radar graphs", style: Theme.of(context).textTheme.displayLarge),
trailing: Switch(value: sheetbotRadarGraphs, onChanged: (bool value){
prefs.setBool("sheetbotRadarGraphs", value);
setState(() {
@ -519,7 +546,7 @@ class _DestinationSettings extends State<DestinationSettings> {
mainAxisSize: MainAxisSize.min,
children: [
ListTile(
title: Text("Osk-Kagari gimmick", style: settingsTitlesStyle),
title: Text("Osk-Kagari gimmick", style: Theme.of(context).textTheme.displayLarge),
trailing: Switch(value: oskKagariGimmick, onChanged: (bool value){
prefs.setBool("oskKagariGimmick", value);
setState(() {
@ -545,7 +572,7 @@ class _DestinationSettings extends State<DestinationSettings> {
Card(
child: Center(child: Column(
children: [
Text(SettingsCardMod.database.title, style: const TextStyle(fontFamily: "Eurostile Round Extended", fontSize: 42)),
Text(SettingsCardMod.database.title, style: Theme.of(context).textTheme.titleLarge),
Divider(),
FutureBuilder<(int, int, int)>(future: teto.getDatabaseData(),
builder: (context, snapshot) {
@ -602,12 +629,12 @@ class _DestinationSettings extends State<DestinationSettings> {
),
Card(
child: ListTile(
title: Text("Export Database", style: settingsTitlesStyle),
title: Text("Export Database", style: Theme.of(context).textTheme.displayLarge),
),
),
Card(
child: ListTile(
title: Text("Import Database", style: settingsTitlesStyle),
title: Text("Import Database", style: Theme.of(context).textTheme.displayLarge),
),
)
],
@ -628,12 +655,12 @@ class _DestinationSettings extends State<DestinationSettings> {
width: 450,
child: Column(
children: [
const Card(
Card(
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Spacer(),
Text("Settings", style: TextStyle(fontFamily: "Eurostile Round Extended", fontSize: 36)),
Text("Settings", style: Theme.of(context).textTheme.headlineMedium),
Spacer()
],
),
@ -939,7 +966,7 @@ class DistinguishmentThingy extends StatelessWidget{
children: getDistinguishmentTitle(distinguishment.header),
),
),
Text(getDistinguishmentSubtitle(distinguishment.footer), style: const TextStyle(fontSize: 18), textAlign: TextAlign.center),
Text(getDistinguishmentSubtitle(distinguishment.footer), style: Theme.of(context).textTheme.displayLarge, textAlign: TextAlign.center),
],
),
);
@ -1001,7 +1028,7 @@ class FakeDistinguishmentThingy extends StatelessWidget{
),
),
),
Text(getDistinguishmentSubtitle(), style: const TextStyle(fontSize: 18), textAlign: TextAlign.center),
Text(getDistinguishmentSubtitle(), style: Theme.of(context).textTheme.displayLarge, textAlign: TextAlign.center),
],
),
),
@ -1376,10 +1403,13 @@ class _NewUserThingyState extends State<NewUserThingy> with SingleTickerProvider
),
),
) : Container(
transform: Matrix4.translationValues(0, secondButtonPosition, 0),
transform: Matrix4.translationValues(secondButtonPosition*5, -secondButtonPosition*25, 0),
child: Opacity(
opacity: max(0, secondButtonOpacity),
child: const Icon(Icons.person_remove)
opacity: max(0, min(1, secondButtonOpacity)),
child: Transform.rotate(
angle:_addToTrackAnim.status == AnimationStatus.reverse ? (1-_addToTrackAnim.value as double)*-20 : 0,
child: const Icon(Icons.person_remove)
)
)
),
label: _addToTrackAnim.value < 0.5 ? Container(
@ -1391,8 +1421,8 @@ class _NewUserThingyState extends State<NewUserThingy> with SingleTickerProvider
) : Container(
transform: Matrix4.translationValues(0, secondButtonPosition, 0),
child: Opacity(
opacity: max(0, secondButtonOpacity),
child: Text("Stop tracking")
opacity: max(0, min(1, secondButtonOpacity)),
child: Text(_addToTrackAnimController.isAnimating && _addToTrackAnim.status == AnimationStatus.reverse ? "Done! " : "Stop tracking")
)
),
style: const ButtonStyle(shape: WidgetStatePropertyAll(RoundedRectangleBorder(borderRadius: BorderRadius.only(bottomLeft: Radius.circular(12.0))))));

View File

@ -43,15 +43,32 @@ class UserState extends State<UserView> {
Widget build(BuildContext context) {
//final t = Translations.of(context);
return Scaffold(
appBar: AppBar(
title: Text("Search For"),
),
backgroundColor: Colors.black,
floatingActionButtonLocation: FloatingActionButtonLocation.startTop,
floatingActionButton: Padding(
padding: const EdgeInsets.all(8.0),
child: FloatingActionButton(
onPressed: () => Navigator.pop(context),
tooltip: 'Fuck go back',
child: const Icon(Icons.arrow_back),
),
),
body: SafeArea(
child: LayoutBuilder(
builder: (BuildContext context, BoxConstraints constraints) {
return DestinationHome(searchFor: widget.searchFor, dataFuture: getData(widget.searchFor), newsFuture: teto.fetchNews(widget.searchFor), constraints: constraints);
}
child: LayoutBuilder(
builder: (BuildContext context, BoxConstraints constraints) {
return Row(
children: [
Card(
child: Column(
children: [
Text("Pornograph", style: TextStyle(),)
]
),
),
DestinationHome(searchFor: widget.searchFor, dataFuture: getData(widget.searchFor), newsFuture: teto.fetchNews(widget.searchFor), constraints: constraints),
],
);
}
)
)
);

View File

@ -41,7 +41,7 @@ class RecentSingleplayerGames extends StatelessWidget{
"5mblast" => get40lTime(record.stats.finalTime.inMicroseconds),
String() => "huh",
},
style: const TextStyle(fontSize: 18)),
style: Theme.of(context).textTheme.displayLarge),
subtitle: Text(timestamp(record.timestamp), style: const TextStyle(color: Colors.grey, height: 0.85)),
trailing: SpTrailingStats(record, record.gamemode)
)

View File

@ -141,7 +141,7 @@ class SingleplayerRecord extends StatelessWidget {
"5mblast" => get40lTime(stream!.records[i].stats.finalTime.inMicroseconds),
String() => "huh",
},
style: const TextStyle(fontSize: 18)),
style: Theme.of(context).textTheme.displayLarge),
subtitle: Text(timestamp(stream!.records[i].timestamp), style: const TextStyle(color: Colors.grey, height: 0.85)),
trailing: SpTrailingStats(stream!.records[i], stream!.records[i].gamemode)
)