From 48ee31cb4c2358fe26deba8d13b63a79619722ac Mon Sep 17 00:00:00 2001 From: Adam Barth Date: Wed, 11 Mar 2015 14:20:11 -0700 Subject: [PATCH] Update Button to be made of Material To accomplish this, I made the following changes: 1) Material is now in charge of drawing the material shadows. 2) In order to mix in the style for the shadow, Element now takes a list of Styles instead of a single style. 3) Update all clients of Element#style to understand that we now have a list. 4) Update components that drawer shadows to have Material do that work instead. a) One exception: FloatingActionButton draws its own shadow because of its crazy clip requirements. We'll probably want to find a better way for FloatingActionButton to clip in the future. I've also added a widgets-fn example to demo the fn material widgets. This CL introduces a bug into Drawer whereby you can get ink splashes everywhere in the drawer. In the future, we'll need to separate out the different material aspects to get non-splashable materials. R=rafaelw@chromium.org Review URL: https://codereview.chromium.org/1003553002 --- engine/src/flutter/examples/widgets-fn/main.sky | 15 +++++++++++++++ .../flutter/examples/widgets-fn/widgets_app.dart | 12 ++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 engine/src/flutter/examples/widgets-fn/main.sky create mode 100644 engine/src/flutter/examples/widgets-fn/widgets_app.dart diff --git a/engine/src/flutter/examples/widgets-fn/main.sky b/engine/src/flutter/examples/widgets-fn/main.sky new file mode 100644 index 0000000000..c7c304f909 --- /dev/null +++ b/engine/src/flutter/examples/widgets-fn/main.sky @@ -0,0 +1,15 @@ +#!mojo mojo:sky_viewer + + + + + diff --git a/engine/src/flutter/examples/widgets-fn/widgets_app.dart b/engine/src/flutter/examples/widgets-fn/widgets_app.dart new file mode 100644 index 0000000000..eaaa0a58ed --- /dev/null +++ b/engine/src/flutter/examples/widgets-fn/widgets_app.dart @@ -0,0 +1,12 @@ +// 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 '../../framework/fn.dart'; +import '../../framework/components/button.dart'; + +class WidgetsApp extends App { + Node build() { + return new Button(content: new Text('Go'), level: 1); + } +}