From 79880991620c52d3ea9c296427db769d700bc8c1 Mon Sep 17 00:00:00 2001 From: Adam Barth Date: Sat, 26 Mar 2016 00:27:03 -0700 Subject: [PATCH] Fix Travis The collections package changed to add some stricter type annotations. We now pass those type annoations. I also sent https://github.com/dart-lang/collection/pull/26 to make the type annotations match what they were previously. --- .../material_gallery/lib/demo/leave_behind_demo.dart | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/examples/material_gallery/lib/demo/leave_behind_demo.dart b/examples/material_gallery/lib/demo/leave_behind_demo.dart index 26cbbd2313..e5a406ce00 100644 --- a/examples/material_gallery/lib/demo/leave_behind_demo.dart +++ b/examples/material_gallery/lib/demo/leave_behind_demo.dart @@ -13,7 +13,7 @@ enum LeaveBehindDemoAction { rightSwipe } -class LeaveBehindItem { +class LeaveBehindItem implements Comparable { LeaveBehindItem({ this.index, this.name, this.subject, this.body }); LeaveBehindItem.from(LeaveBehindItem item) @@ -23,6 +23,9 @@ class LeaveBehindItem { final String name; final String subject; final String body; + + @override + int compareTo(LeaveBehindItem other) => index.compareTo(other.index); } class LeaveBehindDemo extends StatefulWidget { @@ -72,9 +75,7 @@ class LeaveBehindDemoState extends State { } void handleUndo(LeaveBehindItem item) { - int insertionIndex = lowerBound(leaveBehindItems, item, - compare: (LeaveBehindItem a, LeaveBehindItem b) => a.index.compareTo(b.index) - ); + int insertionIndex = lowerBound(leaveBehindItems, item); setState(() { leaveBehindItems.insert(insertionIndex, item); });