mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-09 22:57:21 +00:00
Removed static space id and community id in the routine
This commit is contained in:
@ -3,18 +3,33 @@ import 'package:flutter_svg/svg.dart';
|
||||
import 'package:syncrow_web/utils/color_manager.dart';
|
||||
import 'package:syncrow_web/utils/constants/assets.dart';
|
||||
|
||||
class CustomSearchBar extends StatelessWidget {
|
||||
class CustomSearchBar extends StatefulWidget {
|
||||
final TextEditingController? controller;
|
||||
final String hintText;
|
||||
final String? searchQuery;
|
||||
final Function(String)? onSearchChanged; // Callback for search input changes
|
||||
|
||||
const CustomSearchBar({
|
||||
super.key,
|
||||
this.controller,
|
||||
this.searchQuery = '',
|
||||
this.hintText = 'Search',
|
||||
this.onSearchChanged,
|
||||
});
|
||||
|
||||
@override
|
||||
State<CustomSearchBar> createState() => _CustomSearchBarState();
|
||||
}
|
||||
|
||||
class _CustomSearchBarState extends State<CustomSearchBar> {
|
||||
@override
|
||||
void dispose() {
|
||||
if (widget.controller != null) {
|
||||
widget.controller!.dispose();
|
||||
}
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
@ -36,16 +51,17 @@ class CustomSearchBar extends StatelessWidget {
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
),
|
||||
child: TextField(
|
||||
controller: controller,
|
||||
child: TextFormField(
|
||||
controller: widget.controller,
|
||||
initialValue: widget.searchQuery,
|
||||
style: const TextStyle(
|
||||
color: Colors.black,
|
||||
),
|
||||
onChanged: onSearchChanged, // Call the callback on text change
|
||||
onChanged: widget.onSearchChanged, // Call the callback on text change
|
||||
decoration: InputDecoration(
|
||||
filled: true,
|
||||
fillColor: ColorsManager.textFieldGreyColor,
|
||||
hintText: hintText,
|
||||
hintText: widget.hintText,
|
||||
hintStyle: Theme.of(context).textTheme.bodyLarge!.copyWith(
|
||||
color: ColorsManager.lightGrayColor,
|
||||
fontSize: 12,
|
||||
|
@ -1,25 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:syncrow_web/pages/spaces_management/all_spaces/model/community_model.dart';
|
||||
|
||||
class SpacesSideTree extends StatefulWidget {
|
||||
final List<CommunityModel> communities;
|
||||
final String? selectedSpaceUuid;
|
||||
const SpacesSideTree({
|
||||
super.key,
|
||||
required this.communities,
|
||||
this.selectedSpaceUuid,
|
||||
});
|
||||
|
||||
@override
|
||||
State<SpacesSideTree> createState() => _SpacesSideTreeState();
|
||||
}
|
||||
|
||||
class _SpacesSideTreeState extends State<SpacesSideTree> {
|
||||
String _searchQuery = '';
|
||||
String? _selectedSpaceUuid;
|
||||
String? _selectedId;
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return const Placeholder();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user