mirror of
https://github.com/flutter/samples.git
synced 2025-11-12 07:48:55 +00:00
Styling revamp using CupertinoThemeData and CupertinoTextThemeData (#593)
This commit is contained in:
@@ -28,11 +28,7 @@ class SettingsGroupHeader extends StatelessWidget {
|
||||
),
|
||||
child: Text(
|
||||
title.toUpperCase(),
|
||||
style: TextStyle(
|
||||
color: CupertinoColors.inactiveGray,
|
||||
fontSize: 13.5,
|
||||
letterSpacing: -0.5,
|
||||
),
|
||||
style: Styles.settingsGroupHeaderText(CupertinoTheme.of(context)),
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -51,14 +47,8 @@ class SettingsGroupFooter extends StatelessWidget {
|
||||
right: 15,
|
||||
top: 7.5,
|
||||
),
|
||||
child: Text(
|
||||
title,
|
||||
style: TextStyle(
|
||||
color: Styles.settingsGroupSubtitle,
|
||||
fontSize: 13,
|
||||
letterSpacing: -0.08,
|
||||
),
|
||||
),
|
||||
child: Text(title,
|
||||
style: Styles.settingsGroupFooterText(CupertinoTheme.of(context))),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -134,10 +134,8 @@ class SettingsItemState extends State<SettingsItem> {
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
SizedBox(height: 8.5),
|
||||
Text(
|
||||
widget.label,
|
||||
style: Styles.settingsItemText(themeData),
|
||||
),
|
||||
Text(widget.label,
|
||||
style: themeData.textTheme.textStyle),
|
||||
SizedBox(height: 4),
|
||||
Text(
|
||||
widget.subtitle,
|
||||
@@ -147,10 +145,8 @@ class SettingsItemState extends State<SettingsItem> {
|
||||
)
|
||||
: Padding(
|
||||
padding: EdgeInsets.only(top: 1.5),
|
||||
child: Text(
|
||||
widget.label,
|
||||
style: Styles.settingsItemText(themeData),
|
||||
),
|
||||
child: Text(widget.label,
|
||||
style: themeData.textTheme.textStyle),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -41,7 +41,8 @@ class _TriviaViewState extends State<TriviaView> with RestorationMixin {
|
||||
Trivia get currentTrivia => veggie.trivia[triviaIndex.value];
|
||||
|
||||
/// The current state of the game.
|
||||
_RestorablePlayerStatus status = _RestorablePlayerStatus(PlayerStatus.readyToAnswer);
|
||||
_RestorablePlayerStatus status =
|
||||
_RestorablePlayerStatus(PlayerStatus.readyToAnswer);
|
||||
|
||||
@override
|
||||
String get restorationId => widget.restorationId;
|
||||
@@ -135,25 +136,19 @@ class _TriviaViewState extends State<TriviaView> with RestorationMixin {
|
||||
style: Styles.triviaFinishedTitleText(themeData),
|
||||
),
|
||||
SizedBox(height: 16),
|
||||
Text(
|
||||
'You answered',
|
||||
style: Styles.triviaFinishedText(themeData),
|
||||
),
|
||||
Text('You answered', style: themeData.textTheme.textStyle),
|
||||
Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
textBaseline: TextBaseline.alphabetic,
|
||||
children: [
|
||||
Text(
|
||||
'$score',
|
||||
'${score.value}',
|
||||
style: Styles.triviaFinishedBigText(themeData),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
child: Text(
|
||||
' of ',
|
||||
style: Styles.triviaFinishedText(themeData),
|
||||
),
|
||||
child: Text(' of ', style: themeData.textTheme.textStyle),
|
||||
),
|
||||
Text(
|
||||
'${veggie.trivia.length}',
|
||||
@@ -161,10 +156,7 @@ class _TriviaViewState extends State<TriviaView> with RestorationMixin {
|
||||
),
|
||||
],
|
||||
),
|
||||
Text(
|
||||
'questions correctly!',
|
||||
style: Styles.triviaFinishedText(themeData),
|
||||
),
|
||||
Text('questions correctly!', style: themeData.textTheme.textStyle),
|
||||
SizedBox(height: 16),
|
||||
CupertinoButton(
|
||||
child: Text('Try Again'),
|
||||
|
||||
@@ -117,7 +117,8 @@ class VeggieCard extends StatelessWidget {
|
||||
/// Whether [veggie] falls into one of user's preferred [VeggieCategory]s
|
||||
final bool isPreferredCategory;
|
||||
|
||||
Widget _buildDetails() {
|
||||
Widget _buildDetails(BuildContext context) {
|
||||
final themeData = CupertinoTheme.of(context);
|
||||
return FrostyBackground(
|
||||
color: Color(0x90ffffff),
|
||||
child: Padding(
|
||||
@@ -127,11 +128,11 @@ class VeggieCard extends StatelessWidget {
|
||||
children: <Widget>[
|
||||
Text(
|
||||
veggie.name,
|
||||
style: Styles.cardTitleText,
|
||||
style: Styles.cardTitleText(themeData),
|
||||
),
|
||||
Text(
|
||||
veggie.shortDescription,
|
||||
style: Styles.cardDescriptionText,
|
||||
style: Styles.cardDescriptionText(themeData),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -165,7 +166,7 @@ class VeggieCard extends StatelessWidget {
|
||||
bottom: 0,
|
||||
left: 0,
|
||||
right: 0,
|
||||
child: _buildDetails(),
|
||||
child: _buildDetails(context),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -97,7 +97,7 @@ class VeggieHeadline extends StatelessWidget {
|
||||
),
|
||||
Text(
|
||||
veggie.shortDescription,
|
||||
style: Styles.headlineDescription(themeData),
|
||||
style: themeData.textTheme.textStyle,
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user