Skip to content

Commit

Permalink
fix: chat messaage color doesn't update when switching theme (AppFlow…
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasXu0 authored Jul 26, 2024
1 parent 29fb4af commit 043cd3f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,6 @@ class _AppFlowyEditorMarkdown extends StatefulWidget {

class _AppFlowyEditorMarkdownState extends State<_AppFlowyEditorMarkdown> {
late EditorState editorState;
late final styleCustomizer = EditorStyleCustomizer(
context: context,
padding: EdgeInsets.zero,
);
late final editorStyle = styleCustomizer.style().copyWith(
// hide the cursor
cursorColor: Colors.transparent,
cursorWidth: 0,
);
late EditorScrollController scrollController;

@override
Expand Down Expand Up @@ -99,6 +90,17 @@ class _AppFlowyEditorMarkdownState extends State<_AppFlowyEditorMarkdown> {

@override
Widget build(BuildContext context) {
// don't lazy load the styleCustomizer and blockBuilders,
// it needs the context to get the theme.
final styleCustomizer = EditorStyleCustomizer(
context: context,
padding: EdgeInsets.zero,
);
final editorStyle = styleCustomizer.style().copyWith(
// hide the cursor
cursorColor: Colors.transparent,
cursorWidth: 0,
);
final blockBuilders = getEditorBuilderMap(
context: context,
editorState: editorState,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import 'dart:convert';
import 'dart:io';

import 'package:flutter/material.dart';

import 'package:appflowy/core/helpers/url_launcher.dart';
import 'package:appflowy/generated/flowy_svgs.g.dart';
import 'package:appflowy/generated/locale_keys.g.dart';
Expand All @@ -16,6 +14,7 @@ import 'package:flowy_infra_ui/flowy_infra_ui.dart';
import 'package:flowy_infra_ui/style_widget/hover.dart';
import 'package:flowy_infra_ui/style_widget/snap_bar.dart';
import 'package:flowy_infra_ui/widget/flowy_tooltip.dart';
import 'package:flutter/material.dart';
import 'package:http/http.dart' as http;
import 'package:path/path.dart';

Expand Down Expand Up @@ -104,7 +103,7 @@ class InteractiveImageToolbar extends StatelessWidget {
),
AppFlowyPopover(
offset: const Offset(0, -8),
decoration: const BoxDecoration(color: Colors.transparent),
decorationColor: Colors.transparent,
direction: PopoverDirection.topWithCenterAligned,
constraints: const BoxConstraints(maxHeight: 50),
popupBuilder: (context) => _renderToolbarItems(
Expand Down

0 comments on commit 043cd3f

Please sign in to comment.