108 lines
3.3 KiB
Dart
Raw Normal View History

2025-08-03 15:28:27 +07:00
import 'package:enaklo_pos/core/components/components.dart';
import 'package:enaklo_pos/core/constants/colors.dart';
import 'package:enaklo_pos/core/extensions/build_context_ext.dart';
2025-08-03 16:13:33 +07:00
import 'package:enaklo_pos/presentation/customer/dialog/form_customer_dialog.dart';
2025-08-03 15:28:27 +07:00
import 'package:flutter/material.dart';
class CustomerTitle extends StatelessWidget {
final String title;
final Function(String) onChanged;
const CustomerTitle(
2025-08-03 16:13:33 +07:00
{super.key, required this.onChanged, required this.title});
2025-08-03 15:28:27 +07:00
@override
Widget build(BuildContext context) {
return Column(
children: [
Container(
height: context.deviceHeight * 0.1,
padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 12.0),
decoration: BoxDecoration(
color: AppColors.white,
border: Border(
bottom: BorderSide(
color: AppColors.background,
width: 1.0,
),
),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(
child: Text(
title,
style: TextStyle(
color: AppColors.black,
fontSize: 20,
fontWeight: FontWeight.w600,
),
),
),
],
),
),
Container(
padding: const EdgeInsets.symmetric(
horizontal: 16.0,
vertical: 12.0,
),
decoration: BoxDecoration(
color: AppColors.white,
border: Border(
bottom: BorderSide(
color: AppColors.background,
width: 1.0,
),
),
),
child: Column(
children: [
Row(
children: [
Expanded(
child: SizedBox(
height: 40,
child: TextFormField(
onChanged: onChanged,
decoration: InputDecoration(
prefixIcon: Icon(
Icons.search,
),
hintText: 'Cari Customer',
),
),
),
),
SpaceWidth(12),
GestureDetector(
onTap: () => showDialog(
context: context,
2025-08-03 16:13:33 +07:00
builder: (context) => FormCustomerDialog(),
2025-08-03 15:28:27 +07:00
),
child: Container(
height: 40,
width: 40,
padding: const EdgeInsets.all(6),
decoration: BoxDecoration(
color: AppColors.primary,
borderRadius: BorderRadius.circular(12),
),
child: Icon(
Icons.add,
color: AppColors.white,
size: 20,
),
),
),
],
),
],
),
),
],
);
}
}