Fix assert

This commit is contained in:
Vishesh Handa
2019-02-02 12:39:12 +01:00
parent 7f31b17012
commit 21ab144b18

View File

@ -1,10 +1,9 @@
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:journal/widgets/note_header.dart';
import 'note_editor.dart';
import 'note.dart';
import 'note_editor.dart';
class NoteBrowsingScreen extends StatefulWidget {
final List<Note> notes;
@ -48,7 +47,7 @@ class NoteBrowsingScreenState extends State<NoteBrowsingScreen> {
onPressed: () {
var route = new MaterialPageRoute(builder: (context) {
int currentIndex = pageController.page.toInt();
assert(currentIndex > 0);
assert(currentIndex >= 0);
assert(currentIndex < widget.notes.length);
Note note = widget.notes[currentIndex];