Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(747)

Unified Diff: sky/sdk/example/demo_launcher/lib/main.dart

Issue 1237693008: Make the Cards in DemoLauncher.apk splash on touch. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: simplified Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/sdk/example/demo_launcher/lib/main.dart
diff --git a/sky/sdk/example/demo_launcher/lib/main.dart b/sky/sdk/example/demo_launcher/lib/main.dart
index 23aeac766869b8fadfda630d9bdf37510e1094ea..70d70a796b356c006af198b5a68d353dc2013c13 100644
--- a/sky/sdk/example/demo_launcher/lib/main.dart
+++ b/sky/sdk/example/demo_launcher/lib/main.dart
@@ -15,6 +15,7 @@ import 'package:sky/widgets/task_description.dart';
import 'package:sky/widgets/theme.dart';
import 'package:sky/widgets/tool_bar.dart';
import 'package:sky/widgets/scrollable_list.dart';
+import 'package:sky/widgets/ink_well.dart';
AssetBundle _initBundle() {
if (rootBundle != null)
@@ -113,6 +114,7 @@ List<SkyDemo> demos = [
)
),
// new SkyDemo(
+
// 'Touch Demo', '../../rendering/touch_demo.dart', 'Simple example showing handling of touch events at a low level'),
new SkyDemo(
name: 'Minedigger Game',
@@ -130,6 +132,25 @@ const double kCardHeight = 120.0;
const EdgeDims kListPadding = const EdgeDims.all(4.0);
class DemoList extends Component {
+ Widget buildCardContents(SkyDemo demo) {
+ return new Container(
+ decoration: demo.decoration,
+ child: new InkWell(
+ child: new Container(
+ margin: const EdgeDims.all(24.0),
+ child: new Flex([
+ new Text(demo.name, style: demo.textTheme.title),
+ new Flexible(
+ child: new Text(demo.description, style: demo.textTheme.subhead)
+ )
+ ],
+ direction: FlexDirection.vertical,
+ alignItems: FlexAlignItems.start)
+ )
+ )
+ );
+ }
+
Widget buildDemo(SkyDemo demo) {
return new Listener(
key: demo.name,
@@ -137,27 +158,7 @@ class DemoList extends Component {
child: new Container(
height: kCardHeight,
child: new Card(
- child: new Flex([
- new Flexible(
- child: new Stack([
- new Container(
- decoration: demo.decoration,
- child: new Container()
- ),
- new Container(
- margin: const EdgeDims.all(24.0),
- child: new Flex([
- new Text(demo.name, style: demo.textTheme.title),
- new Flexible(
- child: new Text(demo.description, style: demo.textTheme.subhead)
- )
- ],
- direction: FlexDirection.vertical,
- alignItems: FlexAlignItems.start)
- )
- ])
- ),
- ], direction: FlexDirection.vertical)
+ child: buildCardContents(demo)
)
)
);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698