Skip to content

Commit 95f52b5

Browse files
committed
fix: Fixing warnings with format. #1
1 parent 3c3ba02 commit 95f52b5

File tree

2 files changed

+10
-16
lines changed

2 files changed

+10
-16
lines changed

lib/home_page.dart

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,9 @@ class HomePageState extends State<HomePage> {
5656
final doc = Document();
5757
setState(() {
5858
_controller = QuillController(
59-
document: doc, selection: const TextSelection.collapsed(offset: 0));
59+
document: doc,
60+
selection: const TextSelection.collapsed(offset: 0),
61+
);
6062
});
6163
}
6264

@@ -258,8 +260,7 @@ class HomePageState extends State<HomePage> {
258260
iconSize: toolbarIconSize,
259261
controller: _controller!,
260262
),
261-
for (final builder in embedButtons)
262-
builder(_controller!, toolbarIconSize, null, null),
263+
for (final builder in embedButtons) builder(_controller!, toolbarIconSize, null, null),
263264
],
264265
);
265266

@@ -291,8 +292,7 @@ class HomePageState extends State<HomePage> {
291292
if (!widget.platformService.isWebPlatform()) {
292293
// Copies the picked file from temporary cache to applications directory
293294
final appDocDir = await getApplicationDocumentsDirectory();
294-
final copiedFile =
295-
await file.copy('${appDocDir.path}/${basename(file.path)}');
295+
final copiedFile = await file.copy('${appDocDir.path}/${basename(file.path)}');
296296
return copiedFile.path.toString();
297297
} else {
298298
// TODO: This will fail on web
@@ -303,8 +303,7 @@ class HomePageState extends State<HomePage> {
303303
}
304304

305305
/// Callback that is called after an image is picked whilst on the web platform.
306-
Future<String?> _webImagePickImpl(
307-
OnImagePickCallback onImagePickCallback) async {
306+
Future<String?> _webImagePickImpl(OnImagePickCallback onImagePickCallback) async {
308307
// Lets the user pick one file; files with any file extension can be selected
309308
final result = await ImageFilePicker().pickImage();
310309

@@ -330,7 +329,6 @@ class HomePageState extends State<HomePage> {
330329
// coverage:ignore-start
331330
/// Image file picker wrapper class
332331
class ImageFilePicker {
333-
Future<FilePickerResult?> pickImage() =>
334-
FilePicker.platform.pickFiles(type: FileType.image);
332+
Future<FilePickerResult?> pickImage() => FilePicker.platform.pickFiles(type: FileType.image);
335333
}
336334
// coverage:ignore-end

lib/web_embeds/web_embeds.dart

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,12 @@ import 'package:responsive_framework/responsive_framework.dart';
66
import 'package:universal_html/html.dart' as html;
77

88
// Conditionally importing the PlatformViewRegistry class according to the platform
9-
import 'mobile_platform_registry.dart'
10-
if (dart.library.html) 'web_platform_registry.dart' as ui_instance;
9+
import 'mobile_platform_registry.dart' if (dart.library.html) 'web_platform_registry.dart' as ui_instance;
1110

1211
/// Class used to conditionally register the view factory.
1312
/// For more information, check https://github.com/flutter/flutter/issues/41563#issuecomment-547923478.
1413
class PlatformViewRegistryFix {
15-
void registerViewFactory(
16-
PlatformService platformService, imageURL, dynamic cbFnc) {
14+
void registerViewFactory(PlatformService platformService, imageURL, dynamic cbFnc) {
1715
if (platformService.isWebPlatform()) {
1816
ui_instance.PlatformViewRegistry.registerViewFactory(
1917
imageURL,
@@ -50,9 +48,7 @@ class ImageEmbedBuilderWeb extends EmbedBuilder {
5048
final size = MediaQuery.of(context).size;
5149

5250
// This is needed for images to be correctly embedded on the web.
53-
ImageUniversalUI()
54-
.platformViewRegistry
55-
.registerViewFactory(PlatformService(), imageUrl, (viewId) {
51+
ImageUniversalUI().platformViewRegistry.registerViewFactory(PlatformService(), imageUrl, (viewId) {
5652
return html.ImageElement()
5753
..src = imageUrl
5854
..style.height = 'auto'

0 commit comments

Comments
 (0)