Merge branch 'master' of tzw/fcs into master
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
const uploadPhotoLimit = 10;
|
||||
const shipmentCountForCartonFilter = 10;
|
||||
const resendCountSec = 30;
|
||||
int imageQuality = 100;
|
||||
double imageMaxWidth = 1000;
|
||||
|
||||
const config_collection = "configs";
|
||||
const user_collection = "users";
|
||||
@@ -84,7 +86,7 @@ const privilege_receiving = "rc";
|
||||
const privilege_pickup = "pku";
|
||||
const privilege_collect = "col";
|
||||
const privilege_report = "rpt";
|
||||
const privilege_pin ="pin";
|
||||
const privilege_pin = "pin";
|
||||
|
||||
// Pickup types
|
||||
const shipment_local_pickup = "Local pickup";
|
||||
|
||||
@@ -328,7 +328,8 @@ class _CartonFilterState extends State<CartonFilter> {
|
||||
onTap: () => _changeStatus(b),
|
||||
title: Row(
|
||||
children: [
|
||||
Text(b, style: const TextStyle(fontSize: 15)),
|
||||
Text(capitalizeFirstLetter(b),
|
||||
style: const TextStyle(fontSize: 15)),
|
||||
const SizedBox(
|
||||
width: 20,
|
||||
),
|
||||
|
||||
@@ -31,6 +31,7 @@ class PartSearchDelegate extends SearchDelegate<Carton> {
|
||||
ThemeData appBarTheme(BuildContext context) {
|
||||
final ThemeData theme = Theme.of(context);
|
||||
return theme.copyWith(
|
||||
textSelectionTheme: TextSelectionThemeData(cursorColor: Colors.grey),
|
||||
appBarTheme: AppBarTheme(color: primaryColor),
|
||||
iconButtonTheme: IconButtonThemeData(
|
||||
style: ButtonStyle(
|
||||
|
||||
@@ -24,6 +24,7 @@ class _CartonSizeEditorState extends State<CartonSizeEditor> {
|
||||
TextEditingController _widthController = new TextEditingController();
|
||||
TextEditingController _heightController = new TextEditingController();
|
||||
TextEditingController _lengthController = new TextEditingController();
|
||||
final _formKey = GlobalKey<FormState>();
|
||||
|
||||
bool _isLoading = false;
|
||||
CartonSize? _cartonSize;
|
||||
@@ -55,9 +56,16 @@ class _CartonSizeEditorState extends State<CartonSizeEditor> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final nameBox = InputText(
|
||||
labelTextKey: 'box.carton_size.name',
|
||||
iconData: Icons.text_format,
|
||||
controller: _nameController);
|
||||
labelTextKey: 'box.carton_size.name',
|
||||
iconData: Icons.text_format,
|
||||
controller: _nameController,
|
||||
validator: (value) {
|
||||
if (value!.isEmpty) {
|
||||
return "Enter carton size name";
|
||||
}
|
||||
return null;
|
||||
},
|
||||
);
|
||||
|
||||
final lengthBox = LengthPicker(
|
||||
controller: _lengthController,
|
||||
@@ -90,10 +98,13 @@ class _CartonSizeEditorState extends State<CartonSizeEditor> {
|
||||
context,
|
||||
getLocalString(context, 'box.cargo.save.btn'),
|
||||
callack: () async {
|
||||
if (!_formKey.currentState!.validate()) return;
|
||||
|
||||
if (_nameController.text == "") {
|
||||
showMsgDialog(context, "Esrror", "Invalid carton size name!");
|
||||
showMsgDialog(context, "Error", "Invalid carton size name!");
|
||||
return;
|
||||
}
|
||||
|
||||
setState(() {
|
||||
_isLoading = true;
|
||||
});
|
||||
@@ -132,35 +143,38 @@ class _CartonSizeEditorState extends State<CartonSizeEditor> {
|
||||
}
|
||||
},
|
||||
);
|
||||
return LocalProgress(
|
||||
inAsyncCall: _isLoading,
|
||||
child: Scaffold(
|
||||
appBar: LocalAppBar(
|
||||
labelKey: "box.carton_size",
|
||||
backgroundColor: Colors.white,
|
||||
labelColor: primaryColor,
|
||||
arrowColor: primaryColor,
|
||||
onBack: () {
|
||||
if (isDataChanged()) {
|
||||
showConfirmDialog(context, "back.button_confirm", () {
|
||||
return Form(
|
||||
key: _formKey,
|
||||
child: LocalProgress(
|
||||
inAsyncCall: _isLoading,
|
||||
child: Scaffold(
|
||||
appBar: LocalAppBar(
|
||||
labelKey: "box.carton_size",
|
||||
backgroundColor: Colors.white,
|
||||
labelColor: primaryColor,
|
||||
arrowColor: primaryColor,
|
||||
onBack: () {
|
||||
if (isDataChanged()) {
|
||||
showConfirmDialog(context, "back.button_confirm", () {
|
||||
Navigator.of(context).pop();
|
||||
});
|
||||
} else {
|
||||
Navigator.of(context).pop();
|
||||
});
|
||||
} else {
|
||||
Navigator.of(context).pop();
|
||||
}
|
||||
},
|
||||
),
|
||||
body: Container(
|
||||
padding: EdgeInsets.all(18),
|
||||
child: ListView(
|
||||
shrinkWrap: true,
|
||||
children: <Widget>[
|
||||
nameBox,
|
||||
dimBox,
|
||||
SizedBox(height: 40),
|
||||
saveBtn,
|
||||
SizedBox(height: 20),
|
||||
],
|
||||
}
|
||||
},
|
||||
),
|
||||
body: Container(
|
||||
padding: EdgeInsets.all(18),
|
||||
child: ListView(
|
||||
shrinkWrap: true,
|
||||
children: <Widget>[
|
||||
nameBox,
|
||||
dimBox,
|
||||
SizedBox(height: 40),
|
||||
saveBtn,
|
||||
SizedBox(height: 20),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -48,7 +48,7 @@ class _FAQEditorState extends State<FAQEditor> {
|
||||
_mmA.text = _faq.answerMm ?? '';
|
||||
_pageLabelEng.text = _faq.pageLinkLabelEng ?? "";
|
||||
_pageLabelMm.text = _faq.pageLinkLabelMm ?? "";
|
||||
_pageLink = _faq.pageLink ?? '';
|
||||
_pageLink = _faq.pageLink ?? info;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -83,10 +83,15 @@ class _FcsShipmentEditorState extends State<FcsShipmentEditor> {
|
||||
_currentDestination =
|
||||
loadingDestination.isNotEmpty ? loadingDestination.first : null;
|
||||
} else {
|
||||
_currentShipmentType = model.shipmentTypes.first;
|
||||
_currentConsignee = model.shipmentConsingees.first;
|
||||
_currentLoadingPort = model.shipmentPorts.first;
|
||||
_currentDestination = model.shipmentPorts.first;
|
||||
_currentShipmentType =
|
||||
model.shipmentTypes.isNotEmpty ? model.shipmentTypes.first : null;
|
||||
_currentConsignee = model.shipmentConsingees.isNotEmpty
|
||||
? model.shipmentConsingees.first
|
||||
: null;
|
||||
_currentLoadingPort =
|
||||
model.shipmentPorts.isNotEmpty ? model.shipmentPorts.first : null;
|
||||
_currentDestination =
|
||||
model.shipmentPorts.isNotEmpty ? model.shipmentPorts.first : null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -357,10 +362,14 @@ class _FcsShipmentEditorState extends State<FcsShipmentEditor> {
|
||||
return _shipmentNumberController.text != "" ||
|
||||
_cutoffDateController.text != "" ||
|
||||
_etaDateController.text != "" ||
|
||||
_currentConsignee != shipmentModel.shipmentConsingees.first ||
|
||||
_currentShipmentType != shipmentModel.shipmentTypes.first ||
|
||||
_currentLoadingPort != shipmentModel.shipmentPorts.first ||
|
||||
_currentDestination != shipmentModel.shipmentPorts.first;
|
||||
(shipmentModel.shipmentConsingees.isNotEmpty &&
|
||||
_currentConsignee != shipmentModel.shipmentConsingees.first) ||
|
||||
(shipmentModel.shipmentTypes.isNotEmpty &&
|
||||
_currentShipmentType != shipmentModel.shipmentTypes.first) ||
|
||||
(shipmentModel.shipmentPorts.isNotEmpty &&
|
||||
_currentLoadingPort != shipmentModel.shipmentPorts.first) ||
|
||||
(shipmentModel.shipmentPorts.isNotEmpty &&
|
||||
_currentDestination != shipmentModel.shipmentPorts.first);
|
||||
} else {
|
||||
FcsShipment fcsShipment = _getPayload();
|
||||
return widget.shipment!.isChangedForEdit(fcsShipment);
|
||||
|
||||
@@ -404,11 +404,15 @@ String removeTrailingZeros(double number) {
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
bool isValidEmail(String email) {
|
||||
// Define a regular expression for validating an email
|
||||
final emailRegex = RegExp(r'^[^@\s]+@[^@\s]+\.[^@\s]+$');
|
||||
|
||||
// Check if the email matches the pattern
|
||||
return emailRegex.hasMatch(email);
|
||||
}
|
||||
}
|
||||
|
||||
String capitalizeFirstLetter(String text) {
|
||||
if (text.isEmpty) return text;
|
||||
return text[0].toUpperCase() + text.substring(1);
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ class MarketEditor extends StatefulWidget {
|
||||
|
||||
class _MarketEditorState extends State<MarketEditor> {
|
||||
TextEditingController _marketNameCtl = new TextEditingController();
|
||||
final _formKey = GlobalKey<FormState>();
|
||||
|
||||
bool _isLoading = false;
|
||||
List<String> markets = [];
|
||||
@@ -141,36 +142,46 @@ class _MarketEditorState extends State<MarketEditor> {
|
||||
await showDialog<String>(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return new AlertDialog(
|
||||
contentPadding: const EdgeInsets.all(16.0),
|
||||
content: new Row(
|
||||
children: <Widget>[
|
||||
new Expanded(
|
||||
child: InputText(
|
||||
labelTextKey: "market.edit.name",
|
||||
controller: _marketNameCtl,
|
||||
autoFocus: true,
|
||||
),
|
||||
)
|
||||
return Form(
|
||||
key: _formKey,
|
||||
child: new AlertDialog(
|
||||
contentPadding: const EdgeInsets.all(16.0),
|
||||
content: new Row(
|
||||
children: <Widget>[
|
||||
new Expanded(
|
||||
child: InputText(
|
||||
labelTextKey: "market.edit.name",
|
||||
controller: _marketNameCtl,
|
||||
autoFocus: true,
|
||||
validator: (value) {
|
||||
if (value!.isEmpty) {
|
||||
return "Enter market name";
|
||||
}
|
||||
return null;
|
||||
},
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
actions: <Widget>[
|
||||
new TextButton(
|
||||
child: LocalText(context, "btn.cancel", color: primaryColor),
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
}),
|
||||
new TextButton(
|
||||
child: LocalText(
|
||||
context,
|
||||
"btn.save",
|
||||
color: primaryColor,
|
||||
),
|
||||
onPressed: () {
|
||||
if (!_formKey.currentState!.validate()) return;
|
||||
Navigator.pop(context);
|
||||
_add();
|
||||
})
|
||||
],
|
||||
),
|
||||
actions: <Widget>[
|
||||
new TextButton(
|
||||
child: LocalText(context, "btn.cancel", color: primaryColor),
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
}),
|
||||
new TextButton(
|
||||
child: LocalText(
|
||||
context,
|
||||
"btn.save",
|
||||
color: primaryColor,
|
||||
),
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
_add();
|
||||
})
|
||||
],
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
@@ -31,20 +31,20 @@ class PackageSearchDelegate extends SearchDelegate<Package> {
|
||||
ThemeData appBarTheme(BuildContext context) {
|
||||
final ThemeData theme = Theme.of(context);
|
||||
return theme.copyWith(
|
||||
appBarTheme: AppBarTheme(color: primaryColor),
|
||||
iconButtonTheme: IconButtonThemeData(
|
||||
style: ButtonStyle(
|
||||
iconColor: WidgetStateProperty.all<Color>(Colors.white))),
|
||||
inputDecorationTheme: InputDecorationTheme(
|
||||
border: InputBorder.none,
|
||||
hintStyle: TextStyle(color: Colors.grey, fontSize: 14)),
|
||||
textTheme: TextTheme(
|
||||
displayLarge: TextStyle(
|
||||
color: theme.primaryTextTheme.displayLarge?.color,
|
||||
fontSize: 16,
|
||||
backgroundColor: primaryColor)),
|
||||
primaryColor: primaryColor,
|
||||
);
|
||||
textSelectionTheme: TextSelectionThemeData(cursorColor: Colors.grey),
|
||||
appBarTheme: AppBarTheme(color: primaryColor),
|
||||
iconButtonTheme: IconButtonThemeData(
|
||||
style: ButtonStyle(
|
||||
iconColor: WidgetStateProperty.all<Color>(Colors.white))),
|
||||
inputDecorationTheme: InputDecorationTheme(
|
||||
border: InputBorder.none,
|
||||
hintStyle: TextStyle(color: Colors.grey, fontSize: 14)),
|
||||
textTheme: TextTheme(
|
||||
displayLarge: TextStyle(
|
||||
color: theme.primaryTextTheme.displayLarge?.color,
|
||||
fontSize: 16,
|
||||
backgroundColor: primaryColor)),
|
||||
primaryColor: primaryColor);
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -126,7 +126,7 @@ class PackageSearchDelegate extends SearchDelegate<Package> {
|
||||
|
||||
@override
|
||||
Widget buildSuggestions(BuildContext context) {
|
||||
return FutureBuilder<List<String>?>(
|
||||
return FutureBuilder<List<String>?>(
|
||||
future: SharedPref.getRecentSearch('package_search', query),
|
||||
builder: (context, snapshot) {
|
||||
List<String> _oldFilters = snapshot.data ?? [];
|
||||
@@ -134,8 +134,7 @@ class PackageSearchDelegate extends SearchDelegate<Package> {
|
||||
return const Center(
|
||||
child: Opacity(
|
||||
opacity: 0.2,
|
||||
child: Icon(Octicons.package,
|
||||
color: primaryColor, size: 200),
|
||||
child: Icon(Octicons.package, color: primaryColor, size: 200),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -34,20 +34,20 @@ class UserSearchDelegate extends SearchDelegate<User> {
|
||||
ThemeData appBarTheme(BuildContext context) {
|
||||
final ThemeData theme = Theme.of(context);
|
||||
return theme.copyWith(
|
||||
appBarTheme: AppBarTheme(color: primaryColor),
|
||||
iconButtonTheme: IconButtonThemeData(
|
||||
style: ButtonStyle(
|
||||
iconColor: WidgetStateProperty.all<Color>(Colors.white))),
|
||||
inputDecorationTheme: InputDecorationTheme(
|
||||
border: InputBorder.none,
|
||||
hintStyle: TextStyle(color: Colors.grey, fontSize: 14)),
|
||||
textTheme: TextTheme(
|
||||
displayLarge: TextStyle(
|
||||
color: theme.primaryTextTheme.displayLarge?.color,
|
||||
fontSize: 16,
|
||||
backgroundColor: primaryColor)),
|
||||
primaryColor: primaryColor,
|
||||
);
|
||||
textSelectionTheme: TextSelectionThemeData(cursorColor: Colors.grey),
|
||||
appBarTheme: AppBarTheme(color: primaryColor),
|
||||
iconButtonTheme: IconButtonThemeData(
|
||||
style: ButtonStyle(
|
||||
iconColor: WidgetStateProperty.all<Color>(Colors.white))),
|
||||
inputDecorationTheme: InputDecorationTheme(
|
||||
border: InputBorder.none,
|
||||
hintStyle: TextStyle(color: Colors.grey, fontSize: 14)),
|
||||
textTheme: TextTheme(
|
||||
displayLarge: TextStyle(
|
||||
color: theme.primaryTextTheme.displayLarge?.color,
|
||||
fontSize: 16,
|
||||
backgroundColor: primaryColor)),
|
||||
primaryColor: primaryColor);
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
@@ -4,6 +4,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
import 'package:image_picker/image_picker.dart';
|
||||
|
||||
import '../../constants.dart';
|
||||
import 'show_img.dart';
|
||||
|
||||
typedef OnFile = void Function(File?);
|
||||
@@ -57,8 +58,8 @@ class _LocalImagePickerState extends State<LocalImagePicker> {
|
||||
if (camera || gallery) {
|
||||
var selectedFile = await ImagePicker().pickImage(
|
||||
source: camera ? ImageSource.camera : ImageSource.gallery,
|
||||
imageQuality: 80,
|
||||
maxWidth: 1000);
|
||||
imageQuality: imageQuality,
|
||||
maxWidth: imageMaxWidth);
|
||||
if (selectedFile != null) {
|
||||
setState(() {
|
||||
this.file = File(selectedFile.path);
|
||||
|
||||
@@ -40,96 +40,96 @@ class InputDate extends StatelessWidget {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(top: 15.0, bottom: 5),
|
||||
child: TextFormField(
|
||||
readOnly: true,
|
||||
onTap: () async {
|
||||
var dateFormatter = new DateFormat(dateFormatString);
|
||||
FocusScope.of(context).unfocus();
|
||||
var initialDate = DateTime.now();
|
||||
if (controller.text != "") {
|
||||
try {
|
||||
initialDate = dateFormatter.parse(controller.text);
|
||||
} catch (e) {} // ignore error
|
||||
}
|
||||
var d = await showDatePicker(
|
||||
context: context,
|
||||
firstDate: DateTime(0),
|
||||
lastDate: DateTime(2025),
|
||||
initialDate: initialDate,
|
||||
builder: (context, child) {
|
||||
return Theme(
|
||||
data: Theme.of(context).copyWith(
|
||||
colorScheme: ColorScheme.light(
|
||||
background: primaryColor,
|
||||
surfaceTint: Colors.white,
|
||||
primary: primaryColor),
|
||||
textButtonTheme: TextButtonThemeData(
|
||||
style:
|
||||
TextButton.styleFrom(foregroundColor: primaryColor),
|
||||
),
|
||||
readOnly: true,
|
||||
onTap: () async {
|
||||
var dateFormatter = new DateFormat(dateFormatString);
|
||||
FocusScope.of(context).unfocus();
|
||||
var initialDate = DateTime.now();
|
||||
if (controller.text != "") {
|
||||
try {
|
||||
initialDate = dateFormatter.parse(controller.text);
|
||||
} catch (e) {} // ignore error
|
||||
}
|
||||
var d = await showDatePicker(
|
||||
context: context,
|
||||
firstDate: DateTime(0),
|
||||
lastDate: DateTime(2050),
|
||||
initialDate: initialDate,
|
||||
builder: (context, child) {
|
||||
return Theme(
|
||||
data: Theme.of(context).copyWith(
|
||||
colorScheme: ColorScheme.light(
|
||||
background: primaryColor,
|
||||
surfaceTint: Colors.white,
|
||||
primary: primaryColor),
|
||||
textButtonTheme: TextButtonThemeData(
|
||||
style: TextButton.styleFrom(foregroundColor: primaryColor),
|
||||
),
|
||||
child: child!,
|
||||
);
|
||||
},
|
||||
);
|
||||
if (d != null) {
|
||||
controller.text = dateFormatter.format(d);
|
||||
}
|
||||
},
|
||||
controller: controller,
|
||||
autofocus: autoFocus,
|
||||
cursorColor: primaryColor,
|
||||
style: textStyle,
|
||||
maxLines: maxLines,
|
||||
keyboardType: textInputType,
|
||||
decoration: new InputDecoration(
|
||||
// hintText: '',
|
||||
hintStyle: TextStyle(
|
||||
height: 1.5,
|
||||
),
|
||||
errorStyle: const TextStyle(color: dangerColor, fontSize: 12),
|
||||
labelText: labelTextKey == null
|
||||
? null
|
||||
: AppTranslations.of(context)!.text(labelTextKey!),
|
||||
labelStyle: languageModel.isEng
|
||||
? newLabelStyle(color: Colors.black54, fontSize: 20)
|
||||
: newLabelStyleMM(color: Colors.black54, fontSize: 20),
|
||||
icon: iconData == null
|
||||
? null
|
||||
: Icon(
|
||||
iconData,
|
||||
color: primaryColor,
|
||||
),
|
||||
enabledBorder: withBorder
|
||||
? OutlineInputBorder(
|
||||
borderSide: BorderSide(color: primaryColor, width: 1.0),
|
||||
)
|
||||
: UnderlineInputBorder(
|
||||
borderSide: BorderSide(color: primaryColor, width: 1.0)),
|
||||
focusedBorder: withBorder
|
||||
? OutlineInputBorder(
|
||||
borderSide: BorderSide(color: primaryColor, width: 1.0),
|
||||
)
|
||||
: UnderlineInputBorder(
|
||||
borderSide: BorderSide(color: primaryColor, width: 1.0)),
|
||||
errorBorder: withBorder
|
||||
? OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color: borderColor ?? dangerColor, width: 1.0),
|
||||
)
|
||||
: UnderlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color: borderColor ?? dangerColor, width: 1.0)),
|
||||
focusedErrorBorder: withBorder
|
||||
? OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color: borderColor ?? dangerColor, width: 1.0),
|
||||
)
|
||||
: UnderlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color: borderColor ?? dangerColor, width: 1.0)),
|
||||
),
|
||||
child: child!,
|
||||
);
|
||||
},
|
||||
);
|
||||
if (d != null) {
|
||||
controller.text = dateFormatter.format(d);
|
||||
}
|
||||
},
|
||||
controller: controller,
|
||||
autofocus: autoFocus,
|
||||
cursorColor: primaryColor,
|
||||
style: textStyle,
|
||||
maxLines: maxLines,
|
||||
keyboardType: textInputType,
|
||||
decoration: new InputDecoration(
|
||||
// hintText: '',
|
||||
hintStyle: TextStyle(
|
||||
height: 1.5,
|
||||
),
|
||||
validator: validator,
|
||||
autovalidateMode: autovalidateMode,),
|
||||
errorStyle: const TextStyle(color: dangerColor, fontSize: 12),
|
||||
labelText: labelTextKey == null
|
||||
? null
|
||||
: AppTranslations.of(context)!.text(labelTextKey!),
|
||||
labelStyle: languageModel.isEng
|
||||
? newLabelStyle(color: Colors.black54, fontSize: 20)
|
||||
: newLabelStyleMM(color: Colors.black54, fontSize: 20),
|
||||
icon: iconData == null
|
||||
? null
|
||||
: Icon(
|
||||
iconData,
|
||||
color: primaryColor,
|
||||
),
|
||||
enabledBorder: withBorder
|
||||
? OutlineInputBorder(
|
||||
borderSide: BorderSide(color: primaryColor, width: 1.0),
|
||||
)
|
||||
: UnderlineInputBorder(
|
||||
borderSide: BorderSide(color: primaryColor, width: 1.0)),
|
||||
focusedBorder: withBorder
|
||||
? OutlineInputBorder(
|
||||
borderSide: BorderSide(color: primaryColor, width: 1.0),
|
||||
)
|
||||
: UnderlineInputBorder(
|
||||
borderSide: BorderSide(color: primaryColor, width: 1.0)),
|
||||
errorBorder: withBorder
|
||||
? OutlineInputBorder(
|
||||
borderSide:
|
||||
BorderSide(color: borderColor ?? dangerColor, width: 1.0),
|
||||
)
|
||||
: UnderlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color: borderColor ?? dangerColor, width: 1.0)),
|
||||
focusedErrorBorder: withBorder
|
||||
? OutlineInputBorder(
|
||||
borderSide:
|
||||
BorderSide(color: borderColor ?? dangerColor, width: 1.0),
|
||||
)
|
||||
: UnderlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color: borderColor ?? dangerColor, width: 1.0)),
|
||||
),
|
||||
validator: validator,
|
||||
autovalidateMode: autovalidateMode,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ import 'package:flutter_vector_icons/flutter_vector_icons.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
import 'package:image_picker/image_picker.dart';
|
||||
|
||||
import '../../constants.dart';
|
||||
import 'display_image_source.dart';
|
||||
import 'multi_img_controller.dart';
|
||||
|
||||
@@ -147,11 +148,11 @@ class _MultiImageFileState extends State<MultiImageFile> {
|
||||
Icon(Icons.error),
|
||||
)
|
||||
: Image.file(
|
||||
fileContainers[index].file!,
|
||||
width: 50,
|
||||
height: 50,
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
fileContainers[index].file!,
|
||||
width: 50,
|
||||
height: 50,
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
),
|
||||
widget.enabled
|
||||
@@ -177,8 +178,8 @@ class _MultiImageFileState extends State<MultiImageFile> {
|
||||
_openImagePicker(bool camera) async {
|
||||
var selectedFile = await ImagePicker().pickImage(
|
||||
source: camera ? ImageSource.camera : ImageSource.gallery,
|
||||
imageQuality: 80,
|
||||
maxWidth: 1000);
|
||||
imageQuality: imageQuality,
|
||||
maxWidth: imageMaxWidth);
|
||||
if (selectedFile != null) {
|
||||
_fileAdded(DisplayImageSource(), File(selectedFile.path));
|
||||
}
|
||||
@@ -214,8 +215,8 @@ class _MultiImageFileState extends State<MultiImageFile> {
|
||||
if (camera || gallery) {
|
||||
var selectedFile = await ImagePicker().pickImage(
|
||||
source: camera ? ImageSource.camera : ImageSource.gallery,
|
||||
imageQuality: 80,
|
||||
maxWidth: 1000);
|
||||
imageQuality: imageQuality,
|
||||
maxWidth: imageMaxWidth);
|
||||
if (selectedFile != null) {
|
||||
_fileAdded(fileContainer,
|
||||
File.fromRawPath(await selectedFile.readAsBytes()));
|
||||
|
||||
Reference in New Issue
Block a user