shadowed_box.dart 828 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 'dart:ui';
6

7 8
import 'package:flutter/rendering.dart';
import 'package:flutter/material.dart';
9 10 11 12 13 14

void main() {
  var coloredBox = new RenderDecoratedBox(
    decoration: new BoxDecoration(
      gradient: new RadialGradient(
        center: Point.origin, radius: 500.0,
Hixie's avatar
Hixie committed
15
        colors: <Color>[Colors.yellow[500], Colors.blue[500]]),
Hans Muller's avatar
Hans Muller committed
16
      boxShadow: elevationToShadow[8])
17 18 19 20
  );
  var paddedBox = new RenderPadding(
    padding: const EdgeDims.all(50.0),
    child: coloredBox);
Ian Hickson's avatar
Ian Hickson committed
21
  new RenderingFlutterBinding(root: new RenderDecoratedBox(
22 23 24 25 26 27
    decoration: const BoxDecoration(
      backgroundColor: const Color(0xFFFFFFFF)
    ),
    child: paddedBox
  ));
}