Skip to content
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

TW-2159 Replace google fonts with static fonts #2170

Merged
merged 2 commits into from
Dec 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed assets/google_fonts/Inter-Black.ttf
Binary file not shown.
Binary file removed assets/google_fonts/Inter-ExtraBold.ttf
Binary file not shown.
Binary file removed assets/google_fonts/Inter-ExtraLight.ttf
Binary file not shown.
Binary file removed assets/google_fonts/Inter-Light.ttf
Binary file not shown.
Binary file removed assets/google_fonts/Inter-Thin.ttf
Binary file not shown.
45 changes: 29 additions & 16 deletions lib/config/themes.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import 'package:fluffychat/utils/responsive/responsive_utils.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:go_router/go_router.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:linagora_design_flutter/colors/linagora_ref_colors.dart';
import 'package:linagora_design_flutter/colors/linagora_sys_colors.dart';

Expand All @@ -23,58 +22,72 @@ abstract class TwakeThemes {

static ResponsiveUtils responsive = getIt.get<ResponsiveUtils>();

static var fallbackTextTheme = TextTheme(
bodyLarge: GoogleFonts.inter(
static var fallbackTextTheme = const TextTheme(
bodyLarge: TextStyle(
fontFamily: 'Inter',
fontWeight: FontWeight.w500,
letterSpacing: -0.15,
),
bodyMedium: GoogleFonts.inter(
bodyMedium: TextStyle(
fontFamily: 'Inter',
fontWeight: FontWeight.w500,
letterSpacing: 0.25,
),
bodySmall: GoogleFonts.inter(
bodySmall: TextStyle(
fontFamily: 'Inter',
fontWeight: FontWeight.w500,
letterSpacing: 0.4,
),
labelLarge: GoogleFonts.inter(
labelLarge: TextStyle(
fontFamily: 'Inter',
fontWeight: FontWeight.w500,
letterSpacing: 0.1,
),
labelSmall: GoogleFonts.inter(
labelSmall: TextStyle(
fontFamily: 'Inter',
fontWeight: FontWeight.w500,
letterSpacing: 0.5,
),
displayLarge: GoogleFonts.inter(
displayLarge: TextStyle(
fontFamily: 'Inter',
fontWeight: FontWeight.w700,
),
displayMedium: GoogleFonts.inter(
displayMedium: TextStyle(
fontFamily: 'Inter',
fontWeight: FontWeight.w600,
letterSpacing: 0.4,
),
displaySmall: GoogleFonts.inter(
displaySmall: TextStyle(
fontFamily: 'Inter',
fontWeight: FontWeight.w600,
letterSpacing: 0.4,
),
headlineMedium: GoogleFonts.inter(
headlineMedium: TextStyle(
fontFamily: 'Inter',
fontWeight: FontWeight.w600,
),
headlineSmall: GoogleFonts.inter(
headlineSmall: TextStyle(
fontFamily: 'Inter',
fontWeight: FontWeight.w600,
letterSpacing: 0.4,
),
headlineLarge: GoogleFonts.inter(
headlineLarge: TextStyle(
fontFamily: 'Inter',
fontWeight: FontWeight.w600,
fontSize: 32,
),
titleLarge: GoogleFonts.inter(
titleLarge: TextStyle(
fontFamily: 'Inter',
fontWeight: FontWeight.w600,
letterSpacing: -0.15,
),
titleMedium: GoogleFonts.inter(
titleMedium: TextStyle(
fontFamily: 'Inter',
fontWeight: FontWeight.w500,
letterSpacing: 0.15,
),
titleSmall: GoogleFonts.inter(
titleSmall: TextStyle(
fontFamily: 'Inter',
fontWeight: FontWeight.w500,
letterSpacing: 0.1,
),
Expand Down
10 changes: 4 additions & 6 deletions lib/pages/bootstrap/bootstrap_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/l10n.dart';
import 'package:flutter_secure_storage/flutter_secure_storage.dart';

import 'package:google_fonts/google_fonts.dart';
import 'package:matrix/encryption.dart';
import 'package:matrix/encryption/utils/bootstrap.dart';
import 'package:matrix/matrix.dart';
Expand Down Expand Up @@ -136,7 +135,7 @@ class BootstrapDialogState extends State<BootstrapDialog> {
minLines: 2,
maxLines: 4,
readOnly: true,
style: GoogleFonts.robotoMono(),
style: Theme.of(context).textTheme.bodyMedium,
contextMenuBuilder: mobileTwakeContextMenuBuilder,
controller: TextEditingController(text: key),
decoration: const InputDecoration(
Expand Down Expand Up @@ -268,12 +267,11 @@ class BootstrapDialogState extends State<BootstrapDialog> {
? null
: [AutofillHints.password],
controller: _recoveryKeyTextEditingController,
style: GoogleFonts.robotoMono(),
style: Theme.of(context).textTheme.bodyLarge,
decoration: InputDecoration(
contentPadding: const EdgeInsets.all(16),
hintStyle: TextStyle(
fontFamily:
Theme.of(context).textTheme.bodyLarge?.fontFamily,
hintStyle: const TextStyle(
fontFamily: 'Inter',
),
hintText: L10n.of(context)!.recoveryKey,
errorText: _recoveryKeyInputError,
Expand Down
5 changes: 2 additions & 3 deletions lib/pages/chat/chat_app_bar_title_style.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import 'package:fluffychat/di/global/get_it_initializer.dart';
import 'package:fluffychat/utils/responsive/responsive_utils.dart';
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:linagora_design_flutter/linagora_design_flutter.dart';

class ChatAppBarTitleStyle {
Expand Down Expand Up @@ -37,12 +36,12 @@ class ChatAppBarTitleStyle {
? Theme.of(context).textTheme.labelMedium?.copyWith(
color: LinagoraRefColors.material().tertiary[30],
letterSpacing: ChatAppBarTitleStyle.letterSpacingStatusContent,
fontFamily: GoogleFonts.inter().fontFamily,
fontFamily: 'Inter',
)
: Theme.of(context).textTheme.bodySmall?.copyWith(
color: LinagoraRefColors.material().neutral[50],
letterSpacing: ChatAppBarTitleStyle.letterSpacingRoomName,
fontFamily: GoogleFonts.inter().fontFamily,
fontFamily: 'Inter',
);

static TextStyle? onlineStatusTextStyle(BuildContext context) =>
Expand Down
3 changes: 1 addition & 2 deletions lib/pages/chat/chat_input_row.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/l10n.dart';
import 'package:flutter_keyboard_visibility/flutter_keyboard_visibility.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:linagora_design_flutter/colors/linagora_ref_colors.dart';
import 'package:matrix/matrix.dart';

Expand Down Expand Up @@ -157,7 +156,7 @@ class ChatInputRow extends StatelessWidget {
color: controller.responsive.isMobile(context)
? LinagoraRefColors.material().tertiary[50]
: LinagoraRefColors.material().tertiary[30],
fontFamily: GoogleFonts.inter().fontFamily,
fontFamily: 'Inter',
),
),
onChanged: controller.onInputBarChanged,
Expand Down
3 changes: 1 addition & 2 deletions lib/pages/chat/events/message/display_name_widget.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import 'package:fluffychat/pages/chat/events/message/message_style.dart';
import 'package:fluffychat/utils/string_extension.dart';
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:linagora_design_flutter/linagora_design_flutter.dart';
import 'package:matrix/matrix.dart';

Expand Down Expand Up @@ -29,7 +28,7 @@ class DisplayNameWidget extends StatelessWidget {
maxCharacters: maxCharactersDisplayNameBubble,
),
style: Theme.of(context).textTheme.labelMedium?.copyWith(
fontFamily: GoogleFonts.inter().fontFamily,
fontFamily: 'Inter',
color: LinagoraSysColors.material().secondary,
),
maxLines: 2,
Expand Down
3 changes: 1 addition & 2 deletions lib/pages/chat/input_bar/input_bar_style.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';

class InputBarStyle {
static const double suggestionAvatarSize = 30;
Expand All @@ -17,7 +16,7 @@ class InputBarStyle {
color: Theme.of(context).brightness == Brightness.light
? Colors.black
: Colors.white,
fontFamily: GoogleFonts.inter().fontFamily,
fontFamily: 'Inter',
);

static const double suggestionTileAvatarTextGap = 8.0;
Expand Down
3 changes: 1 addition & 2 deletions lib/pages/chat_draft/draft_chat_view_style.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import 'package:fluffychat/pages/chat/chat_input_row_style.dart';
import 'package:fluffychat/utils/responsive/responsive_utils.dart';
import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/l10n.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:linagora_design_flutter/linagora_design_flutter.dart';

class DraftChatViewStyle {
Expand All @@ -27,7 +26,7 @@ class DraftChatViewStyle {
color: responsive.isMobile(context)
? LinagoraRefColors.material().tertiary[50]
: LinagoraRefColors.material().tertiary[30],
fontFamily: GoogleFonts.inter().fontFamily,
fontFamily: 'Inter',
),
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import 'package:fluffychat/utils/url_launcher.dart';
import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/l10n.dart';
import 'package:go_router/go_router.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:matrix/matrix.dart';
import 'package:fluffychat/config/app_config.dart';
import 'package:fluffychat/pages/chat_encryption_settings/chat_encryption_settings.dart';
Expand Down Expand Up @@ -168,7 +167,7 @@ class ChatEncryptionSettingsView extends StatelessWidget {
deviceKeys[i].ed25519Key?.beautified ??
L10n.of(context)!.unknownEncryptionAlgorithm,
style: TextStyle(
fontFamily: GoogleFonts.robotoMono().fontFamily,
fontFamily: 'Inter',
color: Theme.of(context).colorScheme.secondary,
),
),
Expand Down
3 changes: 1 addition & 2 deletions lib/pages/chat_list/chat_list_item_title.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import 'package:fluffychat/utils/room_status_extension.dart';
import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/l10n.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:linagora_design_flutter/linagora_design_flutter.dart';
import 'package:matrix/matrix.dart';

Expand Down Expand Up @@ -46,7 +45,7 @@ class ChatListItemTitle extends StatelessWidget with ChatListItemMixin {
maxLines: 1,
softWrap: false,
style: ListItemStyle.titleTextStyle(
fontFamily: GoogleFonts.inter().fontFamily ?? 'Inter',
fontFamily: 'Inter',
),
),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import 'package:fluffychat/widgets/highlight_text.dart';
import 'package:fluffychat/widgets/matrix.dart';
import 'package:fluffychat/widgets/twake_components/twake_chip.dart';
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:flutter_gen/gen_l10n/l10n.dart';
import 'package:fluffychat/utils/string_extension.dart';
import 'package:linagora_design_flutter/linagora_design_flutter.dart';
Expand Down Expand Up @@ -70,9 +69,7 @@ class ExpansionContactListTile extends StatelessWidget {
contactDisplayName: contact.displayName,
highlightKeyword: highlightKeyword,
style: ListItemStyle.titleTextStyle(
fontFamily:
GoogleFonts.inter().fontFamily ??
'Inter',
fontFamily: 'Inter',
),
),
),
Expand Down Expand Up @@ -105,8 +102,7 @@ class ExpansionContactListTile extends StatelessWidget {
text: contact.matrixId!,
searchWord: highlightKeyword,
style: ListItemStyle.subtitleTextStyle(
fontFamily:
GoogleFonts.inter().fontFamily ?? 'Inter',
fontFamily: 'Inter',
),
maxLines: 1,
overflow: TextOverflow.ellipsis,
Expand All @@ -116,8 +112,7 @@ class ExpansionContactListTile extends StatelessWidget {
text: contact.email!,
searchWord: highlightKeyword,
style: ListItemStyle.subtitleTextStyle(
fontFamily:
GoogleFonts.inter().fontFamily ?? 'Inter',
fontFamily: 'Inter',
),
maxLines: 1,
overflow: TextOverflow.ellipsis,
Expand All @@ -127,8 +122,7 @@ class ExpansionContactListTile extends StatelessWidget {
text: contact.phoneNumber!,
searchWord: highlightKeyword,
style: ListItemStyle.subtitleTextStyle(
fontFamily:
GoogleFonts.inter().fontFamily ?? 'Inter',
fontFamily: 'Inter',
),
),
],
Expand Down
15 changes: 7 additions & 8 deletions lib/pages/search/recent_item_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import 'package:fluffychat/widgets/highlight_text.dart';
import 'package:fluffychat/widgets/twake_components/twake_chip.dart';
import 'package:flutter/material.dart' hide SearchController;
import 'package:flutter_gen/gen_l10n/l10n.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:linagora_design_flutter/linagora_design_flutter.dart';
import 'package:matrix/matrix.dart';

Expand Down Expand Up @@ -114,7 +113,7 @@ class _GroupChatInformation extends StatelessWidget {
_SearchHighlightText(
text: recentChatPresentationSearch.displayName ?? "",
style: ListItemStyle.titleTextStyle(
fontFamily: GoogleFonts.inter().fontFamily ?? 'Inter',
fontFamily: 'Inter',
),
searchWord: searchKeyword,
),
Expand All @@ -124,7 +123,7 @@ class _GroupChatInformation extends StatelessWidget {
maxLines: 1,
softWrap: false,
style: ListItemStyle.subtitleTextStyle(
fontFamily: GoogleFonts.inter().fontFamily ?? 'Inter',
fontFamily: 'Inter',
),
),
],
Expand Down Expand Up @@ -192,14 +191,14 @@ class _DirectChatInformation extends StatelessWidget {
_SearchHighlightText(
text: recentChatPresentationSearch.displayName ?? "",
style: ListItemStyle.titleTextStyle(
fontFamily: GoogleFonts.inter().fontFamily ?? 'Inter',
fontFamily: 'Inter',
),
searchWord: searchKeyword,
),
_SearchHighlightText(
text: recentChatPresentationSearch.directChatMatrixID ?? "",
style: ListItemStyle.subtitleTextStyle(
fontFamily: GoogleFonts.inter().fontFamily ?? 'Inter',
fontFamily: 'Inter',
),
searchWord: searchKeyword,
),
Expand Down Expand Up @@ -250,7 +249,7 @@ class _ContactInformation extends StatelessWidget {
child: _SearchHighlightText(
text: contactPresentationSearch.displayName ?? "",
style: ListItemStyle.titleTextStyle(
fontFamily: GoogleFonts.inter().fontFamily ?? 'Inter',
fontFamily: 'Inter',
),
searchWord: searchKeyword,
),
Expand All @@ -273,15 +272,15 @@ class _ContactInformation extends StatelessWidget {
_SearchHighlightText(
text: contactPresentationSearch.matrixId ?? "",
style: ListItemStyle.subtitleTextStyle(
fontFamily: GoogleFonts.inter().fontFamily ?? 'Inter',
fontFamily: 'Inter',
),
searchWord: searchKeyword,
),
if (contactPresentationSearch.email != null)
_SearchHighlightText(
text: contactPresentationSearch.email ?? "",
style: ListItemStyle.subtitleTextStyle(
fontFamily: GoogleFonts.inter().fontFamily ?? 'Inter',
fontFamily: 'Inter',
),
searchWord: searchKeyword,
),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import 'package:fluffychat/pages/settings_dashboard/settings/settings_view_style.dart';
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:linagora_design_flutter/linagora_design_flutter.dart';

class SettingsItemBuilder extends StatelessWidget {
Expand Down Expand Up @@ -53,8 +52,7 @@ class SettingsItemBuilder extends StatelessWidget {
Text(
title,
style: ListItemStyle.titleTextStyle(
fontFamily:
GoogleFonts.inter().fontFamily ?? 'Inter',
fontFamily: 'Inter',
),
maxLines: 2,
overflow: TextOverflow.ellipsis,
Expand Down
Loading
Loading