diff --git a/src/kaiteki/lib/ui/shared/posts/interaction_event_bar.dart b/src/kaiteki/lib/ui/shared/posts/interaction_event_bar.dart index 95b6c808..fba08824 100644 --- a/src/kaiteki/lib/ui/shared/posts/interaction_event_bar.dart +++ b/src/kaiteki/lib/ui/shared/posts/interaction_event_bar.dart @@ -1,9 +1,9 @@ import "package:flutter/material.dart"; import "package:kaiteki/di.dart"; -import "package:kaiteki/ui/shared/common.dart"; import "package:kaiteki/ui/shared/posts/avatar_widget.dart"; import "package:kaiteki/utils/extensions.dart"; import "package:kaiteki_core/model.dart"; +import "package:kaiteki_core/utils.dart"; /// A row that details an interaction for use in timelines class InteractionEventBar extends ConsumerWidget { @@ -43,7 +43,10 @@ class InteractionEventBar extends ConsumerWidget { WidgetSpan( child: Icon( icon, - size: getLocalFontSize(context) * 1.25, + size: DefaultTextStyle.of(context) + .style + .fontSize + .nullTransform((size) => size * 1.25), color: color, ), ), diff --git a/src/kaiteki/lib/ui/shared/posts/reply_bar.dart b/src/kaiteki/lib/ui/shared/posts/reply_bar.dart index d8dda04e..5ae1cef9 100644 --- a/src/kaiteki/lib/ui/shared/posts/reply_bar.dart +++ b/src/kaiteki/lib/ui/shared/posts/reply_bar.dart @@ -2,10 +2,10 @@ import "package:flutter/material.dart"; import "package:kaiteki/di.dart"; import "package:kaiteki/fediverse/user_resolver.dart"; import "package:kaiteki/theming/text_theme.dart"; -import "package:kaiteki/ui/shared/common.dart"; import "package:kaiteki/ui/shared/posts/post_widget.dart"; import "package:kaiteki/utils/extensions.dart"; import "package:kaiteki_core/model.dart"; +import "package:kaiteki_core/utils.dart"; class ReplyBar extends ConsumerWidget { const ReplyBar({ @@ -56,7 +56,10 @@ class ReplyBar extends ConsumerWidget { textDirection: Directionality.of(context).inverted, child: Icon( Icons.reply_rounded, - size: getLocalFontSize(context) * 1.25, + size: DefaultTextStyle.of(context) + .style + .fontSize + .nullTransform((size) => size * 1.25), color: disabledColor, ), ), diff --git a/src/kaiteki_ui/lib/kaiteki_ui.dart b/src/kaiteki_ui/lib/kaiteki_ui.dart index a4fd59af..b04fce23 100644 --- a/src/kaiteki_ui/lib/kaiteki_ui.dart +++ b/src/kaiteki_ui/lib/kaiteki_ui.dart @@ -13,14 +13,6 @@ export 'src/utils/margined_rounded_rectangle_border.dart'; export 'src/utils/margined_stadium_border.dart'; export 'src/utils/text_inherited_icon_theme.dart'; -double getLocalFontSize(BuildContext context) { - return DefaultTextStyle.of(context).style.fontSize!; -} - -Color getLocalTextColor(BuildContext context) { - return DefaultTextStyle.of(context).style.color!; -} - TextStyle getSubheaderTextStyle(ThemeData theme) { final labelLarge = theme.textTheme.labelLarge; final primary = theme.colorScheme.primary;