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.
https://akvelon.com
Apache License 2.0
197 stars 47 forks source link

ScrollController not attached to any scroll views. #201

Open zaksnet opened 1 year ago

zaksnet commented 1 year ago

I get the following error when running the project: ScrollController not attached to any scroll views. I am using the code_field project

Flutter 3.7.7 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 2ad6cd72c0 (7 days ago) • 2023-03-08 09:41:59 -0800
Engine • revision 1837b5be5f
Tools • Dart 2.19.4 • DevTools 2.20.1
flutter_code_editor: ^0.2.13
OS: Windows 11

EDIT: I did try this with Flutter Beta channel also before downgrading to the stable channel and i was receiving the same error EDIT: This only seems to happen when using a Codefield and not when using a TextField

sagexfors commented 1 year ago

Any ways to fix this?

yevyevyev commented 1 year ago

add maxLines: null to CodeField

ksb2311 commented 1 year ago

CodeTheme( data: CodeThemeData(styles: monokaiSublimeTheme), child: SingleChildScrollView( child: CodeField(controller: _controller, maxLines: null), ), )

Any one found any Fix?

justin-prabhakaran commented 1 year ago

i have the same issue

sagexfors commented 11 months ago

well checking in again, did anyone find a fix?

sagexfors commented 11 months ago

for some reason i integrated this to my small app and it didn't give any error weird.

bivu029 commented 7 months ago

well u can use listview --- it works in my case--code

column(
 children:[
Flexible(
            flex: 2,
            child: CodeTheme(
              data: CodeThemeData(
                  styles:
                      monokaiSublimeTheme), // <= Pre-defined in flutter_highlight.
              child: ListView(
                children: [
                  CodeField(   
                  minLines: 30,
                    controller: controller,
                    gutterStyle: const GutterStyle(),
                    wrap: true,
                  ),
                ],
              ),
            ),
          ), //flexible 
]
)