update image resolution and search bar cursor color
This commit is contained in:
@@ -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