1 small fix + redesign thoughts
This commit is contained in:
parent
31659d646d
commit
b93898cc34
|
@ -30,8 +30,9 @@ ThemeData theme = ThemeData(
|
||||||
colorScheme: const ColorScheme.dark(
|
colorScheme: const ColorScheme.dark(
|
||||||
primary: Colors.cyanAccent,
|
primary: Colors.cyanAccent,
|
||||||
surface: Color.fromARGB(255, 10, 10, 10),
|
surface: Color.fromARGB(255, 10, 10, 10),
|
||||||
secondary: Colors.white
|
secondary: Colors.white,
|
||||||
),
|
),
|
||||||
|
cardTheme: CardTheme(surfaceTintColor: Color.fromARGB(255, 10, 10, 10)),
|
||||||
scaffoldBackgroundColor: Colors.black
|
scaffoldBackgroundColor: Colors.black
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/gestures.dart';
|
import 'package:flutter/gestures.dart';
|
||||||
import 'package:flutter/material.dart' hide Badge;
|
import 'package:flutter/material.dart' hide Badge;
|
||||||
import 'package:flutter/rendering.dart';
|
|
||||||
import 'package:flutter/widgets.dart';
|
|
||||||
import 'package:flutter_markdown/flutter_markdown.dart';
|
import 'package:flutter_markdown/flutter_markdown.dart';
|
||||||
import 'package:flutter_svg/flutter_svg.dart';
|
import 'package:flutter_svg/flutter_svg.dart';
|
||||||
import 'package:intl/intl.dart';
|
import 'package:intl/intl.dart';
|
||||||
|
@ -30,6 +28,17 @@ class MainView extends StatefulWidget {
|
||||||
State<MainView> createState() => _MainState();
|
State<MainView> createState() => _MainState();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum Cards {overview, tetraLeague, quickPlay, quickPlayExpert, sprint, blitz, other}
|
||||||
|
Map<Cards, String> cardsTitles = {
|
||||||
|
Cards.overview: "Overview",
|
||||||
|
Cards.tetraLeague: t.tetraLeague,
|
||||||
|
Cards.quickPlay: t.quickPlay,
|
||||||
|
Cards.quickPlayExpert: "${t.quickPlay} ${t.expert}",
|
||||||
|
Cards.sprint: t.sprint,
|
||||||
|
Cards.blitz: t.blitz,
|
||||||
|
Cards.other: t.other
|
||||||
|
};
|
||||||
|
|
||||||
TetrioPlayer testPlayer = TetrioPlayer(
|
TetrioPlayer testPlayer = TetrioPlayer(
|
||||||
userId: "6098518e3d5155e6ec429cdc",
|
userId: "6098518e3d5155e6ec429cdc",
|
||||||
username: "dan63",
|
username: "dan63",
|
||||||
|
@ -85,37 +94,55 @@ class _MainState extends State<MainView> with TickerProviderStateMixin {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(body: Row(
|
return Scaffold(
|
||||||
|
body: LayoutBuilder(
|
||||||
|
builder: (BuildContext context, BoxConstraints constraints) {
|
||||||
|
return Row(
|
||||||
children: [
|
children: [
|
||||||
NavigationRail(
|
NavigationRail(
|
||||||
destinations: [
|
leading: FloatingActionButton(
|
||||||
|
elevation: 0,
|
||||||
|
onPressed: () {
|
||||||
|
// Add your onPressed code here!
|
||||||
|
},
|
||||||
|
child: const Icon(Icons.search),
|
||||||
|
),
|
||||||
|
trailing: IconButton(
|
||||||
|
onPressed: () {
|
||||||
|
// Add your onPressed code here!
|
||||||
|
},
|
||||||
|
icon: const Icon(Icons.more_horiz_rounded),
|
||||||
|
),
|
||||||
|
destinations: const [
|
||||||
NavigationRailDestination(
|
NavigationRailDestination(
|
||||||
icon: Icon(Icons.favorite_border),
|
icon: Icon(Icons.home),
|
||||||
selectedIcon: Icon(Icons.favorite),
|
selectedIcon: Icon(Icons.home),
|
||||||
label: Text('First'),
|
label: Text('First'),
|
||||||
),
|
),
|
||||||
NavigationRailDestination(
|
NavigationRailDestination(
|
||||||
icon: Icon(Icons.bookmark_border),
|
icon: Icon(Icons.leaderboard),
|
||||||
selectedIcon: Icon(Icons.book),
|
selectedIcon: Icon(Icons.leaderboard),
|
||||||
label: Text('Second'),
|
label: Text('Second'),
|
||||||
),
|
),
|
||||||
NavigationRailDestination(
|
NavigationRailDestination(
|
||||||
icon: Icon(Icons.star_border),
|
icon: Icon(Icons.compress),
|
||||||
selectedIcon: Icon(Icons.star),
|
selectedIcon: Icon(Icons.compress),
|
||||||
|
label: Text('Third'),
|
||||||
|
),
|
||||||
|
NavigationRailDestination(
|
||||||
|
icon: Icon(Icons.calculate),
|
||||||
|
selectedIcon: Icon(Icons.calculate),
|
||||||
|
label: Text('Calc'),
|
||||||
|
),
|
||||||
|
NavigationRailDestination(
|
||||||
|
icon: Icon(Icons.settings),
|
||||||
|
selectedIcon: Icon(Icons.settings),
|
||||||
label: Text('Third'),
|
label: Text('Third'),
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
selectedIndex: 0
|
selectedIndex: 0
|
||||||
),
|
),
|
||||||
Expanded(
|
Row(
|
||||||
child: Scrollbar(
|
|
||||||
controller: controller,
|
|
||||||
thumbVisibility: true,
|
|
||||||
child: SingleChildScrollView(
|
|
||||||
controller: controller,
|
|
||||||
scrollDirection: Axis.horizontal,
|
|
||||||
child: Row(
|
|
||||||
mainAxisSize: MainAxisSize.min,
|
|
||||||
children: [
|
children: [
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: 450.0,
|
width: 450.0,
|
||||||
|
@ -133,7 +160,6 @@ class _MainState extends State<MainView> with TickerProviderStateMixin {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Card(
|
Card(
|
||||||
surfaceTintColor: theme.colorScheme.surface,
|
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Padding(
|
Padding(
|
||||||
|
@ -211,7 +237,6 @@ class _MainState extends State<MainView> with TickerProviderStateMixin {
|
||||||
),
|
),
|
||||||
if (testPlayer.distinguishment != null) DistinguishmentThingy(testPlayer.distinguishment!),
|
if (testPlayer.distinguishment != null) DistinguishmentThingy(testPlayer.distinguishment!),
|
||||||
if (testPlayer.bio != null) Card(
|
if (testPlayer.bio != null) Card(
|
||||||
surfaceTintColor: theme.colorScheme.surface,
|
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Row(
|
Row(
|
||||||
|
@ -234,59 +259,68 @@ class _MainState extends State<MainView> with TickerProviderStateMixin {
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: 450.0,
|
width: constraints.maxWidth - 450 - 80,
|
||||||
child: Column(
|
child: Column(
|
||||||
|
//crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Card(
|
Card(
|
||||||
child: Row(
|
child: Row(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
Spacer(),
|
Spacer(),
|
||||||
Text("test card"),
|
Text(t.tetraLeague, style: TextStyle(fontFamily: "Eurostile Round Extended", fontSize: 42)),
|
||||||
Spacer()
|
Spacer()
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
)
|
),
|
||||||
|
Card(),
|
||||||
|
SegmentedButton<Cards>(
|
||||||
|
segments: const <ButtonSegment<Cards>>[
|
||||||
|
ButtonSegment<Cards>(
|
||||||
|
value: Cards.overview,
|
||||||
|
label: Text('Overview'),
|
||||||
|
icon: Icon(Icons.calendar_view_day)),
|
||||||
|
ButtonSegment<Cards>(
|
||||||
|
value: Cards.tetraLeague,
|
||||||
|
label: Text('Tetra League'),
|
||||||
|
icon: Icon(Icons.calendar_view_week)),
|
||||||
|
ButtonSegment<Cards>(
|
||||||
|
value: Cards.quickPlay,
|
||||||
|
label: Text('Quick Play'),
|
||||||
|
icon: Icon(Icons.calendar_view_month)),
|
||||||
|
// ButtonSegment<Cards>(
|
||||||
|
// value: Cards.quickPlayExpert,
|
||||||
|
// label: Text('QP Expert'),
|
||||||
|
// icon: Icon(Icons.calendar_today)),
|
||||||
|
ButtonSegment<Cards>(
|
||||||
|
value: Cards.sprint,
|
||||||
|
label: Text('40 Lines'),
|
||||||
|
icon: Icon(Icons.calendar_today)),
|
||||||
|
ButtonSegment<Cards>(
|
||||||
|
value: Cards.blitz,
|
||||||
|
label: Text('Blitz'),
|
||||||
|
icon: Icon(Icons.calendar_today)),
|
||||||
|
// ButtonSegment<Cards>(
|
||||||
|
// value: Cards.other,
|
||||||
|
// label: Text('Other'),
|
||||||
|
// icon: Icon(Icons.calendar_today)),
|
||||||
],
|
],
|
||||||
),
|
selected: <Cards>{Cards.tetraLeague},
|
||||||
),
|
onSelectionChanged: (Set<Cards> newSelection) {
|
||||||
SizedBox(
|
setState(() {
|
||||||
width: 450.0,
|
// By default there is only a single segment that can be
|
||||||
child: Column(
|
// selected at one time, so its value is always the first
|
||||||
children: [
|
// item in the selected set.
|
||||||
Card(
|
//calendarView = newSelection.first;
|
||||||
child: Row(
|
});})
|
||||||
children: [
|
|
||||||
Spacer(),
|
|
||||||
Text("test card"),
|
|
||||||
Spacer()
|
|
||||||
],
|
|
||||||
),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
SizedBox(
|
|
||||||
width: 450.0,
|
|
||||||
child: Column(
|
|
||||||
children: [
|
|
||||||
Card(
|
|
||||||
child: Row(
|
|
||||||
children: [
|
|
||||||
Spacer(),
|
|
||||||
Text("test card"),
|
|
||||||
Spacer()
|
|
||||||
],
|
|
||||||
),
|
|
||||||
)
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
|
);
|
||||||
|
},
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -599,7 +633,6 @@ class NewUserThingy extends StatelessWidget {
|
||||||
|
|
||||||
return Card(
|
return Card(
|
||||||
clipBehavior: Clip.antiAlias,
|
clipBehavior: Clip.antiAlias,
|
||||||
surfaceTintColor: theme.colorScheme.surface,
|
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.only(bottom: 8.0),
|
padding: const EdgeInsets.only(bottom: 8.0),
|
||||||
child: Column(
|
child: Column(
|
||||||
|
|
|
@ -338,7 +338,7 @@ class TlMatchResultState extends State<TlMatchResultView> {
|
||||||
CompareThingy(
|
CompareThingy(
|
||||||
label: t.statCellNum.estOfTRShort,
|
label: t.statCellNum.estOfTRShort,
|
||||||
greenSide: roundSelector == -2 ? timeWeightedStats[0].estTr.esttr :
|
greenSide: roundSelector == -2 ? timeWeightedStats[0].estTr.esttr :
|
||||||
roundSelector.isNegative ? widget.record.results.leaderboard[greenSidePlayer].stats.nerdStats.app : widget.record.results.rounds[roundSelector].firstWhere((element) => element.id == widget.initPlayerId).stats.estTr.esttr,
|
roundSelector.isNegative ? widget.record.results.leaderboard[greenSidePlayer].stats.estTr.esttr : widget.record.results.rounds[roundSelector].firstWhere((element) => element.id == widget.initPlayerId).stats.estTr.esttr,
|
||||||
redSide: roundSelector == -2 ? timeWeightedStats[1].estTr.esttr :
|
redSide: roundSelector == -2 ? timeWeightedStats[1].estTr.esttr :
|
||||||
roundSelector == -1 ? widget.record.results.leaderboard[redSidePlayer].stats.estTr.esttr : widget.record.results.rounds[roundSelector].firstWhere((element) => element.id != widget.initPlayerId).stats.estTr.esttr,
|
roundSelector == -1 ? widget.record.results.leaderboard[redSidePlayer].stats.estTr.esttr : widget.record.results.rounds[roundSelector].firstWhere((element) => element.id != widget.initPlayerId).stats.estTr.esttr,
|
||||||
fractionDigits: 2,
|
fractionDigits: 2,
|
||||||
|
|
Loading…
Reference in New Issue