mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00

Instread of an explicit 'enabled' bool, this uses the presence of the event handler to determine if a widget is enabled or not. This means that if you've not passed a handler, your widget will be disabled, which makes sense, since it wouldn't work anyway. Adds this feature to checkbox, and ports raised button, flat button, and radio buttons to this new model. Adds a checkbox to card_collection that can be disabled. Hide a (basically bogus) hint from the (soon to be disabled) strong hint mode in the analyzer that this reveals.
47 lines
1.5 KiB
Dart
47 lines
1.5 KiB
Dart
// Copyright 2015 The Chromium Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
class ContainerApp extends StatelessComponent {
|
|
Widget build(BuildContext context) {
|
|
return new Column(<Widget>[
|
|
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://raw.githubusercontent.com/dart-lang/logos/master/logos_and_wordmarks/dart-logo.png",
|
|
width: 300.0,
|
|
height: 300.0
|
|
)
|
|
),
|
|
new Container(
|
|
decoration: new BoxDecoration(backgroundColor: const Color(0xFFFFFF00)),
|
|
padding: new EdgeDims.symmetric(horizontal: 50.0, vertical: 75.0),
|
|
child: new Row(<Widget>[
|
|
new RaisedButton(
|
|
child: new Text('PRESS ME'),
|
|
onPressed: () => print("Hello World")
|
|
),
|
|
new RaisedButton(
|
|
child: new Text('DISABLED')
|
|
)
|
|
])
|
|
),
|
|
new Flexible(
|
|
child: new Container(
|
|
decoration: new BoxDecoration(backgroundColor: const Color(0xFF00FFFF))
|
|
)
|
|
),
|
|
],
|
|
justifyContent: FlexJustifyContent.spaceBetween
|
|
);
|
|
}
|
|
}
|
|
|
|
void main() {
|
|
runApp(new ContainerApp());
|
|
}
|