feat(apps): 重构 UI 架构为 presentation 层并新增 l10n 国际化支持
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
import 'day_view_scale.dart';
|
||||
|
||||
class DayTimelineMetrics {
|
||||
static const int hoursInDay = 24;
|
||||
static const int minutesInHour = 60;
|
||||
static const int minutesInDay = hoursInDay * minutesInHour;
|
||||
|
||||
static const double timeLabelWidth = 44;
|
||||
static const double timeLabelGap = 8;
|
||||
static const double eventRightInset = 4;
|
||||
static const double eventColumnGap = 4;
|
||||
|
||||
static double timelineHeight(DayViewScale scale) {
|
||||
return scale.pixelsForMinutes(minutesInDay);
|
||||
}
|
||||
|
||||
static double eventAreaLeft() {
|
||||
return timeLabelWidth + timeLabelGap;
|
||||
}
|
||||
|
||||
static double eventAreaWidth(double boardWidth) {
|
||||
final width = boardWidth - eventAreaLeft() - eventRightInset;
|
||||
return width > 0 ? width : 0;
|
||||
}
|
||||
|
||||
static int clampMinuteOfDay(int minute) {
|
||||
return minute.clamp(0, minutesInDay).toInt();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user