shadowed_box.dart 855 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

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