Skip to content

Commit

Permalink
Style fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
veloce committed Apr 11, 2024
1 parent 190b962 commit fcb014c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 18 deletions.
6 changes: 4 additions & 2 deletions lib/src/view/puzzle/storm_dashboard.dart
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ class _Body extends ConsumerWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: Styles.sectionTopPadding,
padding:
Styles.sectionTopPadding.add(Styles.horizontalBodyPadding),
child: StatCardRow(
[
StatCard(
Expand All @@ -82,7 +83,8 @@ class _Body extends ConsumerWidget {
),
),
Padding(
padding: Styles.sectionTopPadding,
padding:
Styles.sectionTopPadding.add(Styles.horizontalBodyPadding),
child: StatCardRow(
[
StatCard(
Expand Down
23 changes: 11 additions & 12 deletions lib/src/view/user/perf_stats_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ class _Body extends ConsumerWidget {
data: (data) {
return SafeArea(
child: ListView(
padding: Styles.horizontalBodyPadding,
padding: Styles.horizontalBodyPadding.add(Styles.sectionTopPadding),
scrollDirection: Axis.vertical,
children: [
ratingHistory.when(
Expand Down Expand Up @@ -594,6 +594,7 @@ class _GameListWidget extends ConsumerWidget {
Widget build(BuildContext context, WidgetRef ref) {
return ListSection(
header: header,
margin: const EdgeInsets.symmetric(vertical: 10.0),
hasLeading: false,
children: [
for (final game in games)
Expand Down Expand Up @@ -759,8 +760,10 @@ class _EloChartState extends State<_EloChart> {
@override
Widget build(BuildContext context) {
final borderColor =
Theme.of(context).colorScheme.onBackground.withOpacity(0.5);
final chartColor = Theme.of(context).colorScheme.tertiary;
Theme.of(context).colorScheme.onSurface.withOpacity(0.5);
final chartColor = Theme.of(context).platform == TargetPlatform.iOS
? Colors.cyan
: Theme.of(context).colorScheme.tertiary;
final chartDateFormatter = switch (_selectedRange) {
DateRange.oneWeek => DateFormat.MMMd(_currentLocale),
DateRange.oneMonth => DateFormat.MMMd(_currentLocale),
Expand Down Expand Up @@ -841,9 +844,7 @@ class _EloChartState extends State<_EloChart> {
LineChartBarData(
spots: _flSpot,
dotData: const FlDotData(show: false),
color: Theme.of(context).platform == TargetPlatform.iOS
? null
: chartColor,
color: chartColor,
belowBarData: BarAreaData(
color: chartColor.withOpacity(0.2),
show: true,
Expand All @@ -869,10 +870,7 @@ class _EloChartState extends State<_EloChart> {
lineTouchData: LineTouchData(
touchSpotThreshold: double.infinity,
touchTooltipData: LineTouchTooltipData(
tooltipBgColor:
Theme.of(context).platform == TargetPlatform.iOS
? const Color.fromRGBO(96, 125, 139, 1)
: chartColor.withOpacity(0.2),
getTooltipColor: (_) => chartColor.withOpacity(0.5),
fitInsideHorizontally: true,
fitInsideVertically: true,
getTooltipItems: (touchedSpots) {
Expand Down Expand Up @@ -962,11 +960,12 @@ class _RangeButton extends StatelessWidget {

@override
Widget build(BuildContext context) {
final chartColor = Theme.of(context).colorScheme.tertiary;
final chartColor = Theme.of(context).platform == TargetPlatform.iOS
? Colors.cyan
: Theme.of(context).colorScheme.tertiary;

return PlatformCard(
color: selected ? chartColor.withOpacity(0.2) : null,
surfaceTintColor: selected ? Colors.transparent : null,
shadowColor: selected ? Colors.transparent : null,
child: AdaptiveInkWell(
borderRadius: const BorderRadius.all(Radius.circular(8.0)),
Expand Down
4 changes: 0 additions & 4 deletions lib/src/widgets/platform.dart
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ class PlatformCard extends StatelessWidget {
this.borderRadius,
this.elevation,
this.color,
this.surfaceTintColor,
this.shadowColor,
});

Expand All @@ -79,7 +78,6 @@ class PlatformCard extends StatelessWidget {
final BorderRadius? borderRadius;
final double? elevation;
final Color? color;
final Color? surfaceTintColor;
final Color? shadowColor;

/// The empty space that surrounds the card.
Expand All @@ -105,7 +103,6 @@ class PlatformCard extends StatelessWidget {
? CupertinoColors.systemBackground
: CupertinoColors.secondarySystemBackground
.resolveFrom(context)),
surfaceTintColor: surfaceTintColor,
shadowColor: shadowColor,
shape: borderRadius != null
? RoundedRectangleBorder(
Expand All @@ -126,7 +123,6 @@ class PlatformCard extends StatelessWidget {
borderRadius: BorderRadius.all(Radius.circular(10.0)),
),
color: color,
surfaceTintColor: surfaceTintColor,
shadowColor: shadowColor,
semanticContainer: semanticContainer,
elevation: elevation,
Expand Down

0 comments on commit fcb014c

Please sign in to comment.