Skip to content

Commit

Permalink
chore: fix spelling issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Gambley1 committed Apr 15, 2024
1 parent 497ff9b commit 317dbc2
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 20 deletions.
3 changes: 2 additions & 1 deletion .vscode/cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,8 @@
"giffy",
"giphy",
"ccon",
"nodoc"
"nodoc",
"ChildLayouter"
],
"ignorePaths": [
".github/workflows/**",
Expand Down
5 changes: 1 addition & 4 deletions lib/chats/chat/widgets/message/chat_message_factory.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,13 @@ class ChatMessageFactory {

Widget createChatNotificationFromText({
required BuildContext context,
required RichableText text,
required CustomRichText text,
}) {
return _Notification(
// TODOwrap to DefaultTextStyle for custom emoji
text: text.toInlineSpan(context),
);
}

// TODOmove to another class for message parts
Widget createChatNotificationBubble({required InlineSpan span}) =>
_Notification(text: span);

Expand All @@ -35,7 +33,6 @@ class ChatMessageFactory {
child: Container(
padding: const EdgeInsets.only(top: 3, bottom: 3, left: 6, right: 6),
decoration: BoxDecoration(
// TODOextract color to styles
color: Colors.black.withAlpha(60),
borderRadius: const BorderRadius.all(Radius.circular(16)),
),
Expand Down
2 changes: 1 addition & 1 deletion lib/chats/chat/widgets/message/message_caption.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class MessageCaption extends StatelessWidget {
this.padding,
});

final s.RichableText text;
final s.CustomRichText text;
final Widget shortInfo;
final EdgeInsets? padding;

Expand Down
4 changes: 0 additions & 4 deletions lib/chats/chat/widgets/message/message_content.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,8 @@ class _ContentRenderBox extends RenderBox
final constraints = this.constraints;
final width = _computeWidth(
constraints: constraints,
// TODOreplace by dryLayoutChild, need implement computeDryLayout
// in MessageSkeleton
layoutChild: ChildLayoutHelper.layoutChild,
);
// TODOconstraints.minHeight,
// maybe using calculated height from _computeWidth?
size = Size(width, constraints.minHeight);
_layout(constraints.copyWith(maxWidth: width));
}
Expand Down
6 changes: 2 additions & 4 deletions lib/chats/chat/widgets/message/message_text.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,12 @@ import 'package:shared/shared.dart' as s;
class MessageText extends StatelessWidget {
const MessageText({required this.text, required this.shortInfo, super.key});

final s.RichableText text;
final s.CustomRichText text;
final Widget shortInfo;

@override
Widget build(BuildContext context) {
return MessageWrap(
// TODOwrap to DefaultTextStyle for custom emoji
wrapGravity: WrapGravity.top,
content: Text.rich(text.toInlineSpan(context)),
shortInfo: Padding(
Expand All @@ -24,11 +23,10 @@ class MessageText extends StatelessWidget {
}
}

extension RichTextExt on s.RichableText {
extension RichTextExt on s.CustomRichText {
InlineSpan toInlineSpan(BuildContext context) {
return TextSpan(
children: entities.map((s.Entity e) {
// TODOsupport multiple types
return e.types.first.map(
planeText: (_) {
return TextSpan(text: e.text);
Expand Down
2 changes: 1 addition & 1 deletion lib/chats/chat/widgets/message_wrap_showcase_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class MessageAnimation extends StatelessWidget {
right: chatContextData.horizontalPadding,
top: chatContextData.verticalPadding,
),
text: RichableText.planeText(
text: CustomRichText.planeText(
'Hi fa fe fa fa f',
),
shortInfo: shortInfoFactory.create(
Expand Down
2 changes: 1 addition & 1 deletion lib/feed/post/widgets/post_popup.dart
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ class _PostPopupState extends State<PopupModal>
valueListenable: _isLiked,
child: RepaintBoundary(
key: ValueKey(
'${widget.block.id}${widget.block.createdAt}repaintBoundry',
'${widget.block.id}${widget.block.createdAt}-repaintBoundary',
),
child: widget.builder.call(context),
),
Expand Down
8 changes: 4 additions & 4 deletions packages/shared/lib/src/models/rich_text.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
import 'package:shared/src/models/entity.dart';
import 'package:shared/src/models/type.dart' as t;

class RichableText {
const RichableText({
class CustomRichText {
const CustomRichText({
required this.entities,
});

factory RichableText.planeText(String text) {
return RichableText(
factory CustomRichText.planeText(String text) {
return CustomRichText(
entities: <Entity>[
Entity(text: text, types: <t.Type>[const t.Type.planeText()]),
],
Expand Down

0 comments on commit 317dbc2

Please sign in to comment.