the-airbender / quill_html_editor

HTML rich text editor for Android, iOS, and Web, using the QuillJS library. QuillJS is a free, open source WYSIWYG editor built for the modern web.
https://pub.dev/packages/quill_html_editor
MIT License
94 stars 88 forks source link

[BUG] flutter web: callback OnCreatedEditor and OnEditorLoaded not working when deploy on firebase hosting #125

Open Mo8 opened 1 year ago

Mo8 commented 1 year ago

Hi same problem as @rakib205 in #68 , setText in flutter run --debug and flutter run --release is okay with onEditorCreated and onEditorLoaded callback but on deployement on firebase hosting not working ( i think the editor never load completly , i tried to print and nothing in callback and in the WebViewX onPageFinished callback )

on chrome

[√] Flutter (Channel stable, 3.13.0, on Microsoft Windows [version 10.0.19045.3324], locale fr-FR) [√] Windows Version (Installed version of Windows is version 10 or higher) [√] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1) [√] Chrome - develop for the web [√] Visual Studio - develop Windows apps (Visual Studio Community 2019 16.11.21) [√] Android Studio (version 2021.2) [√] IntelliJ IDEA Community Edition (version 2021.3) [√] VS Code (version 1.81.1) [√] Connected device (3 available) [√] Network resources


import 'package:quill_html_editor/quill_html_editor.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}
class _MyHomePageState extends State<MyHomePage> {
  final controller = QuillEditorController();

  @override
  void initState() {
    controller.onEditorLoaded(() {
      Future.delayed(const Duration(seconds: 2), () {
        print("hi hi");
        controller.setText('Hello World');
      });
    });
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Center(
        child: Column(
          children: [
            ToolBar(controller: controller),
            QuillHtmlEditor(
              controller: controller,
              minHeight: 400,
              onEditorCreated: () {
                Future.delayed(
                  const Duration(seconds: 2),
                  () {
                    print("hi");
                    controller.setText('Hello World');
                  },
                );
              },
            ),
          ],
        ),
      ),
    );
  }
}```
Mo8 commented 1 year ago

waiting for other test maybe not a bug

Mo8 commented 1 year ago

Okay i tried to access on chrome private navigator and it work well, and on edge also. So i dont understand why not in normal chrome navigator Here on normal chrome image

here on edge image

here on chrome private image

on private firefox ( installed for testing ) image