Ver código fonte

🔧fix web support

xuty 5 anos atrás
pai
commit
b89cfd2224

+ 4 - 0
CHANGELOG.md

@@ -1,3 +1,7 @@
+## [1.1.0] - 2020-9-29
+
+* Fix web support.
+
 ## [1.0.2] - 2020-9-29
 
 * Update link.

+ 2 - 2
README.md

@@ -1,4 +1,4 @@
-**[xterm.dart 1.0.x](https://pub.dev/packages/xterm) is available! 🎉**
+**[xterm.dart 1.0.0+](https://pub.dev/packages/xterm) is available! 🎉**
 
 ## xterm.dart
 
@@ -49,7 +49,7 @@
 ```yml
 dependencies:
   ...
-  xterm: ^1.0.0
+  xterm: ^1.1.0
 ```
 
 **2.** Create the terminal:

+ 8 - 1
example/pubspec.lock

@@ -137,6 +137,13 @@ packages:
       url: "https://pub.dartlang.org"
     source: hosted
     version: "1.9.2"
+  platform_info:
+    dependency: transitive
+    description:
+      name: platform_info
+      url: "https://pub.dartlang.org"
+    source: hosted
+    version: "2.0.1"
   pointycastle:
     dependency: transitive
     description:
@@ -232,7 +239,7 @@ packages:
       path: ".."
       relative: true
     source: path
-    version: "1.0.2"
+    version: "1.1.0"
 sdks:
   dart: ">=2.10.0-0.0.dev <2.10.0"
   flutter: ">=1.17.0 <2.0.0"

+ 2 - 2
lib/frontend/input_behaviors.dart

@@ -1,5 +1,5 @@
-import 'dart:io';
 
+import 'package:platform_info/platform_info.dart';
 import 'package:xterm/frontend/input_behavior.dart';
 import 'package:xterm/frontend/input_behavior_desktop.dart';
 import 'package:xterm/frontend/input_behavior_mobile.dart';
@@ -10,7 +10,7 @@ class InputBehaviors {
   static const mobile = InputBehaviorMobile();
 
   static InputBehavior get platform {
-    if (Platform.isAndroid || Platform.isIOS) {
+    if (Platform.I.isMobile) {
       return mobile;
     }
 

+ 2 - 0
lib/frontend/terminal_view.dart

@@ -54,6 +54,7 @@ class TerminalView extends StatefulWidget {
     final text = Text(
       testString,
       style: TextStyle(
+        fontFamily: 'monospace',
         fontFamilyFallback: style.fontFamily,
         fontSize: style.fontSize,
       ),
@@ -482,6 +483,7 @@ class TerminalPainter extends CustomPainter {
         decoration: cell.attr.underline
             ? TextDecoration.underline
             : TextDecoration.none,
+        fontFamily: 'monospace',
         fontFamilyFallback: view.style.fontFamily);
 
     final span = TextSpan(

+ 7 - 0
pubspec.lock

@@ -88,6 +88,13 @@ packages:
       url: "https://pub.dartlang.org"
     source: hosted
     version: "1.8.0-nullsafety"
+  platform_info:
+    dependency: "direct main"
+    description:
+      name: platform_info
+      url: "https://pub.dartlang.org"
+    source: hosted
+    version: "2.0.1"
   quiver:
     dependency: "direct main"
     description:

+ 2 - 1
pubspec.yaml

@@ -1,6 +1,6 @@
 name: xterm
 description: xterm.dart is a fast and fully-featured terminal emulator for Flutter applications, with support for mobile and desktop platforms.
-version: 1.0.2
+version: 1.1.0
 homepage: https://github.com/TerminalStudio/xterm.dart
 
 environment:
@@ -12,6 +12,7 @@ dependencies:
   async: ^2.4.1
   meta: ^1.1.8
   quiver: ^2.1.3
+  platform_info: ^2.0.1
   flutter:
     sdk: flutter