From fb7100c2584d82fb038b4342cf363a4fb4396fce Mon Sep 17 00:00:00 2001 From: iak Date: Mon, 9 May 2022 15:54:30 +0300 Subject: [PATCH 1/2] added SmartQuotesType --- example/pubspec.lock | 21 ++++++++++++++------- lib/src/code_field.dart | 6 ++++++ pubspec.lock | 21 ++++++++++++++------- 3 files changed, 34 insertions(+), 14 deletions(-) diff --git a/example/pubspec.lock b/example/pubspec.lock index 0289756..6b23683 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -7,7 +7,7 @@ packages: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.7.0" + version: "2.8.2" boolean_selector: dependency: transitive description: @@ -21,7 +21,7 @@ packages: name: characters url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.2.0" charcode: dependency: transitive description: @@ -120,14 +120,21 @@ packages: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.10" + version: "0.12.11" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.3" meta: dependency: transitive description: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.4.0" + version: "1.7.0" path: dependency: transitive description: @@ -188,7 +195,7 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.4.1" + version: "0.4.8" typed_data: dependency: transitive description: @@ -244,7 +251,7 @@ packages: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.1.1" sdks: - dart: ">=2.12.0 <3.0.0" + dart: ">=2.14.0 <3.0.0" flutter: ">=1.26.0" diff --git a/lib/src/code_field.dart b/lib/src/code_field.dart index b37da95..024a325 100644 --- a/lib/src/code_field.dart +++ b/lib/src/code_field.dart @@ -56,6 +56,9 @@ class LineNumberStyle { } class CodeField extends StatefulWidget { + /// {@macro flutter.widgets.textField.minLines} + final SmartQuotesType smartQuotesType; + /// {@macro flutter.widgets.textField.minLines} final int? minLines; @@ -117,6 +120,7 @@ class CodeField extends StatefulWidget { this.lineNumberBuilder, this.focusNode, this.onChanged, + this.smartQuotesType = SmartQuotesType.enabled, }) : super(key: key); @override @@ -248,6 +252,7 @@ class CodeFieldState extends State { widget.cursorColor ?? theme?[ROOT_KEY]?.color ?? defaultText; final lineNumberCol = TextField( + smartQuotesType: widget.smartQuotesType, scrollPadding: widget.padding, style: numberTextStyle, controller: _numberController, @@ -273,6 +278,7 @@ class CodeFieldState extends State { ); final codeField = TextField( + smartQuotesType: widget.smartQuotesType, focusNode: _focusNode, scrollPadding: widget.padding, style: textStyle, diff --git a/pubspec.lock b/pubspec.lock index 7dc0de3..a253452 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -7,7 +7,7 @@ packages: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.7.0" + version: "2.8.2" boolean_selector: dependency: transitive description: @@ -21,7 +21,7 @@ packages: name: characters url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.2.0" charcode: dependency: transitive description: @@ -87,14 +87,21 @@ packages: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.10" + version: "0.12.11" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.3" meta: dependency: transitive description: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.4.0" + version: "1.7.0" path: dependency: transitive description: @@ -148,7 +155,7 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.4.1" + version: "0.4.8" typed_data: dependency: transitive description: @@ -162,7 +169,7 @@ packages: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.1.1" sdks: - dart: ">=2.12.0 <3.0.0" + dart: ">=2.14.0 <3.0.0" flutter: ">=1.26.0" From baa69020aac3b54af67a23f937e60e2b8ee6252f Mon Sep 17 00:00:00 2001 From: iak Date: Fri, 20 May 2022 10:06:02 +0300 Subject: [PATCH 2/2] set keyboardType: TextInputType.visiblePassword to codeField --- lib/src/code_field.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/src/code_field.dart b/lib/src/code_field.dart index 024a325..abcd735 100644 --- a/lib/src/code_field.dart +++ b/lib/src/code_field.dart @@ -2,9 +2,8 @@ import 'dart:async'; import 'dart:math'; import 'package:flutter/material.dart'; -import 'package:flutter/rendering.dart'; -import 'package:flutter/services.dart'; import 'package:linked_scroll_controller/linked_scroll_controller.dart'; + import './code_controller.dart'; class LineNumberController extends TextEditingController { @@ -278,6 +277,7 @@ class CodeFieldState extends State { ); final codeField = TextField( + keyboardType: TextInputType.visiblePassword, smartQuotesType: widget.smartQuotesType, focusNode: _focusNode, scrollPadding: widget.padding,