Skip to content

Commit 1259d58

Browse files
authored
Timeline Selection (#303)
2 parents 7a035ee + da5bff9 commit 1259d58

File tree

10 files changed

+501
-214
lines changed

10 files changed

+501
-214
lines changed

lib/l10n/app_en.arb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,14 @@
291291
"@Downloads": {},
292292
"downloads": "Downloads",
293293
"download": "Download",
294+
"downloadN": "Download {n, plural, =1{1 event} other{{n} events}}",
295+
"@downloadN": {
296+
"placeholders": {
297+
"n": {
298+
"type": "int"
299+
}
300+
}
301+
},
294302
"downloaded": "Downloaded",
295303
"downloading": "Downloading",
296304
"seeInDownloads": "See in Downloads",

lib/l10n/app_fr.arb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,14 @@
281281
"@Downloads": {},
282282
"downloads": "Téléchargements",
283283
"download": "Télécharger",
284+
"downloadN": "Download {n, plural, =1{1 event} other{{n} events}}",
285+
"@downloadN": {
286+
"placeholders": {
287+
"n": {
288+
"type": "int"
289+
}
290+
}
291+
},
284292
"downloaded": "Téléchargé",
285293
"downloading": "En téléchargement",
286294
"seeInDownloads": "Voir dans téléchargements",

lib/l10n/app_pl.arb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,14 @@
291291
"@Downloads": {},
292292
"downloads": "Pobrania",
293293
"download": "Pobierz",
294+
"downloadN": "Download {n, plural, =1{1 event} other{{n} events}}",
295+
"@downloadN": {
296+
"placeholders": {
297+
"n": {
298+
"type": "int"
299+
}
300+
}
301+
},
294302
"downloaded": "Pobrane",
295303
"downloading": "Pobieranie",
296304
"seeInDownloads": "Zobacz w Pobranych",

lib/l10n/app_pt.arb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,14 @@
291291
"@Downloads": {},
292292
"downloads": "Downloads",
293293
"download": "Baixar",
294+
"downloadN": "Baixar {n, plural, =1{1 evento} other{{n} eventos}}",
295+
"@downloadN": {
296+
"placeholders": {
297+
"n": {
298+
"type": "int"
299+
}
300+
}
301+
},
294302
"downloaded": "Baixado",
295303
"downloading": "Baixando",
296304
"seeInDownloads": "Ver nos Downloads",

lib/screens/downloads/indicators.dart

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ class DownloadProgressIndicator extends StatelessWidget {
3636
this.color,
3737
});
3838

39+
/// The download progress from 0.0 to 1.0.
3940
final DownloadProgress progress;
4041

4142
/// The color of the indicator.
@@ -98,9 +99,11 @@ class DownloadIndicator extends StatelessWidget {
9899
final theme = Theme.of(context);
99100
final loc = AppLocalizations.of(context);
100101

101-
return SizedBox(
102-
height: 40.0,
103-
width: 40.0,
102+
return ConstrainedBox(
103+
constraints: BoxConstraints(
104+
maxHeight: 40.0,
105+
maxWidth: 40.0,
106+
),
104107
child: () {
105108
if (event.isAlarm) {
106109
return Icon(
@@ -140,6 +143,11 @@ class DownloadIndicator extends StatelessWidget {
140143
return SquaredIconButton(
141144
tooltip: loc.download,
142145
onPressed: () => downloads.download(event),
146+
padding: const EdgeInsetsDirectional.only(
147+
top: 4.0,
148+
bottom: 4.0,
149+
end: 4.0,
150+
),
143151
icon: Icon(
144152
Icons.download,
145153
size: small ? 18.0 : 22.0,

lib/screens/events_timeline/desktop/timeline.dart

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -482,12 +482,13 @@ class Timeline extends ChangeNotifier {
482482
debugLabel: 'Zoom Indicator Controller',
483483
);
484484
void scrollTo(double to, [double? max]) {
485-
final position =
486-
zoomController.hasClients ? zoomController.positions.last : null;
485+
if (!zoomController.hasClients) return;
486+
487+
final position = zoomController.positions.last;
487488
zoomController.jumpTo(clampDouble(
488489
to,
489490
0.0,
490-
max ?? position?.maxScrollExtent ?? 0.0,
491+
max ?? position.maxScrollExtent,
491492
));
492493
}
493494

0 commit comments

Comments
 (0)