mirror of
https://gitlab.com/nkming2/nc-photos.git
synced 2025-01-22 16:56:19 +01:00
34 lines
832 B
Dart
34 lines
832 B
Dart
import 'dart:ui';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
class AppDimension extends ThemeExtension<AppDimension> {
|
|
const AppDimension({
|
|
required this.homeBottomAppBarHeight,
|
|
});
|
|
|
|
static AppDimension of(BuildContext context) =>
|
|
Theme.of(context).extension<AppDimension>()!;
|
|
|
|
@override
|
|
AppDimension copyWith({
|
|
double? homeBottomAppBarHeight,
|
|
}) =>
|
|
AppDimension(
|
|
homeBottomAppBarHeight:
|
|
homeBottomAppBarHeight ?? this.homeBottomAppBarHeight,
|
|
);
|
|
|
|
@override
|
|
AppDimension lerp(ThemeExtension<AppDimension>? other, double t) {
|
|
if (other is! AppDimension) {
|
|
return this;
|
|
}
|
|
return AppDimension(
|
|
homeBottomAppBarHeight:
|
|
lerpDouble(homeBottomAppBarHeight, other.homeBottomAppBarHeight, t)!,
|
|
);
|
|
}
|
|
|
|
final double homeBottomAppBarHeight;
|
|
}
|