filters
This commit is contained in:
@@ -77,6 +77,30 @@ class MapViewState extends State<MapView> {
|
|||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
RaisedButton(
|
||||||
|
color: Colors.grey[900],
|
||||||
|
elevation: 0,
|
||||||
|
padding: EdgeInsets.symmetric(
|
||||||
|
vertical: 12, horizontal: 4),
|
||||||
|
onPressed: () {
|
||||||
|
Navigator.pop(context);
|
||||||
|
},
|
||||||
|
child: Column(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: <Widget>[
|
||||||
|
Icon(
|
||||||
|
Icons.arrow_back_ios_rounded,
|
||||||
|
color: Colors.orange,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
RaisedButton(
|
RaisedButton(
|
||||||
color: Colors.grey[900],
|
color: Colors.grey[900],
|
||||||
elevation: 0,
|
elevation: 0,
|
||||||
|
|||||||
@@ -21,8 +21,52 @@ class SearchResults extends StatefulWidget {
|
|||||||
_SearchResultsState createState() => _SearchResultsState();
|
_SearchResultsState createState() => _SearchResultsState();
|
||||||
}
|
}
|
||||||
|
|
||||||
class _SearchResultsState extends State<SearchResults> {
|
class _SearchResultsState extends State<SearchResults>
|
||||||
|
with SingleTickerProviderStateMixin {
|
||||||
GlobalKey<ScaffoldState> _drawerKey = GlobalKey();
|
GlobalKey<ScaffoldState> _drawerKey = GlobalKey();
|
||||||
|
bool expand;
|
||||||
|
AnimationController animationController;
|
||||||
|
Animation<double> animation;
|
||||||
|
|
||||||
|
void prepareAnimations() {
|
||||||
|
animationController =
|
||||||
|
AnimationController(vsync: this, duration: Duration(milliseconds: 500));
|
||||||
|
animation = CurvedAnimation(
|
||||||
|
parent: animationController, curve: Curves.fastOutSlowIn);
|
||||||
|
}
|
||||||
|
|
||||||
|
void checkExpand() {
|
||||||
|
print('Check Expand');
|
||||||
|
if (expand) {
|
||||||
|
animationController.forward();
|
||||||
|
print('Open');
|
||||||
|
} else {
|
||||||
|
animationController.reverse();
|
||||||
|
print('Close');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void didUpdateWidget(SearchResults oldWidget) {
|
||||||
|
print('Widget Did Update');
|
||||||
|
super.didUpdateWidget(oldWidget);
|
||||||
|
checkExpand();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
print("Init State");
|
||||||
|
super.initState();
|
||||||
|
expand = false;
|
||||||
|
prepareAnimations();
|
||||||
|
checkExpand();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void dispose() {
|
||||||
|
animationController.dispose();
|
||||||
|
super.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
@@ -35,6 +79,13 @@ class _SearchResultsState extends State<SearchResults> {
|
|||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
|
SizeTransition(
|
||||||
|
sizeFactor: animation,
|
||||||
|
child: Container(
|
||||||
|
decoration: BoxDecoration(color: Colors.blue),
|
||||||
|
child: Text("Dupa"),
|
||||||
|
),
|
||||||
|
),
|
||||||
Container(
|
Container(
|
||||||
decoration: BoxDecoration(color: Colors.grey[850]),
|
decoration: BoxDecoration(color: Colors.grey[850]),
|
||||||
child: Column(
|
child: Column(
|
||||||
@@ -118,7 +169,9 @@ class _SearchResultsState extends State<SearchResults> {
|
|||||||
icon: Icons.filter_alt_rounded,
|
icon: Icons.filter_alt_rounded,
|
||||||
text: "Filtruj",
|
text: "Filtruj",
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
_drawerKey.currentState.openDrawer();
|
setState(() {
|
||||||
|
expand = !expand;
|
||||||
|
});
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|||||||
Reference in New Issue
Block a user