Skip to content

Commit

Permalink
TW-824: install google fonts to fetch font from http
Browse files Browse the repository at this point in the history
  • Loading branch information
Julian KOUNE committed Oct 20, 2023
1 parent a1e7d9f commit 32211f6
Show file tree
Hide file tree
Showing 52 changed files with 74 additions and 343 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
202 changes: 0 additions & 202 deletions fonts/Roboto/LICENSE.txt

This file was deleted.

Binary file removed fonts/Roboto/Roboto-Black.ttf
Binary file not shown.
Binary file removed fonts/Roboto/Roboto-BlackItalic.ttf
Binary file not shown.
Binary file removed fonts/Roboto/Roboto-Bold.ttf
Binary file not shown.
Binary file removed fonts/Roboto/Roboto-BoldItalic.ttf
Binary file not shown.
Binary file removed fonts/Roboto/Roboto-Italic.ttf
Binary file not shown.
Binary file removed fonts/Roboto/Roboto-Light.ttf
Binary file not shown.
Binary file removed fonts/Roboto/Roboto-LightItalic.ttf
Binary file not shown.
Binary file removed fonts/Roboto/Roboto-Medium.ttf
Binary file not shown.
Binary file removed fonts/Roboto/Roboto-MediumItalic.ttf
Binary file not shown.
Binary file removed fonts/Roboto/Roboto-Regular.ttf
Binary file not shown.
Binary file removed fonts/Roboto/Roboto-Thin.ttf
Binary file not shown.
Binary file removed fonts/Roboto/Roboto-ThinItalic.ttf
Binary file not shown.
Binary file removed fonts/Roboto/RobotoMono-Regular.ttf
Binary file not shown.
34 changes: 15 additions & 19 deletions lib/config/themes.dart
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
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';

import 'app_config.dart';

abstract class FluffyThemes {
abstract class TwakeThemes {
static const double columnWidth = 360.0;
static const double iconSize = 24.0;

Expand All @@ -18,58 +19,53 @@ abstract class FluffyThemes {
static bool getDisplayNavigationRail(BuildContext context) =>
!(GoRouterState.of(context).path?.startsWith('/settings') == true);

static const fallbackTextStyle = TextStyle(
fontFamily: 'Inter',
fontFamilyFallback: ['Inter'],
);

static var fallbackTextTheme = TextTheme(
bodyLarge: fallbackTextStyle.copyWith(
bodyLarge: GoogleFonts.inter(
fontWeight: FontWeight.w500,
letterSpacing: -0.15,
),
bodyMedium: fallbackTextStyle.copyWith(
bodyMedium: GoogleFonts.inter(
fontWeight: FontWeight.w500,
letterSpacing: 0.25,
),
bodySmall: fallbackTextStyle.copyWith(
bodySmall: GoogleFonts.inter(
fontWeight: FontWeight.w500,
letterSpacing: 0.4,
),
labelLarge: fallbackTextStyle.copyWith(
labelLarge: GoogleFonts.inter(
fontWeight: FontWeight.w500,
letterSpacing: 0.1,
),
labelSmall: fallbackTextStyle.copyWith(
labelSmall: GoogleFonts.inter(
fontWeight: FontWeight.w500,
letterSpacing: 0.5,
),
displayLarge: fallbackTextStyle.copyWith(
displayLarge: GoogleFonts.inter(
fontWeight: FontWeight.w700,
),
displayMedium: fallbackTextStyle.copyWith(
displayMedium: GoogleFonts.inter(
fontWeight: FontWeight.w600,
letterSpacing: 0.4,
),
displaySmall: fallbackTextStyle.copyWith(
displaySmall: GoogleFonts.inter(
fontWeight: FontWeight.w600,
letterSpacing: 0.4,
),
headlineMedium: fallbackTextStyle.copyWith(
headlineMedium: GoogleFonts.inter(
fontWeight: FontWeight.w600,
),
headlineSmall: fallbackTextStyle.copyWith(
headlineSmall: GoogleFonts.inter(
fontWeight: FontWeight.w600,
letterSpacing: 0.4,
),
titleLarge: fallbackTextStyle.copyWith(
titleLarge: GoogleFonts.inter(
fontWeight: FontWeight.w600,
),
titleMedium: fallbackTextStyle.copyWith(
titleMedium: GoogleFonts.inter(
fontWeight: FontWeight.w500,
letterSpacing: 0.15,
),
titleSmall: fallbackTextStyle.copyWith(
titleSmall: GoogleFonts.inter(
fontWeight: FontWeight.w500,
letterSpacing: 0.1,
),
Expand Down
9 changes: 5 additions & 4 deletions lib/pages/bootstrap/bootstrap_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/l10n.dart';
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
import 'package:future_loading_dialog/future_loading_dialog.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 @@ -117,7 +118,7 @@ class BootstrapDialogState extends State<BootstrapDialog> {
body: Center(
child: ConstrainedBox(
constraints:
const BoxConstraints(maxWidth: FluffyThemes.columnWidth * 1.5),
const BoxConstraints(maxWidth: TwakeThemes.columnWidth * 1.5),
child: ListView(
padding: const EdgeInsets.all(16.0),
children: [
Expand All @@ -140,7 +141,7 @@ class BootstrapDialogState extends State<BootstrapDialog> {
minLines: 2,
maxLines: 4,
readOnly: true,
style: const TextStyle(fontFamily: 'RobotoMono'),
style: GoogleFonts.robotoMono(),
controller: TextEditingController(text: key),
decoration: const InputDecoration(
contentPadding: EdgeInsets.all(16),
Expand Down Expand Up @@ -244,7 +245,7 @@ class BootstrapDialogState extends State<BootstrapDialog> {
body: Center(
child: ConstrainedBox(
constraints: const BoxConstraints(
maxWidth: FluffyThemes.columnWidth * 1.5,
maxWidth: TwakeThemes.columnWidth * 1.5,
),
child: ListView(
padding: const EdgeInsets.all(16.0),
Expand All @@ -270,7 +271,7 @@ class BootstrapDialogState extends State<BootstrapDialog> {
? null
: [AutofillHints.password],
controller: _recoveryKeyTextEditingController,
style: const TextStyle(fontFamily: 'RobotoMono'),
style: GoogleFonts.robotoMono(),
decoration: InputDecoration(
contentPadding: const EdgeInsets.all(16),
hintStyle: TextStyle(
Expand Down
4 changes: 2 additions & 2 deletions lib/pages/chat/chat_emoji_picker.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ class ChatEmojiPicker extends StatelessWidget {
valueListenable: controller.showEmojiPickerNotifier,
builder: (context, showEmojiPicker, _) {
return AnimatedContainer(
duration: FluffyThemes.animationDuration,
curve: FluffyThemes.animationCurve,
duration: TwakeThemes.animationDuration,
curve: TwakeThemes.animationCurve,
width: MediaQuery.of(context).size.width,
height: showEmojiPicker ? MediaQuery.of(context).size.height / 3 : 0,
child: showEmojiPicker
Expand Down
2 changes: 1 addition & 1 deletion lib/pages/chat/chat_event_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class ChatEventList extends StatelessWidget {

@override
Widget build(BuildContext context) {
final horizontalPadding = FluffyThemes.isColumnMode(context) ? 8.0 : 0.0;
final horizontalPadding = TwakeThemes.isColumnMode(context) ? 8.0 : 0.0;

// create a map of eventId --> index to greatly improve performance of
// ListView's findChildIndexCallback
Expand Down
4 changes: 2 additions & 2 deletions lib/pages/chat/chat_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ class ChatView extends StatelessWidget with MessageContentMixin {
return const SizedBox.shrink();
}

final bottomSheetPadding = FluffyThemes.isColumnMode(context) ? 16.0 : 8.0;
final bottomSheetPadding = TwakeThemes.isColumnMode(context) ? 16.0 : 8.0;

return GestureDetector(
onTapDown: controller.setReadMarker,
Expand Down Expand Up @@ -273,7 +273,7 @@ class ChatView extends StatelessWidget with MessageContentMixin {
controller.room!.membership == Membership.join)
Container(
constraints: const BoxConstraints(
maxWidth: FluffyThemes.columnWidth * 2.5,
maxWidth: TwakeThemes.columnWidth * 2.5,
),
alignment: Alignment.center,
child: controller.room?.isAbandonedDMRoom == true
Expand Down
2 changes: 1 addition & 1 deletion lib/pages/chat/events/message/message.dart
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,7 @@ class Message extends StatelessWidget {
? LinagoraSysColors.material().secondaryContainer
: Theme.of(context).primaryColor.withAlpha(0),
constraints:
const BoxConstraints(maxWidth: FluffyThemes.columnWidth * 2.5),
const BoxConstraints(maxWidth: TwakeThemes.columnWidth * 2.5),
child: Row(
mainAxisSize: MainAxisSize.max,
children: [
Expand Down
4 changes: 2 additions & 2 deletions lib/pages/chat/reactions_picker.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ class ReactionsPicker extends StatelessWidget {
controller.room!.canSendDefaultMessages &&
controller.selectedEvents.isNotEmpty;
return AnimatedContainer(
duration: FluffyThemes.animationDuration,
curve: FluffyThemes.animationCurve,
duration: TwakeThemes.animationDuration,
curve: TwakeThemes.animationCurve,
height: (display) ? 56 : 0,
child: Material(
color: Colors.transparent,
Expand Down
Loading

0 comments on commit 32211f6

Please sign in to comment.