You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
95 lines
2.5 KiB
95 lines
2.5 KiB
import 'package:flutter/material.dart';
|
|
import 'package:supplier_new/common/settings.dart';
|
|
|
|
class SearchOrderAppBar extends StatelessWidget implements PreferredSizeWidget {
|
|
final TextEditingController controller;
|
|
final VoidCallback onBack;
|
|
final VoidCallback onHelp;
|
|
|
|
const SearchOrderAppBar({
|
|
super.key,
|
|
required this.controller,
|
|
required this.onBack,
|
|
required this.onHelp,
|
|
});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return AppBar(
|
|
backgroundColor: Colors.white,
|
|
scrolledUnderElevation: 0,
|
|
elevation: 0,
|
|
leading: GestureDetector(
|
|
onTap: onBack, // 👉 Controlled by parent
|
|
child: Padding(
|
|
padding: const EdgeInsets.all(8.0),
|
|
child: Image.asset(
|
|
'images/backbutton_appbar.png',
|
|
height: 24,
|
|
width: 24,
|
|
fit: BoxFit.contain,
|
|
),
|
|
),
|
|
),
|
|
titleSpacing: 0,
|
|
title: Container(
|
|
height: 40,
|
|
decoration: BoxDecoration(
|
|
color: Colors.white,
|
|
borderRadius: BorderRadius.circular(22),
|
|
border: Border.all(color: const Color(0XFF939495)),
|
|
),
|
|
child: TextField(
|
|
controller: controller,
|
|
decoration: InputDecoration(
|
|
hintText: "Search order",
|
|
hintStyle: fontTextStyle(
|
|
16,
|
|
const Color(0XFF646566),
|
|
FontWeight.w400,
|
|
),
|
|
prefixIcon: SizedBox(
|
|
height: 20,
|
|
width: 20,
|
|
child: Padding(
|
|
padding: const EdgeInsets.all(8.0),
|
|
child: Image.asset(
|
|
'images/search.png',
|
|
fit: BoxFit.contain,
|
|
),
|
|
),
|
|
),
|
|
border: InputBorder.none,
|
|
contentPadding: const EdgeInsets.symmetric(vertical: 0),
|
|
),
|
|
style: fontTextStyle(
|
|
16,
|
|
const Color(0XFF2A2A2A),
|
|
FontWeight.w400,
|
|
),
|
|
onSubmitted: (value) {
|
|
debugPrint("Search Orders: $value");
|
|
},
|
|
),
|
|
),
|
|
actions: [
|
|
Padding(
|
|
padding: const EdgeInsets.all(8.0),
|
|
child: GestureDetector(
|
|
onTap: onHelp, // 👉 Controlled by parent
|
|
child: Image.asset(
|
|
'images/help_appbar.png',
|
|
height: 24,
|
|
width: 24,
|
|
fit: BoxFit.contain,
|
|
),
|
|
),
|
|
),
|
|
],
|
|
);
|
|
}
|
|
|
|
@override
|
|
Size get preferredSize => const Size.fromHeight(kToolbarHeight);
|
|
}
|