This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
child: Column( | |
children: <Widget>[ | |
Flexible( | |
flex: 4, | |
child: new Column( | |
children: <Widget>[ | |
// Your children .. | |
], | |
), | |
), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The minimum insets for contents of the Scaffold to keep visible. | |
final EdgeInsets minInsets = mediaQuery.padding.copyWith( | |
bottom: widget.resizeToAvoidBottomPadding ? mediaQuery.viewInsets.bottom : 0.0, | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
void main() => runApp(new MyApp()); | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return new MaterialApp( | |
title: 'Flutter Demo', | |
theme: new ThemeData( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Repository { | |
static final Repository _repo = new Repository._internal(); | |
BookDatabase database; | |
static Repository get() { | |
return _repo; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class FadeRoute<T> extends MaterialPageRoute<T> { | |
FadeRoute({ WidgetBuilder builder, RouteSettings settings }) | |
: super(builder: builder, settings: settings); | |
@override | |
Widget buildTransitions(BuildContext context, | |
Animation<double> animation, | |
Animation<double> secondaryAnimation, | |
Widget child) { | |
if (settings.isInitialRoute) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
onTap: (){ | |
Navigator.of(context).push( | |
new FadeRoute( | |
builder: (BuildContext context) => new BookNotesPage(bookState), | |
settings: new RouteSettings(name: '/notes', isInitialRoute: false), | |
)); | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
new Hero( | |
child: new Image.network(bookState.url), | |
tag: bookState.id, | |
): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I/flutter ( 5025): ══╡ EXCEPTION CAUGHT BY GESTURE ╞═══════════════════════════════════════════════════════════════════ | |
I/flutter ( 5025): The following assertion was thrown while handling a gesture: | |
I/flutter ( 5025): 'package:flutter/src/material/page.dart': Failed assertion: line 84 pos 12: 'opaque': is not true. | |
I/flutter ( 5025): | |
I/flutter ( 5025): Either the assertion indicates an error in the framework itself, or we should provide substantially | |
I/flutter ( 5025): more information in this error message to help you determine and fix the underlying cause. | |
I/flutter ( 5025): In either case, please report this assertion by filing a bug on GitHub: | |
I/flutter ( 5025): https://github.com/flutter/flutter/issues/new | |
I/flutter ( 5025): | |
I/flutter ( 5025): When the exception was thrown, this was the stack: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@override | |
void initState() { | |
super.initState(); | |
_textController = new TextEditingController(text: widget.book.notes); | |
subject.stream.debounce(new Duration(milliseconds: 400)).listen((text){ | |
widget.book.notes = text; | |
BookDatabase.get().updateBook(widget.book); | |
}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
child: new IconButton( | |
icon: bookState.starred? new Icon(Icons.star): new Icon(Icons.star_border), | |
color: Colors.black, | |
onPressed: (){ | |
setState(() { | |
bookState.starred = !bookState.starred; | |
}); | |
BookDatabase.get().updateBook(bookState); | |
}, | |
), |