From db06315d8ad00b28d0e3fe93376a1185ac544033 Mon Sep 17 00:00:00 2001 From: Julian KOUNE Date: Tue, 17 Oct 2023 15:41:57 +0200 Subject: [PATCH] TW-824: install google fonts to fetch font from http --- .../google_fonts}/Inter-Black.ttf | Bin .../google_fonts}/Inter-Bold.ttf | Bin .../google_fonts}/Inter-ExtraBold.ttf | Bin .../google_fonts}/Inter-ExtraLight.ttf | Bin .../google_fonts}/Inter-Light.ttf | Bin .../google_fonts}/Inter-Medium.ttf | Bin .../google_fonts}/Inter-Regular.ttf | Bin .../google_fonts}/Inter-SemiBold.ttf | Bin .../google_fonts}/Inter-Thin.ttf | Bin lib/config/themes.dart | 36 +++++++-------- lib/pages/bootstrap/bootstrap_dialog.dart | 4 +- lib/pages/chat/chat_emoji_picker.dart | 4 +- lib/pages/chat/chat_event_list.dart | 2 +- lib/pages/chat/chat_view.dart | 4 +- lib/pages/chat/events/message/message.dart | 2 +- lib/pages/chat/reactions_picker.dart | 4 +- lib/pages/chat/reply_display.dart | 4 +- lib/pages/chat/typing_indicators.dart | 6 +-- lib/pages/chat_draft/draft_chat_view.dart | 4 +- .../chat_draft/draft_chat_view_style.dart | 2 +- lib/pages/chat_list/chat_list_body_view.dart | 8 ++-- .../chat_list/chat_list_item_subtitle.dart | 8 ++-- lib/pages/chat_list/navi_rail_item.dart | 4 +- lib/pages/dialer/pip/pip_view.dart | 4 +- .../homeserver_picker_view.dart | 4 +- lib/pages/story/story_view.dart | 4 +- lib/utils/adaptive_bottom_sheet.dart | 2 +- lib/widgets/connection_status_header.dart | 4 +- lib/widgets/layouts/login_scaffold.dart | 2 +- lib/widgets/lock_screen.dart | 4 +- lib/widgets/mxc_image.dart | 2 +- lib/widgets/twake_app.dart | 4 +- .../twake_fab/twake_fab_style.dart | 43 ------------------ pubspec.lock | 8 ++++ pubspec.yaml | 34 +------------- web/index.html | 2 +- web/{splash => }/style.css | 1 + 37 files changed, 71 insertions(+), 139 deletions(-) rename {fonts/Inter => assets/google_fonts}/Inter-Black.ttf (100%) rename {fonts/Inter => assets/google_fonts}/Inter-Bold.ttf (100%) rename {fonts/Inter => assets/google_fonts}/Inter-ExtraBold.ttf (100%) rename {fonts/Inter => assets/google_fonts}/Inter-ExtraLight.ttf (100%) rename {fonts/Inter => assets/google_fonts}/Inter-Light.ttf (100%) rename {fonts/Inter => assets/google_fonts}/Inter-Medium.ttf (100%) rename {fonts/Inter => assets/google_fonts}/Inter-Regular.ttf (100%) rename {fonts/Inter => assets/google_fonts}/Inter-SemiBold.ttf (100%) rename {fonts/Inter => assets/google_fonts}/Inter-Thin.ttf (100%) delete mode 100644 lib/widgets/twake_components/twake_fab/twake_fab_style.dart rename web/{splash => }/style.css (99%) diff --git a/fonts/Inter/Inter-Black.ttf b/assets/google_fonts/Inter-Black.ttf similarity index 100% rename from fonts/Inter/Inter-Black.ttf rename to assets/google_fonts/Inter-Black.ttf diff --git a/fonts/Inter/Inter-Bold.ttf b/assets/google_fonts/Inter-Bold.ttf similarity index 100% rename from fonts/Inter/Inter-Bold.ttf rename to assets/google_fonts/Inter-Bold.ttf diff --git a/fonts/Inter/Inter-ExtraBold.ttf b/assets/google_fonts/Inter-ExtraBold.ttf similarity index 100% rename from fonts/Inter/Inter-ExtraBold.ttf rename to assets/google_fonts/Inter-ExtraBold.ttf diff --git a/fonts/Inter/Inter-ExtraLight.ttf b/assets/google_fonts/Inter-ExtraLight.ttf similarity index 100% rename from fonts/Inter/Inter-ExtraLight.ttf rename to assets/google_fonts/Inter-ExtraLight.ttf diff --git a/fonts/Inter/Inter-Light.ttf b/assets/google_fonts/Inter-Light.ttf similarity index 100% rename from fonts/Inter/Inter-Light.ttf rename to assets/google_fonts/Inter-Light.ttf diff --git a/fonts/Inter/Inter-Medium.ttf b/assets/google_fonts/Inter-Medium.ttf similarity index 100% rename from fonts/Inter/Inter-Medium.ttf rename to assets/google_fonts/Inter-Medium.ttf diff --git a/fonts/Inter/Inter-Regular.ttf b/assets/google_fonts/Inter-Regular.ttf similarity index 100% rename from fonts/Inter/Inter-Regular.ttf rename to assets/google_fonts/Inter-Regular.ttf diff --git a/fonts/Inter/Inter-SemiBold.ttf b/assets/google_fonts/Inter-SemiBold.ttf similarity index 100% rename from fonts/Inter/Inter-SemiBold.ttf rename to assets/google_fonts/Inter-SemiBold.ttf diff --git a/fonts/Inter/Inter-Thin.ttf b/assets/google_fonts/Inter-Thin.ttf similarity index 100% rename from fonts/Inter/Inter-Thin.ttf rename to assets/google_fonts/Inter-Thin.ttf diff --git a/lib/config/themes.dart b/lib/config/themes.dart index a796e600f1..30007bdbeb 100644 --- a/lib/config/themes.dart +++ b/lib/config/themes.dart @@ -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; @@ -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, ), @@ -82,7 +78,7 @@ abstract class FluffyThemes { ThemeData( visualDensity: VisualDensity.standard, useMaterial3: true, - fontFamily: 'Inter', + fontFamily: GoogleFonts.inter().fontFamily, textTheme: brightness == Brightness.light ? Typography.material2021().black.merge(fallbackTextTheme) : Typography.material2021().white.merge(fallbackTextTheme), diff --git a/lib/pages/bootstrap/bootstrap_dialog.dart b/lib/pages/bootstrap/bootstrap_dialog.dart index d5b8772d83..d9132b79dd 100644 --- a/lib/pages/bootstrap/bootstrap_dialog.dart +++ b/lib/pages/bootstrap/bootstrap_dialog.dart @@ -117,7 +117,7 @@ class BootstrapDialogState extends State { 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: [ @@ -244,7 +244,7 @@ class BootstrapDialogState extends State { 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), diff --git a/lib/pages/chat/chat_emoji_picker.dart b/lib/pages/chat/chat_emoji_picker.dart index 9aa7d4a616..5e5f2f78f3 100644 --- a/lib/pages/chat/chat_emoji_picker.dart +++ b/lib/pages/chat/chat_emoji_picker.dart @@ -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 diff --git a/lib/pages/chat/chat_event_list.dart b/lib/pages/chat/chat_event_list.dart index a4d848a99b..4906043c9a 100644 --- a/lib/pages/chat/chat_event_list.dart +++ b/lib/pages/chat/chat_event_list.dart @@ -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 diff --git a/lib/pages/chat/chat_view.dart b/lib/pages/chat/chat_view.dart index 0ef3a694a0..ed082df7d2 100644 --- a/lib/pages/chat/chat_view.dart +++ b/lib/pages/chat/chat_view.dart @@ -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, @@ -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 diff --git a/lib/pages/chat/events/message/message.dart b/lib/pages/chat/events/message/message.dart index a674954f96..bfa35843bf 100644 --- a/lib/pages/chat/events/message/message.dart +++ b/lib/pages/chat/events/message/message.dart @@ -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: [ diff --git a/lib/pages/chat/reactions_picker.dart b/lib/pages/chat/reactions_picker.dart index b6e0387743..8ac73a2fee 100644 --- a/lib/pages/chat/reactions_picker.dart +++ b/lib/pages/chat/reactions_picker.dart @@ -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, diff --git a/lib/pages/chat/reply_display.dart b/lib/pages/chat/reply_display.dart index 2bb416eac1..f1b164fd4e 100644 --- a/lib/pages/chat/reply_display.dart +++ b/lib/pages/chat/reply_display.dart @@ -16,8 +16,8 @@ class ReplyDisplay extends StatelessWidget { @override Widget build(BuildContext context) { return AnimatedContainer( - duration: FluffyThemes.animationDuration, - curve: FluffyThemes.animationCurve, + duration: TwakeThemes.animationDuration, + curve: TwakeThemes.animationCurve, height: controller.editEvent != null || controller.replyEvent != null ? 56 : 0, diff --git a/lib/pages/chat/typing_indicators.dart b/lib/pages/chat/typing_indicators.dart index 6e2e466420..acbf9760e1 100644 --- a/lib/pages/chat/typing_indicators.dart +++ b/lib/pages/chat/typing_indicators.dart @@ -23,11 +23,11 @@ class TypingIndicators extends StatelessWidget { alignment: Alignment.center, child: AnimatedContainer( constraints: - const BoxConstraints(maxWidth: FluffyThemes.columnWidth * 2.5), + const BoxConstraints(maxWidth: TwakeThemes.columnWidth * 2.5), height: typingUsers.isEmpty ? 0 : AvatarStyle.defaultSize + bottomPadding, - duration: FluffyThemes.animationDuration, - curve: FluffyThemes.animationCurve, + duration: TwakeThemes.animationDuration, + curve: TwakeThemes.animationCurve, alignment: controller.timeline!.events.isNotEmpty && controller.timeline!.events.first.senderId == Matrix.of(context).client.userID diff --git a/lib/pages/chat_draft/draft_chat_view.dart b/lib/pages/chat_draft/draft_chat_view.dart index fd8cd8f5de..297f7a04f0 100644 --- a/lib/pages/chat_draft/draft_chat_view.dart +++ b/lib/pages/chat_draft/draft_chat_view.dart @@ -227,8 +227,8 @@ class DraftChatView extends StatelessWidget { DraftChatViewStyle.containerMaxWidthConstraints, alignment: Alignment.center, child: AnimatedContainer( - duration: FluffyThemes.animationDuration, - curve: FluffyThemes.animationCurve, + duration: TwakeThemes.animationDuration, + curve: TwakeThemes.animationCurve, width: MediaQuery.of(context).size.width, height: DraftChatViewStyle.animatedContainerHeight( context, diff --git a/lib/pages/chat_draft/draft_chat_view_style.dart b/lib/pages/chat_draft/draft_chat_view_style.dart index 666b78b02f..ed96123f03 100644 --- a/lib/pages/chat_draft/draft_chat_view_style.dart +++ b/lib/pages/chat_draft/draft_chat_view_style.dart @@ -11,7 +11,7 @@ class DraftChatViewStyle { responsive.isMobile(context) ? 56 : 80; static BoxConstraints get containerMaxWidthConstraints => - const BoxConstraints(maxWidth: FluffyThemes.columnWidth * 2.5); + const BoxConstraints(maxWidth: TwakeThemes.columnWidth * 2.5); static double animatedContainerHeight( BuildContext context, diff --git a/lib/pages/chat_list/chat_list_body_view.dart b/lib/pages/chat_list/chat_list_body_view.dart index 5e76da71ae..1f7c5a2b0e 100644 --- a/lib/pages/chat_list/chat_list_body_view.dart +++ b/lib/pages/chat_list/chat_list_body_view.dart @@ -25,8 +25,8 @@ class ChatListBodyView extends StatelessWidget { return Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ - if (FluffyThemes.isColumnMode(context) && - FluffyThemes.getDisplayNavigationRail(context)) ...[ + if (TwakeThemes.isColumnMode(context) && + TwakeThemes.getDisplayNavigationRail(context)) ...[ Container( color: Theme.of(context).dividerColor, width: 1, @@ -137,8 +137,8 @@ class ChatListBodyView extends StatelessWidget { height: ChatListBodyViewStyle.heightIsTorBrowser( controller.isTorBrowser, ), - duration: FluffyThemes.animationDuration, - curve: FluffyThemes.animationCurve, + duration: TwakeThemes.animationDuration, + curve: TwakeThemes.animationCurve, clipBehavior: Clip.hardEdge, decoration: const BoxDecoration(), child: Material( diff --git a/lib/pages/chat_list/chat_list_item_subtitle.dart b/lib/pages/chat_list/chat_list_item_subtitle.dart index 583bcefc52..f7dcf67958 100644 --- a/lib/pages/chat_list/chat_list_item_subtitle.dart +++ b/lib/pages/chat_list/chat_list_item_subtitle.dart @@ -64,8 +64,8 @@ class ChatListItemSubtitle extends StatelessWidget with ChatListItemMixin { .getAllMentionedUserIdsFromMessage(room) .contains(Matrix.of(context).client.userID); return AnimatedContainer( - duration: FluffyThemes.animationDuration, - curve: FluffyThemes.animationCurve, + duration: TwakeThemes.animationDuration, + curve: TwakeThemes.animationCurve, padding: const EdgeInsets.only(bottom: 4), height: ChatListItemStyle.mentionIconWidth, width: isMentionned && room.isUnreadOrInvited @@ -96,8 +96,8 @@ class ChatListItemSubtitle extends StatelessWidget with ChatListItemMixin { ), const SizedBox(width: 4), AnimatedContainer( - duration: FluffyThemes.animationDuration, - curve: FluffyThemes.animationCurve, + duration: TwakeThemes.animationDuration, + curve: TwakeThemes.animationCurve, padding: const EdgeInsets.symmetric(horizontal: 7), height: unreadBadgeSize, width: ChatListItemStyle.notificationBadgeSize( diff --git a/lib/pages/chat_list/navi_rail_item.dart b/lib/pages/chat_list/navi_rail_item.dart index 0c07839392..83fb6a5775 100644 --- a/lib/pages/chat_list/navi_rail_item.dart +++ b/lib/pages/chat_list/navi_rail_item.dart @@ -32,8 +32,8 @@ class NaviRailItem extends StatelessWidget { left: 0, child: AnimatedContainer( width: isSelected ? 4 : 0, - duration: FluffyThemes.animationDuration, - curve: FluffyThemes.animationCurve, + duration: TwakeThemes.animationDuration, + curve: TwakeThemes.animationCurve, decoration: BoxDecoration( color: Theme.of(context).colorScheme.primary, borderRadius: const BorderRadius.only( diff --git a/lib/pages/dialer/pip/pip_view.dart b/lib/pages/dialer/pip/pip_view.dart index 0201e87622..a793373c11 100644 --- a/lib/pages/dialer/pip/pip_view.dart +++ b/lib/pages/dialer/pip/pip_view.dart @@ -44,11 +44,11 @@ class PIPViewState extends State with TickerProviderStateMixin { super.initState(); _corner = widget.initialCorner; _toggleFloatingAnimationController = AnimationController( - duration: FluffyThemes.animationDuration, + duration: TwakeThemes.animationDuration, vsync: this, ); _dragAnimationController = AnimationController( - duration: FluffyThemes.animationDuration, + duration: TwakeThemes.animationDuration, vsync: this, ); } diff --git a/lib/pages/homeserver_picker/homeserver_picker_view.dart b/lib/pages/homeserver_picker/homeserver_picker_view.dart index d7e15bb071..5d315e1f57 100644 --- a/lib/pages/homeserver_picker/homeserver_picker_view.dart +++ b/lib/pages/homeserver_picker/homeserver_picker_view.dart @@ -43,8 +43,8 @@ class HomeserverPickerView extends StatelessWidget { // usually forced to logout as TOR browser is non-persistent AnimatedContainer( height: controller.isTorBrowser ? 64 : 0, - duration: FluffyThemes.animationDuration, - curve: FluffyThemes.animationCurve, + duration: TwakeThemes.animationDuration, + curve: TwakeThemes.animationCurve, clipBehavior: Clip.hardEdge, decoration: const BoxDecoration(), child: Material( diff --git a/lib/pages/story/story_view.dart b/lib/pages/story/story_view.dart index e2f365448b..10ab49c3e2 100644 --- a/lib/pages/story/story_view.dart +++ b/lib/pages/story/story_view.dart @@ -251,8 +251,8 @@ class StoryView extends StatelessWidget { onHorizontalDragStart: controller.hold, onHorizontalDragEnd: controller.unhold, child: AnimatedContainer( - duration: FluffyThemes.animationDuration, - curve: FluffyThemes.animationCurve, + duration: TwakeThemes.animationDuration, + curve: TwakeThemes.animationCurve, padding: const EdgeInsets.symmetric( horizontal: 16.0, vertical: 80, diff --git a/lib/utils/adaptive_bottom_sheet.dart b/lib/utils/adaptive_bottom_sheet.dart index bfedb0950f..98676df50d 100644 --- a/lib/utils/adaptive_bottom_sheet.dart +++ b/lib/utils/adaptive_bottom_sheet.dart @@ -18,7 +18,7 @@ Future showAdaptiveBottomSheet({ isScrollControlled: isScrollControlled, constraints: BoxConstraints( maxHeight: MediaQuery.of(context).size.height - 128, - maxWidth: FluffyThemes.columnWidth * 1.5, + maxWidth: TwakeThemes.columnWidth * 1.5, ), clipBehavior: Clip.hardEdge, shape: const RoundedRectangleBorder( diff --git a/lib/widgets/connection_status_header.dart b/lib/widgets/connection_status_header.dart index 7d58b000fe..37f65155c7 100644 --- a/lib/widgets/connection_status_header.dart +++ b/lib/widgets/connection_status_header.dart @@ -43,8 +43,8 @@ class ConnectionStatusHeaderState extends State { client.prevBatch != null; return AnimatedContainer( - duration: FluffyThemes.animationDuration, - curve: FluffyThemes.animationCurve, + duration: TwakeThemes.animationDuration, + curve: TwakeThemes.animationCurve, height: hide ? 0 : 36, clipBehavior: Clip.hardEdge, decoration: BoxDecoration(color: Theme.of(context).colorScheme.surface), diff --git a/lib/widgets/layouts/login_scaffold.dart b/lib/widgets/layouts/login_scaffold.dart index 5731af590b..6be87b67e4 100644 --- a/lib/widgets/layouts/login_scaffold.dart +++ b/lib/widgets/layouts/login_scaffold.dart @@ -14,7 +14,7 @@ class LoginScaffold extends StatelessWidget { @override Widget build(BuildContext context) { - final isMobileMode = !FluffyThemes.isColumnMode(context); + final isMobileMode = !TwakeThemes.isColumnMode(context); final scaffold = Scaffold( backgroundColor: isMobileMode ? null : Colors.transparent, appBar: appBar == null diff --git a/lib/widgets/lock_screen.dart b/lib/widgets/lock_screen.dart index 2b5473f229..07d55f4052 100644 --- a/lib/widgets/lock_screen.dart +++ b/lib/widgets/lock_screen.dart @@ -25,8 +25,8 @@ class LockScreenState extends State { @override Widget build(BuildContext context) { return MaterialApp( - theme: FluffyThemes.buildTheme(Brightness.light), - darkTheme: FluffyThemes.buildTheme(Brightness.dark), + theme: TwakeThemes.buildTheme(Brightness.light), + darkTheme: TwakeThemes.buildTheme(Brightness.dark), localizationsDelegates: L10n.localizationsDelegates, supportedLocales: L10n.supportedLocales, home: Builder( diff --git a/lib/widgets/mxc_image.dart b/lib/widgets/mxc_image.dart index 6469ecad92..468d3711a4 100644 --- a/lib/widgets/mxc_image.dart +++ b/lib/widgets/mxc_image.dart @@ -50,7 +50,7 @@ class MxcImage extends StatefulWidget { this.animated = false, this.animationDuration = const Duration(milliseconds: 500), this.retryDuration = const Duration(seconds: 2), - this.animationCurve = FluffyThemes.animationCurve, + this.animationCurve = TwakeThemes.animationCurve, this.thumbnailMethod = ThumbnailMethod.scale, this.cacheKey, this.rounded = false, diff --git a/lib/widgets/twake_app.dart b/lib/widgets/twake_app.dart index b0785919d0..dc8ee73d70 100644 --- a/lib/widgets/twake_app.dart +++ b/lib/widgets/twake_app.dart @@ -67,8 +67,8 @@ class TwakeAppState extends State { title: AppConfig.applicationName, debugShowCheckedModeBanner: false, themeMode: themeMode, - theme: FluffyThemes.buildTheme(Brightness.light, primaryColor), - darkTheme: FluffyThemes.buildTheme(Brightness.light, primaryColor), + theme: TwakeThemes.buildTheme(Brightness.light, primaryColor), + darkTheme: TwakeThemes.buildTheme(Brightness.light, primaryColor), scrollBehavior: CustomScrollBehavior(), localizationsDelegates: L10n.localizationsDelegates, supportedLocales: L10n.supportedLocales, diff --git a/lib/widgets/twake_components/twake_fab/twake_fab_style.dart b/lib/widgets/twake_components/twake_fab/twake_fab_style.dart deleted file mode 100644 index fa28c47809..0000000000 --- a/lib/widgets/twake_components/twake_fab/twake_fab_style.dart +++ /dev/null @@ -1,43 +0,0 @@ -import 'package:flutter/material.dart'; - -class TwakeFabStyle { - static const double defaultSize = 28; - static const Color defaultPrimaryColor = Color(0xFF99A2AD); - - static const double notificationBubbleWidth = 25; - static const double notificationBubbleHeight = 20; - static const Color notificationBubbleBackgroundColor = Color(0xffff3347); - static const BorderRadiusGeometry notificationBubbleBorderRadius = - BorderRadius.all(Radius.circular(12)); - static const Color notificationBubbleBorderColorLightTheme = Colors.white; - static const Color notificationBubbleBorderColorDarkTheme = - Color.fromARGB(239, 36, 36, 36); - static BoxBorder notificationBubbleBorder(BuildContext context) { - return Border.all( - color: Theme.of(context).brightness == Brightness.light - ? notificationBubbleBorderColorLightTheme - : notificationBubbleBorderColorDarkTheme, - width: 1, - ); - } - - static const TextStyle notificationBubbleTextStyle = TextStyle( - fontFamily: 'Inter', - color: Colors.white, - fontSize: 10, - fontWeight: FontWeight.w500, - letterSpacing: 0.3, - ); - - static TextStyle buttonTextStyle(BuildContext context, bool isSelected) { - return TextStyle( - fontFamily: 'Inter', - color: isSelected - ? Theme.of(context).colorScheme.primary - : TwakeFabStyle.defaultPrimaryColor, - fontSize: 10, - fontWeight: FontWeight.w500, - letterSpacing: 0.3, - ); - } -} diff --git a/pubspec.lock b/pubspec.lock index 060e6c41aa..f0243f187f 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1163,6 +1163,14 @@ packages: url: "https://pub.dev" source: hosted version: "10.0.0" + google_fonts: + dependency: "direct main" + description: + name: google_fonts + sha256: "6b6f10f0ce3c42f6552d1c70d2c28d764cf22bb487f50f66cca31dcd5194f4d6" + url: "https://pub.dev" + source: hosted + version: "4.0.4" graphs: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index be77f5a1fa..e68f426715 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -154,6 +154,7 @@ dependencies: video_player: ^2.7.2 js: ^0.6.7 super_clipboard: ^0.6.4 + google_fonts: ^4.0.4 dev_dependencies: build_runner: ^2.3.3 dart_code_metrics: ^5.7.3 @@ -193,38 +194,7 @@ flutter: - assets/sounds/ - assets/js/ - assets/js/package/ - - fonts: - - family: Roboto - fonts: - - asset: fonts/Roboto/Roboto-Regular.ttf - - asset: fonts/Roboto/Roboto-Italic.ttf - style: italic - - asset: fonts/Roboto/Roboto-Bold.ttf - weight: 700 - - family: RobotoMono - fonts: - - asset: fonts/Roboto/RobotoMono-Regular.ttf - - family: Inter - fonts: - - asset: fonts/Inter/Inter-Thin.ttf - weight: 100 - - asset: fonts/Inter/Inter-ExtraLight.ttf - weight: 200 - - asset: fonts/Inter/Inter-Light.ttf - weight: 300 - - asset: fonts/Inter/Inter-Regular.ttf - weight: 400 - - asset: fonts/Inter/Inter-Medium.ttf - weight: 500 - - asset: fonts/Inter/Inter-SemiBold.ttf - weight: 600 - - asset: fonts/Inter/Inter-Bold.ttf - weight: 700 - - asset: fonts/Inter/Inter-ExtraBold.ttf - weight: 800 - - asset: fonts/Inter/Inter-Black.ttf - weight: 900 + - assets/google_fonts/ msix_config: display_name: Twake diff --git a/web/index.html b/web/index.html index b7127210af..da4d894d31 100644 --- a/web/index.html +++ b/web/index.html @@ -31,7 +31,7 @@ Twake - +