diff --git a/example/pubspec.lock b/example/pubspec.lock index 33a3595d..c5e5993b 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -359,14 +359,6 @@ packages: url: "https://pub.dev" source: hosted version: "0.5.1" - tuple: - dependency: transitive - description: - name: tuple - sha256: "0ea99cd2f9352b2586583ab2ce6489d1f95a5f6de6fb9492faaf97ae2060f0aa" - url: "https://pub.dev" - source: hosted - version: "2.0.1" typed_data: dependency: transitive description: diff --git a/lib/src/ast/syntax_tree.dart b/lib/src/ast/syntax_tree.dart index 3491b637..c68ac7fb 100644 --- a/lib/src/ast/syntax_tree.dart +++ b/lib/src/ast/syntax_tree.dart @@ -5,7 +5,6 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/widgets.dart'; import 'package:provider/provider.dart'; -import 'package:tuple/tuple.dart'; import '../render/layout/line.dart'; import '../render/layout/line_editable.dart'; @@ -580,8 +579,8 @@ class EquationRowNode extends ParentableNode }, // Selector translates global cursor position to local caret index // Will only update Line when selection range actually changes - child: Selector2, - Tuple3>( + child: Selector2( selector: (context, selection, handleLayerLinks) { final start = selection.start - this.pos; final end = selection.end - this.pos; @@ -598,10 +597,10 @@ class EquationRowNode extends ParentableNode : const TextSelection.collapsed(offset: -1); final startHandleLayerLink = - caretPositions.contains(start) ? handleLayerLinks.item1 : null; + caretPositions.contains(start) ? handleLayerLinks.$1 : null; final endHandleLayerLink = - caretPositions.contains(end) ? handleLayerLinks.item2 : null; - return Tuple3( + caretPositions.contains(end) ? handleLayerLinks.$2 : null; + return ( caretSelection, startHandleLayerLink, endHandleLayerLink, @@ -617,9 +616,9 @@ class EquationRowNode extends ParentableNode preferredLineHeight: options.fontSize, cursorBlinkOpacityController: Provider.of>(context).value, - selection: conf.item1, - startHandleLayerLink: conf.item2, - endHandleLayerLink: conf.item3, + selection: conf.$1, + startHandleLayerLink: conf.$2, + endHandleLayerLink: conf.$3, cursorColor: value.cursorColor, cursorOffset: value.cursorOffset, cursorRadius: value.cursorRadius, @@ -863,7 +862,7 @@ void _traverseNonSpaceNodes( void Function(_NodeSpacingConf? prev, _NodeSpacingConf? curr) callback, ) { _NodeSpacingConf? prev; - // Tuple2 curr; + // (AtomType, AtomType) curr; for (final child in childTypeList) { if (child.leftType == AtomType.spacing || child.rightType == AtomType.spacing) { diff --git a/lib/src/render/layout/multiscripts.dart b/lib/src/render/layout/multiscripts.dart index d8a6b539..a7a4803d 100644 --- a/lib/src/render/layout/multiscripts.dart +++ b/lib/src/render/layout/multiscripts.dart @@ -2,7 +2,6 @@ import 'dart:math' as math; import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; -import 'package:tuple/tuple.dart'; import '../../ast/options.dart'; import '../../ast/size.dart'; @@ -209,10 +208,10 @@ class MultiscriptsLayoutDelegate extends IntrinsicLayoutDelegate<_ScriptPos> { isBaseCharacterBox: isBaseCharacterBox, ); - final subShift = postscriptRes.item2; - final supShift = postscriptRes.item1; - final presubShift = prescriptRes.item2; - final presupShift = prescriptRes.item1; + final subShift = postscriptRes.$2; + final supShift = postscriptRes.$1; + final presubShift = prescriptRes.$2; + final presupShift = prescriptRes.$1; // Rule 18f final height = [ @@ -258,7 +257,7 @@ class _ScriptUvConf { const _ScriptUvConf(this.fullHeight, this.baseline, this.options); } -Tuple2 calculateUV({ +(double, double) calculateUV({ required _ScriptUvConf base, _ScriptUvConf? sub, _ScriptUvConf? sup, @@ -324,5 +323,5 @@ Tuple2 calculateUV({ } } } - return Tuple2(u, v); + return (u, v); } diff --git a/lib/src/widgets/selectable.dart b/lib/src/widgets/selectable.dart index e725c2a9..8f6ff873 100644 --- a/lib/src/widgets/selectable.dart +++ b/lib/src/widgets/selectable.dart @@ -3,7 +3,6 @@ import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:flutter/scheduler.dart'; import 'package:provider/provider.dart'; -import 'package:tuple/tuple.dart'; import '../ast/options.dart'; import '../ast/style.dart'; @@ -515,7 +514,7 @@ class InternalSelectableMathState extends State ), ), Provider.value( - value: Tuple2(startHandleLayerLink, endHandleLayerLink), + value: (startHandleLayerLink, endHandleLayerLink), ), // We can't just provide an AnimationController, otherwise // Provider will throw diff --git a/pubspec.yaml b/pubspec.yaml index 5b06dcc1..20b0dee7 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ name: flutter_math_fork -description: Fast and high-quality TeX math equation rendering with pure Dart & Flutter. +description: Fast and high-quality TeX math equation rendering with pure Dart & Flutter. version: 0.7.1 homepage: https://github.com/simpleclub-extended/flutter_math_fork @@ -15,7 +15,6 @@ dependencies: provider: ^6.0.5 meta: ^1.8.0 collection: ^1.17.0 - tuple: ^2.0.1 dev_dependencies: flutter_test: