|
|
@ -2,11 +2,9 @@
|
|
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
|
|
// found in the LICENSE file.
|
|
|
|
// found in the LICENSE file.
|
|
|
|
|
|
|
|
|
|
|
|
import 'dart:async';
|
|
|
|
|
|
|
|
import 'dart:math';
|
|
|
|
import 'dart:math';
|
|
|
|
|
|
|
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter/services.dart';
|
|
|
|
|
|
|
|
import 'package:meta/meta.dart';
|
|
|
|
import 'package:meta/meta.dart';
|
|
|
|
import 'package:scoped_model/scoped_model.dart';
|
|
|
|
import 'package:scoped_model/scoped_model.dart';
|
|
|
|
|
|
|
|
|
|
|
@ -51,11 +49,11 @@ double _paddedThumbnailHeight(BuildContext context) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
class ExpandingBottomSheet extends StatefulWidget {
|
|
|
|
class ExpandingBottomSheet extends StatefulWidget {
|
|
|
|
const ExpandingBottomSheet(
|
|
|
|
const ExpandingBottomSheet({
|
|
|
|
{Key key,
|
|
|
|
Key key,
|
|
|
|
@required this.hideController,
|
|
|
|
@required this.hideController,
|
|
|
|
@required this.expandingController})
|
|
|
|
@required this.expandingController,
|
|
|
|
: assert(hideController != null),
|
|
|
|
}) : assert(hideController != null),
|
|
|
|
assert(expandingController != null),
|
|
|
|
assert(expandingController != null),
|
|
|
|
super(key: key);
|
|
|
|
super(key: key);
|
|
|
|
|
|
|
|
|
|
|
@ -551,18 +549,6 @@ class _ExpandingBottomSheetState extends State<ExpandingBottomSheet>
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Closes the cart if the cart is open, otherwise exits the app (this should
|
|
|
|
|
|
|
|
// only be relevant for Android).
|
|
|
|
|
|
|
|
Future<bool> _onWillPop() async {
|
|
|
|
|
|
|
|
if (!_isOpen) {
|
|
|
|
|
|
|
|
await SystemNavigator.pop();
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
close();
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return AnimatedSize(
|
|
|
|
return AnimatedSize(
|
|
|
@ -571,8 +557,6 @@ class _ExpandingBottomSheetState extends State<ExpandingBottomSheet>
|
|
|
|
curve: Curves.easeInOut,
|
|
|
|
curve: Curves.easeInOut,
|
|
|
|
vsync: this,
|
|
|
|
vsync: this,
|
|
|
|
alignment: AlignmentDirectional.topStart,
|
|
|
|
alignment: AlignmentDirectional.topStart,
|
|
|
|
child: WillPopScope(
|
|
|
|
|
|
|
|
onWillPop: _onWillPop,
|
|
|
|
|
|
|
|
child: AnimatedBuilder(
|
|
|
|
child: AnimatedBuilder(
|
|
|
|
animation: widget.hideController,
|
|
|
|
animation: widget.hideController,
|
|
|
|
builder: (context, child) => AnimatedBuilder(
|
|
|
|
builder: (context, child) => AnimatedBuilder(
|
|
|
@ -583,7 +567,6 @@ class _ExpandingBottomSheetState extends State<ExpandingBottomSheet>
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|