blob: f5998d2bfce8c26356c6e57bc721002975686a18 [file] [log] [blame]
// Copyright 2019 The Flutter team. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/gallery_localizations.dart';
// Duration of time (e.g. 16h 12m)
String formattedDuration(BuildContext context, Duration duration,
{bool abbreviated}) {
final hoursShortForm =
final minutesShortForm =
GalleryLocalizations.of(context).craneMinutes(duration.inMinutes % 60);
return GalleryLocalizations.of(context)
.craneFlightDuration(hoursShortForm, minutesShortForm);