diff --git a/example/lib/ssh.dart b/example/lib/ssh.dart index 2287916..492de26 100644 --- a/example/lib/ssh.dart +++ b/example/lib/ssh.dart @@ -1,6 +1,5 @@ import 'dart:async'; import 'dart:convert'; -import 'dart:typed_data'; import 'package:dartssh2/dartssh2.dart'; import 'package:example/src/virtual_keyboard.dart'; @@ -77,7 +76,7 @@ class _MyHomePageState extends State { }; terminal.onOutput = (data) { - session.write(utf8.encode(data) as Uint8List); + session.write(utf8.encode(data)); }; session.stdout diff --git a/example/lib/suggestion.dart b/example/lib/suggestion.dart index 584b944..c97b7ce 100644 --- a/example/lib/suggestion.dart +++ b/example/lib/suggestion.dart @@ -266,7 +266,7 @@ class _HomeState extends State { autofocus: true, backgroundOpacity: 0.7, onKey: (node, event) { - if (event is! RawKeyDownEvent) { + if (event is! KeyDownEvent) { return KeyEventResult.ignored; } diff --git a/example/pubspec.lock b/example/pubspec.lock index ce1a587..103692a 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -93,10 +93,10 @@ packages: dependency: transitive description: name: collection - sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c" + sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a url: "https://pub.dev" source: hosted - version: "1.17.1" + version: "1.18.0" convert: dependency: transitive description: @@ -264,6 +264,30 @@ packages: url: "https://pub.dev" source: hosted version: "4.8.1" + leak_tracker: + dependency: transitive + description: + name: leak_tracker + sha256: "78eb209deea09858f5269f5a5b02be4049535f568c07b275096836f01ea323fa" + url: "https://pub.dev" + source: hosted + version: "10.0.0" + leak_tracker_flutter_testing: + dependency: transitive + description: + name: leak_tracker_flutter_testing + sha256: b46c5e37c19120a8a01918cfaf293547f47269f7cb4b0058f21531c2465d6ef0 + url: "https://pub.dev" + source: hosted + version: "2.0.1" + leak_tracker_testing: + dependency: transitive + description: + name: leak_tracker_testing + sha256: a597f72a664dbd293f3bfc51f9ba69816f84dcd403cdac7066cb3f6003f3ab47 + url: "https://pub.dev" + source: hosted + version: "2.0.1" lints: dependency: "direct dev" description: @@ -276,26 +300,26 @@ packages: dependency: transitive description: name: matcher - sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb" + sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb url: "https://pub.dev" source: hosted - version: "0.12.15" + version: "0.12.16+1" material_color_utilities: dependency: transitive description: name: material_color_utilities - sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 + sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a" url: "https://pub.dev" source: hosted - version: "0.2.0" + version: "0.8.0" meta: dependency: transitive description: name: meta - sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" + sha256: d584fa6707a52763a52446f02cc621b077888fb63b93bbcb1143a7be5a0c0c04 url: "https://pub.dev" source: hosted - version: "1.9.1" + version: "1.11.0" package_config: dependency: transitive description: @@ -308,10 +332,10 @@ packages: dependency: "direct main" description: name: path - sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" + sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" url: "https://pub.dev" source: hosted - version: "1.8.3" + version: "1.9.0" petitparser: dependency: transitive description: @@ -393,26 +417,26 @@ packages: dependency: transitive description: name: source_span - sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 + sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" url: "https://pub.dev" source: hosted - version: "1.9.1" + version: "1.10.0" stack_trace: dependency: transitive description: name: stack_trace - sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 + sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" url: "https://pub.dev" source: hosted - version: "1.11.0" + version: "1.11.1" stream_channel: dependency: transitive description: name: stream_channel - sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" + sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.1.2" string_scanner: dependency: transitive description: @@ -433,10 +457,10 @@ packages: dependency: transitive description: name: test_api - sha256: eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfb + sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b" url: "https://pub.dev" source: hosted - version: "0.5.1" + version: "0.6.1" typed_data: dependency: transitive description: @@ -453,6 +477,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.4" + vm_service: + dependency: transitive + description: + name: vm_service + sha256: b3d56ff4341b8f182b96aceb2fa20e3dcb336b9f867bc0eafc0de10f1048e957 + url: "https://pub.dev" + source: hosted + version: "13.0.0" watcher: dependency: transitive description: @@ -501,5 +533,5 @@ packages: source: hosted version: "0.0.6" sdks: - dart: ">=3.0.0 <4.0.0" + dart: ">=3.2.0-0 <4.0.0" flutter: ">=3.10.0" diff --git a/lib/src/terminal_view.dart b/lib/src/terminal_view.dart index cbf9222..2d660a7 100644 --- a/lib/src/terminal_view.dart +++ b/lib/src/terminal_view.dart @@ -28,7 +28,7 @@ class TerminalView extends StatefulWidget { this.controller, this.theme = TerminalThemes.defaultTheme, this.textStyle = const TerminalStyle(), - this.textScaleFactor, + this.textScaler, this.padding, this.scrollController, this.autoResize = true, @@ -63,9 +63,9 @@ class TerminalView extends StatefulWidget { final TerminalStyle textStyle; /// The number of font pixels for each logical pixel. If null, will use the - /// [MediaQueryData.textScaleFactor] obtained from [MediaQuery], or 1.0 if + /// [MediaQueryData.textScaler] obtained from [MediaQuery], or 1.0 if /// there is no [MediaQuery] in scope. - final double? textScaleFactor; + final TextScaler? textScaler; /// Padding around the inner [Scrollable] widget. final EdgeInsets? padding; @@ -129,7 +129,7 @@ class TerminalView extends StatefulWidget { /// Keyboard event handler of the terminal. This has higher priority than /// [shortcuts] and input handler of the terminal. - final FocusOnKeyCallback? onKey; + final FocusOnKeyEventCallback? onKey; /// True if no input should send to the terminal. final bool readOnly; @@ -233,8 +233,8 @@ class TerminalViewState extends State { padding: MediaQuery.of(context).padding, autoResize: widget.autoResize, textStyle: widget.textStyle, - textScaleFactor: - widget.textScaleFactor ?? MediaQuery.textScaleFactorOf(context), + textScaler: + widget.textScaler ?? MediaQuery.textScalerOf(context), theme: widget.theme, focusNode: _focusNode, cursorType: widget.cursorType, @@ -394,7 +394,7 @@ class TerminalViewState extends State { setState(() => _composingText = text); } - KeyEventResult _handleKeyEvent(FocusNode focusNode, RawKeyEvent event) { + KeyEventResult _handleKeyEvent(FocusNode focusNode, KeyEvent event) { final resultOverride = widget.onKey?.call(focusNode, event); if (resultOverride != null && resultOverride != KeyEventResult.ignored) { return resultOverride; @@ -410,7 +410,7 @@ class TerminalViewState extends State { return shortcutResult; } - if (event is! RawKeyDownEvent) { + if (event is! KeyDownEvent) { return KeyEventResult.ignored; } @@ -422,9 +422,12 @@ class TerminalViewState extends State { final handled = widget.terminal.keyInput( key, - ctrl: event.isControlPressed, - alt: event.isAltPressed, - shift: event.isShiftPressed, + ctrl: event.physicalKey == PhysicalKeyboardKey.controlLeft || + event.physicalKey == PhysicalKeyboardKey.controlRight, + alt: event.physicalKey == PhysicalKeyboardKey.altLeft || + event.physicalKey == PhysicalKeyboardKey.altRight, + shift: event.physicalKey == PhysicalKeyboardKey.shiftLeft || + event.physicalKey == PhysicalKeyboardKey.shiftRight, ); if (handled) { @@ -463,7 +466,7 @@ class _TerminalView extends LeafRenderObjectWidget { required this.padding, required this.autoResize, required this.textStyle, - required this.textScaleFactor, + required this.textScaler, required this.theme, required this.focusNode, required this.cursorType, @@ -484,7 +487,7 @@ class _TerminalView extends LeafRenderObjectWidget { final TerminalStyle textStyle; - final double textScaleFactor; + final TextScaler textScaler; final TerminalTheme theme; @@ -507,7 +510,7 @@ class _TerminalView extends LeafRenderObjectWidget { padding: padding, autoResize: autoResize, textStyle: textStyle, - textScaleFactor: textScaleFactor, + textScaler: textScaler, theme: theme, focusNode: focusNode, cursorType: cursorType, @@ -526,7 +529,7 @@ class _TerminalView extends LeafRenderObjectWidget { ..padding = padding ..autoResize = autoResize ..textStyle = textStyle - ..textScaleFactor = textScaleFactor + ..textScaler = textScaler ..theme = theme ..focusNode = focusNode ..cursorType = cursorType diff --git a/lib/src/ui/char_metrics.dart b/lib/src/ui/char_metrics.dart index d7d3710..e35439d 100644 --- a/lib/src/ui/char_metrics.dart +++ b/lib/src/ui/char_metrics.dart @@ -1,13 +1,14 @@ import 'dart:ui'; +import 'package:flutter/painting.dart'; import 'package:xterm/src/ui/terminal_text_style.dart'; -Size calcCharSize(TerminalStyle style, double textScaleFactor) { +Size calcCharSize(TerminalStyle style, TextScaler textScaler) { const test = 'mmmmmmmmmm'; final textStyle = style.toTextStyle(); final builder = ParagraphBuilder(textStyle.getParagraphStyle()); - builder.pushStyle(textStyle.getTextStyle(textScaleFactor: textScaleFactor)); + builder.pushStyle(textStyle.getTextStyle(textScaler: textScaler)); builder.addText(test); final paragraph = builder.build(); diff --git a/lib/src/ui/custom_text_edit.dart b/lib/src/ui/custom_text_edit.dart index 6b23701..2483c36 100644 --- a/lib/src/ui/custom_text_edit.dart +++ b/lib/src/ui/custom_text_edit.dart @@ -31,7 +31,7 @@ class CustomTextEdit extends StatefulWidget { final void Function(TextInputAction) onAction; - final KeyEventResult Function(FocusNode, RawKeyEvent) onKey; + final KeyEventResult Function(FocusNode, KeyEvent) onKey; final FocusNode focusNode; @@ -90,7 +90,7 @@ class CustomTextEditState extends State with TextInputClient { return Focus( focusNode: widget.focusNode, autofocus: widget.autofocus, - onKey: _onKey, + onKeyEvent: _onKey, child: widget.child, ); } @@ -133,7 +133,7 @@ class CustomTextEditState extends State with TextInputClient { _openOrCloseInputConnectionIfNeeded(); } - KeyEventResult _onKey(FocusNode focusNode, RawKeyEvent event) { + KeyEventResult _onKey(FocusNode focusNode, KeyEvent event) { if (_currentEditingState.composing.isCollapsed) { return widget.onKey(focusNode, event); } diff --git a/lib/src/ui/keyboard_listener.dart b/lib/src/ui/keyboard_listener.dart index 6a5e1ae..0328868 100644 --- a/lib/src/ui/keyboard_listener.dart +++ b/lib/src/ui/keyboard_listener.dart @@ -12,7 +12,7 @@ class CustomKeyboardListener extends StatelessWidget { final void Function(String?) onComposing; - final KeyEventResult Function(FocusNode, RawKeyEvent) onKey; + final KeyEventResult Function(FocusNode, KeyEvent) onKey; const CustomKeyboardListener({ Key? key, @@ -24,7 +24,7 @@ class CustomKeyboardListener extends StatelessWidget { required this.onKey, }) : super(key: key); - KeyEventResult _onKey(FocusNode focusNode, RawKeyEvent keyEvent) { + KeyEventResult _onKey(FocusNode focusNode, KeyEvent keyEvent) { // First try to handle the key event directly. final handled = onKey(focusNode, keyEvent); if (handled == KeyEventResult.ignored) { @@ -33,20 +33,19 @@ class CustomKeyboardListener extends StatelessWidget { if (keyEvent.character != null && keyEvent.character != "") { onInsert(keyEvent.character!); return KeyEventResult.handled; - } else if (keyEvent.data is RawKeyEventDataIos && - keyEvent is RawKeyDownEvent) { + } else if (keyEvent is KeyDownEvent) { // On iOS keyEvent.character is always null. But data.characters // contains the the character(s) corresponding to the input. - final data = keyEvent.data as RawKeyEventDataIos; - if (data.characters != "") { + final data = keyEvent.logicalKey.keyLabel; + if (data != "") { onComposing(null); - onInsert(data.characters); - } else if (data.charactersIgnoringModifiers != "") { - // If characters is an empty string but charactersIgnoringModifiers is - // not an empty string, this indicates that the current characters is - // being composed. The current composing state is - // charactersIgnoringModifiers. - onComposing(data.charactersIgnoringModifiers); + onInsert(data); + // } else if (data.charactersIgnoringModifiers != "") { + // // If characters is an empty string but charactersIgnoringModifiers is + // // not an empty string, this indicates that the current characters is + // // being composed. The current composing state is + // // charactersIgnoringModifiers. + // onComposing(data.charactersIgnoringModifiers); } } } @@ -58,7 +57,7 @@ class CustomKeyboardListener extends StatelessWidget { return Focus( focusNode: focusNode, autofocus: autofocus, - onKey: _onKey, + onKeyEvent: _onKey, child: child, ); } diff --git a/lib/src/ui/painter.dart b/lib/src/ui/painter.dart index 378e635..40db80a 100644 --- a/lib/src/ui/painter.dart +++ b/lib/src/ui/painter.dart @@ -1,5 +1,7 @@ import 'dart:ui'; +import 'package:flutter/painting.dart'; +import 'package:flutter/rendering.dart'; import 'package:xterm/src/ui/palette_builder.dart'; import 'package:xterm/src/ui/paragraph_cache.dart'; import 'package:xterm/xterm.dart'; @@ -9,10 +11,10 @@ class TerminalPainter { TerminalPainter({ required TerminalTheme theme, required TerminalStyle textStyle, - required double textScaleFactor, + required TextScaler textScaler, }) : _textStyle = textStyle, _theme = theme, - _textScaleFactor = textScaleFactor; + _textScaler = textScaler; /// A lookup table from terminal colors to Flutter colors. late var _colorPalette = PaletteBuilder(_theme).build(); @@ -34,11 +36,11 @@ class TerminalPainter { _paragraphCache.clear(); } - double get textScaleFactor => _textScaleFactor; - double _textScaleFactor = 1.0; - set textScaleFactor(double value) { - if (value == _textScaleFactor) return; - _textScaleFactor = value; + TextScaler get textScaler => _textScaler; + TextScaler _textScaler = TextScaler.linear(1.0); + set textScaler(TextScaler value) { + if (value == _textScaler) return; + _textScaler = value; _cellSize = _measureCharSize(); _paragraphCache.clear(); } @@ -58,7 +60,7 @@ class TerminalPainter { final textStyle = _textStyle.toTextStyle(); final builder = ParagraphBuilder(textStyle.getParagraphStyle()); builder.pushStyle( - textStyle.getTextStyle(textScaleFactor: _textScaleFactor), + textStyle.getTextStyle(textScaler: _textScaler), ); builder.addText(test); @@ -173,7 +175,7 @@ class TerminalPainter { final charCode = cellData.content & CellContent.codepointMask; if (charCode == 0) return; - final cacheKey = cellData.getHash() ^ _textScaleFactor.hashCode; + final cacheKey = cellData.getHash() ^ _textScaler.hashCode; var paragraph = _paragraphCache.getLayoutFromCache(cacheKey); if (paragraph == null) { @@ -208,7 +210,7 @@ class TerminalPainter { paragraph = _paragraphCache.performAndCacheLayout( char, style, - _textScaleFactor, + _textScaler, cacheKey, ); } diff --git a/lib/src/ui/paragraph_cache.dart b/lib/src/ui/paragraph_cache.dart index 8dd7158..80896a0 100644 --- a/lib/src/ui/paragraph_cache.dart +++ b/lib/src/ui/paragraph_cache.dart @@ -17,17 +17,17 @@ class ParagraphCache { return _cache[key]; } - /// Applies [style] and [textScaleFactor] to [text] and lays it out to create + /// Applies [style] and [textScaler] to [text] and lays it out to create /// a [Paragraph]. The [Paragraph] is cached and can be retrieved with the /// same [key] by calling [getLayoutFromCache]. Paragraph performAndCacheLayout( String text, TextStyle style, - double textScaleFactor, + TextScaler textScaler, int key, ) { final builder = ParagraphBuilder(style.getParagraphStyle()); - builder.pushStyle(style.getTextStyle(textScaleFactor: textScaleFactor)); + builder.pushStyle(style.getTextStyle(textScaler: textScaler)); builder.addText(text); final paragraph = builder.build(); diff --git a/lib/src/ui/render.dart b/lib/src/ui/render.dart index 08f07f2..de2a2f7 100644 --- a/lib/src/ui/render.dart +++ b/lib/src/ui/render.dart @@ -1,4 +1,4 @@ -import 'dart:math' show min, max; +import 'dart:math' show max; import 'dart:ui'; import 'package:flutter/rendering.dart'; @@ -27,7 +27,7 @@ class RenderTerminal extends RenderBox with RelayoutWhenSystemFontsChangeMixin { required EdgeInsets padding, required bool autoResize, required TerminalStyle textStyle, - required double textScaleFactor, + required TextScaler textScaler, required TerminalTheme theme, required FocusNode focusNode, required TerminalCursorType cursorType, @@ -47,7 +47,7 @@ class RenderTerminal extends RenderBox with RelayoutWhenSystemFontsChangeMixin { _painter = TerminalPainter( theme: theme, textStyle: textStyle, - textScaleFactor: textScaleFactor, + textScaler: textScaler, ); Terminal _terminal; @@ -98,9 +98,9 @@ class RenderTerminal extends RenderBox with RelayoutWhenSystemFontsChangeMixin { markNeedsLayout(); } - set textScaleFactor(double value) { - if (value == _painter.textScaleFactor) return; - _painter.textScaleFactor = value; + set textScaler(TextScaler value) { + if (value == _painter.textScaler) return; + _painter.textScaler = value; markNeedsLayout(); } @@ -475,7 +475,7 @@ class RenderTerminal extends RenderBox with RelayoutWhenSystemFontsChangeMixin { PlaceholderAlignment.middle, ); builder.pushStyle( - style.getTextStyle(textScaleFactor: _painter.textScaleFactor), + style.getTextStyle(textScaler: _painter.textScaler), ); builder.addText(composingText); diff --git a/lib/zmodem.dart b/lib/zmodem.dart index c45b807..6498e6d 100644 --- a/lib/zmodem.dart +++ b/lib/zmodem.dart @@ -93,7 +93,7 @@ class ZModemMux { /// buffered if a ZModem session is active. void terminalWrite(String input) { if (_session == null) { - stdin.add(utf8.encode(input) as Uint8List); + stdin.add(utf8.encode(input)); } } diff --git a/pubspec.lock b/pubspec.lock index 38a104a..63df71d 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -5,18 +5,18 @@ packages: dependency: transitive description: name: _fe_analyzer_shared - sha256: "8880b4cfe7b5b17d57c052a5a3a8cc1d4f546261c7cc8fbd717bd53f48db0568" + sha256: ae92f5d747aee634b87f89d9946000c2de774be1d6ac3e58268224348cd0101a url: "https://pub.dev" source: hosted - version: "59.0.0" + version: "61.0.0" analyzer: dependency: transitive description: name: analyzer - sha256: a89627f49b0e70e068130a36571409726b04dab12da7e5625941d2c8ec278b96 + sha256: ea3d8652bda62982addfd92fdc2d0214e5f82e43325104990d4f4c4a2a313562 url: "https://pub.dev" source: hosted - version: "5.11.1" + version: "5.13.0" analyzer_plugin: dependency: transitive description: @@ -157,10 +157,10 @@ packages: dependency: transitive description: name: collection - sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c" + sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a url: "https://pub.dev" source: hosted - version: "1.17.1" + version: "1.18.0" convert: dependency: "direct main" description: @@ -173,10 +173,10 @@ packages: dependency: transitive description: name: coverage - sha256: "2fb815080e44a09b85e0f2ca8a820b15053982b2e714b59267719e8a9ff17097" + sha256: "8acabb8306b57a409bf4c83522065672ee13179297a6bb0cb9ead73948df7c76" url: "https://pub.dev" source: hosted - version: "1.6.3" + version: "1.7.2" crypto: dependency: transitive description: @@ -197,10 +197,10 @@ packages: dependency: "direct dev" description: name: dart_code_metrics - sha256: "162c81dbd0a2ba182f38ca615335f3e8878f212ec7beea83d6bfad4e99eb541a" + sha256: "3dede3f7abc077a4181ec7445448a289a9ce08e2981e6a4d49a3fb5099d47e1f" url: "https://pub.dev" source: hosted - version: "5.7.3" + version: "5.7.6" dart_code_metrics_presets: dependency: transitive description: @@ -339,6 +339,30 @@ packages: url: "https://pub.dev" source: hosted version: "4.8.1" + leak_tracker: + dependency: transitive + description: + name: leak_tracker + sha256: "78eb209deea09858f5269f5a5b02be4049535f568c07b275096836f01ea323fa" + url: "https://pub.dev" + source: hosted + version: "10.0.0" + leak_tracker_flutter_testing: + dependency: transitive + description: + name: leak_tracker_flutter_testing + sha256: b46c5e37c19120a8a01918cfaf293547f47269f7cb4b0058f21531c2465d6ef0 + url: "https://pub.dev" + source: hosted + version: "2.0.1" + leak_tracker_testing: + dependency: transitive + description: + name: leak_tracker_testing + sha256: a597f72a664dbd293f3bfc51f9ba69816f84dcd403cdac7066cb3f6003f3ab47 + url: "https://pub.dev" + source: hosted + version: "2.0.1" lints: dependency: "direct dev" description: @@ -359,26 +383,26 @@ packages: dependency: transitive description: name: matcher - sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb" + sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb url: "https://pub.dev" source: hosted - version: "0.12.15" + version: "0.12.16+1" material_color_utilities: dependency: transitive description: name: material_color_utilities - sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 + sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a" url: "https://pub.dev" source: hosted - version: "0.2.0" + version: "0.8.0" meta: dependency: "direct main" description: name: meta - sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" + sha256: d584fa6707a52763a52446f02cc621b077888fb63b93bbcb1143a7be5a0c0c04 url: "https://pub.dev" source: hosted - version: "1.9.1" + version: "1.11.0" mime: dependency: transitive description: @@ -391,10 +415,10 @@ packages: dependency: "direct dev" description: name: mockito - sha256: dd61809f04da1838a680926de50a9e87385c1de91c6579629c3d1723946e8059 + sha256: "8b46d7eb40abdda92d62edd01546051f0c27365e65608c284de336dccfef88cc" url: "https://pub.dev" source: hosted - version: "5.4.0" + version: "5.4.1" node_preamble: dependency: transitive description: @@ -415,10 +439,10 @@ packages: dependency: transitive description: name: path - sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" + sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" url: "https://pub.dev" source: hosted - version: "1.8.3" + version: "1.9.0" petitparser: dependency: transitive description: @@ -548,26 +572,26 @@ packages: dependency: transitive description: name: source_span - sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 + sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" url: "https://pub.dev" source: hosted - version: "1.9.1" + version: "1.10.0" stack_trace: dependency: transitive description: name: stack_trace - sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 + sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" url: "https://pub.dev" source: hosted - version: "1.11.0" + version: "1.11.1" stream_channel: dependency: transitive description: name: stream_channel - sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" + sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.1.2" stream_transform: dependency: transitive description: @@ -596,26 +620,26 @@ packages: dependency: "direct dev" description: name: test - sha256: "3dac9aecf2c3991d09b9cdde4f98ded7b30804a88a0d7e4e7e1678e78d6b97f4" + sha256: a1f7595805820fcc05e5c52e3a231aedd0b72972cb333e8c738a8b1239448b6f url: "https://pub.dev" source: hosted - version: "1.24.1" + version: "1.24.9" test_api: dependency: transitive description: name: test_api - sha256: eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfb + sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b" url: "https://pub.dev" source: hosted - version: "0.5.1" + version: "0.6.1" test_core: dependency: transitive description: name: test_core - sha256: "5138dbffb77b2289ecb12b81c11ba46036590b72a64a7a90d6ffb880f1a29e93" + sha256: a757b14fc47507060a162cc2530d9a4a2f92f5100a952c7443b5cad5ef5b106a url: "https://pub.dev" source: hosted - version: "0.5.1" + version: "0.5.9" timing: dependency: transitive description: @@ -652,10 +676,10 @@ packages: dependency: transitive description: name: vm_service - sha256: f3743ca475e0c9ef71df4ba15eb2d7684eecd5c8ba20a462462e4e8b561b2e11 + sha256: b3d56ff4341b8f182b96aceb2fa20e3dcb336b9f867bc0eafc0de10f1048e957 url: "https://pub.dev" source: hosted - version: "11.6.0" + version: "13.0.0" watcher: dependency: transitive description: @@ -705,5 +729,5 @@ packages: source: hosted version: "0.0.6" sdks: - dart: ">=3.0.0 <4.0.0" + dart: ">=3.2.0-0 <4.0.0" flutter: ">=3.10.0" diff --git a/test/src/terminal_view_test.dart b/test/src/terminal_view_test.dart index 86355f0..e90c7fb 100644 --- a/test/src/terminal_view_test.dart +++ b/test/src/terminal_view_test.dart @@ -310,17 +310,17 @@ void main() { testWidgets('works', (tester) async { final terminal = Terminal(); - final textScaleFactor = ValueNotifier(1.0); + final textScaler = ValueNotifier(TextScaler.linear(1.0)); await tester.pumpWidget( MaterialApp( home: Scaffold( - body: ValueListenableBuilder( - valueListenable: textScaleFactor, - builder: (context, textScaleFactor, child) { + body: ValueListenableBuilder( + valueListenable: textScaler, + builder: (context, textScaler, child) { return TerminalView( terminal, - textScaleFactor: textScaleFactor, + textScaler: textScaler, ); }, ), @@ -336,7 +336,7 @@ void main() { matchesGoldenFile('_goldens/text_scale_factor@1x.png'), ); - textScaleFactor.value = 2.0; + textScaler.value = TextScaler.linear(2.0); await tester.pump(); await expectLater( @@ -352,7 +352,7 @@ void main() { MaterialApp( home: Scaffold( body: MediaQuery( - data: const MediaQueryData(textScaleFactor: 2.0), + data: const MediaQueryData(textScaler: TextScaler.linear(2)), child: TerminalView( terminal, ),