Fix analyzer warnings

This commit is contained in:
Adam Barth
2015-08-22 08:24:02 -07:00
parent 89c1144718
commit 2873880f50
3 changed files with 4 additions and 24 deletions

View File

@@ -124,7 +124,7 @@ class FitnessApp extends App {
name: '/settings',
builder: (navigator, route) => new SettingsFragment(
navigator: navigator,
userData: _userData as UserData,
userData: _userData,
updater: settingsUpdater
)
),

View File

@@ -28,14 +28,6 @@ class SettingsFragment extends StatefulComponent {
updater(backup: value ? BackupMode.enabled : BackupMode.disabled);
}
void _goalWeightChanged(double value) {
assert(updater != null);
setState(() {
optimism = value ? StockMode.optimistic : StockMode.pessimistic;
});
sendUpdates();
}
Widget buildToolBar() {
return new ToolBar(
left: new IconButton(

View File

@@ -70,30 +70,18 @@ void main() {
test("should throw when inserting multiple elements", () {
doc.appendChild(doc.createElement("div"));
var oldChild = doc.appendChild(doc.createText(" text "));
doc.appendChild(doc.createText(" text "));
expect(childElementCount(doc), equals(1));
var newChild = doc.createElement("div");
// expect(() {
// doc.replaceChild(newChild, 0);
// }, throws);
// expect(() {
// doc.insertBefore(newChild, oldChild);
// }, throws);
doc.createElement("div");
});
test("should throw when inserting multiple elements with a fragment", () {
var oldChild = doc.appendChild(doc.createElement("div"));
doc.appendChild(doc.createElement("div"));
expect(childElementCount(doc), equals(1));
var fragment = doc.createDocumentFragment();
fragment.appendChild(doc.createText(" text "));
fragment.appendChild(doc.createElement("div"));
fragment.appendChild(doc.createElement("div"));
fragment.appendChild(doc.createText(" "));
// expect(() {
// doc.replaceChild(fragment, 0);
// }, throws);
// expect(() {
// doc.insertBefore(fragment, oldChild);
// }, throws);
});
}