Skip to content

Commit

Permalink
fix: use font weight specified via font variant
Browse files Browse the repository at this point in the history
Fixes #315
  • Loading branch information
boxdot committed Jan 31, 2025
1 parent 8cf7564 commit 597cc8a
Show file tree
Hide file tree
Showing 37 changed files with 397 additions and 169 deletions.
2 changes: 1 addition & 1 deletion app/lib/conversation_details/add_members_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class AddMembersScreenView extends StatelessWidget {
),
title: Text(
contact.userName,
style: labelStyle,
style: Theme.of(context).textTheme.labelMedium,
overflow: TextOverflow.ellipsis,
),
trailing: Checkbox(
Expand Down
4 changes: 2 additions & 2 deletions app/lib/conversation_details/connection_details.dart
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ class ConnectionDetails extends StatelessWidget {
),
Text(
conversation.title,
style: labelStyle,
style: Theme.of(context).textTheme.labelMedium,
),
Text(
conversation.conversationType.description,
style: labelStyle,
style: Theme.of(context).textTheme.labelMedium,
),
],
),
Expand Down
5 changes: 4 additions & 1 deletion app/lib/conversation_details/conversation_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@ class _EmptyConversationPane extends StatelessWidget {
return Scaffold(
body: Center(
child: Text(
style: labelStyle.copyWith(color: colorDMB),
style: Theme.of(context)
.textTheme
.labelMedium
?.copyWith(color: colorDMB),
"Select a chat to start messaging",
),
),
Expand Down
16 changes: 11 additions & 5 deletions app/lib/conversation_details/group_details.dart
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,13 @@ class GroupDetails extends StatelessWidget {
final bytes = await image?.readAsBytes();
conversationDetailsCubit.setConversationPicture(bytes: bytes);
}),
Text(conversation.title, style: labelStyle),
Text(
conversation.title,
style: Theme.of(context).textTheme.labelMedium,
),
Text(
conversation.conversationType.description,
style: labelStyle,
style: Theme.of(context).textTheme.labelMedium,
),
Expanded(
child: Container(
Expand All @@ -64,9 +67,12 @@ class GroupDetails extends StatelessWidget {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const Text(
Text(
"Members",
style: boldLabelStyle,
style: Theme.of(context)
.textTheme
.labelMedium
?.merge(VariableFontWeight.bold),
),
Expanded(
child: ListView.builder(
Expand All @@ -82,7 +88,7 @@ class GroupDetails extends StatelessWidget {
),
title: Text(
member,
style: labelStyle,
style: Theme.of(context).textTheme.labelMedium,
overflow: TextOverflow.ellipsis,
),
trailing: const Icon(Icons.more_horiz),
Expand Down
2 changes: 1 addition & 1 deletion app/lib/conversation_details/member_details_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class MemberDetailsScreen extends StatelessWidget {
const SizedBox(height: _padding),
Text(
memberUsername,
style: labelStyle,
style: Theme.of(context).textTheme.labelMedium,
),
const SizedBox(height: _padding),
],
Expand Down
20 changes: 7 additions & 13 deletions app/lib/conversation_list/conversation_list_content.dart
Original file line number Diff line number Diff line change
Expand Up @@ -186,10 +186,10 @@ class _UnreadBadge extends StatelessWidget {
child: Text(
badgeText,
style: const TextStyle(
color: Colors.white,
fontSize: 10,
fontVariations: variationSemiBold,
letterSpacing: 0),
color: Colors.white,
fontSize: 10,
letterSpacing: 0,
).merge(VariableFontWeight.semiBold),
),
);
}
Expand All @@ -210,16 +210,14 @@ class _LastMessage extends StatelessWidget {
final style = TextStyle(
color: colorDMB,
fontSize: isSmallScreen(context) ? 14 : 13,
fontVariations: variationRegular,
letterSpacing: -0.2,
height: 1.2,
);

final contentStyle = conversation.unreadMessages > 0
? style.copyWith(fontVariations: variationMedium)
? style.merge(VariableFontWeight.medium)
: style;

final senderStyle = style.copyWith(fontVariations: variationSemiBold);
final senderStyle = style.merge(VariableFontWeight.semiBold);

final (sender, displayedLastMessage) = switch (lastMessage?.message) {
UiMessage_Content(field0: final content) => (
Expand Down Expand Up @@ -263,8 +261,6 @@ class _LastUpdated extends StatelessWidget {
style: const TextStyle(
color: colorDMB,
fontSize: 11,
fontVariations: variationRegular,
letterSpacing: -0.2,
),
),
);
Expand All @@ -289,9 +285,7 @@ class _ConversationTitle extends StatelessWidget {
style: const TextStyle(
color: convListItemTextColor,
fontSize: 14,
fontVariations: variationSemiBold,
letterSpacing: -0.2,
),
).merge(VariableFontWeight.semiBold),
),
);
}
Expand Down
8 changes: 2 additions & 6 deletions app/lib/conversation_list/conversation_list_header.dart
Original file line number Diff line number Diff line change
Expand Up @@ -100,20 +100,16 @@ class _UsernameSpace extends StatelessWidget {
displayName ?? "",
style: const TextStyle(
color: colorDMB,
fontVariations: variationBold,
fontSize: 13,
letterSpacing: -0.2,
),
).merge(VariableFontWeight.bold),
),
const SizedBox(height: 5),
Text(
userName,
style: const TextStyle(
color: colorDMB,
fontSize: 10,
fontVariations: variationMedium,
letterSpacing: -0.2,
),
).merge(VariableFontWeight.medium),
overflow: TextOverflow.ellipsis,
),
],
Expand Down
5 changes: 4 additions & 1 deletion app/lib/conversation_list/create_conversation_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,10 @@ class _CreateConversationViewState extends State<CreateConversationView> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const SizedBox(height: 50),
Text(widget.prompt, style: labelStyle),
Text(
widget.prompt,
style: Theme.of(context).textTheme.labelMedium,
),
const SizedBox(height: 20),
Form(
autovalidateMode: AutovalidateMode.always,
Expand Down
38 changes: 22 additions & 16 deletions app/lib/developer/developer_settings_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ class DeveloperSettingsScreen extends StatefulWidget {
_DeveloperSettingsScreenState();
}

final _titleFontWeight = VariableFontWeight.medium;

class _DeveloperSettingsScreenState extends State<DeveloperSettingsScreen> {
String? deviceToken;

Expand Down Expand Up @@ -69,8 +71,6 @@ class _DeveloperSettingsScreenState extends State<DeveloperSettingsScreen> {
}
}

const _titleFontWeight = FontWeight.w600;

class DeveloperSettingsScreenView extends StatelessWidget {
const DeveloperSettingsScreenView({
required this.deviceToken,
Expand All @@ -87,13 +87,13 @@ class DeveloperSettingsScreenView extends StatelessWidget {
Widget build(BuildContext context) {
final user = context.select((LoadableUserCubit cubit) => cubit.state.user);

return SafeArea(
child: Scaffold(
appBar: AppBar(
title: const Text('Developer Settings'),
leading: const AppBarBackButton(),
),
body: Center(
return Scaffold(
appBar: AppBar(
title: const Text('Developer Settings'),
leading: const AppBarBackButton(),
),
body: SafeArea(
child: Center(
child: Container(
constraints:
isPointer() ? const BoxConstraints(maxWidth: 800) : null,
Expand All @@ -103,7 +103,7 @@ class DeveloperSettingsScreenView extends StatelessWidget {
titleTextStyle: Theme.of(context)
.textTheme
.bodyLarge!
.copyWith(fontWeight: _titleFontWeight),
.merge(_titleFontWeight),
),
child: ListView(
children: [
Expand Down Expand Up @@ -137,10 +137,13 @@ class DeveloperSettingsScreenView extends StatelessWidget {
ListTile(
title: Text(
user.userName,
style: Theme.of(context).textTheme.bodyLarge?.copyWith(
style: Theme.of(context)
.textTheme
.bodyLarge
?.copyWith(
color: Colors.red,
fontWeight: _titleFontWeight,
),
)
.merge(_titleFontWeight),
),
subtitle: Text("id: ${user.clientId}"),
trailing: const Icon(Icons.delete),
Expand All @@ -155,10 +158,13 @@ class DeveloperSettingsScreenView extends StatelessWidget {
ListTile(
title: Text(
'Erase All Databases',
style: Theme.of(context).textTheme.bodyLarge?.copyWith(
style: Theme.of(context)
.textTheme
.bodyLarge
?.copyWith(
color: Colors.red,
fontWeight: _titleFontWeight,
),
)
.merge(_titleFontWeight),
),
trailing: const Icon(Icons.delete),
onTap: () => _confirmDialog(
Expand Down
7 changes: 3 additions & 4 deletions app/lib/intro_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ class IntroScreen extends StatelessWidget {
filterQuality: FilterQuality.high,
color: Colors.grey[350],
),
const _GradientText(
_GradientText(
"Prototype.",
gradient: LinearGradient(
gradient: const LinearGradient(
colors: [
Color.fromARGB(255, 34, 163, 255),
Color.fromARGB(255, 72, 23, 250)
Expand All @@ -46,9 +46,8 @@ class IntroScreen extends StatelessWidget {
),
style: TextStyle(
fontSize: 36,
fontVariations: variationMedium,
letterSpacing: -0.9,
),
).merge(VariableFontWeight.medium),
),
// Text button that opens the developer settings screen
TextButton(
Expand Down
7 changes: 2 additions & 5 deletions app/lib/message_list/display_message_tile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,9 @@ class SystemMessageContent extends StatelessWidget {
message.message,
style: TextStyle(
color: Colors.grey[700],
fontVariations: variationBold,
letterSpacing: -0.02,
fontSize: 10,
height: 1.4,
),
).merge(VariableFontWeight.bold),
),
);
}
Expand All @@ -115,10 +113,9 @@ class ErrorMessageContent extends StatelessWidget {
message.message,
style: const TextStyle(
color: Colors.red,
fontWeight: FontWeight.w200,
fontSize: 10,
height: 1.0,
),
).merge(VariableFontWeight.w200),
),
);
}
Expand Down
11 changes: 6 additions & 5 deletions app/lib/message_list/message_renderer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,12 @@ TextSpan _styledTextSpan(
child: SelectionContainer.disabled(
child: Text(
keyword,
style: style?.copyWith(
//color: colorDMB,
fontSize: 12,
fontVariations: variationSemiBold,
),
style: style
?.copyWith(
//color: colorDMB,
fontSize: 12,
)
.merge(VariableFontWeight.semiBold),
),
),
),
Expand Down
7 changes: 2 additions & 5 deletions app/lib/message_list/text_message_tile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,8 @@ class TextMessageTile extends StatelessWidget {
style: TextStyle(
color: colorGreyDark,
fontSize: isLargeScreen(context) ? 10 : 11,
fontVariations: variationMedium,
letterSpacing: -0.1,
),
).merge(VariableFontWeight.medium),
),
),
);
Expand Down Expand Up @@ -165,10 +164,8 @@ class TextMessageTile extends StatelessWidget {
isSender ? "You" : contentMessage.sender.split("@").firstOrNull ?? "",
style: const TextStyle(
color: colorDMB,
fontVariations: variationSemiBold,
fontSize: 12,
letterSpacing: -0.2,
),
).merge(VariableFontWeight.semiBold),
overflow: TextOverflow.ellipsis,
),
);
Expand Down
4 changes: 1 addition & 3 deletions app/lib/message_list/tile_timestamp.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,8 @@ class TileTimestamp extends StatelessWidget {
timeString(timestamp),
style: const TextStyle(
color: colorDMB,
fontWeight: FontWeight.w200,
fontSize: 10,
letterSpacing: -0.2,
),
).merge(VariableFontWeight.w200),
),
),
);
Expand Down
4 changes: 2 additions & 2 deletions app/lib/registration/server_choice.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ class ServerChoice extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
const Text(
Text(
'Choose a server where you want to create your account',
style: labelStyle,
style: Theme.of(context).textTheme.labelMedium,
),
Form(
autovalidateMode: AutovalidateMode.always,
Expand Down
4 changes: 2 additions & 2 deletions app/lib/registration/username_password.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ class UsernamePasswordChoice extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
const Text(
Text(
'Choose a username and password',
style: labelStyle,
style: Theme.of(context).textTheme.labelMedium,
),
Form(
autovalidateMode: AutovalidateMode.always,
Expand Down
Loading

0 comments on commit 597cc8a

Please sign in to comment.