Skip to content

Commit

Permalink
Theme adjustments.
Browse files Browse the repository at this point in the history
  • Loading branch information
Joaoaraujo97 committed Jun 26, 2024
1 parent 37b64a1 commit 31ca12d
Show file tree
Hide file tree
Showing 22 changed files with 72 additions and 70 deletions.
4 changes: 2 additions & 2 deletions lib/application/pages/details/collection_details_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class CollectionDetailsPage extends ConsumerWidget {
context.verticalBox(Spacing.small),
Text(
strings.detailsResourcesWarning,
style: Theme.of(context).textTheme.caption?.copyWith(color: memoTheme.neutralSwatch.shade300),
style: Theme.of(context).textTheme.bodySmall?.copyWith(color: memoTheme.neutralSwatch.shade300),
),
context.verticalBox(Spacing.small),
ResourcesList(
Expand Down Expand Up @@ -156,7 +156,7 @@ class CollectionDetailsPage extends ConsumerWidget {
Widget _buildSectionTitle(BuildContext context, WidgetRef ref, String text) => Text(
text,
style:
Theme.of(context).textTheme.subtitle1?.copyWith(color: ref.watch(themeController).neutralSwatch.shade300),
Theme.of(context).textTheme.titleMedium?.copyWith(color: ref.watch(themeController).neutralSwatch.shade300),
);
}

Expand Down
2 changes: 1 addition & 1 deletion lib/application/pages/details/contributor_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class MultiContributorsView extends ConsumerWidget {
size: dimens.contributorImageSize,
child: Text(
'+${contributorsAmount - _visibleContributorsLimit}',
style: Theme.of(context).textTheme.subtitle2,
style: Theme.of(context).textTheme.titleSmall,
),
),
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class CompletedExecutionContents extends ConsumerWidget {

Widget _buildSectionTitle(BuildContext context, MemoThemeData theme, String text) => Text(
text,
style: Theme.of(context).textTheme.subtitle1?.copyWith(color: theme.neutralSwatch.shade300),
style: Theme.of(context).textTheme.titleMedium?.copyWith(color: theme.neutralSwatch.shade300),
);

Widget _wrapInVerticalSection(Widget child, MemoThemeData theme) {
Expand Down Expand Up @@ -146,19 +146,19 @@ class _Header extends ConsumerWidget {
context.verticalBox(Spacing.xLarge),
Text(
strings.executionWellDone,
style: textTheme.subtitle1?.copyWith(color: memoTheme.primarySwatch.shade400),
style: textTheme.titleMedium?.copyWith(color: memoTheme.primarySwatch.shade400),
textAlign: TextAlign.center,
),
context.verticalBox(Spacing.small),
Text(
strings.executionImprovedKnowledgeDescription,
style: textTheme.subtitle1?.copyWith(color: memoTheme.neutralSwatch.shade400),
style: textTheme.titleMedium?.copyWith(color: memoTheme.neutralSwatch.shade400),
textAlign: TextAlign.center,
),
context.verticalBox(Spacing.large),
Text(
'# $collectionName',
style: textTheme.headline6,
style: textTheme.headlineSmall,
textAlign: TextAlign.center,
),
],
Expand Down Expand Up @@ -199,13 +199,13 @@ class _PerformanceIndicators extends ConsumerWidget {
context.verticalBox(Spacing.small),
Text(
readableAnswersForDifficulty(difficulty) + strings.percentSymbol,
style: textTheme.subtitle1?.copyWith(color: memoTheme.secondarySwatch.shade400),
style: textTheme.titleMedium?.copyWith(color: memoTheme.secondarySwatch.shade400),
textAlign: TextAlign.center,
),
context.verticalBox(Spacing.xxSmall),
Text(
strings.answeredMemos(difficulty).toUpperCase(),
style: textTheme.caption,
style: textTheme.bodySmall,
textAlign: TextAlign.center,
),
],
Expand Down
3 changes: 2 additions & 1 deletion lib/application/pages/execution/execution_terminal.dart
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,8 @@ class _TerminalActions extends HookWidget {
Expanded(
child: Text(
strings.memoDifficulty(difficulty),
style: Theme.of(context).textTheme.bodyText2?.copyWith(color: isMarkedAnswer ? highlightColor : null),
style:
Theme.of(context).textTheme.bodyMedium?.copyWith(color: isMarkedAnswer ? highlightColor : null),
),
),
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class _CollectionsSectionHeader extends ConsumerWidget {
@override
Widget build(BuildContext context, WidgetRef ref) {
final titleColor = ref.watch(themeController).neutralSwatch.shade300;
final sectionTitleStyle = Theme.of(context).textTheme.headline6?.copyWith(color: titleColor);
final sectionTitleStyle = Theme.of(context).textTheme.headlineSmall?.copyWith(color: titleColor);
return Text(title, style: sectionTitleStyle);
}
}
4 changes: 2 additions & 2 deletions lib/application/pages/home/collections/collections_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,11 @@ class _CollectionsEmptyState extends ConsumerWidget {
color: theme.neutralSwatch.shade700,
),
context.verticalBox(Spacing.xLarge),
Text(title, style: textTheme.headline6, textAlign: TextAlign.center),
Text(title, style: textTheme.headlineSmall, textAlign: TextAlign.center),
context.verticalBox(Spacing.medium),
Text(
description,
style: textTheme.bodyText2?.copyWith(color: theme.neutralSwatch.shade400),
style: textTheme.bodyMedium?.copyWith(color: theme.neutralSwatch.shade400),
textAlign: TextAlign.center,
),
context.verticalBox(Spacing.xLarge),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ class _DescriptionField extends HookConsumerWidget {
controller: controller,
modalTitle: Text(
strings.detailsDescription,
style: textTheme.bodyText1?.copyWith(color: theme.primarySwatch.shade400),
style: textTheme.bodyLarge?.copyWith(color: theme.primarySwatch.shade400),
),
placeholder: strings.collectionDescription,
helperText: strings.fieldCharactersAmount(descriptionLength, validators.collectionDescriptionMaxLength),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ class _NavigationIndicator extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.center,
children: [
AssetIconButton(images.chevronLeftAsset, onPressed: onLeftTapped),
Text('$currentPage/$pagesAmount', style: textTheme.subtitle2),
Text('$currentPage/$pagesAmount', style: textTheme.titleSmall),
AssetIconButton(images.chevronRightAsset, onPressed: onRightTapped),
],
);
Expand All @@ -209,7 +209,7 @@ class _CreateMemoEmptyState extends ConsumerWidget {
context.verticalBox(Spacing.small),
Text(
strings.newMemo.toUpperCase(),
style: textTheme.button?.copyWith(color: theme.primarySwatch.shade400),
style: textTheme.labelLarge?.copyWith(color: theme.primarySwatch.shade400),
textAlign: TextAlign.center,
)
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ class _MemosReorderableList extends ConsumerWidget {
Widget build(BuildContext context, WidgetRef ref) {
final textTheme = Theme.of(context).textTheme;

final listHeader = Text('${strings.jumpTo}...', style: textTheme.subtitle1, textAlign: TextAlign.center);
final listHeader = Text('${strings.jumpTo}...', style: textTheme.titleMedium, textAlign: TextAlign.center);

return Theme(
// Overrides theme to remove canvasColor and shadowColor when dragging a Memo card
Expand Down Expand Up @@ -321,7 +321,7 @@ class _MemosReorderableListRow extends ConsumerWidget {
children: [
Text(
strings.updateMemoQuestionTitle(index + 1),
style: textTheme.bodyText1?.copyWith(color: theme.secondarySwatch),
style: textTheme.bodyLarge?.copyWith(color: theme.secondarySwatch),
),
context.verticalBox(Spacing.xSmall),
Text(metadata.question.plainContent, maxLines: 3),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class UpdateMemoTerminal extends HookConsumerWidget {

final questionTitle = Text(
strings.updateMemoQuestionTitle(memoIndex),
style: textTheme.bodyText1?.copyWith(color: theme.secondarySwatch),
style: textTheme.bodyLarge?.copyWith(color: theme.secondarySwatch),
);
final questionField = Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
Expand All @@ -57,7 +57,7 @@ class UpdateMemoTerminal extends HookConsumerWidget {

final answerTitle = Text(
strings.updateMemoAnswer,
style: textTheme.bodyText1?.copyWith(color: theme.primarySwatch),
style: textTheme.bodyLarge?.copyWith(color: theme.primarySwatch),
);
final answerField = Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
Expand Down
6 changes: 3 additions & 3 deletions lib/application/pages/home/progress/progress_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ class ProgressPage extends ConsumerWidget {
TextSpan(
text: texts[index],
style: index.isOdd
? textTheme.headline4?.copyWith(color: titleColor)
: textTheme.headline3?.copyWith(color: titleColor),
? textTheme.headlineLarge?.copyWith(color: titleColor)
: textTheme.displaySmall?.copyWith(color: titleColor),
),
);
}
Expand Down Expand Up @@ -147,7 +147,7 @@ class _ProgressContainer extends ConsumerWidget {
children: [
title,
context.verticalBox(Spacing.xSmall),
Text(description, style: textTheme.caption),
Text(description, style: textTheme.bodySmall),
],
);

Expand Down
2 changes: 1 addition & 1 deletion lib/application/pages/settings/settings_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class SettingsPage extends ConsumerWidget {
if (item is SettingsSectionItem) {
return Text(
strings.settingsDescriptionForSection(item.section),
style: Theme.of(context).textTheme.subtitle1,
style: Theme.of(context).textTheme.titleMedium,
).withOnlyPadding(context, top: Spacing.xLarge, bottom: Spacing.xxSmall);
} else if (item is LinkSettingsItem) {
return UrlLinkButton(
Expand Down
34 changes: 17 additions & 17 deletions lib/application/theme/material_theme_data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ ThemeData buildThemeData({
elevation: 0,
iconTheme: iconTheme,
backgroundColor: Colors.transparent,
titleTextStyle: textTheme.subtitle1,
titleTextStyle: textTheme.titleMedium,
foregroundColor: Colors.white,
);

Expand All @@ -70,13 +70,13 @@ ThemeData buildThemeData({
labelPadding: tabBarLabelPadding,
labelColor: secondarySwatch.shade400,
unselectedLabelColor: neutralSwatch.shade300,
labelStyle: textTheme.subtitle2,
unselectedLabelStyle: textTheme.subtitle2,
labelStyle: textTheme.titleSmall,
unselectedLabelStyle: textTheme.titleSmall,
);

final snackBarTheme = SnackBarThemeData(
backgroundColor: neutralSwatch.shade800,
contentTextStyle: textTheme.bodyText2,
contentTextStyle: textTheme.bodyMedium,
actionTextColor: secondarySwatch.shade400,
);

Expand Down Expand Up @@ -120,91 +120,91 @@ ThemeData buildThemeData({
//
TextTheme _buildTextTheme(String fontFamily, {required Color textColor}) {
return TextTheme(
headline1: TextStyle(
displayLarge: TextStyle(
fontFamily: fontFamily,
fontSize: 96,
height: 1.17,
fontWeight: FontWeight.w400,
color: textColor,
),
headline2: TextStyle(
displayMedium: TextStyle(
fontFamily: fontFamily,
fontSize: 60,
height: 1.2,
fontWeight: FontWeight.w500,
color: textColor,
),
headline3: TextStyle(
displaySmall: TextStyle(
fontFamily: fontFamily,
fontSize: 48,
height: 1,
fontWeight: FontWeight.w500,
color: textColor,
),
headline4: TextStyle(
headlineLarge: TextStyle(
fontFamily: fontFamily,
fontSize: 32,
height: 1.19,
fontWeight: FontWeight.w400,
color: textColor,
),
headline5: TextStyle(
headlineMedium: TextStyle(
fontFamily: fontFamily,
fontSize: 24,
height: 1.17,
fontWeight: FontWeight.w400,
color: textColor,
),
headline6: TextStyle(
headlineSmall: TextStyle(
fontFamily: fontFamily,
fontSize: 20,
height: 1.2,
fontWeight: FontWeight.w400,
color: textColor,
),
subtitle1: TextStyle(
titleMedium: TextStyle(
fontFamily: fontFamily,
fontSize: 16,
height: 1.25,
fontWeight: FontWeight.w700,
color: textColor,
),
subtitle2: TextStyle(
titleSmall: TextStyle(
fontFamily: fontFamily,
fontSize: 14,
height: 1.14,
fontWeight: FontWeight.w500,
color: textColor,
),
bodyText1: TextStyle(
bodyLarge: TextStyle(
fontFamily: fontFamily,
fontSize: 16,
height: 1.5,
fontWeight: FontWeight.w300,
color: textColor,
),
bodyText2: TextStyle(
bodyMedium: TextStyle(
fontFamily: fontFamily,
fontSize: 14,
height: 1.57,
fontWeight: FontWeight.w400,
color: textColor,
),
button: TextStyle(
labelLarge: TextStyle(
fontFamily: fontFamily,
fontSize: 16,
height: 1.25,
fontWeight: FontWeight.w700,
color: textColor,
),
caption: TextStyle(
bodySmall: TextStyle(
fontFamily: fontFamily,
fontSize: 12,
height: 1.33,
fontWeight: FontWeight.w400,
color: textColor,
),
overline: TextStyle(
labelSmall: TextStyle(
fontFamily: fontFamily,
fontSize: 10,
height: 1,
Expand Down
6 changes: 3 additions & 3 deletions lib/application/utils/bottom_sheet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Future<T?> showSnappableDraggableModalBottomSheet<T>(
Text(
title,
textAlign: TextAlign.center,
style: Theme.of(context).textTheme.headline6,
style: Theme.of(context).textTheme.headlineSmall,
maxLines: 1,
overflow: TextOverflow.ellipsis,
).withSymmetricalPadding(context, vertical: Spacing.small, horizontal: Spacing.medium)
Expand Down Expand Up @@ -92,9 +92,9 @@ Future<T?> showDestructiveOperationModalBottomSheet<T>(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Text(title, style: textTheme.subtitle1),
Text(title, style: textTheme.titleMedium),
context.verticalBox(Spacing.xLarge),
Text(message, style: textTheme.bodyText1),
Text(message, style: textTheme.bodyLarge),
context.verticalBox(Spacing.xxxLarge),
DestructiveButton(onPressed: onDestructiveTapped, text: destructiveActionTitle),
context.verticalBox(Spacing.medium),
Expand Down
4 changes: 2 additions & 2 deletions lib/application/widgets/theme/collection_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class CollectionCard extends ConsumerWidget {
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(name, style: Theme.of(context).textTheme.headline6),
Text(name, style: Theme.of(context).textTheme.headlineSmall),
context.verticalBox(Spacing.xSmall),
Flexible(child: _buildTagsWrap(context)),
],
Expand Down Expand Up @@ -141,7 +141,7 @@ class CollectionCard extends ConsumerWidget {

Text _buildMemoryRecallTitle(BuildContext context, MemoThemeData theme) {
final captionColor = theme.neutralSwatch.shade200;
final captionStyle = Theme.of(context).textTheme.caption;
final captionStyle = Theme.of(context).textTheme.bodySmall;
return Text(progressDescription!, style: captionStyle?.copyWith(color: captionColor));
}

Expand Down
4 changes: 2 additions & 2 deletions lib/application/widgets/theme/custom_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ class CustomTextButton extends ConsumerWidget {
Widget build(BuildContext context, WidgetRef ref) {
final theme = ref.watch(themeController);
final buttonColorSwatch = color ?? theme.primarySwatch;
final textTheme = Theme.of(context).textTheme.button!;
final textTheme = Theme.of(context).textTheme.labelLarge!;

Color? buttonColor(_ButtonState state) {
switch (state) {
Expand Down Expand Up @@ -173,7 +173,7 @@ class _CustomElevatedButton extends StatelessWidget {

@override
Widget build(BuildContext context) {
final textTheme = Theme.of(context).textTheme.button!;
final textTheme = Theme.of(context).textTheme.labelLarge!;

Widget leadingAssetBuilder(_ButtonState state) => Image.asset(leadingAsset!, color: textTheme.color);

Expand Down
Loading

0 comments on commit 31ca12d

Please sign in to comment.