change player open episode page animation.
This commit is contained in:
parent
9b8ef2d770
commit
b510472443
|
@ -222,9 +222,14 @@ class PlayerWidget extends StatelessWidget {
|
||||||
: AudioPanel(
|
: AudioPanel(
|
||||||
key: playerKey,
|
key: playerKey,
|
||||||
miniPanel: _miniPanel(context),
|
miniPanel: _miniPanel(context),
|
||||||
expandedPanel: ControlPanel(onTap: () {
|
expandedPanel: ControlPanel(
|
||||||
playerKey.currentState.scrollToTop();
|
onExpand: () {
|
||||||
}));
|
playerKey.currentState.scrollToTop();
|
||||||
|
},
|
||||||
|
onClose: () {
|
||||||
|
playerKey.currentState.backToMini();
|
||||||
|
},
|
||||||
|
));
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -605,7 +610,9 @@ class SleepModeState extends State<SleepMode>
|
||||||
AnimationController(vsync: this, duration: Duration(milliseconds: 400));
|
AnimationController(vsync: this, duration: Duration(milliseconds: 400));
|
||||||
_animation = Tween<double>(begin: 0.0, end: 1.0).animate(_controller)
|
_animation = Tween<double>(begin: 0.0, end: 1.0).animate(_controller)
|
||||||
..addListener(() {
|
..addListener(() {
|
||||||
setState(() {});
|
if (mounted) {
|
||||||
|
setState(() {});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
_controller.addStatusListener((status) {
|
_controller.addStatusListener((status) {
|
||||||
|
@ -835,19 +842,19 @@ class SleepModeState extends State<SleepMode>
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
if (fraction > 0)
|
if (move > 0)
|
||||||
Positioned(
|
Positioned(
|
||||||
bottom: 120,
|
bottom: 120,
|
||||||
left: width / 2 - 100,
|
left: width / 2 - 100,
|
||||||
width: 200,
|
width: 200,
|
||||||
child: Center(
|
child: Center(
|
||||||
child: Transform.translate(
|
child: Transform.translate(
|
||||||
offset: Offset(0, -50 * fraction),
|
offset: Offset(0, -50 * move),
|
||||||
child: Text(s.goodNight,
|
child: Text(s.goodNight,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
color: Colors.white.withOpacity(fraction))),
|
color: Colors.white.withOpacity(move))),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -863,8 +870,9 @@ class SleepModeState extends State<SleepMode>
|
||||||
}
|
}
|
||||||
|
|
||||||
class ControlPanel extends StatefulWidget {
|
class ControlPanel extends StatefulWidget {
|
||||||
ControlPanel({this.onTap, Key key}) : super(key: key);
|
ControlPanel({this.onExpand, this.onClose, Key key}) : super(key: key);
|
||||||
final VoidCallback onTap;
|
final VoidCallback onExpand;
|
||||||
|
final VoidCallback onClose;
|
||||||
@override
|
@override
|
||||||
_ControlPanelState createState() => _ControlPanelState();
|
_ControlPanelState createState() => _ControlPanelState();
|
||||||
}
|
}
|
||||||
|
@ -1237,12 +1245,24 @@ class _ControlPanelState extends State<ControlPanel>
|
||||||
if (_setSpeed == 0)
|
if (_setSpeed == 0)
|
||||||
Expanded(
|
Expanded(
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
onTap: () => Navigator.push(
|
onTap: () async {
|
||||||
context,
|
widget.onClose();
|
||||||
SlideUptRoute(
|
Navigator.push(
|
||||||
page: EpisodeDetail(
|
context,
|
||||||
episodeItem: data.item1,
|
FadeRoute(
|
||||||
heroTag: 'playpanel'))),
|
page: EpisodeDetail(
|
||||||
|
episodeItem: data.item1,
|
||||||
|
heroTag: 'playpanel'))
|
||||||
|
// PageRouteBuilder( pageBuilder: (context,
|
||||||
|
// animation,
|
||||||
|
// secondAnimation) =>
|
||||||
|
// EpisodeDetail(
|
||||||
|
// episodeItem:
|
||||||
|
// data.item1,
|
||||||
|
// heroTag:
|
||||||
|
// 'playpanel'))
|
||||||
|
);
|
||||||
|
},
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
SizedBox(
|
SizedBox(
|
||||||
|
@ -1386,7 +1406,7 @@ class _ControlPanelState extends State<ControlPanel>
|
||||||
color: context.textColor)),
|
color: context.textColor)),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
onTap: widget.onTap),
|
onTap: widget.onExpand),
|
||||||
),
|
),
|
||||||
if (_setSpeed == 0 && maxHeight > 300)
|
if (_setSpeed == 0 && maxHeight > 300)
|
||||||
Transform.translate(
|
Transform.translate(
|
||||||
|
|
|
@ -112,3 +112,34 @@ class ScaleRoute extends PageRouteBuilder {
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class FadeRoute extends PageRouteBuilder {
|
||||||
|
final Widget page;
|
||||||
|
FadeRoute({this.page})
|
||||||
|
: super(
|
||||||
|
pageBuilder: (
|
||||||
|
context,
|
||||||
|
animation,
|
||||||
|
secondaryAnimation,
|
||||||
|
) =>
|
||||||
|
page,
|
||||||
|
transitionsBuilder: (
|
||||||
|
context,
|
||||||
|
animation,
|
||||||
|
secondaryAnimation,
|
||||||
|
child,
|
||||||
|
) =>
|
||||||
|
FadeTransition(
|
||||||
|
opacity: Tween<double>(
|
||||||
|
begin: 0.0,
|
||||||
|
end: 1.0,
|
||||||
|
).animate(
|
||||||
|
CurvedAnimation(
|
||||||
|
parent: animation,
|
||||||
|
curve: Curves.easeInCubic,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: child,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue