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

Similar to widgets.dart, rendering.dart exports the entire rendering layer. Also, update the examples to use rendering.dart and widgets.dart. Also clean up some exports so that the examples have more sensible imports.
34 lines
807 B
Dart
34 lines
807 B
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:sky/widgets.dart';
|
|
import 'package:sky/theme/colors.dart' as colors;
|
|
|
|
class BigSwitchApp extends App {
|
|
bool _value = false;
|
|
|
|
void _handleOnChanged(bool value) {
|
|
setState(() {
|
|
_value = value;
|
|
});
|
|
}
|
|
|
|
Widget build() {
|
|
Matrix4 scale = new Matrix4.identity();
|
|
scale.scale(5.0, 5.0);
|
|
return new Container(
|
|
child: new Switch(value: _value, onChanged: _handleOnChanged),
|
|
padding: new EdgeDims.all(20.0),
|
|
transform: scale,
|
|
decoration: new BoxDecoration(
|
|
backgroundColor: colors.Teal[600]
|
|
)
|
|
);
|
|
}
|
|
}
|
|
|
|
void main() {
|
|
runApp(new BigSwitchApp());
|
|
}
|