mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-09 22:57:21 +00:00
Merge branch 'dev' into link_space_model_spaces
This commit is contained in:
@ -71,4 +71,5 @@ abstract class ColorsManager {
|
||||
static const Color lightGrayBorderColor = Color(0xB2D5D5D5);
|
||||
//background: #F8F8F8;
|
||||
static const Color vividBlue = Color(0xFF023DFE);
|
||||
static const Color semiTransparentRed = Color(0x99FF0000);
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ abstract class ApiEndpoints {
|
||||
|
||||
////// Devices Management ////////////////
|
||||
|
||||
static const String getAllDevices = '/projects/{projectId}/device';
|
||||
static const String getAllDevices = '/projects/{projectId}/devices';
|
||||
static const String getSpaceDevices =
|
||||
'/projects/{projectId}/communities/{communityUuid}/spaces/{spaceUuid}/devices';
|
||||
static const String getDeviceStatus = '/device/{uuid}/functions/status';
|
||||
@ -120,8 +120,8 @@ abstract class ApiEndpoints {
|
||||
static const String inviteUser = '/invite-user';
|
||||
|
||||
static const String checkEmail = '/invite-user/check-email';
|
||||
static const String getUsers = '/projects/{projectUuid}/user';
|
||||
static const String getUserById = '/projects/{projectUuid}/user/{userUuid}';
|
||||
static const String getUsers = '/projects/{projectId}/user';
|
||||
static const String getUserById = '/projects/{projectId}/user/{userUuid}';
|
||||
static const String editUser = '/invite-user/{inviteUserUuid}';
|
||||
static const String deleteUser = '/invite-user/{inviteUserUuid}';
|
||||
static const String changeUserStatus =
|
||||
|
@ -258,6 +258,7 @@ class Assets {
|
||||
static const String doorSensor = 'assets/icons/door_sensor.svg';
|
||||
|
||||
static const String delete = 'assets/icons/delete.svg';
|
||||
static const String deleteSpaceModel = 'assets/icons/delete_space_model.svg';
|
||||
static const String edit = 'assets/icons/edit.svg';
|
||||
static const String editSpace = 'assets/icons/edit_space.svg';
|
||||
//assets/icons/routine/tab_to_run.svg
|
||||
|
@ -1,18 +1,37 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class ResponsiveLayout extends StatelessWidget {
|
||||
final Widget desktopBody;
|
||||
final Widget mobileBody;
|
||||
const ResponsiveLayout(
|
||||
{super.key, required this.desktopBody, required this.mobileBody});
|
||||
final Widget? tablet;
|
||||
final Widget desktopBody;
|
||||
|
||||
const ResponsiveLayout({
|
||||
super.key,
|
||||
required this.mobileBody,
|
||||
this.tablet,
|
||||
required this.desktopBody,
|
||||
});
|
||||
|
||||
static bool isMobile(BuildContext context) =>
|
||||
MediaQuery.of(context).size.width < 650;
|
||||
|
||||
static bool isTablet(BuildContext context) =>
|
||||
MediaQuery.of(context).size.width < 1100 &&
|
||||
MediaQuery.of(context).size.width >= 650;
|
||||
|
||||
static bool isDesktop(BuildContext context) =>
|
||||
MediaQuery.of(context).size.width >= 1100;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return LayoutBuilder(
|
||||
builder: (context, constraints) {
|
||||
if (constraints.maxWidth < 600) {
|
||||
return mobileBody;
|
||||
} else {
|
||||
if (constraints.maxWidth >= 1100) {
|
||||
return desktopBody;
|
||||
} else if (constraints.maxWidth >= 650) {
|
||||
return tablet!;
|
||||
} else {
|
||||
return mobileBody;
|
||||
}
|
||||
},
|
||||
);
|
||||
|
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