mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-15 17:47:53 +00:00
Implemented side tree to devices and rountines screen
This commit is contained in:
76
lib/pages/routines/widgets/search_bar_condition_title.dart
Normal file
76
lib/pages/routines/widgets/search_bar_condition_title.dart
Normal file
@ -0,0 +1,76 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:syncrow_web/pages/common/text_field/custom_text_field.dart';
|
||||
import 'package:syncrow_web/pages/routines/bloc/routine_bloc/routine_bloc.dart';
|
||||
import 'package:syncrow_web/pages/routines/widgets/routines_title_widget.dart';
|
||||
import 'package:syncrow_web/utils/color_manager.dart';
|
||||
import 'package:syncrow_web/utils/helpers/responsice_layout_helper/responsive_layout_helper.dart';
|
||||
|
||||
class ConditionTitleAndSearchBar extends StatelessWidget with HelperResponsiveLayout {
|
||||
const ConditionTitleAndSearchBar({
|
||||
super.key,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final isMedium = isMediumScreenSize(context);
|
||||
final isSmall = isSmallScreenSize(context);
|
||||
return isMedium || isSmall
|
||||
? Wrap(
|
||||
spacing: 10,
|
||||
runSpacing: 10,
|
||||
children: [
|
||||
const TitleRoutine(title: 'Conditions', subtitle: '(IF)'),
|
||||
StatefulTextField(
|
||||
title: '',
|
||||
width: 250,
|
||||
height: 40,
|
||||
hintText: 'Search',
|
||||
elevation: 0,
|
||||
borderRadius: 15,
|
||||
icon: Icons.search,
|
||||
hintColor: ColorsManager.grayColor,
|
||||
boxDecoration: BoxDecoration(
|
||||
color: ColorsManager.boxColor,
|
||||
borderRadius: BorderRadius.circular(15),
|
||||
),
|
||||
controller: TextEditingController(),
|
||||
// onSubmitted: (value) {
|
||||
// context.read<RoutineBloc>().add(SearchRoutines(value));
|
||||
// },
|
||||
onChanged: (value) {
|
||||
context.read<RoutineBloc>().add(SearchRoutines(value));
|
||||
},
|
||||
),
|
||||
],
|
||||
)
|
||||
: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
children: [
|
||||
const TitleRoutine(title: 'Conditions', subtitle: '(IF)'),
|
||||
StatefulTextField(
|
||||
title: '',
|
||||
width: 250,
|
||||
height: 40,
|
||||
hintText: 'Search',
|
||||
elevation: 0,
|
||||
borderRadius: 15,
|
||||
icon: Icons.search,
|
||||
hintColor: ColorsManager.grayColor,
|
||||
boxDecoration: BoxDecoration(
|
||||
color: ColorsManager.boxColor,
|
||||
borderRadius: BorderRadius.circular(15),
|
||||
),
|
||||
controller: TextEditingController(),
|
||||
// onSubmitted: (value) {
|
||||
// context.read<RoutineBloc>().add(SearchRoutines(value));
|
||||
// },
|
||||
onChanged: (value) {
|
||||
context.read<RoutineBloc>().add(SearchRoutines(value));
|
||||
},
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user