Merge branch 'dev' of https://github.com/SyncrowIOT/web into feature/space-management

This commit is contained in:
hannathkadher
2024-11-11 20:57:11 +04:00
282 changed files with 19897 additions and 2847 deletions

View File

@ -16,8 +16,9 @@ class DefaultButton extends StatelessWidget {
this.foregroundColor,
this.borderRadius,
this.height = 40,
this.width = 140,
this.padding,
this.borderColor,
this.elevation,
});
final void Function()? onPressed;
final Widget child;
@ -32,7 +33,8 @@ class DefaultButton extends StatelessWidget {
final ButtonStyle? customButtonStyle;
final Color? backgroundColor;
final Color? foregroundColor;
final double? width;
final Color? borderColor;
final double? elevation;
@override
Widget build(BuildContext context) {
@ -42,38 +44,42 @@ class DefaultButton extends StatelessWidget {
? null
: customButtonStyle ??
ButtonStyle(
fixedSize: WidgetStateProperty.all(Size(width ?? 50, height ?? 40)), // Set button height
textStyle: MaterialStateProperty.all(
textStyle: WidgetStateProperty.all(
customTextStyle ??
Theme.of(context).textTheme.bodySmall!.copyWith(
fontSize: 13,
color: foregroundColor,
fontWeight: FontWeight.normal),
),
foregroundColor: MaterialStateProperty.all(
foregroundColor: WidgetStateProperty.all(
isSecondary
? Colors.black
: enabled
? foregroundColor ?? Colors.white
: Colors.black,
),
backgroundColor: MaterialStateProperty.resolveWith<Color>(
(Set<MaterialState> states) {
backgroundColor: WidgetStateProperty.resolveWith<Color>(
(Set<WidgetState> states) {
return enabled
? backgroundColor ?? ColorsManager.primaryColor
: Colors.black.withOpacity(0.2);
}),
shape: WidgetStateProperty.all<RoundedRectangleBorder>(
shape: WidgetStateProperty.all(
RoundedRectangleBorder(
borderRadius: BorderRadius.circular(borderRadius ?? 10),
side: BorderSide(color: borderColor ?? Colors.transparent),
borderRadius: BorderRadius.circular(borderRadius ?? 20),
),
),
padding: MaterialStateProperty.all(
EdgeInsets.all(padding ?? 10),
),
minimumSize: MaterialStateProperty.all(
fixedSize: WidgetStateProperty.all(
const Size.fromHeight(50),
),
padding: WidgetStateProperty.all(
EdgeInsets.all(padding ?? 10),
),
minimumSize: WidgetStateProperty.all(
const Size.fromHeight(50),
),
elevation: WidgetStateProperty.all(elevation ?? 0),
),
child: SizedBox(
height: height ?? 50,

View File

@ -1,5 +1,6 @@
import 'package:flutter/material.dart';
import 'package:syncrow_web/pages/common/buttons/default_button.dart';
import 'package:syncrow_web/utils/extension/build_context_x.dart';
import 'package:syncrow_web/utils/style.dart';
import 'package:syncrow_web/utils/color_manager.dart';
@ -23,14 +24,18 @@ class SearchResetButtons extends StatelessWidget {
const SizedBox(height: 25),
Center(
child: Container(
height: 43,
height: 42,
width: 100,
decoration: containerDecoration,
child: Center(
child: DefaultButton(
onPressed: onSearch,
borderRadius: 9,
child: const Text('Search'),
child: Text(
'Search',
style: context.textTheme.titleSmall!
.copyWith(color: Colors.white, fontSize: 12),
),
),
),
),
@ -44,21 +49,19 @@ class SearchResetButtons extends StatelessWidget {
const SizedBox(height: 25),
Center(
child: Container(
height: 43,
height: 42,
width: 100,
decoration: containerDecoration,
child: Center(
child: DefaultButton(
backgroundColor: ColorsManager.whiteColors,
borderRadius: 9,
onPressed: onReset,
child: Text(
'Reset',
style: Theme.of(context)
.textTheme
.bodySmall!
.copyWith(color: Colors.black),
style: context.textTheme.titleSmall!
.copyWith(color: Colors.black, fontSize: 12),
),
onPressed: onReset,
),
),
),