mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-10 07:07:19 +00:00
formatted all files.
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:syncrow_web/utils/color_manager.dart';
|
||||
import 'package:syncrow_web/utils/extension/build_context_x.dart';
|
||||
|
||||
class DialogDropdown extends StatefulWidget {
|
||||
final List<String> items;
|
||||
@ -7,14 +8,14 @@ class DialogDropdown extends StatefulWidget {
|
||||
final String? selectedValue;
|
||||
|
||||
const DialogDropdown({
|
||||
Key? key,
|
||||
super.key,
|
||||
required this.items,
|
||||
required this.onSelected,
|
||||
this.selectedValue,
|
||||
}) : super(key: key);
|
||||
});
|
||||
|
||||
@override
|
||||
_DialogDropdownState createState() => _DialogDropdownState();
|
||||
State<DialogDropdown> createState() => _DialogDropdownState();
|
||||
}
|
||||
|
||||
class _DialogDropdownState extends State<DialogDropdown> {
|
||||
@ -46,16 +47,14 @@ class _DialogDropdownState extends State<DialogDropdown> {
|
||||
}
|
||||
|
||||
OverlayEntry _createOverlayEntry() {
|
||||
final renderBox = context.findRenderObject() as RenderBox;
|
||||
final renderBox = context.findRenderObject()! as RenderBox;
|
||||
final size = renderBox.size;
|
||||
final offset = renderBox.localToGlobal(Offset.zero);
|
||||
|
||||
return OverlayEntry(
|
||||
builder: (context) {
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
_closeDropdown();
|
||||
},
|
||||
onTap: _closeDropdown,
|
||||
behavior: HitTestBehavior.translucent,
|
||||
child: Stack(
|
||||
children: [
|
||||
@ -87,12 +86,9 @@ class _DialogDropdownState extends State<DialogDropdown> {
|
||||
child: ListTile(
|
||||
title: Text(
|
||||
item,
|
||||
style: Theme.of(context)
|
||||
.textTheme
|
||||
.bodyMedium
|
||||
?.copyWith(
|
||||
color: ColorsManager.textPrimaryColor,
|
||||
),
|
||||
style: context.textTheme.bodyMedium?.copyWith(
|
||||
color: ColorsManager.textPrimaryColor,
|
||||
),
|
||||
),
|
||||
onTap: () {
|
||||
widget.onSelected(item);
|
||||
|
@ -10,24 +10,25 @@ class EditChip extends StatelessWidget {
|
||||
final double borderRadius;
|
||||
|
||||
const EditChip({
|
||||
Key? key,
|
||||
super.key,
|
||||
this.label = 'Edit',
|
||||
required this.onTap,
|
||||
this.labelColor = ColorsManager.spaceColor,
|
||||
this.backgroundColor = ColorsManager.whiteColors,
|
||||
this.borderColor = ColorsManager.spaceColor,
|
||||
this.borderRadius = 16.0,
|
||||
}) : super(key: key);
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GestureDetector(
|
||||
onTap: onTap,
|
||||
child: Chip(
|
||||
label: Text(
|
||||
label,
|
||||
style: Theme.of(context).textTheme.bodySmall!.copyWith(color: labelColor)
|
||||
),
|
||||
label: Text(label,
|
||||
style: Theme.of(context)
|
||||
.textTheme
|
||||
.bodySmall!
|
||||
.copyWith(color: labelColor)),
|
||||
backgroundColor: backgroundColor,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(borderRadius),
|
||||
|
@ -9,12 +9,12 @@ class TagDialogTextfieldDropdown extends StatefulWidget {
|
||||
final String product;
|
||||
|
||||
const TagDialogTextfieldDropdown({
|
||||
Key? key,
|
||||
super.key,
|
||||
required this.items,
|
||||
required this.onSelected,
|
||||
this.initialValue,
|
||||
required this.product,
|
||||
}) : super(key: key);
|
||||
});
|
||||
|
||||
@override
|
||||
_DialogTextfieldDropdownState createState() =>
|
||||
@ -79,7 +79,7 @@ class _DialogTextfieldDropdownState extends State<TagDialogTextfieldDropdown> {
|
||||
}
|
||||
|
||||
OverlayEntry _createOverlayEntry() {
|
||||
final renderBox = context.findRenderObject() as RenderBox;
|
||||
final renderBox = context.findRenderObject()! as RenderBox;
|
||||
final size = renderBox.size;
|
||||
final offset = renderBox.localToGlobal(Offset.zero);
|
||||
|
||||
|
@ -10,7 +10,8 @@ class CustomExpansionTile extends StatefulWidget {
|
||||
final ValueChanged<bool>? onExpansionChanged; // Notify when expansion changes
|
||||
final VoidCallback? onItemSelected; // Callback for selecting the item
|
||||
|
||||
CustomExpansionTile({
|
||||
const CustomExpansionTile({
|
||||
super.key,
|
||||
required this.title,
|
||||
this.children,
|
||||
this.initiallyExpanded = false,
|
||||
|
@ -7,7 +7,7 @@ class CustomSearchBar extends StatefulWidget {
|
||||
final TextEditingController? controller;
|
||||
final String hintText;
|
||||
final String? searchQuery;
|
||||
final Function(String)? onSearchChanged; // Callback for search input changes
|
||||
final void Function(String)? onSearchChanged;
|
||||
|
||||
const CustomSearchBar({
|
||||
super.key,
|
||||
@ -37,7 +37,7 @@ class _CustomSearchBarState extends State<CustomSearchBar> {
|
||||
color: ColorsManager.whiteColors,
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Colors.black.withOpacity(0.2),
|
||||
color: Colors.black.withValues(alpha: 0.2),
|
||||
spreadRadius: 0,
|
||||
blurRadius: 8,
|
||||
offset: const Offset(0, 4),
|
||||
@ -57,7 +57,7 @@ class _CustomSearchBarState extends State<CustomSearchBar> {
|
||||
style: const TextStyle(
|
||||
color: Colors.black,
|
||||
),
|
||||
onChanged: widget.onSearchChanged, // Call the callback on text change
|
||||
onChanged: widget.onSearchChanged,
|
||||
decoration: InputDecoration(
|
||||
filled: true,
|
||||
fillColor: ColorsManager.textFieldGreyColor,
|
||||
|
Reference in New Issue
Block a user