fluffychat/lib/pangea/utils/bot_style.dart
ggurdin 9ecf4e3bd2
fix: fix dart formatting for CI (#1368)
* fix: fix dart formatting for CI

* fix: sorted imports, updated deprecated flutter functions

* fix: format files

* fix: format files

* feat: replace syncfusion flutter package with excel flutter package

* fix: don't run enable google services patch in CI

* fix: update iOS supported platforms for enable ios build script

* fix: commented out linux build in integrate CI
2025-01-07 08:32:42 -05:00

37 lines
1,020 B
Dart

import 'package:flutter/material.dart';
import 'package:fluffychat/config/app_config.dart';
import 'package:fluffychat/pangea/utils/error_handler.dart';
class BotStyle {
static TextStyle text(
BuildContext context, {
TextStyle? existingStyle,
bool setColor = true,
bool big = false,
bool italics = false,
bool bold = false,
}) {
try {
final TextStyle botStyle = TextStyle(
fontWeight: bold ? FontWeight.w700 : null,
fontSize: AppConfig.messageFontSize *
AppConfig.fontSizeFactor *
(big == true ? 1.2 : 1),
fontStyle: italics ? FontStyle.italic : null,
color: setColor ? Theme.of(context).colorScheme.primary : null,
inherit: true,
height: 1.3,
);
return existingStyle?.merge(botStyle) ?? botStyle;
} catch (err, stack) {
ErrorHandler.logError(
m: "error getting styles",
s: stack,
data: {},
);
return existingStyle ?? const TextStyle();
}
}
}