-
Notifications
You must be signed in to change notification settings - Fork 7.8k
Styling revamp using CupertinoThemeData and CupertinoTextThemeData #593
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
d9da034
bf79045
5e39732
d6307ad
9c564ad
70b661c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,171 +3,100 @@ | |
| // found in the LICENSE file. | ||
|
|
||
| import 'package:flutter/cupertino.dart'; | ||
| import 'package:flutter/material.dart'; | ||
ADVavvas marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| import 'package:flutter/widgets.dart'; | ||
| import 'package:font_awesome_flutter/font_awesome_flutter.dart'; | ||
| import 'package:veggieseasons/data/veggie.dart'; | ||
|
|
||
| abstract class Styles { | ||
| static TextStyle headlineText(CupertinoThemeData themeData) => TextStyle( | ||
| color: themeData.textTheme.textStyle.color, | ||
| static CupertinoThemeData veggieThemeData = CupertinoThemeData( | ||
| textTheme: CupertinoTextThemeData( | ||
| textStyle: TextStyle( | ||
| fontSize: 16, | ||
| fontWeight: FontWeight.normal, | ||
| fontStyle: FontStyle.normal, | ||
| fontFamily: 'NotoSans', | ||
| letterSpacing: -0.41, | ||
| decoration: TextDecoration.none, | ||
| ), | ||
| ), | ||
| ); | ||
|
|
||
| static TextStyle headlineText(CupertinoThemeData themeData) => | ||
| themeData.textTheme.textStyle.copyWith( | ||
| fontSize: 32, | ||
| fontStyle: FontStyle.normal, | ||
| fontWeight: FontWeight.bold, | ||
| ); | ||
|
|
||
| static const minorText = TextStyle( | ||
| color: Color.fromRGBO(128, 128, 128, 1), | ||
| fontFamily: 'NotoSans', | ||
| fontSize: 16, | ||
| fontStyle: FontStyle.normal, | ||
| fontWeight: FontWeight.normal, | ||
| ); | ||
| static TextStyle minorText(CupertinoThemeData themeData) => | ||
| themeData.textTheme.textStyle.copyWith( | ||
| color: Color.fromRGBO(128, 128, 128, 1), | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It seems like we're using a regular color. Is "minorText" supposed to use the same color when you switch from light mode to dark mode? Same with "cardTitleText" and "cardCategoryText", etc,.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The cards are all white with black text, which also works fine since they have a picture (and shadows). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see. The cards all have very bright backgrounds because of the images they used. Make sense to opt-out of dark mode on the cards. |
||
| ); | ||
|
|
||
| static TextStyle headlineName(CupertinoThemeData themeData) => TextStyle( | ||
| color: themeData.textTheme.textStyle.color, | ||
| fontFamily: 'NotoSans', | ||
| static TextStyle headlineName(CupertinoThemeData themeData) => | ||
| themeData.textTheme.textStyle.copyWith( | ||
| fontSize: 24, | ||
| fontStyle: FontStyle.normal, | ||
| fontWeight: FontWeight.bold, | ||
| ); | ||
|
|
||
| static TextStyle headlineDescription(CupertinoThemeData themeData) => | ||
| TextStyle( | ||
| color: themeData.textTheme.textStyle.color, | ||
| fontFamily: 'NotoSans', | ||
| fontSize: 16, | ||
| fontStyle: FontStyle.normal, | ||
| fontWeight: FontWeight.normal, | ||
| static TextStyle cardTitleText(CupertinoThemeData themeData) => | ||
| themeData.textTheme.textStyle.copyWith( | ||
| color: Color.fromRGBO(0, 0, 0, 0.9), | ||
| fontSize: 32, | ||
| fontWeight: FontWeight.bold, | ||
| ); | ||
|
|
||
| static const cardTitleText = TextStyle( | ||
| color: Color.fromRGBO(0, 0, 0, 0.9), | ||
| fontFamily: 'NotoSans', | ||
| fontSize: 32, | ||
| fontStyle: FontStyle.normal, | ||
| fontWeight: FontWeight.bold, | ||
| ); | ||
|
|
||
| static const cardCategoryText = TextStyle( | ||
| color: Color.fromRGBO(255, 255, 255, 0.9), | ||
| fontFamily: 'NotoSans', | ||
| fontSize: 16, | ||
| fontStyle: FontStyle.normal, | ||
| fontWeight: FontWeight.normal, | ||
| ); | ||
| static TextStyle cardCategoryText(CupertinoThemeData themeData) => | ||
| themeData.textTheme.textStyle.copyWith( | ||
| color: Color.fromRGBO(255, 255, 255, 0.9), | ||
| ); | ||
|
|
||
| static const cardDescriptionText = TextStyle( | ||
| color: Color.fromRGBO(0, 0, 0, 0.9), | ||
| fontFamily: 'NotoSans', | ||
| fontSize: 16, | ||
| fontStyle: FontStyle.normal, | ||
| fontWeight: FontWeight.normal, | ||
| ); | ||
| static TextStyle cardDescriptionText(CupertinoThemeData themeData) => | ||
| themeData.textTheme.textStyle.copyWith( | ||
| color: Color.fromRGBO(0, 0, 0, 0.9), | ||
| ); | ||
|
|
||
| static TextStyle detailsTitleText(CupertinoThemeData themeData) => TextStyle( | ||
| color: themeData.textTheme.textStyle.color, | ||
| fontFamily: 'NotoSans', | ||
| static TextStyle detailsTitleText(CupertinoThemeData themeData) => | ||
| themeData.textTheme.textStyle.copyWith( | ||
| fontSize: 30, | ||
| fontStyle: FontStyle.normal, | ||
| fontWeight: FontWeight.bold, | ||
| ); | ||
|
|
||
| static TextStyle detailsPreferredCategoryText(CupertinoThemeData themeData) => | ||
| TextStyle( | ||
| color: themeData.textTheme.textStyle.color, | ||
| fontFamily: 'NotoSans', | ||
| fontSize: 16, | ||
| fontStyle: FontStyle.normal, | ||
| themeData.textTheme.textStyle.copyWith( | ||
| fontWeight: FontWeight.bold, | ||
| ); | ||
|
|
||
| static TextStyle detailsCategoryText(CupertinoThemeData themeData) => | ||
| TextStyle( | ||
| color: themeData.textTheme.textStyle.color, | ||
| fontFamily: 'NotoSans', | ||
| fontSize: 16, | ||
| fontStyle: FontStyle.normal, | ||
| fontWeight: FontWeight.normal, | ||
| static TextStyle detailsBoldDescriptionText(CupertinoThemeData themeData) => | ||
| themeData.textTheme.textStyle.copyWith( | ||
| color: Color.fromRGBO(0, 0, 0, 0.9), | ||
| fontWeight: FontWeight.bold, | ||
| ); | ||
|
|
||
| static TextStyle detailsDescriptionText(CupertinoThemeData themeData) => | ||
| TextStyle( | ||
| color: themeData.textTheme.textStyle.color, | ||
| fontFamily: 'NotoSans', | ||
| fontSize: 16, | ||
| fontStyle: FontStyle.normal, | ||
| fontWeight: FontWeight.normal, | ||
| static TextStyle detailsServingHeaderText(CupertinoThemeData themeData) => | ||
| themeData.textTheme.textStyle.copyWith( | ||
| color: Color.fromRGBO(176, 176, 176, 1), | ||
| fontWeight: FontWeight.bold, | ||
| ); | ||
|
|
||
| static const detailsBoldDescriptionText = TextStyle( | ||
| color: Color.fromRGBO(0, 0, 0, 0.9), | ||
| fontFamily: 'NotoSans', | ||
| fontSize: 16, | ||
| fontStyle: FontStyle.normal, | ||
| fontWeight: FontWeight.bold, | ||
| ); | ||
|
|
||
| static const detailsServingHeaderText = TextStyle( | ||
| color: Color.fromRGBO(176, 176, 176, 1), | ||
| fontFamily: 'NotoSans', | ||
| fontSize: 16, | ||
| fontStyle: FontStyle.normal, | ||
| fontWeight: FontWeight.bold, | ||
| ); | ||
|
|
||
| static TextStyle detailsServingLabelText(CupertinoThemeData themeData) => | ||
| TextStyle( | ||
| color: themeData.textTheme.textStyle.color, | ||
| fontFamily: 'NotoSans', | ||
| fontSize: 16, | ||
| fontStyle: FontStyle.normal, | ||
| themeData.textTheme.textStyle.copyWith( | ||
| fontWeight: FontWeight.bold, | ||
| ); | ||
|
|
||
| static TextStyle detailsServingValueText(CupertinoThemeData themeData) => | ||
| TextStyle( | ||
| color: themeData.textTheme.textStyle.color, | ||
| fontFamily: 'NotoSans', | ||
| fontSize: 16, | ||
| fontStyle: FontStyle.normal, | ||
| fontWeight: FontWeight.normal, | ||
| ); | ||
|
|
||
| static TextStyle detailsServingNoteText(CupertinoThemeData themeData) => | ||
| TextStyle( | ||
| color: themeData.textTheme.textStyle.color, | ||
| fontFamily: 'NotoSans', | ||
| fontSize: 16, | ||
| themeData.textTheme.textStyle.copyWith( | ||
| fontStyle: FontStyle.italic, | ||
| fontWeight: FontWeight.normal, | ||
| ); | ||
|
|
||
| static TextStyle triviaFinishedTitleText(CupertinoThemeData themeData) => | ||
| TextStyle( | ||
| color: themeData.textTheme.textStyle.color, | ||
| fontFamily: 'NotoSans', | ||
| themeData.textTheme.textStyle.copyWith( | ||
| fontSize: 32, | ||
| fontStyle: FontStyle.normal, | ||
| fontWeight: FontWeight.normal, | ||
| ); | ||
|
|
||
| static TextStyle triviaFinishedText(CupertinoThemeData themeData) => | ||
| TextStyle( | ||
| color: themeData.textTheme.textStyle.color, | ||
| fontFamily: 'NotoSans', | ||
| fontSize: 16, | ||
| fontStyle: FontStyle.normal, | ||
| fontWeight: FontWeight.normal, | ||
| ); | ||
|
|
||
| static TextStyle triviaFinishedBigText(CupertinoThemeData themeData) => | ||
| TextStyle( | ||
| color: themeData.textTheme.textStyle.color, | ||
| fontFamily: 'NotoSans', | ||
| themeData.textTheme.textStyle.copyWith( | ||
| fontSize: 48, | ||
| fontStyle: FontStyle.normal, | ||
| fontWeight: FontWeight.normal, | ||
| ); | ||
|
|
||
| static const appBackground = Color(0xffd0d0d0); | ||
|
|
@@ -186,22 +115,15 @@ abstract class Styles { | |
|
|
||
| static const closeButtonPressed = Color(0xff808080); | ||
|
|
||
| static TextStyle searchText(CupertinoThemeData themeData) => TextStyle( | ||
| color: themeData.textTheme.textStyle.color, | ||
| fontFamily: 'NotoSans', | ||
| static TextStyle searchText(CupertinoThemeData themeData) => | ||
| themeData.textTheme.textStyle.copyWith( | ||
| fontSize: 14, | ||
| fontStyle: FontStyle.normal, | ||
| fontWeight: FontWeight.normal, | ||
| ); | ||
|
|
||
| static TextStyle settingsItemText(CupertinoThemeData themeData) => | ||
| themeData.textTheme.textStyle; | ||
|
|
||
| static TextStyle settingsItemSubtitleText(CupertinoThemeData themeData) => | ||
| TextStyle( | ||
| themeData.textTheme.textStyle.copyWith( | ||
| fontSize: 12, | ||
| letterSpacing: -0.2, | ||
| color: themeData.textTheme.textStyle.color, | ||
| ); | ||
|
|
||
| static const Color searchCursorColor = Color.fromRGBO(0, 122, 255, 1); | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.