Skip to content

Commit

Permalink
fix: use default emoji font family on iOS
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasXu0 committed May 30, 2024
1 parent 9217b74 commit 90a45df
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,9 @@ class MobileViewCard extends StatelessWidget {
Widget _buildTitle(BuildContext context, RecentViewState state) {
final name = state.name;
final icon = state.icon;
final fontFamily = Platform.isAndroid || Platform.isLinux
? GoogleFonts.notoColorEmoji().fontFamily
: null;
return RichText(
maxLines: 3,
overflow: TextOverflow.ellipsis,
Expand All @@ -164,10 +167,10 @@ class MobileViewCard extends StatelessWidget {
style: Theme.of(context).textTheme.bodyMedium!.copyWith(
fontSize: 17.0,
fontWeight: FontWeight.w600,
fontFamily: GoogleFonts.notoColorEmoji().fontFamily,
fontFamily: fontFamily,
),
),
const TextSpan(text: ' '),
if (icon.isNotEmpty) const WidgetSpan(child: HSpace(2.0)),
TextSpan(
text: name,
style: Theme.of(context).textTheme.bodyMedium!.copyWith(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ class FlowyText extends StatelessWidget {

var fontFamily = this.fontFamily;
var fallbackFontFamily = this.fallbackFontFamily;
if (isEmoji) {
if (isEmoji && (Platform.isLinux || Platform.isAndroid)) {
fontFamily = _loadEmojiFontFamilyIfNeeded();
if (fontFamily != null && fallbackFontFamily == null) {
fallbackFontFamily = [fontFamily];
Expand Down

0 comments on commit 90a45df

Please sign in to comment.