update cargo type form from rate, update carton info and form
This commit is contained in:
@@ -9,6 +9,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<Pickup?> searchPickup(BuildContext context,
|
||||
{CallbackPickupSelect? callbackPickupSelect}) async =>
|
||||
await showSearch<Pickup>(
|
||||
@@ -32,7 +35,7 @@ class PackageSearchDelegate extends SearchDelegate<Pickup> {
|
||||
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)),
|
||||
@@ -124,13 +127,27 @@ class PackageSearchDelegate extends SearchDelegate<Pickup> {
|
||||
|
||||
@override
|
||||
Widget buildSuggestions(BuildContext context) {
|
||||
return Container(
|
||||
child: Center(
|
||||
child: Opacity(
|
||||
opacity: 0.2,
|
||||
child: Icon(SimpleLineIcons.direction,
|
||||
size: 200, color: primaryColor)),
|
||||
),
|
||||
return FutureBuilder<List<String>?>(
|
||||
future: SharedPref.getRecentSearch('pickup_search', query),
|
||||
builder: (context, snapshot) {
|
||||
List<String> _oldFilters = snapshot.data ?? [];
|
||||
if (_oldFilters.isEmpty) {
|
||||
return const Center(
|
||||
child: Opacity(
|
||||
opacity: 0.2,
|
||||
child: Icon(SimpleLineIcons.direction,
|
||||
color: primaryColor, size: 200),
|
||||
),
|
||||
);
|
||||
}
|
||||
return SuggestList(
|
||||
recentSearchList: _oldFilters,
|
||||
onTap: (String s) {
|
||||
query = s;
|
||||
showResults(context);
|
||||
},
|
||||
prefKey: 'pickup_search');
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user