Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Inherited theme can break the styling of the hyperlink menu #198

Open
andrew-moreno opened this issue Jun 17, 2024 · 0 comments
Open

Comments

@andrew-moreno
Copy link

andrew-moreno commented Jun 17, 2024

Describe the bug
Applying certain inputDecorationTheme styles to the app's theme can break the styling in the hyperlink menu.

Example
Applying the following styles to the inputDecorationTheme will display the hyperlink menu in the following way.

enabledBorder: OutlineInputBorder(),
isDense: true,
constraints: BoxConstraints(minHeight: 40),
filled: true,
fillColor: Colors.white,

image

Flutter Doctor

[✓] Flutter (Channel stable, 3.22.1, on macOS 14.4.1 23E224 darwin-arm64, locale en-CA)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 15.0)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2022.3)
[✓] VS Code (version 1.90.1)
[✓] Connected device (3 available)
[✓] Network resources

Code to reproduce

import 'package:flutter/material.dart';
import 'package:quill_html_editor/quill_html_editor.dart';

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

class MyApp extends StatefulWidget {
  const MyApp({super.key});

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  late QuillEditorController controller;

  @override
  void initState() {
    controller = QuillEditorController();

    super.initState();
  }

  @override
  void dispose() {
    /// please do not forget to dispose the controller
    controller.dispose();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return SafeArea(
      child: MaterialApp(
        theme: ThemeData(
          inputDecorationTheme: const InputDecorationTheme(
            enabledBorder: OutlineInputBorder(),
            isDense: true,
            constraints: BoxConstraints(minHeight: 40),
            filled: true,
            fillColor: Colors.white,
          ),
        ),
        home: Scaffold(
          body: Column(
            children: [
              ToolBar(controller: controller),
              Expanded(
                child: QuillHtmlEditor(
                  controller: controller,
                  minHeight: 500,
                  loadingBuilder: (context) {
                    return const Center(
                      child: CircularProgressIndicator(
                        strokeWidth: 1,
                        color: Colors.red,
                      ),
                    );
                  },
                ),
              ),
            ],
          ),
        ),
      ),
    );
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant