big_switch.dart 837 Bytes
Newer Older
1 2 3 4
// 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.

5
import 'package:sky/widgets.dart';
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
import 'package:sky/theme/colors.dart';
import 'package:vector_math/vector_math.dart';

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),
23
        padding: new EdgeDims.all(20.0),
24 25 26 27 28 29 30 31 32 33 34
        transform: scale,
        decoration: new BoxDecoration(
          backgroundColor: Teal[600]
        )
    );
  }
}

void main() {
  runApp(new BigSwitchApp());
}