浏览代码

[Cupertino] Update Cupertino gallery

/main
iizzaya 5 年前
当前提交
82b6fc9b
共有 14 个文件被更改,包括 734 次插入40 次删除
  1. 29
      Runtime/cupertino/switch.cs
  2. 6
      Samples/UIWidgetsGallery/demo/cupertino/cupertino_buttons_demo.cs
  3. 46
      Samples/UIWidgetsGallery/gallery/demos.cs
  4. 24
      Samples/UIWidgetsGallery/demo/cupertino/cupertino_activity_indicator_demo.cs
  5. 11
      Samples/UIWidgetsGallery/demo/cupertino/cupertino_activity_indicator_demo.cs.meta
  6. 273
      Samples/UIWidgetsGallery/demo/cupertino/cupertino_alert_demo.cs
  7. 11
      Samples/UIWidgetsGallery/demo/cupertino/cupertino_alert_demo.cs.meta
  8. 5
      Samples/UIWidgetsGallery/demo/cupertino/cupertino_navigation_demo.cs
  9. 71
      Samples/UIWidgetsGallery/demo/cupertino/cupertino_slider_demo.cs
  10. 11
      Samples/UIWidgetsGallery/demo/cupertino/cupertino_slider_demo.cs.meta
  11. 73
      Samples/UIWidgetsGallery/demo/cupertino/cupertino_switch_demo.cs
  12. 11
      Samples/UIWidgetsGallery/demo/cupertino/cupertino_switch_demo.cs.meta
  13. 192
      Samples/UIWidgetsGallery/demo/cupertino/cupertino_text_field_demo.cs
  14. 11
      Samples/UIWidgetsGallery/demo/cupertino/cupertino_text_field_demo.cs.meta

29
Runtime/cupertino/switch.cs


namespace Unity.UIWidgets.cupertino {
class CupertinoSwitchUtils {
public static float _kTrackWidth = 51.0f;
public static float _kTrackHeight = 31.0f;
public static float _kTrackRadius = _kTrackHeight / 2.0f;
public static float _kTrackInnerStart = _kTrackHeight / 2.0f;
public static float _kTrackInnerEnd = _kTrackWidth - _kTrackInnerStart;
public static float _kTrackInnerLength = _kTrackInnerEnd - _kTrackInnerStart;
public static float _kSwitchWidth = 59.0f;
public static float _kSwitchHeight = 39.0f;
public static float _kCupertinoSwitchDisabledOpacity = 0.5f;
public const float _kTrackWidth = 51.0f;
public const float _kTrackHeight = 31.0f;
public const float _kTrackRadius = _kTrackHeight / 2.0f;
public const float _kTrackInnerStart = _kTrackHeight / 2.0f;
public const float _kTrackInnerEnd = _kTrackWidth - _kTrackInnerStart;
public const float _kTrackInnerLength = _kTrackInnerEnd - _kTrackInnerStart;
public const float _kSwitchWidth = 59.0f;
public const float _kSwitchHeight = 39.0f;
public const float _kCupertinoSwitchDisabledOpacity = 0.5f;
public static Color _kTrackColor = CupertinoColors.lightBackgroundGray;
public static TimeSpan _kReactionDuration = new TimeSpan(0, 0, 0, 0, 300);
public static TimeSpan _kToggleDuration = new TimeSpan(0, 0, 0, 0, 200);

public readonly ValueChanged<bool> onChanged;
public readonly TickerProvider vsync;
public readonly DragStartBehavior dragStartBehavior;
public override RenderObject createRenderObject(BuildContext context) {
return new _RenderCupertinoSwitch(
value: this.value,

TapGestureRecognizer _tap;
HorizontalDragGestureRecognizer _drag;
public override void attach(object owne) {
base.attach(this.owner);
public override void attach(object _owner) {
base.attach(_owner);
if (this.value) {
this._positionController.forward();
}

this._position.curve = null;
this._position.reverseCurve = null;
float delta = details.primaryDelta / CupertinoSwitchUtils._kTrackInnerLength ?? 0f;
// switch (this.textDirection) {
// case TextDirection.rtl:
// this._positionController.setValue(this._positionController.value - delta);

6
Samples/UIWidgetsGallery/demo/cupertino/cupertino_buttons_demo.cs


using System.Collections.Generic;
using Unity.UIWidgets.cupertino;
using Unity.UIWidgets.material;
using Unity.UIWidgets.painting;
using Unity.UIWidgets.rendering;
using Unity.UIWidgets.widgets;

public static string routeName = "/cupertino/buttons";
public override State createState() => new _CupertinoButtonDemoState();
public override State createState() {
return new _CupertinoButtonDemoState();
}
}
class _CupertinoButtonDemoState : State<CupertinoButtonsDemo> {

46
Samples/UIWidgetsGallery/gallery/demos.cs


// documentationUrl: "https://docs.flutter.io/flutter/cupertino/CupertinoSegmentedControl-class.html",
// buildRoute: (BuildContext context) => CupertinoSegmentedControlDemo()
// ),
// new GalleryDemo(
// title: "Sliders",
// icon: GalleryIcons.sliders,
// category: GalleryDemoCategory._kCupertinoComponents,
// routeName: CupertinoSliderDemo.routeName,
// documentationUrl: "https://docs.flutter.io/flutter/cupertino/CupertinoSlider-class.html",
// buildRoute: (BuildContext context) => CupertinoSliderDemo()
// ),
// new GalleryDemo(
// title: "Switches",
// icon: GalleryIcons.cupertino_switch,
// category: GalleryDemoCategory._kCupertinoComponents,
// routeName: CupertinoSwitchDemo.routeName,
// documentationUrl: "https://docs.flutter.io/flutter/cupertino/CupertinoSwitch-class.html",
// buildRoute: (BuildContext context) => CupertinoSwitchDemo()
// ),
// new GalleryDemo(
// title: "Text Fields",
// icon: GalleryIcons.text_fields_alt,
// category: GalleryDemoCategory._kCupertinoComponents,
// routeName: CupertinoTextFieldDemo.routeName,
// buildRoute: (BuildContext context) => CupertinoTextFieldDemo()
// ),
new GalleryDemo(
title: "Sliders",
icon: GalleryIcons.sliders,
category: _kCupertinoComponents,
routeName: CupertinoSliderDemo.routeName,
documentationUrl: "https://docs.flutter.io/flutter/cupertino/CupertinoSlider-class.html",
buildRoute: (BuildContext context) => new CupertinoSliderDemo()
),
new GalleryDemo(
title: "Switches",
icon: GalleryIcons.cupertino_switch,
category: _kCupertinoComponents,
routeName: CupertinoSwitchDemo.routeName,
documentationUrl: "https://docs.flutter.io/flutter/cupertino/CupertinoSwitch-class.html",
buildRoute: (BuildContext context) => new CupertinoSwitchDemo()
),
new GalleryDemo(
title: "Text Fields",
icon: GalleryIcons.text_fields_alt,
category: _kCupertinoComponents,
routeName: CupertinoTextFieldDemo.routeName,
buildRoute: (BuildContext context) => new CupertinoTextFieldDemo()
),
//
// // Media
// new GalleryDemo(

24
Samples/UIWidgetsGallery/demo/cupertino/cupertino_activity_indicator_demo.cs


using Unity.UIWidgets.cupertino;
using Unity.UIWidgets.widgets;
namespace UIWidgetsGallery.gallery {
/*
class CupertinoProgressIndicatorDemo : StatelessWidget {
public static string routeName = "/cupertino/progress_indicator";
public override
Widget build(BuildContext context) {
return new CupertinoPageScaffold(
navigationBar: new CupertinoNavigationBar(
previousPageTitle: "Cupertino",
middle: new Text("Activity Indicator"),
trailing: new CupertinoDemoDocumentationButton(routeName)
),
child: new Center(
child: new CupertinoActivityIndicator()
)
);
}
}
*/
}

11
Samples/UIWidgetsGallery/demo/cupertino/cupertino_activity_indicator_demo.cs.meta


fileFormatVersion: 2
guid: cd9442c2f316e4ad1924fa656a7788a8
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

273
Samples/UIWidgetsGallery/demo/cupertino/cupertino_alert_demo.cs


using System.Collections.Generic;
using Unity.UIWidgets.cupertino;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.painting;
using Unity.UIWidgets.widgets;
namespace UIWidgetsGallery.gallery {
/*
class CupertinoAlertDemo : StatefulWidget {
public static string routeName = "/cupertino/alert";
public override State createState() => new _CupertinoAlertDemoState();
}
class _CupertinoAlertDemoState : State<CupertinoAlertDemo> {
string lastSelectedValue;
void showDemoDialog(
BuildContext context = null,
Widget child = null
) {
CupertinoRouteUtils.showCupertinoDialog<string>(
context: context,
builder: (BuildContext _context) => child
).Then((string value) => {
if (value != null) {
this.setState(() => { this.lastSelectedValue = value; });
}
});
}
void showDemoActionSheet(
BuildContext context = null,
Widget child = null
) {
CupertinoRouteUtils.showCupertinoModalPopup<string>(
context: context,
builder: (BuildContext _context) => child
).Then((string value) => {
if (value != null) {
this.setState(() => { this.lastSelectedValue = value; });
}
});
}
public override Widget build(BuildContext context) {
return new CupertinoPageScaffold(
navigationBar: new CupertinoNavigationBar(
middle: new Text("Alerts"),
previousPageTitle: "Cupertino",
trailing: new CupertinoDemoDocumentationButton(CupertinoAlertDemo.routeName)
),
child:
new DefaultTextStyle(
style: CupertinoTheme.of(context).textTheme.textStyle,
child: new Builder(
builder: (BuildContext _context) => {
List<Widget> stackChildren = new List<Widget> {
new ListView(
padding: EdgeInsets.symmetric(vertical: 24.0f, horizontal: 72.0f)
+ MediaQuery.of(_context).padding,
children: new List<Widget> {
CupertinoButton.filled(
child: new Text("Alert"),
onPressed: () => {
this.showDemoDialog(
context: _context,
child: new CupertinoAlertDialog(
title: new Text("Discard draft?"),
actions: new List<Widget> {
new CupertinoDialogAction(
child: new Text("Discard"),
isDestructiveAction: true,
onPressed: () => { Navigator.pop(_context, "Discard"); }
),
new CupertinoDialogAction(
child: new Text("Cancel"),
isDefaultAction: true,
onPressed: () => { Navigator.pop(_context, "Cancel"); }
),
}
)
);
}
),
new Padding(padding: EdgeInsets.all(8.0f)),
CupertinoButton.filled(
child: new Text("Alert with Title"),
padding: EdgeInsets.symmetric(vertical: 16.0f, horizontal: 36.0f),
onPressed: () => {
this.showDemoDialog(
context: _context,
child: new CupertinoAlertDialog(
title: new Text(
"Allow \"Maps\" to access your location while you are using the app?")
,
content: new Text(
"Your current location will be displayed on the map and used \n" +
"for directions, nearby search results, and estimated travel times.")
,
actions: new List<Widget> {
new CupertinoDialogAction(
child: new Text("Don\"t Allow"),
onPressed: () => {
Navigator.pop(_context, "Disallow");
}
),
new CupertinoDialogAction(
child: new Text("Allow"),
onPressed: () => { Navigator.pop(_context, "Allow"); }
),
}
)
);
}
),
new Padding(padding: EdgeInsets.all(8.0f)),
CupertinoButton.filled(
child: new Text("Alert with Buttons"),
padding: EdgeInsets.symmetric(vertical: 16.0f, horizontal: 36.0f),
onPressed: () => {
this.showDemoDialog(
context: _context,
child: new CupertinoDessertDialog(
title: new Text("Select Favorite Dessert"),
content: new Text(
"Please select your favorite type of dessert from the \n" +
"list below. Your selection will be used to customize the suggested \n" +
"list of eateries in your area.")
)
);
}
),
new Padding(padding: EdgeInsets.all(8.0f)),
CupertinoButton.filled(
child: new Text("Alert Buttons Only"),
padding: EdgeInsets.symmetric(vertical: 16.0f, horizontal: 36.0f),
onPressed: () => {
this.showDemoDialog(
context: _context,
child: new CupertinoDessertDialog()
);
}
),
new Padding(padding: EdgeInsets.all(8.0f)),
CupertinoButton.filled(
child: new Text("Action Sheet"),
padding: EdgeInsets.symmetric(vertical: 16.0f, horizontal: 36.0f),
onPressed: () => {
this.showDemoActionSheet(
context: _context,
child: new CupertinoActionSheet(
title: new Text("Favorite Dessert"),
message:
new Text(
"Please select the best dessert from the options below."),
actions:
new List<Widget> {
new CupertinoActionSheetAction(
child: new Text("Profiteroles"),
onPressed: () => {
Navigator.pop(_context, "Profiteroles");
}
),
new CupertinoActionSheetAction(
child: new Text("Cannolis"),
onPressed: () => {
Navigator.pop(_context, "Cannolis");
}
),
new CupertinoActionSheetAction(
child: new Text("Trifle"),
onPressed: () => { Navigator.pop(_context, "Trifle"); }
),
},
cancelButton: new CupertinoActionSheetAction(
child: new Text("Cancel"),
isDefaultAction:
true,
onPressed:
() => { Navigator.pop(_context, "Cancel"); }
)
)
);
}
)
}
)
};
if (this.lastSelectedValue != null) {
stackChildren.Add(
new Positioned(
bottom: 32.0f,
child: new Text("You selected: $lastSelectedValue")
)
);
}
return new Stack(
alignment: Alignment.center,
children: stackChildren
);
}
)
)
);
}
}
class CupertinoDessertDialog : StatelessWidget {
public CupertinoDessertDialog(
Key key = null,
Widget title = null,
Widget content = null
) : base(key: key) {
this.title = title;
this.content = content;
}
public readonly Widget title;
public readonly Widget content;
public override Widget build(BuildContext context) {
return new CupertinoAlertDialog(
title: title,
content: content,
actions: new List<Widget> {
new CupertinoDialogAction(
child: new Text("Cheesecake"),
onPressed: () => { Navigator.pop(context, "Cheesecake"); }
),
new CupertinoDialogAction(
child: new Text("Tiramisu"),
onPressed: () => { Navigator.pop(context, "Tiramisu"); }
),
new CupertinoDialogAction(
child: new Text("Apple Pie"),
onPressed:
() => { Navigator.pop(context, "Apple Pie"); }
),
new CupertinoDialogAction(
child: new Text("Devil\"s food cake"),
onPressed:
() => { Navigator.pop(context, "Devil\"s food cake"); }
),
new CupertinoDialogAction(
child: new Text("Banana Split"),
onPressed:
() => { Navigator.pop(context, "Banana Split"); }
),
new CupertinoDialogAction(
child: new Text("Oatmeal Cookie"),
onPressed:
() => { Navigator.pop(context, "Oatmeal Cookies"); }
),
new CupertinoDialogAction(
child: new Text("Chocolate Brownie"),
onPressed:
() => { Navigator.pop(context, "Chocolate Brownies"); }
),
new CupertinoDialogAction(
child: new Text("Cancel"),
isDestructiveAction:
true,
onPressed:
() => { Navigator.pop(context, "Cancel"); }
),
}
);
}
}
*/
}

11
Samples/UIWidgetsGallery/demo/cupertino/cupertino_alert_demo.cs.meta


fileFormatVersion: 2
guid: fcd454968bdd543c181c3bde5aee8651
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

5
Samples/UIWidgetsGallery/demo/cupertino/cupertino_navigation_demo.cs


namespace UIWidgetsGallery.gallery {
public class cupertino_navigation_demo {
}
}

71
Samples/UIWidgetsGallery/demo/cupertino/cupertino_slider_demo.cs


using System.Collections.Generic;
using Unity.UIWidgets.cupertino;
using Unity.UIWidgets.rendering;
using Unity.UIWidgets.widgets;
namespace UIWidgetsGallery.gallery {
class CupertinoSliderDemo : StatefulWidget {
public static string routeName = "/cupertino/slider";
public override State createState() {
return new _CupertinoSliderDemoState();
}
}
class _CupertinoSliderDemoState : State<CupertinoSliderDemo> {
float _value = 25.0f;
float _discreteValue = 20.0f;
public override Widget build(BuildContext context) {
return new CupertinoPageScaffold(
navigationBar: new CupertinoNavigationBar(
middle: new Text("Sliders"),
previousPageTitle: "Cupertino",
trailing: new CupertinoDemoDocumentationButton(CupertinoSliderDemo.routeName)
),
child: new DefaultTextStyle(
style: CupertinoTheme.of(context).textTheme.textStyle,
child: new SafeArea(
child: new Center(
child: new Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: new List<Widget> {
new Column(
mainAxisSize: MainAxisSize.min,
children: new List<Widget> {
new CupertinoSlider(
value: this._value,
min: 0.0f,
max: 100.0f,
divisions: 100, // TODO: FIX BUG
onChanged: (float value) => {
this.setState(() => { this._value = value; });
}
),
new Text($"Cupertino Continuous: {this._value.ToString("F1")}"),
}
),
new Column(
mainAxisSize: MainAxisSize.min,
children: new List<Widget> {
new CupertinoSlider(
value: this._discreteValue,
min: 0.0f,
max: 100.0f,
divisions: 5,
onChanged: (float value) => {
this.setState(() => { this._discreteValue = value; });
}
),
new Text($"Cupertino Discrete: {this._discreteValue}"),
}
),
}
)
)
)
)
);
}
}
}

11
Samples/UIWidgetsGallery/demo/cupertino/cupertino_slider_demo.cs.meta


fileFormatVersion: 2
guid: 172d1ae6d262e45d4a131a02d85ddf44
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

73
Samples/UIWidgetsGallery/demo/cupertino/cupertino_switch_demo.cs


using System.Collections.Generic;
using Unity.UIWidgets.cupertino;
using Unity.UIWidgets.rendering;
using Unity.UIWidgets.widgets;
namespace UIWidgetsGallery.gallery {
class CupertinoSwitchDemo : StatefulWidget {
public static string routeName = "/cupertino/switch";
public override State createState() => new _CupertinoSwitchDemoState();
}
class _CupertinoSwitchDemoState : State<CupertinoSwitchDemo> {
bool _switchValue = false;
public override Widget build(BuildContext context) {
return new CupertinoPageScaffold(
navigationBar: new CupertinoNavigationBar(
middle: new Text("Switch"),
previousPageTitle: "Cupertino",
trailing: new CupertinoDemoDocumentationButton(CupertinoSwitchDemo.routeName)
),
child: new DefaultTextStyle(
style: CupertinoTheme.of(context).textTheme.textStyle,
child: new SafeArea(
child: new Center(
child: new Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: new List<Widget> {
new Column(
children: new List<Widget> {
new CupertinoSwitch(
value: this._switchValue,
onChanged: (bool value) => {
this.setState(() => { this._switchValue = value; });
}
),
new Text(
"Enabled - " + (this._switchValue ? "On" : "Off")
),
}
),
new Column(
children: new List<Widget> {
new CupertinoSwitch(
value: true,
onChanged: null
),
new Text(
"Disabled - On"
),
}
),
new Column(
children: new List<Widget> {
new CupertinoSwitch(
value: false,
onChanged: null
),
new Text(
"Disabled - Off"
),
}
)
}
)
)
)
)
);
}
}
}

11
Samples/UIWidgetsGallery/demo/cupertino/cupertino_switch_demo.cs.meta


fileFormatVersion: 2
guid: 6f9a95d09a56a495f8878fd15b5aed4b
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

192
Samples/UIWidgetsGallery/demo/cupertino/cupertino_text_field_demo.cs


using System.Collections.Generic;
using Unity.UIWidgets.cupertino;
using Unity.UIWidgets.painting;
using Unity.UIWidgets.service;
using Unity.UIWidgets.widgets;
namespace UIWidgetsGallery.gallery {
class CupertinoTextFieldDemo : StatefulWidget {
public const string routeName = "/cupertino/text_fields";
public override State createState() {
return new _CupertinoTextFieldDemoState();
}
}
class _CupertinoTextFieldDemoState : State<CupertinoTextFieldDemo> {
TextEditingController _chatTextController;
TextEditingController _locationTextController;
public override void initState() {
base.initState();
this._chatTextController = new TextEditingController();
this._locationTextController = new TextEditingController(text: "Montreal, Canada");
}
Widget _buildChatTextField() {
return new CupertinoTextField(
controller: this._chatTextController,
textCapitalization: TextCapitalization.sentences,
placeholder: "Text Message",
decoration: new BoxDecoration(
border: Border.all(
width: 0.0f,
color: CupertinoColors.inactiveGray
),
borderRadius: BorderRadius.circular(15.0f)
),
maxLines: null,
keyboardType: TextInputType.multiline,
prefix: new Padding(padding: EdgeInsets.symmetric(horizontal: 4.0f)),
suffix:
new Padding(
padding: EdgeInsets.symmetric(horizontal: 4.0f),
child: new CupertinoButton(
color: CupertinoColors.activeGreen,
minSize: 0.0f,
child: new Icon(
CupertinoIcons.up_arrow,
size: 21.0f,
color: CupertinoColors.white
),
padding: EdgeInsets.all(2.0f),
borderRadius:
BorderRadius.circular(15.0f),
onPressed: () => this.setState(() => this._chatTextController.clear())
)
),
autofocus: true,
suffixMode: OverlayVisibilityMode.editing,
onSubmitted: (string text) => this.setState(() => this._chatTextController.clear())
);
}
Widget _buildNameField() {
return new CupertinoTextField(
prefix: new Icon(
CupertinoIcons.person_solid,
color: CupertinoColors.lightBackgroundGray,
size: 28.0f
),
padding: EdgeInsets.symmetric(horizontal: 6.0f, vertical: 12.0f),
clearButtonMode: OverlayVisibilityMode.editing,
textCapitalization: TextCapitalization.words,
autocorrect: false,
decoration: new BoxDecoration(
border: new Border(bottom: new BorderSide(width: 0.0f, color: CupertinoColors.inactiveGray))
),
placeholder: "Name"
);
}
Widget _buildEmailField() {
return new CupertinoTextField(
prefix: new Icon(
CupertinoIcons.mail_solid,
color: CupertinoColors.lightBackgroundGray,
size: 28.0f
),
padding: EdgeInsets.symmetric(horizontal: 6.0f, vertical: 12.0f),
clearButtonMode: OverlayVisibilityMode.editing,
keyboardType: TextInputType.emailAddress,
autocorrect: false,
decoration: new BoxDecoration(
border: new Border(bottom: new BorderSide(width: 0.0f, color: CupertinoColors.inactiveGray))
),
placeholder: "Email"
);
}
Widget _buildLocationField() {
return new CupertinoTextField(
controller: this._locationTextController,
prefix: new Icon(
CupertinoIcons.location_solid,
color: CupertinoColors.lightBackgroundGray,
size: 28.0f
),
padding: EdgeInsets.symmetric(horizontal: 6.0f, vertical: 12.0f),
clearButtonMode: OverlayVisibilityMode.editing,
textCapitalization: TextCapitalization.words,
decoration: new BoxDecoration(
border: new Border(bottom: new BorderSide(width: 0.0f, color: CupertinoColors.inactiveGray))
),
placeholder: "Location"
);
}
Widget _buildPinField() {
return new CupertinoTextField(
prefix: new Icon(
CupertinoIcons.padlock_solid,
color: CupertinoColors.lightBackgroundGray,
size: 28.0f
),
padding: EdgeInsets.symmetric(horizontal: 6.0f, vertical: 12.0f),
clearButtonMode: OverlayVisibilityMode.editing,
keyboardType: TextInputType.number,
autocorrect: false,
obscureText: true,
decoration: new BoxDecoration(
border: new Border(bottom: new BorderSide(width: 0.0f, color: CupertinoColors.inactiveGray))
),
placeholder: "Create a PIN"
);
}
Widget _buildTagsField() {
return new CupertinoTextField(
controller: new TextEditingController(text: "colleague, reading club"),
prefix: new Icon(
CupertinoIcons.tags_solid,
color: CupertinoColors.lightBackgroundGray,
size: 28.0f
),
enabled: false,
padding: EdgeInsets.symmetric(horizontal: 6.0f, vertical: 12.0f),
decoration: new BoxDecoration(
border: new Border(bottom: new BorderSide(width: 0.0f, color: CupertinoColors.inactiveGray))
)
);
}
public override Widget build(BuildContext context) {
return new DefaultTextStyle(
style: new TextStyle(
fontFamily: ".SF Pro Text", // ".SF UI Text",
inherit: false,
fontSize: 17.0f,
color: CupertinoColors.black
),
child: new CupertinoPageScaffold(
navigationBar: new CupertinoNavigationBar(
previousPageTitle: "Cupertino",
middle: new Text("Text Fields")
),
child: new SafeArea(
child: new ListView(
children: new List<Widget> {
new Padding(
padding: EdgeInsets.symmetric(vertical: 32.0f, horizontal: 16.0f),
child: new Column(
children: new List<Widget> {
this._buildNameField(),
this._buildEmailField(),
this._buildLocationField(),
this._buildPinField(),
this._buildTagsField(),
}
)
),
new Padding(
padding: EdgeInsets.symmetric(vertical: 32.0f, horizontal: 16.0f),
child: this._buildChatTextField()
),
}
)
)
)
);
}
}
}

11
Samples/UIWidgetsGallery/demo/cupertino/cupertino_text_field_demo.cs.meta


fileFormatVersion: 2
guid: 38c40bf70348345f5bc7e93853e451fd
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
正在加载...
取消
保存