update cargo type form from rate, update carton info and form
This commit is contained in:
@@ -8,6 +8,9 @@ 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';
|
||||
|
||||
Future<Package?> searchPackage(BuildContext context,
|
||||
{CallbackPackageSelect? callbackPackageSelect}) async =>
|
||||
await showSearch<Package>(
|
||||
@@ -22,7 +25,7 @@ class PackageSearchDelegate extends SearchDelegate<Package> {
|
||||
PackageSearchDelegate({this.callbackPackageSelect});
|
||||
|
||||
@override
|
||||
String get searchFieldLabel => 'Search by Tracking ID/Customer Name';
|
||||
String get searchFieldLabel => 'Search by Tracking ID/Customer name';
|
||||
|
||||
@override
|
||||
ThemeData appBarTheme(BuildContext context) {
|
||||
@@ -31,7 +34,7 @@ class PackageSearchDelegate extends SearchDelegate<Package> {
|
||||
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)),
|
||||
@@ -123,12 +126,27 @@ class PackageSearchDelegate extends SearchDelegate<Package> {
|
||||
|
||||
@override
|
||||
Widget buildSuggestions(BuildContext context) {
|
||||
return Container(
|
||||
child: Center(
|
||||
child: Opacity(
|
||||
opacity: 0.2,
|
||||
child: Icon(Octicons.package, size: 200, color: primaryColor)),
|
||||
),
|
||||
return FutureBuilder<List<String>?>(
|
||||
future: SharedPref.getRecentSearch('package_search', query),
|
||||
builder: (context, snapshot) {
|
||||
List<String> _oldFilters = snapshot.data ?? [];
|
||||
if (_oldFilters.isEmpty) {
|
||||
return const Center(
|
||||
child: Opacity(
|
||||
opacity: 0.2,
|
||||
child: Icon(Octicons.package,
|
||||
color: primaryColor, size: 200),
|
||||
),
|
||||
);
|
||||
}
|
||||
return SuggestList(
|
||||
recentSearchList: _oldFilters,
|
||||
onTap: (String s) {
|
||||
query = s;
|
||||
showResults(context);
|
||||
},
|
||||
prefKey: 'package_search');
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user