|
|
@ -34,6 +34,8 @@ class _LoggerFABState extends State<LoggerFAB> {
|
|
|
|
double get screenWidth => MediaQuery.of(context).size.width;
|
|
|
|
double get screenWidth => MediaQuery.of(context).size.width;
|
|
|
|
double get screenHeight => MediaQuery.of(context).size.height;
|
|
|
|
double get screenHeight => MediaQuery.of(context).size.height;
|
|
|
|
bool _moving = false;
|
|
|
|
bool _moving = false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool showSubPage = false;
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return AnimatedPositioned(
|
|
|
|
return AnimatedPositioned(
|
|
|
@ -41,45 +43,56 @@ class _LoggerFABState extends State<LoggerFAB> {
|
|
|
|
duration: _moving ? Duration.zero : Duration(milliseconds: 300),
|
|
|
|
duration: _moving ? Duration.zero : Duration(milliseconds: 300),
|
|
|
|
left: _x - 25,
|
|
|
|
left: _x - 25,
|
|
|
|
top: _y - 25,
|
|
|
|
top: _y - 25,
|
|
|
|
child: GestureDetector(
|
|
|
|
child: AnimatedOpacity(
|
|
|
|
onPanStart: (detail) {
|
|
|
|
duration: Duration(milliseconds: 300),
|
|
|
|
_moving = true;
|
|
|
|
curve: Curves.easeInOutCubic,
|
|
|
|
},
|
|
|
|
opacity: showSubPage ? 0 : 1,
|
|
|
|
onPanUpdate: (details) {
|
|
|
|
child: GestureDetector(
|
|
|
|
setState(() {
|
|
|
|
onPanStart: (detail) {
|
|
|
|
_x = details.globalPosition.dx;
|
|
|
|
_moving = true;
|
|
|
|
_y = details.globalPosition.dy;
|
|
|
|
},
|
|
|
|
});
|
|
|
|
onPanUpdate: (details) {
|
|
|
|
},
|
|
|
|
setState(() {
|
|
|
|
onPanEnd: (detail) {
|
|
|
|
_x = details.globalPosition.dx;
|
|
|
|
if ((_x < screenWidth / 2)) {
|
|
|
|
_y = details.globalPosition.dy;
|
|
|
|
_x = 50;
|
|
|
|
});
|
|
|
|
} else
|
|
|
|
},
|
|
|
|
_x = screenWidth - 50;
|
|
|
|
onPanEnd: (detail) {
|
|
|
|
if ((_y < screenHeight / 2)) {
|
|
|
|
if ((_x < screenWidth / 2)) {
|
|
|
|
_y = 70;
|
|
|
|
_x = 50;
|
|
|
|
} else
|
|
|
|
} else
|
|
|
|
_y = screenHeight - 50;
|
|
|
|
_x = screenWidth - 50;
|
|
|
|
_moving = false;
|
|
|
|
if (_y > screenHeight - 50) {
|
|
|
|
setState(() {});
|
|
|
|
_y = screenHeight - 50;
|
|
|
|
},
|
|
|
|
} else if (_y < 50) _y = 50;
|
|
|
|
onTap: () => Navigator.push(
|
|
|
|
|
|
|
|
context,
|
|
|
|
_moving = false;
|
|
|
|
MaterialPageRoute(builder: (context) => PowerLoggerView()),
|
|
|
|
setState(() {});
|
|
|
|
),
|
|
|
|
},
|
|
|
|
child: ClipOval(
|
|
|
|
onTap: showSubPage
|
|
|
|
child: BackdropFilter(
|
|
|
|
? null
|
|
|
|
filter: ImageFilter.blur(sigmaX: 5, sigmaY: 5),
|
|
|
|
: () async {
|
|
|
|
child: Container(
|
|
|
|
showSubPage = true;
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
await Navigator.push(
|
|
|
|
color: Colors.blueAccent.withOpacity(0.4),
|
|
|
|
context,
|
|
|
|
borderRadius: BorderRadius.circular(25),
|
|
|
|
MaterialPageRoute(builder: (context) => PowerLoggerView()),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
height: 50,
|
|
|
|
showSubPage = false;
|
|
|
|
width: 50,
|
|
|
|
},
|
|
|
|
child: Icon(
|
|
|
|
child: ClipOval(
|
|
|
|
Icons.code,
|
|
|
|
child: BackdropFilter(
|
|
|
|
color: Colors.white70,
|
|
|
|
filter: ImageFilter.blur(sigmaX: 5, sigmaY: 5),
|
|
|
|
|
|
|
|
child: Container(
|
|
|
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
|
|
|
color: Colors.blueAccent.withOpacity(0.4),
|
|
|
|
|
|
|
|
borderRadius: BorderRadius.circular(25),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
height: 50,
|
|
|
|
|
|
|
|
width: 50,
|
|
|
|
|
|
|
|
child: Icon(
|
|
|
|
|
|
|
|
Icons.code,
|
|
|
|
|
|
|
|
color: Colors.white70,
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|