added fonts, fixed alignment, and responsivness for the web

This commit is contained in:
ashrafzarkanisala
2024-08-27 01:55:11 +03:00
parent f3c5c2c489
commit f14320ea92
15 changed files with 178 additions and 94 deletions

View File

@ -35,7 +35,9 @@ class FilterWidget extends StatelessWidget {
decoration: BoxDecoration(
color: ColorsManager.boxColor,
border: Border.all(
color: isSelected ? Colors.blue : Colors.transparent,
color: isSelected
? ColorsManager.blueColor.withOpacity(0.8)
: Colors.transparent,
width: 2.0,
),
borderRadius: _getBorderRadius(index),
@ -45,7 +47,9 @@ class FilterWidget extends StatelessWidget {
child: Text(
tabs[index],
style: TextStyle(
color: isSelected ? Colors.blue : Colors.black,
color: isSelected
? ColorsManager.blueColor.withOpacity(0.8)
: Colors.black,
),
),
),

View File

@ -10,6 +10,7 @@ class CustomWebTextField extends StatelessWidget {
required this.controller,
this.description,
this.validator,
this.hintText,
});
final bool isRequired;
@ -17,6 +18,7 @@ class CustomWebTextField extends StatelessWidget {
final String? description;
final TextEditingController? controller;
final String? Function(String?)? validator;
final String? hintText;
@override
Widget build(BuildContext context) {
@ -81,7 +83,7 @@ class CustomWebTextField extends StatelessWidget {
errorStyle:
const TextStyle(height: 0), // Hide the error text space
hintText: 'Please enter'),
hintText: hintText ?? 'Please enter'),
),
),
],

View File

@ -3,8 +3,9 @@ import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:syncrow_web/pages/device_managment/all_devices/bloc/device_managment_bloc.dart';
import 'package:syncrow_web/pages/device_managment/all_devices/widgets/device_managment_body.dart';
import 'package:syncrow_web/web_layout/web_scaffold.dart';
import 'package:syncrow_web/utils/helpers/responsice_layout_helper/responsive_layout_helper.dart';
class DeviceManagementPage extends StatelessWidget {
class DeviceManagementPage extends StatelessWidget with HelperResponsiveLayout {
const DeviceManagementPage({super.key});
@override
@ -16,7 +17,7 @@ class DeviceManagementPage extends StatelessWidget {
'Device Management',
style: Theme.of(context).textTheme.headlineLarge,
),
enableMenuSideba: true,
enableMenuSideba: isLargeScreenSize(context),
scaffoldBody: BlocBuilder<DeviceManagementBloc, DeviceManagementState>(
builder: (context, state) {
if (state is DeviceManagementLoading) {

View File

@ -41,7 +41,6 @@ class DeviceManagementBody extends StatelessWidget with HelperResponsiveLayout {
lowBatteryCount = state.lowBatteryCount;
}
// Create tab labels with counts
final tabs = [
'All (${devices.length})',
'Online ($onlineCount)',
@ -50,7 +49,9 @@ class DeviceManagementBody extends StatelessWidget with HelperResponsiveLayout {
];
return Container(
padding: const EdgeInsets.all(30),
padding: isLargeScreenSize(context)
? const EdgeInsets.all(30)
: const EdgeInsets.all(15),
height: context.screenHeight,
width: context.screenWidth,
child: Column(
@ -66,16 +67,12 @@ class DeviceManagementBody extends StatelessWidget with HelperResponsiveLayout {
.add(SelectedFilterChanged(index));
},
),
const SizedBox(
height: 20,
),
const SizedBox(height: 20),
const DeviceSearchFilters(),
const SizedBox(
height: 12,
),
const SizedBox(height: 12),
Container(
height: 43,
width: 100,
width: isSmallScreenSize(context) ? double.infinity : 100,
decoration: containerDecoration,
child: Center(
child: DefaultButton(
@ -95,9 +92,7 @@ class DeviceManagementBody extends StatelessWidget with HelperResponsiveLayout {
),
),
),
const SizedBox(
height: 12,
),
const SizedBox(height: 12),
Expanded(
child: DynamicTable(
cellDecoration: containerDecoration,

View File

@ -29,15 +29,41 @@ class DeviceControlDialog extends StatelessWidget with RouteControlsBasedCode {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Center(
child: Text(
device.categoryName ?? 'Device Control',
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 22,
color: ColorsManager.dialogBlueTitle,
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
const SizedBox(),
Text(
device.categoryName ?? 'Device Control',
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 22,
color: ColorsManager.dialogBlueTitle,
),
),
),
Container(
width: 25,
decoration: BoxDecoration(
color: Colors.transparent,
shape: BoxShape.circle,
border: Border.all(
color: Colors.grey,
width: 1.0,
),
),
child: IconButton(
padding: EdgeInsets.all(1),
icon: const Icon(
Icons.close,
color: Colors.grey,
size: 18,
),
onPressed: () {
Navigator.of(context).pop();
},
),
),
],
),
const SizedBox(height: 20),
_buildDeviceInfoSection(),
@ -56,7 +82,7 @@ class DeviceControlDialog extends StatelessWidget with RouteControlsBasedCode {
Widget _buildDeviceInfoSection() {
return Padding(
padding: const EdgeInsets.symmetric(vertical: 50, horizontal: 50),
padding: const EdgeInsets.symmetric(vertical: 25, horizontal: 50),
child: Table(
children: [
TableRow(

View File

@ -18,15 +18,17 @@ class HomeCard extends StatelessWidget {
});
@override
Widget build(BuildContext context) {
bool evenNumbers = index % 2 == 0;
// bool evenNumbers = index % 2 == 0;
return InkWell(
onTap: active ? onTap : null,
child: Container(
padding: const EdgeInsets.only(left: 10, right: 10, bottom: 10),
decoration: BoxDecoration(
color: evenNumbers && active
? ColorsManager.blueColor.withOpacity(0.8)
: (active
color:
// evenNumbers && active
// ? ColorsManager.blueColor.withOpacity(0.8)
// :
(active
? ColorsManager.blueColor
: ColorsManager.blueColor.withOpacity(0.2)),
borderRadius: BorderRadius.circular(30),