|
|
@ -16,7 +16,6 @@ import 'package:flutter/material.dart';
|
|
|
|
import 'package:meta/meta.dart';
|
|
|
|
import 'package:meta/meta.dart';
|
|
|
|
|
|
|
|
|
|
|
|
import 'login.dart';
|
|
|
|
import 'login.dart';
|
|
|
|
import 'model/product.dart';
|
|
|
|
|
|
|
|
import 'shopping_cart.dart';
|
|
|
|
import 'shopping_cart.dart';
|
|
|
|
|
|
|
|
|
|
|
|
const double _kFlingVelocity = 2.0;
|
|
|
|
const double _kFlingVelocity = 2.0;
|
|
|
@ -147,20 +146,17 @@ class _BackdropTitle extends AnimatedWidget {
|
|
|
|
/// can make a selection. The user can also configure the titles for when the
|
|
|
|
/// can make a selection. The user can also configure the titles for when the
|
|
|
|
/// front or back layer is showing.
|
|
|
|
/// front or back layer is showing.
|
|
|
|
class Backdrop extends StatefulWidget {
|
|
|
|
class Backdrop extends StatefulWidget {
|
|
|
|
final Category currentCategory;
|
|
|
|
|
|
|
|
final Widget frontLayer;
|
|
|
|
final Widget frontLayer;
|
|
|
|
final Widget backLayer;
|
|
|
|
final Widget backLayer;
|
|
|
|
final Widget frontTitle;
|
|
|
|
final Widget frontTitle;
|
|
|
|
final Widget backTitle;
|
|
|
|
final Widget backTitle;
|
|
|
|
|
|
|
|
|
|
|
|
const Backdrop({
|
|
|
|
const Backdrop({
|
|
|
|
@required this.currentCategory,
|
|
|
|
|
|
|
|
@required this.frontLayer,
|
|
|
|
@required this.frontLayer,
|
|
|
|
@required this.backLayer,
|
|
|
|
@required this.backLayer,
|
|
|
|
@required this.frontTitle,
|
|
|
|
@required this.frontTitle,
|
|
|
|
@required this.backTitle,
|
|
|
|
@required this.backTitle,
|
|
|
|
}) : assert(currentCategory != null),
|
|
|
|
}) : assert(frontLayer != null),
|
|
|
|
assert(frontLayer != null),
|
|
|
|
|
|
|
|
assert(backLayer != null),
|
|
|
|
assert(backLayer != null),
|
|
|
|
assert(frontTitle != null),
|
|
|
|
assert(frontTitle != null),
|
|
|
|
assert(backTitle != null);
|
|
|
|
assert(backTitle != null);
|
|
|
@ -184,17 +180,6 @@ class _BackdropState extends State<Backdrop>
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
|
|
|
void didUpdateWidget(Backdrop old) {
|
|
|
|
|
|
|
|
super.didUpdateWidget(old);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (widget.currentCategory != old.currentCategory) {
|
|
|
|
|
|
|
|
_toggleBackdropLayerVisibility();
|
|
|
|
|
|
|
|
} else if (!_frontLayerVisible) {
|
|
|
|
|
|
|
|
_controller.fling(velocity: _kFlingVelocity);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
void dispose() {
|
|
|
|
void dispose() {
|
|
|
|
_controller.dispose();
|
|
|
|
_controller.dispose();
|
|
|
|