You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please let me know how to designate a route or if there is a link related to it. I've been searching for a few days, but I can't find it. I'm going crazy because Gpt keeps telling me the error code
SingleChildScrollView( scrollDirection: Axis.horizontal, child: quill.QuillToolbar.simple( controller: _controller, configurations: quill.QuillSimpleToolbarConfigurations( sharedConfigurations: const quill.QuillSharedConfigurations( locale: Locale('ko'), ), embedButtons: FlutterQuillEmbeds.toolbarButtons(), // 기본 Embeds ), ), ), Container( height: 300, padding: const EdgeInsets.all(10), decoration: BoxDecoration( border: Border.all(color: Colors.grey), ), child: quill.QuillEditor( controller: _controller, scrollController: ScrollController(), configurations: quill.QuillEditorConfigurations( placeholder: "본문에 내용을 입력하세요", scrollable: true, autoFocus: true, expands: true, enableInteractiveSelection: true, // ✨ readOnly 대체 옵션 readOnlyMouseCursor: SystemMouseCursors.click, // 읽기 전용 시 커서 변경 padding: EdgeInsets.zero, textSelectionThemeData: TextSelectionThemeData( cursorColor: Colors.purple, // 커서 색상을 보라색으로 설정 selectionColor: Colors.purple.withOpacity(0.5), // 선택 영역의 색상 설정 (필요에 따라) selectionHandleColor: Colors.purple, // 선택 핸들 색상 설정 (필요에 따라) ), embedBuilders: kIsWeb ? FlutterQuillEmbeds.editorWebBuilders() : FlutterQuillEmbeds.editorBuilders(), ), focusNode: FocusNode(), ), ),
ElevatedButton(
onPressed: _pickAndUploadImage,
child: Text("이미지 추"),
),
const SizedBox(height: 16),
/// ✅ 이미지 선택 후 서버 업로드
Future _pickAndUploadImage() async {
final pickedFile = await _picker.pickImage(source: ImageSource.gallery);
if (pickedFile == null) return;
String imageUrl = await _uploadImage(File(pickedFile.path));
if (imageUrl.isNotEmpty) {
// ✅ 이미지 업로드 후 에디터에 삽입
final index = _controller.selection.baseOffset;
final imageBlock = quill.BlockEmbed.image(imageUrl);
_controller.document.insert(index, imageBlock);
}
}
/// ✅ 서버로 이미지 업로드 후 URL 반환
Future _uploadImage(File file) async {
try {
var request = http.MultipartRequest(
'POST',
Uri.parse('https://api.cosmosx.co.kr/upload'), // 🔹 서버 URL 변경
);
request.files.add(await http.MultipartFile.fromPath('image', file.path));
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Please let me know how to designate a route or if there is a link related to it. I've been searching for a few days, but I can't find it. I'm going crazy because Gpt keeps telling me the error code
SingleChildScrollView( scrollDirection: Axis.horizontal, child: quill.QuillToolbar.simple( controller: _controller, configurations: quill.QuillSimpleToolbarConfigurations( sharedConfigurations: const quill.QuillSharedConfigurations( locale: Locale('ko'), ), embedButtons: FlutterQuillEmbeds.toolbarButtons(), // 기본 Embeds ), ), ), Container( height: 300, padding: const EdgeInsets.all(10), decoration: BoxDecoration( border: Border.all(color: Colors.grey), ), child: quill.QuillEditor( controller: _controller, scrollController: ScrollController(), configurations: quill.QuillEditorConfigurations( placeholder: "본문에 내용을 입력하세요", scrollable: true, autoFocus: true, expands: true, enableInteractiveSelection: true, // ✨ readOnly 대체 옵션 readOnlyMouseCursor: SystemMouseCursors.click, // 읽기 전용 시 커서 변경 padding: EdgeInsets.zero, textSelectionThemeData: TextSelectionThemeData( cursorColor: Colors.purple, // 커서 색상을 보라색으로 설정 selectionColor: Colors.purple.withOpacity(0.5), // 선택 영역의 색상 설정 (필요에 따라) selectionHandleColor: Colors.purple, // 선택 핸들 색상 설정 (필요에 따라) ), embedBuilders: kIsWeb ? FlutterQuillEmbeds.editorWebBuilders() : FlutterQuillEmbeds.editorBuilders(), ), focusNode: FocusNode(), ), ),
Future _pickAndUploadImage() async {
final pickedFile = await _picker.pickImage(source: ImageSource.gallery);
if (pickedFile == null) return;
}
/// ✅ 서버로 이미지 업로드 후 URL 반환
Future _uploadImage(File file) async {
try {
var request = http.MultipartRequest(
'POST',
Uri.parse('https://api.cosmosx.co.kr/upload'), // 🔹 서버 URL 변경
);
request.files.add(await http.MultipartFile.fromPath('image', file.path));
}
`
Beta Was this translation helpful? Give feedback.
All reactions