Skip to content

Commit

Permalink
Fallback to system emoji on windows (#94)
Browse files Browse the repository at this point in the history
  • Loading branch information
Airyzz authored Sep 28, 2023
1 parent f2b3ca0 commit 9f69a41
Show file tree
Hide file tree
Showing 6 changed files with 235 additions and 227 deletions.
1 change: 1 addition & 0 deletions tiamat/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ migrate_working_dir/
.pub-cache/
.pub/
/build/
*.g.dart

# Symbolication related
app.*.symbols
Expand Down
4 changes: 3 additions & 1 deletion tiamat/lib/config/style/theme_dark.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'dart:ui';

import 'package:flutter/material.dart';
import 'package:tiamat/config/style/theme_extensions.dart';
import 'dart:io' show Platform;

class ThemeDarkColors {
static const Color surfaceHigh1 = Color.fromARGB(255, 47, 51, 55);
Expand All @@ -21,7 +22,8 @@ class ThemeDark {
static ThemeData get theme => ThemeData(
brightness: Brightness.dark,
fontFamily: "RobotoCustom",
fontFamilyFallback: const ["EmojiFont"],
// Windows doesnt support the type of font we use :(
fontFamilyFallback: Platform.isWindows ? null : const ["EmojiFont"],
useMaterial3: true,
extensions: const <ThemeExtension<dynamic>>[
ExtraColors(
Expand Down
4 changes: 3 additions & 1 deletion tiamat/lib/config/style/theme_light.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'package:tiamat/config/style/theme_extensions.dart';
import 'package:flutter/material.dart';
import 'dart:io' show Platform;

class ThemeLightColors {
static const Color surfaceHigh1 = Color.fromARGB(255, 245, 245, 245);
Expand All @@ -20,7 +21,8 @@ class ThemeLight {
brightness: Brightness.light,
useMaterial3: true,
fontFamily: "RobotoCustom",
fontFamilyFallback: const ["EmojiFont"],
// Windows doesnt support the type of font we use :(
fontFamilyFallback: Platform.isWindows ? null : const ["EmojiFont"],
extensions: const <ThemeExtension<dynamic>>[
ExtraColors(
surfaceHigh1: ThemeLightColors.surfaceHigh1,
Expand Down
11 changes: 4 additions & 7 deletions tiamat/lib/widgetbook.dart
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
import 'package:flutter/material.dart';
import 'package:tiamat/config/style/theme_dark.dart';
import 'package:tiamat/config/style/theme_light.dart';
import 'package:widgetbook/widgetbook.dart';
import 'package:widgetbook_annotation/widgetbook_annotation.dart' as widgetbook;

import 'dart:io' show Platform;
// Import the generated directories variable
import 'widgetbook.directories.g.dart';

import 'package:flutter/material.dart';
import 'package:tiamat/config/style/theme_dark.dart';
import 'package:tiamat/config/style/theme_glass.dart';
import 'package:tiamat/config/style/theme_light.dart';
import 'package:widgetbook_annotation/widgetbook_annotation.dart';

void main() {
runApp(WidgetbookApp());
}
Expand Down
Loading

0 comments on commit 9f69a41

Please sign in to comment.