mirror of
				https://github.com/AppFlowy-IO/AppFlowy.git
				synced 2025-11-04 03:54:44 +00:00 
			
		
		
		
	* chore: add more logs in reminder bloc * Revert "chore: add more logs in reminder bloc" This reverts commit 9d0bb8fb2963d24cc572754c2f9411cebfa69f98. * chore: add more logs in reminder bloc * fix: unable to view reminders on Desktop * fix: force refresh reminders * chore: fix flutter analyze * feat: support database reminder on Mobile * chore: remove referenced database padding
		
			
				
	
	
		
			51 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			Dart
		
	
	
	
	
	
			
		
		
	
	
			51 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			Dart
		
	
	
	
	
	
import 'package:appflowy/workspace/application/settings/appearance/base_appearance.dart';
 | 
						|
import 'package:flutter/material.dart';
 | 
						|
import 'package:google_fonts/google_fonts.dart';
 | 
						|
 | 
						|
const _defaultFontFamilies = [
 | 
						|
  defaultFontFamily,
 | 
						|
  builtInCodeFontFamily,
 | 
						|
];
 | 
						|
 | 
						|
// if the font family is not available, google fonts packages will throw an exception
 | 
						|
// this method will return the system font family if the font family is not available
 | 
						|
TextStyle getGoogleFontSafely(
 | 
						|
  String fontFamily, {
 | 
						|
  FontWeight? fontWeight,
 | 
						|
  double? fontSize,
 | 
						|
  Color? fontColor,
 | 
						|
  double? letterSpacing,
 | 
						|
  double? lineHeight,
 | 
						|
}) {
 | 
						|
  // if the font family is the built-in font family, we can use it directly
 | 
						|
  if (_defaultFontFamilies.contains(fontFamily)) {
 | 
						|
    return TextStyle(
 | 
						|
      fontFamily: fontFamily.isEmpty ? null : fontFamily,
 | 
						|
      fontWeight: fontWeight,
 | 
						|
      fontSize: fontSize,
 | 
						|
      color: fontColor,
 | 
						|
      letterSpacing: letterSpacing,
 | 
						|
      height: lineHeight,
 | 
						|
    );
 | 
						|
  } else {
 | 
						|
    try {
 | 
						|
      return GoogleFonts.getFont(
 | 
						|
        fontFamily,
 | 
						|
        fontWeight: fontWeight,
 | 
						|
        fontSize: fontSize,
 | 
						|
        color: fontColor,
 | 
						|
        letterSpacing: letterSpacing,
 | 
						|
        height: lineHeight,
 | 
						|
      );
 | 
						|
    } catch (_) {}
 | 
						|
  }
 | 
						|
 | 
						|
  return TextStyle(
 | 
						|
    fontWeight: fontWeight,
 | 
						|
    fontSize: fontSize,
 | 
						|
    color: fontColor,
 | 
						|
    letterSpacing: letterSpacing,
 | 
						|
    height: lineHeight,
 | 
						|
  );
 | 
						|
}
 |