mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-09 14:47:23 +00:00
97 lines
3.2 KiB
Dart
97 lines
3.2 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
import 'color_manager.dart';
|
|
|
|
InputDecoration? textBoxDecoration(
|
|
{bool suffixIcon = false, double radios = 8}) =>
|
|
InputDecoration(
|
|
focusColor: ColorsManager.grayColor,
|
|
suffixIcon: suffixIcon ? const Icon(Icons.search) : null,
|
|
hintText: 'Search',
|
|
filled: true, // Enable background filling
|
|
fillColor: const Color(0xffF5F6F7), // Set the background color
|
|
border: OutlineInputBorder(
|
|
borderRadius: BorderRadius.circular(radios), // Add border radius
|
|
borderSide: BorderSide.none, // Remove the underline
|
|
),
|
|
enabledBorder: OutlineInputBorder(
|
|
borderRadius: BorderRadius.circular(radios), // Add border radius
|
|
borderSide: BorderSide.none, // Remove the underline
|
|
),
|
|
focusedBorder: OutlineInputBorder(
|
|
borderRadius: BorderRadius.circular(radios), // Add border radius
|
|
borderSide: BorderSide.none, // Remove the underline
|
|
),
|
|
errorBorder: OutlineInputBorder(
|
|
borderSide: const BorderSide(color: Colors.red, width: 2),
|
|
borderRadius: BorderRadius.circular(radios),
|
|
),
|
|
focusedErrorBorder: OutlineInputBorder(
|
|
borderSide: const BorderSide(color: Colors.red, width: 2),
|
|
borderRadius: BorderRadius.circular(radios),
|
|
),
|
|
);
|
|
|
|
BoxDecoration containerDecoration = BoxDecoration(
|
|
boxShadow: [
|
|
BoxShadow(
|
|
color: Colors.grey.withOpacity(0.3),
|
|
spreadRadius: 2,
|
|
blurRadius: 4,
|
|
offset: const Offset(0, 5), // changes position of shadow
|
|
),
|
|
],
|
|
color: ColorsManager.boxColor,
|
|
borderRadius: const BorderRadius.all(Radius.circular(10)));
|
|
|
|
BoxDecoration containerWhiteDecoration = BoxDecoration(
|
|
boxShadow: [
|
|
BoxShadow(
|
|
color: Colors.grey.withOpacity(0.3),
|
|
spreadRadius: 2,
|
|
blurRadius: 4,
|
|
offset: const Offset(0, 5), // changes position of shadow
|
|
),
|
|
],
|
|
color: ColorsManager.whiteColors,
|
|
borderRadius: const BorderRadius.all(Radius.circular(15)));
|
|
|
|
BoxDecoration subSectionContainerDecoration = BoxDecoration(
|
|
color: ColorsManager.whiteColors,
|
|
boxShadow: [
|
|
BoxShadow(
|
|
color: Colors.black.withOpacity(0.1),
|
|
blurRadius: 10,
|
|
spreadRadius: 1,
|
|
offset: const Offset(0, 2),
|
|
),
|
|
],
|
|
);
|
|
|
|
InputDecoration inputTextFormDeco({hintText}) => InputDecoration(
|
|
hintText: hintText,
|
|
border: const OutlineInputBorder(
|
|
|
|
borderSide: BorderSide(
|
|
width: 1,
|
|
color: ColorsManager.textGray, // Border color for unfocused state
|
|
),
|
|
borderRadius: BorderRadius.all(Radius.circular(10)),
|
|
),
|
|
focusedBorder: const OutlineInputBorder(
|
|
borderSide: BorderSide(
|
|
width: 2,
|
|
color: ColorsManager.textGray, // Border color when focused
|
|
),
|
|
borderRadius: BorderRadius.all(Radius.circular(10)),
|
|
),
|
|
enabledBorder: const OutlineInputBorder(
|
|
borderSide: BorderSide(
|
|
width: 1,
|
|
color: ColorsManager
|
|
.textGray // Border color for enabled (but unfocused) state
|
|
),
|
|
borderRadius: BorderRadius.all(Radius.circular(10)),
|
|
),
|
|
);
|