update cargo type form from rate, update carton info and form

This commit is contained in:
tzw
2024-09-25 21:49:09 +06:30
parent 1be18c08a9
commit 02e079c514
51 changed files with 1407 additions and 643 deletions

View File

@@ -62,7 +62,7 @@ class CartonListRow extends StatelessWidget {
Padding(
padding: const EdgeInsets.only(top: 5),
child: new Text(
carton.userName ?? "",
carton.consigneeName ?? "",
style: new TextStyle(
fontSize: 15.0, color: Colors.grey),
),

View File

@@ -7,6 +7,8 @@ import 'package:flutter/material.dart';
import 'package:flutter_vector_icons/flutter_vector_icons.dart';
import 'package:provider/provider.dart';
import '../../helpers/shared_pref.dart';
import '../widgets/suggest_list.dart';
import 'carton_list_row.dart';
typedef CallbackCartonSelect(Carton carton);
@@ -32,7 +34,7 @@ class PartSearchDelegate extends SearchDelegate<Carton> {
appBarTheme: AppBarTheme(color: primaryColor),
iconButtonTheme: IconButtonThemeData(
style: ButtonStyle(
iconColor: MaterialStateProperty.all<Color>(Colors.white))),
iconColor: WidgetStateProperty.all<Color>(Colors.white))),
inputDecorationTheme: InputDecorationTheme(
border: InputBorder.none,
hintStyle: TextStyle(color: Colors.grey, fontSize: 14)),
@@ -120,13 +122,27 @@ class PartSearchDelegate extends SearchDelegate<Carton> {
@override
Widget buildSuggestions(BuildContext context) {
return Container(
child: Center(
child: Opacity(
opacity: 0.2,
child: Icon(MaterialCommunityIcons.package,
size: 200, color: primaryColor)),
),
return FutureBuilder<List<String>?>(
future: SharedPref.getRecentSearch('carton_search', query),
builder: (context, snapshot) {
List<String> _oldFilters = snapshot.data ?? [];
if (_oldFilters.isEmpty) {
return const Center(
child: Opacity(
opacity: 0.2,
child: Icon(MaterialCommunityIcons.package,
color: primaryColor, size: 200),
),
);
}
return SuggestList(
recentSearchList: _oldFilters,
onTap: (String s) {
query = s;
showResults(context);
},
prefKey: 'carton_search');
},
);
}