From 067abee4377e0a9f44660400f219b8e8391b9183 Mon Sep 17 00:00:00 2001 From: kit Date: Mon, 9 Sep 2024 10:26:22 +0700 Subject: [PATCH] update deprecated --- example/lib/basic.dart | 1 - example/lib/custom_toolbar_demo.dart | 1 - example/lib/main.dart | 3 --- lib/src/services/local_server.dart | 4 ++-- lib/src/widgets/insert_image_dialog.dart | 4 ++-- pubspec.lock | 4 ++-- pubspec.yaml | 2 +- 7 files changed, 7 insertions(+), 12 deletions(-) diff --git a/example/lib/basic.dart b/example/lib/basic.dart index 64e6609..3e1fd46 100644 --- a/example/lib/basic.dart +++ b/example/lib/basic.dart @@ -80,7 +80,6 @@ class BasicDemo extends StatelessWidget { // You can return a Link (maybe you need to upload the image to your // storage before displaying in the editor or you can also use base64 getImageUrl: (image) { - String link = 'https://avatars.githubusercontent.com/u/24323581?v=4'; String base64 = base64Encode(image.readAsBytesSync()); String base64String = 'data:image/png;base64, $base64'; return base64String; diff --git a/example/lib/custom_toolbar_demo.dart b/example/lib/custom_toolbar_demo.dart index 4aea1db..c208651 100644 --- a/example/lib/custom_toolbar_demo.dart +++ b/example/lib/custom_toolbar_demo.dart @@ -93,7 +93,6 @@ class _CustomToolbarDemoState extends State { // You can return a Link (maybe you need to upload the image to your // storage before displaying in the editor or you can also use base64 getImageUrl: (image) { - String link = 'https://avatars.githubusercontent.com/u/24323581?v=4'; String base64 = base64Encode(image.readAsBytesSync()); String base64String = 'data:image/png;base64, $base64'; return base64String; diff --git a/example/lib/main.dart b/example/lib/main.dart index 33e6c94..e1ea7dc 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -1,9 +1,6 @@ -import 'dart:convert'; import 'package:example/basic.dart'; -import 'package:example/custom_toolbar_demo.dart'; import 'package:flutter/material.dart'; -import 'package:rich_editor/rich_editor.dart'; void main() { runApp(MyApp()); diff --git a/lib/src/services/local_server.dart b/lib/src/services/local_server.dart index 9c7fb7b..a0136e8 100644 --- a/lib/src/services/local_server.dart +++ b/lib/src/services/local_server.dart @@ -65,7 +65,7 @@ class LocalServer { }); completer.complete(); }); - }, onError: (e, stackTrace) => print('Error: $e $stackTrace')); + }); return completer.future; } } @@ -117,7 +117,7 @@ class WebSocketServer { }, onError: (err) => print('[!]Error -- ${err.toString()}')); completer.complete(); }, onError: (err) => print('[!]Error -- ${err.toString()}')); - }, onError: (err) => print('[!]Error -- ${err.toString()}')); + }); return completer.future; } diff --git a/lib/src/widgets/insert_image_dialog.dart b/lib/src/widgets/insert_image_dialog.dart index 2a6f139..af92f0f 100644 --- a/lib/src/widgets/insert_image_dialog.dart +++ b/lib/src/widgets/insert_image_dialog.dart @@ -65,9 +65,9 @@ class _InsertImageDialogState extends State { final picker = ImagePicker(); var image; if (widget.isVideo) { - image = await picker.getVideo(source: ImageSource.gallery); + image = await picker.pickVideo(source: ImageSource.gallery); } else { - image = await picker.getImage( + image = await picker.pickImage( source: ImageSource.gallery, maxWidth: 800.0, maxHeight: 600.0, diff --git a/pubspec.lock b/pubspec.lock index 6dd19ed..4893fa8 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -82,10 +82,10 @@ packages: dependency: "direct main" description: name: flutter_colorpicker - sha256: "3410869743dc4e4493a0a865c119b091452f5ea5d93e703f62415a320625e871" + sha256: "969de5f6f9e2a570ac660fb7b501551451ea2a1ab9e2097e89475f60e07816ea" url: "https://pub.dev" source: hosted - version: "0.5.0" + version: "1.1.0" flutter_inappwebview: dependency: "direct main" description: diff --git a/pubspec.yaml b/pubspec.yaml index e200148..d704708 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -17,7 +17,7 @@ dependencies: mime: ^1.0.0 image_picker: ^0.8.3+1 flutter_widget_from_html_core: ^0.10.1 - flutter_colorpicker: ^0.5.0 + flutter_colorpicker: ^1.1.0 path: ^1.8.0 xml2json: ^6.2.3 -- 2.45.2