flutter: Remove appBar backgroundColor and use MaterialApp primarySwatch instead
This commit is contained in:
parent
49a7e1df8f
commit
f82b18d975
|
@ -25,6 +25,7 @@ import 'package:flutter/services.dart';
|
|||
import 'package:flutter_localizations/flutter_localizations.dart';
|
||||
import 'package:path_provider/path_provider.dart';
|
||||
import 'package:sanmill/generated/l10n.dart';
|
||||
import 'package:sanmill/style/colors.dart';
|
||||
import 'package:sanmill/widgets/navigation_home_screen.dart';
|
||||
import 'package:stack_trace/stack_trace.dart';
|
||||
|
||||
|
@ -156,7 +157,7 @@ class _SanmillAppState extends State<SanmillApp> {
|
|||
languageCode: 'zh'), // Chinese *See Advanced Locales below*
|
||||
// ... other locales the app supports
|
||||
],
|
||||
theme: ThemeData(primarySwatch: Colors.green),
|
||||
theme: ThemeData(primarySwatch: UIColors.appBarColor),
|
||||
debugShowCheckedModeBanner: false,
|
||||
home: WillPopScope(
|
||||
onWillPop: () async {
|
||||
|
|
|
@ -34,6 +34,8 @@ class UIColors {
|
|||
static var darkBackgroundColor = crusoeColor;
|
||||
static const lightBackgroundColor = papayaWhipColor;
|
||||
|
||||
static var appBarColor = UIColors.primaryColor;
|
||||
|
||||
static var boardBackgroundColor = burlyWoodColor;
|
||||
|
||||
static const darkTextPrimaryColor = Colors.white;
|
||||
|
|
|
@ -102,9 +102,9 @@ class _GameSettingsPageState extends State<GameSettingsPage> {
|
|||
return Scaffold(
|
||||
backgroundColor: UIColors.lightBackgroundColor,
|
||||
appBar: AppBar(
|
||||
centerTitle: true,
|
||||
title: Text(S.of(context).settings),
|
||||
backgroundColor: UIColors.primaryColor),
|
||||
centerTitle: true,
|
||||
title: Text(S.of(context).settings),
|
||||
),
|
||||
body: SingleChildScrollView(
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Column(
|
||||
|
|
|
@ -175,9 +175,9 @@ class _PersonalizationSettingsPageState
|
|||
return Scaffold(
|
||||
backgroundColor: UIColors.lightBackgroundColor,
|
||||
appBar: AppBar(
|
||||
centerTitle: true,
|
||||
title: Text(S.of(context).personalization),
|
||||
backgroundColor: UIColors.primaryColor),
|
||||
centerTitle: true,
|
||||
title: Text(S.of(context).personalization),
|
||||
),
|
||||
body: SingleChildScrollView(
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Column(
|
||||
|
|
Loading…
Reference in New Issue