Skip to content

Commit

Permalink
IS GOING TO SUPPORT FLUTTER 3.10
Browse files Browse the repository at this point in the history
  • Loading branch information
guchengxi1994 committed Jul 29, 2023
1 parent f9d68d5 commit e13f72f
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// ignore_for_file: use_build_context_synchronously

import 'dart:convert';

import 'package:crypto/crypto.dart';
Expand Down Expand Up @@ -244,7 +246,6 @@ class NlpClassificationScreen extends StatelessWidget {
if (result == null) {
return;
}
// ignore: use_build_context_synchronously
ctx.read<NlpClassificationController>().addClassName(result);
},
icon: const Icon(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// ignore_for_file: unused_local_variable

import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'dart:math' as math;

import 'package:mltools_viewer/model/ner_models.dart';
Expand Down Expand Up @@ -85,7 +84,7 @@ class NlpAnnotationTextSelectionControls extends TextSelectionControls {
BuildContext context,
Rect globalEditableRegion,
double textLineHeight,
Offset position,
Offset selectionMidpoint,
List<TextSelectionPoint> endpoints,
TextSelectionDelegate delegate,
ClipboardStatusNotifier? clipboardStatus,
Expand All @@ -95,13 +94,13 @@ class NlpAnnotationTextSelectionControls extends TextSelectionControls {
final TextSelectionPoint endTextSelectionPoint =
endpoints.length > 1 ? endpoints[1] : endpoints[0];
final Offset anchorAbove = Offset(
globalEditableRegion.left + (position).dx,
globalEditableRegion.left + (selectionMidpoint).dx,
globalEditableRegion.top +
startTextSelectionPoint.point.dy -
textLineHeight -
_kToolbarContentDistance);
final Offset anchorBelow = Offset(
globalEditableRegion.left + (position).dx,
globalEditableRegion.left + (selectionMidpoint).dx,
globalEditableRegion.top +
endTextSelectionPoint.point.dy +
_kToolbarContentDistanceBelow,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// ignore_for_file: must_be_immutable
// ignore_for_file: must_be_immutable, use_build_context_synchronously

import 'dart:convert';

Expand Down Expand Up @@ -127,7 +127,6 @@ class CustomTextAnnotationScreen extends StatelessWidget {
);
}));
if (result != null) {
// ignore: use_build_context_synchronously
context
.read<CustomNerLabelingController>()
.addClassName(result);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// ignore_for_file: must_be_immutable
// ignore_for_file: must_be_immutable, use_build_context_synchronously

import 'dart:convert';

Expand Down
1 change: 0 additions & 1 deletion mltools_viewer/test/demo2.dart
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ class Home extends StatelessWidget {
onSelectionChanged: (selection, cause) {
// debugPrint("selection end:${selection.end}");
},
toolbarOptions: ToolbarOptions(copy: true),
// ignore: deprecated_member_use_from_same_package
selectionControls: NlpAnnotationTextSelectionControls(
toolBarItems: NerItems.values
Expand Down

0 comments on commit e13f72f

Please sign in to comment.