Skip to content

Commit

Permalink
Fixed overflow of pomodoro screen on landscape #125
Browse files Browse the repository at this point in the history
  • Loading branch information
Sanat-Jha committed Jan 4, 2025
1 parent 0727f73 commit dd316fc
Showing 1 changed file with 80 additions and 78 deletions.
158 changes: 80 additions & 78 deletions lib/screens/task_pomodoro_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -106,91 +106,93 @@ class _TaskPomodoroScreenState extends State<TaskPomodoroScreen> {
),
)
],
body: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Padding(
padding: const EdgeInsets.all(8.0),
child: Card(
child: ListTile(
title: Text(
widget.task.title,
maxLines: 2,
overflow: TextOverflow.ellipsis,
body: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Padding(
padding: const EdgeInsets.all(8.0),
child: Card(
child: ListTile(
title: Text(
widget.task.title,
maxLines: 2,
overflow: TextOverflow.ellipsis,
),
subtitle: Text(
widget.task.description,
maxLines: 5,
overflow: TextOverflow.ellipsis,
),
trailing: Text(
MyDateUtils.getFormattedDate(widget.task.deadline),
style: const TextStyle(color: Colors.red),
),
),
subtitle: Text(
widget.task.description,
maxLines: 5,
overflow: TextOverflow.ellipsis,
),
),
const Spacing(large: true),
if (_isStarted)
Padding(
padding: const EdgeInsets.all(8.0),
child: CircularCountDownTimer(
width: timerSize,
height: timerSize,
duration: _duration.inSeconds,
isReverse: true,
fillColor: Theme.of(context).focusColor,
ringColor: Theme.of(context).highlightColor,
strokeWidth: 16,
isReverseAnimation: true,
textStyle: Theme.of(context).textTheme.displayMedium,
controller: _controller,
onComplete: _onCountdownComplete,
autoStart: true,
),
trailing: Text(
MyDateUtils.getFormattedDate(widget.task.deadline),
style: const TextStyle(color: Colors.red),
),
if (!_isStarted)
Padding(
padding: const EdgeInsets.all(8.0),
child: DurationPicker(
duration: _duration,
baseUnit: BaseUnit.minute,
width: timerSize,
height: timerSize,
lowerBound: Duration(minutes: _currentTimerType.lowerBound),
upperBound: Duration(minutes: _currentTimerType.upperBound),
onChange: (value) => setState(() {
_duration = value;
}),
),
),
),
),
const Spacing(large: true),
if (_isStarted)
Padding(
padding: const EdgeInsets.all(8.0),
child: CircularCountDownTimer(
width: timerSize,
height: timerSize,
duration: _duration.inSeconds,
isReverse: true,
fillColor: Theme.of(context).focusColor,
ringColor: Theme.of(context).highlightColor,
strokeWidth: 16,
isReverseAnimation: true,
textStyle: Theme.of(context).textTheme.displayMedium,
controller: _controller,
onComplete: _onCountdownComplete,
autoStart: true,
const Spacing(),
Text(helperText),
const Spacing(large: true),
Card(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(48),
),
),
if (!_isStarted)
Padding(
padding: const EdgeInsets.all(8.0),
child: DurationPicker(
duration: _duration,
baseUnit: BaseUnit.minute,
width: timerSize,
height: timerSize,
lowerBound: Duration(minutes: _currentTimerType.lowerBound),
upperBound: Duration(minutes: _currentTimerType.upperBound),
onChange: (value) => setState(() {
_duration = value;
}),
color: Theme.of(context).primaryColorLight,
child: IconButton(
onPressed: () {
if (!_isStarted) {
setState(() {
_isStarted = true;
});
}
if (_controller.isPaused.value) {
_controller.resume();
} else {
_controller.pause();
}
setState(() {});
},
icon: Icon(actionIcon),
iconSize: 48,
),
),
const Spacing(),
Text(helperText),
const Spacing(large: true),
Card(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(48),
),
color: Theme.of(context).primaryColorLight,
child: IconButton(
onPressed: () {
if (!_isStarted) {
setState(() {
_isStarted = true;
});
}
if (_controller.isPaused.value) {
_controller.resume();
} else {
_controller.pause();
}
setState(() {});
},
icon: Icon(actionIcon),
iconSize: 48,
),
),
],
],
),
),
);
}
Expand Down

0 comments on commit dd316fc

Please sign in to comment.