flutter-code-editor icon indicating copy to clipboard operation
flutter-code-editor copied to clipboard

ScrollController not attached to any scroll views.

Open zakstam opened this issue 2 years ago • 7 comments
trafficstars

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

zakstam avatar Mar 15 '23 11:03 zakstam

Any ways to fix this?

gravewhisper avatar Jun 23 '23 13:06 gravewhisper

add maxLines: null to CodeField

yevyevyev avatar Jul 23 '23 21:07 yevyevyev

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

Any one found any Fix?

ksb2311 avatar Aug 04 '23 16:08 ksb2311

i have the same issue

justin-prabhakaran avatar Aug 12 '23 19:08 justin-prabhakaran

well checking in again, did anyone find a fix?

gravewhisper avatar Oct 06 '23 03:10 gravewhisper

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

gravewhisper avatar Oct 11 '23 04:10 gravewhisper

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 
]
)

bivu029 avatar Jan 31 '24 04:01 bivu029