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/docs/adr/0003-improve-for-load-image-first-time.md b/docs/adr/0003-improve-for-load-image-first-time.md index 865f06cd06..7cfd6a043e 100644 --- a/docs/adr/0003-improve-for-load-image-first-time.md +++ b/docs/adr/0003-improve-for-load-image-first-time.md @@ -1,4 +1,4 @@ -# 1. Improve for load image first time and keep image when scrolling +# 3. Improve for load image first time and keep image when scrolling Date: 2023-06-27 diff --git a/docs/adr/0006-dom-exception-error-when-delete-disk-for-web.md b/docs/adr/0006-dom-exception-error-when-delete-disk-for-web.md index ea01007a69..83fb1cac93 100644 --- a/docs/adr/0006-dom-exception-error-when-delete-disk-for-web.md +++ b/docs/adr/0006-dom-exception-error-when-delete-disk-for-web.md @@ -1,4 +1,4 @@ -# 0006. DOMException error when use delete disk of Hive for Web +# 6. DOMException error when use delete disk of Hive for Web Date: 2023-09-13 diff --git a/docs/adr/0009-Instructions-for-naming-twake-events.md b/docs/adr/0009-Instructions-for-naming-twake-events.md index 8efe8737cf..754602a83a 100644 --- a/docs/adr/0009-Instructions-for-naming-twake-events.md +++ b/docs/adr/0009-Instructions-for-naming-twake-events.md @@ -1,4 +1,4 @@ -# 7. Instructions for naming twake events +# 9. Instructions for naming twake events Date: 2023-10-03 diff --git a/fonts/Roboto/LICENSE.txt b/fonts/Roboto/LICENSE.txt deleted file mode 100644 index 75b52484ea..0000000000 --- a/fonts/Roboto/LICENSE.txt +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/fonts/Roboto/Roboto-Black.ttf b/fonts/Roboto/Roboto-Black.ttf deleted file mode 100644 index 43a00e0df0..0000000000 Binary files a/fonts/Roboto/Roboto-Black.ttf and /dev/null differ diff --git a/fonts/Roboto/Roboto-BlackItalic.ttf b/fonts/Roboto/Roboto-BlackItalic.ttf deleted file mode 100644 index 5082cdc4e8..0000000000 Binary files a/fonts/Roboto/Roboto-BlackItalic.ttf and /dev/null differ diff --git a/fonts/Roboto/Roboto-Bold.ttf b/fonts/Roboto/Roboto-Bold.ttf deleted file mode 100644 index 3742457900..0000000000 Binary files a/fonts/Roboto/Roboto-Bold.ttf and /dev/null differ diff --git a/fonts/Roboto/Roboto-BoldItalic.ttf b/fonts/Roboto/Roboto-BoldItalic.ttf deleted file mode 100644 index e85e7fb9e3..0000000000 Binary files a/fonts/Roboto/Roboto-BoldItalic.ttf and /dev/null differ diff --git a/fonts/Roboto/Roboto-Italic.ttf b/fonts/Roboto/Roboto-Italic.ttf deleted file mode 100644 index c9df607a4d..0000000000 Binary files a/fonts/Roboto/Roboto-Italic.ttf and /dev/null differ diff --git a/fonts/Roboto/Roboto-Light.ttf b/fonts/Roboto/Roboto-Light.ttf deleted file mode 100644 index 0e977514ff..0000000000 Binary files a/fonts/Roboto/Roboto-Light.ttf and /dev/null differ diff --git a/fonts/Roboto/Roboto-LightItalic.ttf b/fonts/Roboto/Roboto-LightItalic.ttf deleted file mode 100644 index 3ad14fa7c4..0000000000 Binary files a/fonts/Roboto/Roboto-LightItalic.ttf and /dev/null differ diff --git a/fonts/Roboto/Roboto-Medium.ttf b/fonts/Roboto/Roboto-Medium.ttf deleted file mode 100644 index e89b0b79a2..0000000000 Binary files a/fonts/Roboto/Roboto-Medium.ttf and /dev/null differ diff --git a/fonts/Roboto/Roboto-MediumItalic.ttf b/fonts/Roboto/Roboto-MediumItalic.ttf deleted file mode 100644 index a5a41d3d00..0000000000 Binary files a/fonts/Roboto/Roboto-MediumItalic.ttf and /dev/null differ diff --git a/fonts/Roboto/Roboto-Regular.ttf b/fonts/Roboto/Roboto-Regular.ttf deleted file mode 100644 index 3d6861b423..0000000000 Binary files a/fonts/Roboto/Roboto-Regular.ttf and /dev/null differ diff --git a/fonts/Roboto/Roboto-Thin.ttf b/fonts/Roboto/Roboto-Thin.ttf deleted file mode 100644 index 7d084aed88..0000000000 Binary files a/fonts/Roboto/Roboto-Thin.ttf and /dev/null differ diff --git a/fonts/Roboto/Roboto-ThinItalic.ttf b/fonts/Roboto/Roboto-ThinItalic.ttf deleted file mode 100644 index c17338960c..0000000000 Binary files a/fonts/Roboto/Roboto-ThinItalic.ttf and /dev/null differ diff --git a/fonts/Roboto/RobotoMono-Regular.ttf b/fonts/Roboto/RobotoMono-Regular.ttf deleted file mode 100644 index d9371a1bd8..0000000000 Binary files a/fonts/Roboto/RobotoMono-Regular.ttf and /dev/null differ diff --git a/lib/config/themes.dart b/lib/config/themes.dart index a796e600f1..c0b1c14113 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, ), diff --git a/lib/pages/bootstrap/bootstrap_dialog.dart b/lib/pages/bootstrap/bootstrap_dialog.dart index d5b8772d83..51dedae37c 100644 --- a/lib/pages/bootstrap/bootstrap_dialog.dart +++ b/lib/pages/bootstrap/bootstrap_dialog.dart @@ -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'; @@ -117,7 +118,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: [ @@ -140,7 +141,7 @@ class BootstrapDialogState extends State { 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), @@ -244,7 +245,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), @@ -270,7 +271,7 @@ class BootstrapDialogState extends State { ? null : [AutofillHints.password], controller: _recoveryKeyTextEditingController, - style: const TextStyle(fontFamily: 'RobotoMono'), + style: GoogleFonts.robotoMono(), decoration: InputDecoration( contentPadding: const EdgeInsets.all(16), hintStyle: TextStyle( 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_encryption_settings/chat_encryption_settings_view.dart b/lib/pages/chat_encryption_settings/chat_encryption_settings_view.dart index 891e91db15..5d9d739fa2 100644 --- a/lib/pages/chat_encryption_settings/chat_encryption_settings_view.dart +++ b/lib/pages/chat_encryption_settings/chat_encryption_settings_view.dart @@ -2,6 +2,7 @@ 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'; @@ -168,7 +169,7 @@ class ChatEncryptionSettingsView extends StatelessWidget { deviceKeys[i].ed25519Key?.beautified ?? L10n.of(context)!.unknownEncryptionAlgorithm, style: TextStyle( - fontFamily: 'RobotoMono', + fontFamily: GoogleFonts.robotoMono().fontFamily, color: Theme.of(context).colorScheme.secondary, ), ), 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 - +