made lesson countdown rotatable
This commit is contained in:
parent
051cdc895e
commit
796b35e27c
@ -1,6 +1,7 @@
|
|||||||
// ignore_for_file: unnecessary_null_comparison
|
// ignore_for_file: unnecessary_null_comparison
|
||||||
|
|
||||||
import 'package:animations/animations.dart';
|
import 'package:animations/animations.dart';
|
||||||
|
import 'package:flutter/services.dart';
|
||||||
import 'package:refilc/api/providers/user_provider.dart';
|
import 'package:refilc/api/providers/user_provider.dart';
|
||||||
import 'package:refilc/helpers/subject.dart';
|
import 'package:refilc/helpers/subject.dart';
|
||||||
import 'package:refilc/models/settings.dart';
|
import 'package:refilc/models/settings.dart';
|
||||||
@ -43,6 +44,10 @@ class LiveCardStateA extends State<LiveCard> {
|
|||||||
_userProvider = Provider.of<UserProvider>(context, listen: false);
|
_userProvider = Provider.of<UserProvider>(context, listen: false);
|
||||||
liveCard = Provider.of<LiveCardProvider>(context, listen: false);
|
liveCard = Provider.of<LiveCardProvider>(context, listen: false);
|
||||||
_userProvider.addListener(liveCard.update);
|
_userProvider.addListener(liveCard.update);
|
||||||
|
|
||||||
|
SystemChrome.setPreferredOrientations([
|
||||||
|
DeviceOrientation.portraitUp,
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -419,14 +424,38 @@ class LiveCardStateA extends State<LiveCard> {
|
|||||||
if (progressCurrent != null &&
|
if (progressCurrent != null &&
|
||||||
progressMax != null)
|
progressMax != null)
|
||||||
GestureDetector(
|
GestureDetector(
|
||||||
onTap: () {
|
onTap: () async {
|
||||||
showDialog(
|
SystemChrome.setPreferredOrientations([
|
||||||
|
DeviceOrientation.portraitUp,
|
||||||
|
DeviceOrientation.portraitDown,
|
||||||
|
DeviceOrientation.landscapeRight,
|
||||||
|
DeviceOrientation.landscapeLeft,
|
||||||
|
]);
|
||||||
|
|
||||||
|
SystemChrome.setSystemUIOverlayStyle(
|
||||||
|
const SystemUiOverlayStyle(
|
||||||
|
statusBarColor: Colors.transparent,
|
||||||
|
statusBarIconBrightness:
|
||||||
|
Brightness.dark,
|
||||||
|
systemNavigationBarColor:
|
||||||
|
Colors.transparent,
|
||||||
|
systemNavigationBarIconBrightness:
|
||||||
|
Brightness.dark,
|
||||||
|
));
|
||||||
|
|
||||||
|
var result = await showDialog(
|
||||||
barrierColor: Colors.black,
|
barrierColor: Colors.black,
|
||||||
context: context,
|
context: context,
|
||||||
builder: (context) => HeadsUpCountdown(
|
builder: (context) => HeadsUpCountdown(
|
||||||
maxTime: maxTime,
|
maxTime: maxTime,
|
||||||
elapsedTime: elapsedTime),
|
elapsedTime: elapsedTime),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (result != null) {
|
||||||
|
SystemChrome.setPreferredOrientations([
|
||||||
|
DeviceOrientation.portraitUp,
|
||||||
|
]);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
color: Colors.transparent,
|
color: Colors.transparent,
|
||||||
@ -825,14 +854,38 @@ class LiveCardStateA extends State<LiveCard> {
|
|||||||
if (progressCurrent != null &&
|
if (progressCurrent != null &&
|
||||||
progressMax != null)
|
progressMax != null)
|
||||||
GestureDetector(
|
GestureDetector(
|
||||||
onTap: () {
|
onTap: () async {
|
||||||
showDialog(
|
SystemChrome.setPreferredOrientations([
|
||||||
|
DeviceOrientation.portraitUp,
|
||||||
|
DeviceOrientation.portraitDown,
|
||||||
|
DeviceOrientation.landscapeRight,
|
||||||
|
DeviceOrientation.landscapeLeft,
|
||||||
|
]);
|
||||||
|
|
||||||
|
SystemChrome.setSystemUIOverlayStyle(
|
||||||
|
const SystemUiOverlayStyle(
|
||||||
|
statusBarColor: Colors.transparent,
|
||||||
|
statusBarIconBrightness:
|
||||||
|
Brightness.dark,
|
||||||
|
systemNavigationBarColor:
|
||||||
|
Colors.transparent,
|
||||||
|
systemNavigationBarIconBrightness:
|
||||||
|
Brightness.dark,
|
||||||
|
));
|
||||||
|
|
||||||
|
var result = await showDialog(
|
||||||
barrierColor: Colors.black,
|
barrierColor: Colors.black,
|
||||||
context: context,
|
context: context,
|
||||||
builder: (context) => HeadsUpCountdown(
|
builder: (context) => HeadsUpCountdown(
|
||||||
maxTime: maxTime,
|
maxTime: maxTime,
|
||||||
elapsedTime: elapsedTime),
|
elapsedTime: elapsedTime),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (result != null) {
|
||||||
|
SystemChrome.setPreferredOrientations([
|
||||||
|
DeviceOrientation.portraitUp,
|
||||||
|
]);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
color: Colors.transparent,
|
color: Colors.transparent,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user