2025-07-31 20:58:10 +07:00
|
|
|
import 'package:enaklo_pos/core/extensions/build_context_ext.dart';
|
2025-07-30 22:38:44 +07:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
|
|
|
|
import '../../../core/components/search_input.dart';
|
|
|
|
|
import '../../../core/constants/colors.dart';
|
|
|
|
|
|
|
|
|
|
class SettingsTitle extends StatelessWidget {
|
|
|
|
|
final String title;
|
2025-07-31 20:58:10 +07:00
|
|
|
final String? subtitle;
|
2025-07-30 22:38:44 +07:00
|
|
|
final TextEditingController? controller;
|
|
|
|
|
final Function(String value)? onChanged;
|
2025-07-31 20:58:10 +07:00
|
|
|
final List<Widget>? actionWidget;
|
2025-07-30 22:38:44 +07:00
|
|
|
|
|
|
|
|
const SettingsTitle(
|
|
|
|
|
this.title, {
|
|
|
|
|
super.key,
|
|
|
|
|
this.controller,
|
|
|
|
|
this.onChanged,
|
2025-07-31 20:58:10 +07:00
|
|
|
this.actionWidget,
|
|
|
|
|
this.subtitle,
|
2025-07-30 22:38:44 +07:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
2025-07-31 20:58:10 +07:00
|
|
|
return Container(
|
|
|
|
|
height: context.deviceHeight * 0.1,
|
|
|
|
|
padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 12.0),
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: AppColors.white,
|
|
|
|
|
),
|
|
|
|
|
child: Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Text(
|
|
|
|
|
title,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: AppColors.black,
|
|
|
|
|
fontSize: 20,
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
if (subtitle != null)
|
|
|
|
|
Text(
|
|
|
|
|
subtitle ?? '',
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: AppColors.grey,
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
2025-07-30 22:38:44 +07:00
|
|
|
),
|
2025-07-31 20:58:10 +07:00
|
|
|
if (controller != null)
|
|
|
|
|
SizedBox(
|
|
|
|
|
width: 300.0,
|
|
|
|
|
child: SearchInput(
|
|
|
|
|
controller: controller!,
|
|
|
|
|
onChanged: onChanged,
|
|
|
|
|
hintText: 'Search for food, coffe, etc..',
|
|
|
|
|
),
|
2025-07-30 22:38:44 +07:00
|
|
|
),
|
2025-07-31 20:58:10 +07:00
|
|
|
if (actionWidget != null) ...actionWidget!,
|
|
|
|
|
],
|
|
|
|
|
),
|
2025-07-30 22:38:44 +07:00
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|