update cargo type form from rate, update carton info and form
This commit is contained in:
@@ -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');
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user