Port Date Picker example to fn3
This commit is contained in:
@@ -2,17 +2,17 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
import 'package:sky/widgets.dart';
|
||||
import 'package:sky/src/fn3.dart';
|
||||
|
||||
class ContainerApp extends App {
|
||||
Widget build() {
|
||||
class ContainerApp extends StatelessComponent {
|
||||
Widget build(BuildContext context) {
|
||||
return new Column([
|
||||
new Container(
|
||||
padding: new EdgeDims.all(10.0),
|
||||
margin: new EdgeDims.all(10.0),
|
||||
decoration: new BoxDecoration(backgroundColor: const Color(0xFFCCCCCC)),
|
||||
child: new NetworkImage(
|
||||
src: "https://www.dartlang.org/logos/dart-logo.png",
|
||||
src: "https://raw.githubusercontent.com/dart-lang/logos/master/logos_and_wordmarks/dart-logo.png",
|
||||
width: 300.0,
|
||||
height: 300.0
|
||||
)
|
||||
|
||||
@@ -2,27 +2,30 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
import 'package:sky/widgets.dart';
|
||||
import 'package:sky/src/fn3.dart';
|
||||
import 'package:sky/material.dart';
|
||||
|
||||
void main() => runApp(new DatePickerDemo());
|
||||
|
||||
class DatePickerDemo extends App {
|
||||
class DatePickerDemo extends StatefulComponent {
|
||||
DatePickerDemoState createState() => new DatePickerDemoState(this);
|
||||
}
|
||||
|
||||
DateTime _dateTime;
|
||||
|
||||
void initState() {
|
||||
class DatePickerDemoState extends ComponentState<DatePickerDemo> {
|
||||
DatePickerDemoState(DatePickerDemo config) : super(config) {
|
||||
DateTime now = new DateTime.now();
|
||||
_dateTime = new DateTime(now.year, now.month, now.day);
|
||||
}
|
||||
|
||||
DateTime _dateTime;
|
||||
|
||||
void _handleDateChanged(DateTime dateTime) {
|
||||
setState(() {
|
||||
_dateTime = dateTime;
|
||||
});
|
||||
}
|
||||
|
||||
Widget build() {
|
||||
Widget build(BuildContext context) {
|
||||
return new Theme(
|
||||
data: new ThemeData(
|
||||
brightness: ThemeBrightness.light,
|
||||
|
||||
Reference in New Issue
Block a user