feat(app): dark mode uses a near-black gray with lighter layers instead of pure black
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
import '../ui/theme/app_theme.dart';
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
@@ -39,10 +40,15 @@ class MyApp extends StatelessWidget {
|
|||||||
final router = routerConfig;
|
final router = routerConfig;
|
||||||
if (cupertino ?? _platformIsCupertino) {
|
if (cupertino ?? _platformIsCupertino) {
|
||||||
if (router != null) {
|
if (router != null) {
|
||||||
return CupertinoApp.router(title: 'Pipelines', routerConfig: router);
|
return CupertinoApp.router(
|
||||||
|
title: 'Pipelines',
|
||||||
|
theme: appCupertinoTheme,
|
||||||
|
routerConfig: router,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
return CupertinoApp(
|
return CupertinoApp(
|
||||||
title: 'Pipelines',
|
title: 'Pipelines',
|
||||||
|
theme: appCupertinoTheme,
|
||||||
home: AdaptiveShell(
|
home: AdaptiveShell(
|
||||||
destinationBodies: destinationBodies,
|
destinationBodies: destinationBodies,
|
||||||
cupertino: true,
|
cupertino: true,
|
||||||
@@ -54,16 +60,16 @@ class MyApp extends StatelessWidget {
|
|||||||
if (router != null) {
|
if (router != null) {
|
||||||
return MaterialApp.router(
|
return MaterialApp.router(
|
||||||
title: 'Pipelines',
|
title: 'Pipelines',
|
||||||
theme: ThemeData(),
|
theme: appLightTheme(),
|
||||||
darkTheme: ThemeData(brightness: Brightness.dark),
|
darkTheme: appDarkTheme(),
|
||||||
themeMode: ThemeMode.system,
|
themeMode: ThemeMode.system,
|
||||||
routerConfig: router,
|
routerConfig: router,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return MaterialApp(
|
return MaterialApp(
|
||||||
title: 'Pipelines',
|
title: 'Pipelines',
|
||||||
theme: ThemeData(),
|
theme: appLightTheme(),
|
||||||
darkTheme: ThemeData(brightness: Brightness.dark),
|
darkTheme: appDarkTheme(),
|
||||||
themeMode: ThemeMode.system,
|
themeMode: ThemeMode.system,
|
||||||
home: AdaptiveShell(
|
home: AdaptiveShell(
|
||||||
destinationBodies: destinationBodies,
|
destinationBodies: destinationBodies,
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import '../../../ui/theme/app_theme.dart';
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
@@ -42,6 +43,7 @@ class ArtifactDocumentSection extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
if (usesCupertinoHost(context)) {
|
if (usesCupertinoHost(context)) {
|
||||||
return CupertinoListSection.insetGrouped(
|
return CupertinoListSection.insetGrouped(
|
||||||
|
backgroundColor: AppColors.groupedBackground,
|
||||||
header: Semantics(
|
header: Semantics(
|
||||||
container: true,
|
container: true,
|
||||||
header: true,
|
header: true,
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import '../../../ui/theme/app_theme.dart';
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
@@ -390,7 +391,7 @@ class _ArtifactGalleryPageState extends State<ArtifactGalleryPage> {
|
|||||||
return CupertinoPageScaffold(
|
return CupertinoPageScaffold(
|
||||||
// Sections paint the grouped background; the page must match it or a
|
// Sections paint the grouped background; the page must match it or a
|
||||||
// white seam shows below the last section in light mode.
|
// white seam shows below the last section in light mode.
|
||||||
backgroundColor: CupertinoColors.systemGroupedBackground,
|
backgroundColor: AppColors.groupedBackground,
|
||||||
navigationBar: const CupertinoNavigationBar(
|
navigationBar: const CupertinoNavigationBar(
|
||||||
middle: Text(artifactGalleryTitle),
|
middle: Text(artifactGalleryTitle),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import '../../../ui/theme/app_theme.dart';
|
||||||
import '../../../ui/input/arrow_key_pager.dart';
|
import '../../../ui/input/arrow_key_pager.dart';
|
||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
|
|
||||||
@@ -248,7 +249,7 @@ class _ArtifactViewerPageState extends State<ArtifactViewerPage> {
|
|||||||
);
|
);
|
||||||
if (usesCupertinoHost(context)) {
|
if (usesCupertinoHost(context)) {
|
||||||
return CupertinoPageScaffold(
|
return CupertinoPageScaffold(
|
||||||
backgroundColor: CupertinoColors.systemGroupedBackground,
|
backgroundColor: AppColors.groupedBackground,
|
||||||
navigationBar: CupertinoNavigationBar(
|
navigationBar: CupertinoNavigationBar(
|
||||||
middle: Text(title, overflow: TextOverflow.ellipsis),
|
middle: Text(title, overflow: TextOverflow.ellipsis),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import '../../../ui/theme/app_theme.dart';
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
|
|
||||||
@@ -105,6 +106,7 @@ class CupertinoNeedsYouSheet extends StatelessWidget {
|
|||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
CupertinoListSection.insetGrouped(
|
CupertinoListSection.insetGrouped(
|
||||||
|
backgroundColor: AppColors.groupedBackground,
|
||||||
children: [
|
children: [
|
||||||
for (final entry in rows)
|
for (final entry in rows)
|
||||||
_AttentionRow(
|
_AttentionRow(
|
||||||
@@ -117,6 +119,7 @@ class CupertinoNeedsYouSheet extends StatelessWidget {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
CupertinoListSection.insetGrouped(
|
CupertinoListSection.insetGrouped(
|
||||||
|
backgroundColor: AppColors.groupedBackground,
|
||||||
children: [
|
children: [
|
||||||
CupertinoListTile(
|
CupertinoListTile(
|
||||||
key: attentionClearAllKey,
|
key: attentionClearAllKey,
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import '../../../ui/theme/app_theme.dart';
|
||||||
import 'dart:math' as math;
|
import 'dart:math' as math;
|
||||||
|
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
@@ -75,6 +76,7 @@ class ChatBackgroundTaskDetail extends StatelessWidget {
|
|||||||
);
|
);
|
||||||
if (cupertino) {
|
if (cupertino) {
|
||||||
return CupertinoListSection.insetGrouped(
|
return CupertinoListSection.insetGrouped(
|
||||||
|
backgroundColor: AppColors.groupedBackground,
|
||||||
children: [Padding(padding: const EdgeInsets.all(12), child: content)],
|
children: [Padding(padding: const EdgeInsets.all(12), child: content)],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import '../../../ui/theme/app_theme.dart';
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
@@ -223,6 +224,7 @@ class ChatPermissionCard extends StatelessWidget {
|
|||||||
);
|
);
|
||||||
|
|
||||||
Widget _cupertino(BuildContext context) => CupertinoListSection.insetGrouped(
|
Widget _cupertino(BuildContext context) => CupertinoListSection.insetGrouped(
|
||||||
|
backgroundColor: AppColors.groupedBackground,
|
||||||
// As the Material card: the transcript row owns the horizontal inset, so
|
// As the Material card: the transcript row owns the horizontal inset, so
|
||||||
// the card lines up with the message bubbles.
|
// the card lines up with the message bubbles.
|
||||||
margin: const EdgeInsets.only(bottom: 12),
|
margin: const EdgeInsets.only(bottom: 12),
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import '../../../ui/theme/app_theme.dart';
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
@@ -136,6 +137,7 @@ class _ChatQuestionCardState extends State<ChatQuestionCard> {
|
|||||||
: body;
|
: body;
|
||||||
if (cupertino) {
|
if (cupertino) {
|
||||||
return CupertinoListSection.insetGrouped(
|
return CupertinoListSection.insetGrouped(
|
||||||
|
backgroundColor: AppColors.groupedBackground,
|
||||||
// As the Material card: the transcript row owns the horizontal inset,
|
// As the Material card: the transcript row owns the horizontal inset,
|
||||||
// so the card lines up with the message bubbles.
|
// so the card lines up with the message bubbles.
|
||||||
margin: const EdgeInsets.only(bottom: 12),
|
margin: const EdgeInsets.only(bottom: 12),
|
||||||
@@ -165,10 +167,7 @@ class _ChatQuestionCardState extends State<ChatQuestionCard> {
|
|||||||
: '${widget.form['title']}'.trim(),
|
: '${widget.form['title']}'.trim(),
|
||||||
style: chatCardTitleStyle(context, cupertino),
|
style: chatCardTitleStyle(context, cupertino),
|
||||||
),
|
),
|
||||||
Text(
|
Text(_statusLine(), style: chatCardSecondaryStyle(context, cupertino)),
|
||||||
_statusLine(),
|
|
||||||
style: chatCardSecondaryStyle(context, cupertino),
|
|
||||||
),
|
|
||||||
if (error.isNotEmpty)
|
if (error.isNotEmpty)
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(top: 8),
|
padding: const EdgeInsets.only(top: 8),
|
||||||
@@ -229,5 +228,4 @@ class _ChatQuestionCardState extends State<ChatQuestionCard> {
|
|||||||
_fields.every((field) => '${field['type'] ?? ''}' == 'external');
|
_fields.every((field) => '${field['type'] ?? ''}' == 'external');
|
||||||
return allExternal ? chatQuestionConfirm : chatQuestionSubmit;
|
return allExternal ? chatQuestionConfirm : chatQuestionSubmit;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import '../../../../ui/theme/app_theme.dart';
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
@@ -156,6 +157,7 @@ class ChatCupertinoMessage extends StatelessWidget {
|
|||||||
container: true,
|
container: true,
|
||||||
explicitChildNodes: true,
|
explicitChildNodes: true,
|
||||||
child: CupertinoListSection.insetGrouped(
|
child: CupertinoListSection.insetGrouped(
|
||||||
|
backgroundColor: AppColors.groupedBackground,
|
||||||
children: [
|
children: [
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.all(16),
|
padding: const EdgeInsets.all(16),
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import '../../../../ui/theme/app_theme.dart';
|
||||||
import '../../../../ui/layout/section_heading.dart';
|
import '../../../../ui/layout/section_heading.dart';
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
|
|
||||||
@@ -62,6 +63,7 @@ class CupertinoSessionList extends StatelessWidget {
|
|||||||
return [
|
return [
|
||||||
for (final group in groups)
|
for (final group in groups)
|
||||||
CupertinoListSection.insetGrouped(
|
CupertinoListSection.insetGrouped(
|
||||||
|
backgroundColor: AppColors.groupedBackground,
|
||||||
// Styled as a section divider, not as another chat row.
|
// Styled as a section divider, not as another chat row.
|
||||||
header: Builder(
|
header: Builder(
|
||||||
builder: (context) => Text(
|
builder: (context) => Text(
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import '../../../ui/theme/app_theme.dart';
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
|
|
||||||
import '../pipeline_filter.dart';
|
import '../pipeline_filter.dart';
|
||||||
@@ -31,6 +32,7 @@ class PipelineFilterCupertinoBody extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
CupertinoListSection.insetGrouped(
|
CupertinoListSection.insetGrouped(
|
||||||
|
backgroundColor: AppColors.groupedBackground,
|
||||||
header: const Text('RUNS'),
|
header: const Text('RUNS'),
|
||||||
children: [
|
children: [
|
||||||
for (final presence in RunPresence.values)
|
for (final presence in RunPresence.values)
|
||||||
@@ -42,6 +44,7 @@ class PipelineFilterCupertinoBody extends StatelessWidget {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
CupertinoListSection.insetGrouped(
|
CupertinoListSection.insetGrouped(
|
||||||
|
backgroundColor: AppColors.groupedBackground,
|
||||||
header: const Text('LAST RUN STATUS'),
|
header: const Text('LAST RUN STATUS'),
|
||||||
children: [
|
children: [
|
||||||
for (final status in runStatusFilters)
|
for (final status in runStatusFilters)
|
||||||
@@ -61,6 +64,7 @@ class PipelineFilterCupertinoBody extends StatelessWidget {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
CupertinoListSection.insetGrouped(
|
CupertinoListSection.insetGrouped(
|
||||||
|
backgroundColor: AppColors.groupedBackground,
|
||||||
header: const Text('SCHEDULING'),
|
header: const Text('SCHEDULING'),
|
||||||
footer: const Text('Configured schedules, including paused.'),
|
footer: const Text('Configured schedules, including paused.'),
|
||||||
children: [
|
children: [
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import '../../../ui/theme/app_theme.dart';
|
||||||
import 'dart:math' as math;
|
import 'dart:math' as math;
|
||||||
|
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
@@ -215,6 +216,7 @@ class PipelineListPanel extends StatelessWidget {
|
|||||||
key: const Key('pipeline-list'),
|
key: const Key('pipeline-list'),
|
||||||
children: [
|
children: [
|
||||||
CupertinoListSection.insetGrouped(
|
CupertinoListSection.insetGrouped(
|
||||||
|
backgroundColor: AppColors.groupedBackground,
|
||||||
children: [
|
children: [
|
||||||
for (final pipeline in items)
|
for (final pipeline in items)
|
||||||
CupertinoListTile(
|
CupertinoListTile(
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import '../../../ui/theme/app_theme.dart';
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
@@ -124,6 +125,7 @@ class PipelineSummaryView extends StatelessWidget {
|
|||||||
];
|
];
|
||||||
if (useCupertinoControls(context)) {
|
if (useCupertinoControls(context)) {
|
||||||
return CupertinoListSection.insetGrouped(
|
return CupertinoListSection.insetGrouped(
|
||||||
|
backgroundColor: AppColors.groupedBackground,
|
||||||
header: const Text('VERSIONS'),
|
header: const Text('VERSIONS'),
|
||||||
children: rows,
|
children: rows,
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import '../../../ui/theme/app_theme.dart';
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
@@ -57,6 +58,7 @@ Widget runDetailSummaryTab({
|
|||||||
SliverToBoxAdapter(
|
SliverToBoxAdapter(
|
||||||
child: cupertino
|
child: cupertino
|
||||||
? CupertinoListSection.insetGrouped(
|
? CupertinoListSection.insetGrouped(
|
||||||
|
backgroundColor: AppColors.groupedBackground,
|
||||||
children: [_summaryFacts(context, facts, cupertino: true)],
|
children: [_summaryFacts(context, facts, cupertino: true)],
|
||||||
)
|
)
|
||||||
: _summaryFacts(context, facts, cupertino: false),
|
: _summaryFacts(context, facts, cupertino: false),
|
||||||
@@ -198,6 +200,7 @@ Widget runDetailFieldTab({
|
|||||||
key: Key('run-detail-tab-body-$tabKey'),
|
key: Key('run-detail-tab-body-$tabKey'),
|
||||||
children: [
|
children: [
|
||||||
CupertinoListSection.insetGrouped(
|
CupertinoListSection.insetGrouped(
|
||||||
|
backgroundColor: AppColors.groupedBackground,
|
||||||
children: [Padding(padding: const EdgeInsets.all(16), child: body)],
|
children: [Padding(padding: const EdgeInsets.all(16), child: body)],
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import '../../../ui/theme/app_theme.dart';
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
@@ -53,6 +54,7 @@ class RunTimelineList extends StatelessWidget {
|
|||||||
key: const Key('run-detail-tab-body-timeline'),
|
key: const Key('run-detail-tab-body-timeline'),
|
||||||
children: [
|
children: [
|
||||||
CupertinoListSection.insetGrouped(
|
CupertinoListSection.insetGrouped(
|
||||||
|
backgroundColor: AppColors.groupedBackground,
|
||||||
header: const Text('Timeline'),
|
header: const Text('Timeline'),
|
||||||
children: rows,
|
children: rows,
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import '../../../ui/theme/app_theme.dart';
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
@@ -110,6 +111,7 @@ class _RunVisitSessionState extends State<RunVisitSession> {
|
|||||||
key: const Key('run-visit-body-session'),
|
key: const Key('run-visit-body-session'),
|
||||||
children: [
|
children: [
|
||||||
CupertinoListSection.insetGrouped(
|
CupertinoListSection.insetGrouped(
|
||||||
|
backgroundColor: AppColors.groupedBackground,
|
||||||
children: [
|
children: [
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(16, 12, 16, 16),
|
padding: const EdgeInsetsDirectional.fromSTEB(16, 12, 16, 16),
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import '../../../ui/theme/app_theme.dart';
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
|
|
||||||
import '../../../core/api_gateway.dart';
|
import '../../../core/api_gateway.dart';
|
||||||
@@ -61,6 +62,7 @@ class CupertinoSearchBody extends StatelessWidget {
|
|||||||
return [
|
return [
|
||||||
SliverToBoxAdapter(
|
SliverToBoxAdapter(
|
||||||
child: CupertinoListSection.insetGrouped(
|
child: CupertinoListSection.insetGrouped(
|
||||||
|
backgroundColor: AppColors.groupedBackground,
|
||||||
children: [
|
children: [
|
||||||
for (final hit in controller.shownResults)
|
for (final hit in controller.shownResults)
|
||||||
_CupertinoResult(hit: hit, query: query, onOpen: onOpen),
|
_CupertinoResult(hit: hit, query: query, onOpen: onOpen),
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import '../../ui/theme/app_theme.dart';
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
@@ -200,6 +201,7 @@ class SettingsCard extends StatelessWidget {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
if (usesCupertinoControls(context)) {
|
if (usesCupertinoControls(context)) {
|
||||||
return CupertinoListSection.insetGrouped(
|
return CupertinoListSection.insetGrouped(
|
||||||
|
backgroundColor: AppColors.groupedBackground,
|
||||||
margin: EdgeInsets.zero,
|
margin: EdgeInsets.zero,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
SizedBox(
|
SizedBox(
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import '../../ui/theme/app_theme.dart';
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
@@ -21,6 +22,7 @@ class SettingsSchedulesSection extends StatelessWidget {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
if (usesCupertinoControls(context)) {
|
if (usesCupertinoControls(context)) {
|
||||||
return CupertinoListSection.insetGrouped(
|
return CupertinoListSection.insetGrouped(
|
||||||
|
backgroundColor: AppColors.groupedBackground,
|
||||||
margin: EdgeInsets.zero,
|
margin: EdgeInsets.zero,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
CupertinoListTile(
|
CupertinoListTile(
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import '../../ui/theme/app_theme.dart';
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
@@ -22,6 +23,7 @@ class SettingsTemplatesSection extends StatelessWidget {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
if (usesCupertinoControls(context)) {
|
if (usesCupertinoControls(context)) {
|
||||||
return CupertinoListSection.insetGrouped(
|
return CupertinoListSection.insetGrouped(
|
||||||
|
backgroundColor: AppColors.groupedBackground,
|
||||||
margin: EdgeInsets.zero,
|
margin: EdgeInsets.zero,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
CupertinoListTile(
|
CupertinoListTile(
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import '../../../ui/theme/app_theme.dart';
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
@@ -115,6 +116,7 @@ class TemplateGallery extends StatelessWidget {
|
|||||||
key: templatesGalleryKey,
|
key: templatesGalleryKey,
|
||||||
children: [
|
children: [
|
||||||
CupertinoListSection.insetGrouped(
|
CupertinoListSection.insetGrouped(
|
||||||
|
backgroundColor: AppColors.groupedBackground,
|
||||||
children: [
|
children: [
|
||||||
for (final entry in templates)
|
for (final entry in templates)
|
||||||
CupertinoListTile(
|
CupertinoListTile(
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import 'package:flutter/cupertino.dart';
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
import '../adaptive/host.dart';
|
import '../adaptive/host.dart';
|
||||||
|
import '../theme/app_theme.dart';
|
||||||
import '../motion/motion.dart';
|
import '../motion/motion.dart';
|
||||||
import 'section_heading.dart';
|
import 'section_heading.dart';
|
||||||
|
|
||||||
@@ -230,7 +231,7 @@ class StickyBar extends StatelessWidget {
|
|||||||
return PinnedHeaderSliver(
|
return PinnedHeaderSliver(
|
||||||
child: ColoredBox(
|
child: ColoredBox(
|
||||||
color: cupertino
|
color: cupertino
|
||||||
? CupertinoColors.systemGroupedBackground.resolveFrom(context)
|
? AppColors.groupedBackground.resolveFrom(context)
|
||||||
: Theme.of(context).colorScheme.surface,
|
: Theme.of(context).colorScheme.surface,
|
||||||
child: child,
|
child: child,
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -0,0 +1,56 @@
|
|||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
/// The app's backgrounds. Dark mode uses a near-black gray rather than pure
|
||||||
|
/// black, so cards, sections and bars read as layers above the page.
|
||||||
|
abstract final class AppColors {
|
||||||
|
/// A page.
|
||||||
|
static const background = CupertinoDynamicColor.withBrightness(
|
||||||
|
color: Color(0xFFFFFFFF),
|
||||||
|
darkColor: Color(0xFF141416),
|
||||||
|
);
|
||||||
|
|
||||||
|
/// Behind grouped sections (Settings-style lists).
|
||||||
|
static const groupedBackground = CupertinoDynamicColor.withBrightness(
|
||||||
|
color: Color(0xFFF2F2F7),
|
||||||
|
darkColor: Color(0xFF141416),
|
||||||
|
);
|
||||||
|
|
||||||
|
/// Bars over the page.
|
||||||
|
static const bar = CupertinoDynamicColor.withBrightness(
|
||||||
|
color: Color(0xF0F9F9F9),
|
||||||
|
darkColor: Color(0xF01C1C1F),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
const _seed = Color(0xFF6750A4);
|
||||||
|
|
||||||
|
ThemeData appLightTheme() =>
|
||||||
|
ThemeData(colorScheme: ColorScheme.fromSeed(seedColor: _seed));
|
||||||
|
|
||||||
|
/// Material's dark scheme with gray surfaces stepping up from the page.
|
||||||
|
ThemeData appDarkTheme() {
|
||||||
|
final scheme =
|
||||||
|
ColorScheme.fromSeed(
|
||||||
|
seedColor: _seed,
|
||||||
|
brightness: Brightness.dark,
|
||||||
|
).copyWith(
|
||||||
|
surface: const Color(0xFF141416),
|
||||||
|
surfaceDim: const Color(0xFF141416),
|
||||||
|
surfaceBright: const Color(0xFF3A3B40),
|
||||||
|
surfaceContainerLowest: const Color(0xFF0F0F11),
|
||||||
|
surfaceContainerLow: const Color(0xFF1B1C1F),
|
||||||
|
surfaceContainer: const Color(0xFF202125),
|
||||||
|
surfaceContainerHigh: const Color(0xFF27282C),
|
||||||
|
surfaceContainerHighest: const Color(0xFF303136),
|
||||||
|
);
|
||||||
|
return ThemeData(
|
||||||
|
colorScheme: scheme,
|
||||||
|
scaffoldBackgroundColor: scheme.surface,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
const appCupertinoTheme = CupertinoThemeData(
|
||||||
|
scaffoldBackgroundColor: AppColors.background,
|
||||||
|
barBackgroundColor: AppColors.bar,
|
||||||
|
);
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
|
import 'package:pipelines_app/ui/theme/app_theme.dart';
|
||||||
|
|
||||||
|
void main() {
|
||||||
|
test('dark mode is a near-black gray, with lighter layers above it', () {
|
||||||
|
final scheme = appDarkTheme().colorScheme;
|
||||||
|
expect(scheme.surface, const Color(0xFF141416));
|
||||||
|
expect(appDarkTheme().scaffoldBackgroundColor, scheme.surface);
|
||||||
|
final steps = [
|
||||||
|
scheme.surface,
|
||||||
|
scheme.surfaceContainerLow,
|
||||||
|
scheme.surfaceContainer,
|
||||||
|
scheme.surfaceContainerHigh,
|
||||||
|
scheme.surfaceContainerHighest,
|
||||||
|
].map((color) => color.computeLuminance()).toList();
|
||||||
|
for (var i = 1; i < steps.length; i++) {
|
||||||
|
expect(steps[i], greaterThan(steps[i - 1]));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
test('the Cupertino page is gray in dark mode and unchanged in light', () {
|
||||||
|
expect(AppColors.background.darkColor, const Color(0xFF141416));
|
||||||
|
expect(AppColors.background.color, const Color(0xFFFFFFFF));
|
||||||
|
expect(appCupertinoTheme.scaffoldBackgroundColor, AppColors.background);
|
||||||
|
expect(AppColors.groupedBackground.darkColor, isNot(CupertinoColors.black));
|
||||||
|
});
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user