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(
|
||||
primary: Colors.cyanAccent,
|
||||
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
|
||||
);
|
||||
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/gestures.dart';
|
||||
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_svg/flutter_svg.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
|
@ -30,6 +28,17 @@ class MainView extends StatefulWidget {
|
|||
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(
|
||||
userId: "6098518e3d5155e6ec429cdc",
|
||||
username: "dan63",
|
||||
|
@ -85,37 +94,55 @@ class _MainState extends State<MainView> with TickerProviderStateMixin {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(body: Row(
|
||||
return Scaffold(
|
||||
body: LayoutBuilder(
|
||||
builder: (BuildContext context, BoxConstraints constraints) {
|
||||
return Row(
|
||||
children: [
|
||||
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(
|
||||
icon: Icon(Icons.favorite_border),
|
||||
selectedIcon: Icon(Icons.favorite),
|
||||
icon: Icon(Icons.home),
|
||||
selectedIcon: Icon(Icons.home),
|
||||
label: Text('First'),
|
||||
),
|
||||
NavigationRailDestination(
|
||||
icon: Icon(Icons.bookmark_border),
|
||||
selectedIcon: Icon(Icons.book),
|
||||
icon: Icon(Icons.leaderboard),
|
||||
selectedIcon: Icon(Icons.leaderboard),
|
||||
label: Text('Second'),
|
||||
),
|
||||
NavigationRailDestination(
|
||||
icon: Icon(Icons.star_border),
|
||||
selectedIcon: Icon(Icons.star),
|
||||
icon: Icon(Icons.compress),
|
||||
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'),
|
||||
)
|
||||
],
|
||||
selectedIndex: 0
|
||||
),
|
||||
Expanded(
|
||||
child: Scrollbar(
|
||||
controller: controller,
|
||||
thumbVisibility: true,
|
||||
child: SingleChildScrollView(
|
||||
controller: controller,
|
||||
scrollDirection: Axis.horizontal,
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
Row(
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 450.0,
|
||||
|
@ -133,7 +160,6 @@ class _MainState extends State<MainView> with TickerProviderStateMixin {
|
|||
),
|
||||
),
|
||||
Card(
|
||||
surfaceTintColor: theme.colorScheme.surface,
|
||||
child: Column(
|
||||
children: [
|
||||
Padding(
|
||||
|
@ -211,7 +237,6 @@ class _MainState extends State<MainView> with TickerProviderStateMixin {
|
|||
),
|
||||
if (testPlayer.distinguishment != null) DistinguishmentThingy(testPlayer.distinguishment!),
|
||||
if (testPlayer.bio != null) Card(
|
||||
surfaceTintColor: theme.colorScheme.surface,
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
|
@ -234,59 +259,68 @@ class _MainState extends State<MainView> with TickerProviderStateMixin {
|
|||
)
|
||||
),
|
||||
SizedBox(
|
||||
width: 450.0,
|
||||
width: constraints.maxWidth - 450 - 80,
|
||||
child: Column(
|
||||
//crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Card(
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Spacer(),
|
||||
Text("test card"),
|
||||
Text(t.tetraLeague, style: TextStyle(fontFamily: "Eurostile Round Extended", fontSize: 42)),
|
||||
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)),
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: 450.0,
|
||||
child: Column(
|
||||
children: [
|
||||
Card(
|
||||
child: Row(
|
||||
children: [
|
||||
Spacer(),
|
||||
Text("test card"),
|
||||
Spacer()
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: 450.0,
|
||||
child: Column(
|
||||
children: [
|
||||
Card(
|
||||
child: Row(
|
||||
children: [
|
||||
Spacer(),
|
||||
Text("test card"),
|
||||
Spacer()
|
||||
],
|
||||
),
|
||||
)
|
||||
selected: <Cards>{Cards.tetraLeague},
|
||||
onSelectionChanged: (Set<Cards> newSelection) {
|
||||
setState(() {
|
||||
// By default there is only a single segment that can be
|
||||
// selected at one time, so its value is always the first
|
||||
// item in the selected set.
|
||||
//calendarView = newSelection.first;
|
||||
});})
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
));
|
||||
}
|
||||
}
|
||||
|
@ -599,7 +633,6 @@ class NewUserThingy extends StatelessWidget {
|
|||
|
||||
return Card(
|
||||
clipBehavior: Clip.antiAlias,
|
||||
surfaceTintColor: theme.colorScheme.surface,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(bottom: 8.0),
|
||||
child: Column(
|
||||
|
|
|
@ -338,7 +338,7 @@ class TlMatchResultState extends State<TlMatchResultView> {
|
|||
CompareThingy(
|
||||
label: t.statCellNum.estOfTRShort,
|
||||
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 :
|
||||
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,
|
||||
|
|
Loading…
Reference in New Issue