mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-10 07:07:19 +00:00
WebAppBar ResponsiveLayout
This commit is contained in:
30
lib/utils/theme/responsive_text_theme.dart
Normal file
30
lib/utils/theme/responsive_text_theme.dart
Normal file
@ -0,0 +1,30 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:syncrow_web/utils/color_manager.dart';
|
||||
import 'package:syncrow_web/utils/responsive_layout.dart';
|
||||
|
||||
class ResponsiveTextTheme extends ThemeExtension<ResponsiveTextTheme> {
|
||||
final TextStyle deviceManagementTitle;
|
||||
|
||||
ResponsiveTextTheme({
|
||||
required this.deviceManagementTitle,
|
||||
});
|
||||
|
||||
@override
|
||||
ThemeExtension<ResponsiveTextTheme> copyWith() => this;
|
||||
|
||||
@override
|
||||
ThemeExtension<ResponsiveTextTheme> lerp(
|
||||
ThemeExtension<ResponsiveTextTheme>? other, double t) =>
|
||||
this;
|
||||
|
||||
static ResponsiveTextTheme of(BuildContext context) {
|
||||
final isMobile = ResponsiveLayout.isMobile(context);
|
||||
return Theme.of(context).extension<ResponsiveTextTheme>() ??
|
||||
ResponsiveTextTheme(
|
||||
deviceManagementTitle: TextStyle(
|
||||
fontSize: isMobile ? 20 : 30,
|
||||
fontWeight: FontWeight.w700,
|
||||
color: ColorsManager.whiteColors),
|
||||
);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user