akvelon / flutter-code-editor

Flutter Code Editor is a multi-platform code editor supporting syntax highlighting, code blocks folding, autocompletion, read-only code blocks, hiding specific code blocks, themes, and more.

Home Page:https://akvelon.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Hint Text Show in Wrong Direction .

flutterDeveloperAoeonx opened this issue · comments

i facing issue with this sample code ,

import 'package:flutter_code_editor/flutter_code_editor.dart';
import 'package:flutter_highlight/themes/dark.dart';
import 'package:flutter_highlight/themes/default.dart';
import 'package:flutter_highlight/themes/monokai-sublime.dart';
import 'package:highlight/languages/dart.dart';

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

class MyApp extends StatelessWidget {
  const MyApp({super.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 MyHomePage extends StatefulWidget {
  const MyHomePage({super.key, required this.title});

  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  final _codeFieldFocusNode = FocusNode();
  final controller = CodeController(
    text: '...', // Initial code
    language: dart,
    analyzer: DartPadAnalyzer(),
  );
  int _counter = 0;

  void _incrementCounter() {
    setState(() {
      _counter++;
    });
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: SingleChildScrollView(
        child: CodeTheme(
          data: CodeThemeData(styles: darkTheme),
          child: SingleChildScrollView(
            child: Column(
              children: [
                Row(
                  children: [
                    SizedBox(
                      width: MediaQuery.of(context).size.width * 0.5,
                      child: Center(child: Text("nothing in this box ")),
                    ),
                    SizedBox(
                      width: MediaQuery.of(context).size.width * 0.5,
                      height: MediaQuery.of(context).size.height,
                      child: CodeField(
                        focusNode: _codeFieldFocusNode,
                        controller: controller,
                        textStyle: const TextStyle(fontFamily: 'SourceCode'),
                        cursorColor: Colors.red,
                        background: Colors.black,
                        enabled: true,
                        expands: true,
                        readOnly: false,
                        textSelectionTheme: TextSelectionThemeData(
                          cursorColor: Colors.red,
                          selectionColor: Colors.grey,
                          selectionHandleColor: Colors.red,
                        ),
                        gutterStyle: GutterStyle(
                          textStyle: const TextStyle(
                            color: Colors.white,
                          ),
                          showLineNumbers: true,
                          showErrors: true,
                          showFoldingHandles: true,
                        ),
                        wrap: true,
                      ),
                    ),
                  ],
                ),
              ],
            ),
          ),
        ),
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: _incrementCounter,
        tooltip: 'Increment',
        child: const Icon(Icons.add),
      ), // This trailing comma makes auto-formatting nicer for build methods.
    );
  }
}

this is my code and i am facing this issue as show in below image ,

Screenshot 2023-04-18 at 1 28 24 PM

code editor in right side but in it's show in left side ,

please provide me solution due to this i am stucked .

Thank You ...!

commented

Thanks for filing this issue @flutterDeveloperAoeonx
We are currently refactoring the suggestions and will take into account this bug as well.

@Malarg looks like this is caused by the overlay migration. Can you check the cause please? Even though we are extracting this to a separate widget, the calculation will likely stay the same.

Thanks for reply @yescorp and @alexeyinkin ...!

hope this will fixed as soon as possible .