|
|
|
|
|
|
using Unity.UIWidgets.widgets; |
|
|
|
using UnityEngine; |
|
|
|
using Color = Unity.UIWidgets.ui.Color; |
|
|
|
using TextStyle = Unity.UIWidgets.painting.TextStyle; |
|
|
|
|
|
|
|
class _TextInputSample : StatefulWidget { |
|
|
|
public readonly string title; |
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
protected override Widget createWidget() { |
|
|
|
protected override Widget createWidget() { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class _TextInputSampleState : State<_TextInputSample> { |
|
|
|
TextEditingController titleController = new TextEditingController(""); |
|
|
|
|
|
|
return new _EditableInputTypeWidgetState(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
class _EditableInputTypeWidgetState : State<EditableInputTypeWidget> { |
|
|
|
Widget rowWidgets(string title, Widget widget) { |
|
|
|
return new Container( |
|
|
|
|
|
|
} |
|
|
|
)); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
List<Widget> widgets = new List<Widget>(); |
|
|
|
List<Widget> widgets = new List<Widget>(); |
|
|
|
|
|
|
|
|
|
|
|
new EditableText(controller, node, style, cursorColor, Colors.transparent, selectionColor: selectionColor, onSubmitted: this.textSubmitted |
|
|
|
, unityTouchKeyboard: unityKeyboard, selectionControls: MaterialUtils.materialTextSelectionControls))))); |
|
|
|
new EditableText(controller, node, style, cursorColor, Colors.blue, |
|
|
|
selectionColor: selectionColor, onSubmitted: this.textSubmitted |
|
|
|
, unityTouchKeyboard: unityKeyboard, |
|
|
|
selectionControls: MaterialUtils.materialTextSelectionControls, |
|
|
|
cursorWidth: 5.0f, cursorRadius: Radius.circular(2.5f), cursorOpacityAnimates: true, paintCursorAboveText: true))))); |
|
|
|
new EditableText(controller, node, style, cursorColor, Colors.transparent, selectionColor: selectionColor, maxLines: 4, |
|
|
|
new EditableText(controller, node, style, cursorColor, Colors.transparent, |
|
|
|
selectionColor: selectionColor, maxLines: 4, |
|
|
|
new EditableText(controller, node, style, cursorColor, Colors.transparent, selectionColor: selectionColor, obscureText: true, |
|
|
|
onSubmitted: this.textSubmitted, unityTouchKeyboard: unityKeyboard, |
|
|
|
new EditableText(controller, node, style, cursorColor, Colors.transparent, |
|
|
|
selectionColor: selectionColor, obscureText: true, |
|
|
|
onSubmitted: this.textSubmitted, unityTouchKeyboard: unityKeyboard, |
|
|
|
new EditableText(controller, node, style, cursorColor, Colors.transparent, selectionColor: selectionColor, keyboardType: TextInputType.number, |
|
|
|
new EditableText(controller, node, style, cursorColor, Colors.transparent, |
|
|
|
selectionColor: selectionColor, keyboardType: TextInputType.number, |
|
|
|
new EditableText(controller, node, style, cursorColor, Colors.transparent, selectionColor: selectionColor, keyboardType: TextInputType.phone, |
|
|
|
new EditableText(controller, node, style, cursorColor, Colors.transparent, |
|
|
|
selectionColor: selectionColor, keyboardType: TextInputType.phone, |
|
|
|
new EditableText(controller, node, style, cursorColor, Colors.transparent, selectionColor: selectionColor, keyboardType: TextInputType.emailAddress, |
|
|
|
new EditableText(controller, node, style, cursorColor, Colors.transparent, |
|
|
|
selectionColor: selectionColor, keyboardType: TextInputType.emailAddress, |
|
|
|
new EditableText(controller, node, style, cursorColor, Colors.transparent, selectionColor: selectionColor, keyboardType: TextInputType.url, |
|
|
|
new EditableText(controller, node, style, cursorColor, Colors.transparent, |
|
|
|
selectionColor: selectionColor, keyboardType: TextInputType.url, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
widgets.Add(new Text("UIWidgets Touch Keyboard", style: new TextStyle(fontSize:20, height:2.0f), textAlign: TextAlign.center)); |
|
|
|
|
|
|
|
widgets.Add(new Text("UIWidgets Touch Keyboard", style: new TextStyle(fontSize: 20, height: 2.0f), |
|
|
|
textAlign: TextAlign.center)); |
|
|
|
|
|
|
|
widgets.Add(new Text("Unity Touch Keyboard", style: new TextStyle(fontSize:20, height:2.0f), textAlign: TextAlign.center)); |
|
|
|
|
|
|
|
widgets.Add(new Text("Unity Touch Keyboard", style: new TextStyle(fontSize: 20, height: 2.0f), |
|
|
|
textAlign: TextAlign.center)); |
|
|
|
|
|
|
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.stretch, |
|
|
|
children: widgets))); |
|
|
|
crossAxisAlignment: CrossAxisAlignment.stretch, |
|
|
|
children: widgets))); |
|
|
|
|
|
|
|
|
|
|
|
public class EditStateProvider : StatefulWidget { |
|
|
|
public delegate EditableText EditableBuilder(BuildContext context, |
|
|
|
TextEditingController controller, FocusNode focusNode); |
|
|
|