Major UI overhaul
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
@immutable
|
||||
class AppMonoText extends ThemeExtension<AppMonoText> {
|
||||
const AppMonoText({required this.label, required this.body});
|
||||
|
||||
final TextStyle label;
|
||||
final TextStyle body;
|
||||
|
||||
@override
|
||||
AppMonoText copyWith({TextStyle? label, TextStyle? body}) {
|
||||
return AppMonoText(label: label ?? this.label, body: body ?? this.body);
|
||||
}
|
||||
|
||||
@override
|
||||
AppMonoText lerp(ThemeExtension<AppMonoText>? other, double t) {
|
||||
if (other is! AppMonoText) return this;
|
||||
return AppMonoText(
|
||||
label: TextStyle.lerp(label, other.label, t) ?? label,
|
||||
body: TextStyle.lerp(body, other.body, t) ?? body,
|
||||
);
|
||||
}
|
||||
|
||||
static AppMonoText of(BuildContext context) {
|
||||
final ext = Theme.of(context).extension<AppMonoText>();
|
||||
return ext ?? const AppMonoText(label: TextStyle(), body: TextStyle());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user