contact ui, create ticket
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:glassmorphism/glassmorphism.dart';
|
||||
|
||||
class CustomTextFormField extends StatefulWidget {
|
||||
@@ -65,8 +66,8 @@ class _CustomTextFormFieldState extends State<CustomTextFormField> {
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
colors: [
|
||||
Color(0xFFffffff).withOpacity(0.1),
|
||||
Color(0xFFFFFFFF).withOpacity(0.05),
|
||||
const Color(0xFFffffff).withOpacity(0.1),
|
||||
const Color(0xFFFFFFFF).withOpacity(0.05),
|
||||
],
|
||||
stops: [
|
||||
0.1,
|
||||
@@ -76,8 +77,8 @@ class _CustomTextFormFieldState extends State<CustomTextFormField> {
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
colors: [
|
||||
Color(0xff9A0000).withOpacity(0.5),
|
||||
Color(0xFFffffff).withOpacity(0.5),
|
||||
const Color(0xff9A0000).withOpacity(0.5),
|
||||
const Color(0xFFffffff).withOpacity(0.5),
|
||||
],
|
||||
),
|
||||
child: TextFormField(
|
||||
@@ -126,9 +127,9 @@ class _CustomTextFormFieldState extends State<CustomTextFormField> {
|
||||
? null
|
||||
: widget.suffixIcon!,
|
||||
border: InputBorder.none,
|
||||
contentPadding: EdgeInsets.symmetric(horizontal: 10),
|
||||
contentPadding: const EdgeInsets.symmetric(horizontal: 10),
|
||||
),
|
||||
style: TextStyle(color: Colors.white),
|
||||
style: const TextStyle(color: Colors.white),
|
||||
keyboardType: widget.texttype,
|
||||
// validator: widget.validator ??
|
||||
// (value) {
|
||||
@@ -145,3 +146,145 @@ class _CustomTextFormFieldState extends State<CustomTextFormField> {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class CustomTextFormField1 extends StatefulWidget {
|
||||
const CustomTextFormField1({
|
||||
Key? key,
|
||||
this.validator,
|
||||
this.textEditingController,
|
||||
this.hintText,
|
||||
this.leadingIcon,
|
||||
this.prefixIconColor = const Color(0xFF737373),
|
||||
this.isInputPassword = false,
|
||||
this.validatorText,
|
||||
this.value,
|
||||
this.readonly = false,
|
||||
this.enabled = true,
|
||||
this.maxlines = 1,
|
||||
this.texttype,
|
||||
this.inputFormatters,
|
||||
this.onInput,
|
||||
this.onTap,
|
||||
this.suffixIcon,
|
||||
}) : super(key: key);
|
||||
|
||||
final dynamic validator;
|
||||
final TextEditingController? textEditingController;
|
||||
final String? hintText;
|
||||
final Widget? leadingIcon;
|
||||
final Color prefixIconColor;
|
||||
final bool isInputPassword;
|
||||
final String? validatorText;
|
||||
final String? value;
|
||||
final bool readonly;
|
||||
final bool enabled;
|
||||
final int maxlines;
|
||||
final TextInputType? texttype;
|
||||
final dynamic inputFormatters;
|
||||
final Function(String)? onInput;
|
||||
final VoidCallback? onTap;
|
||||
final Widget? suffixIcon;
|
||||
|
||||
@override
|
||||
State<CustomTextFormField1> createState() => _CustomTextFormField1State();
|
||||
}
|
||||
|
||||
class _CustomTextFormField1State extends State<CustomTextFormField1> {
|
||||
late bool obscureText;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
obscureText = widget.isInputPassword;
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return TextFormField(
|
||||
cursorColor: Colors.red,
|
||||
initialValue: widget.value,
|
||||
readOnly: widget.readonly,
|
||||
onTap: widget.onTap,
|
||||
enabled: widget.enabled,
|
||||
enableInteractiveSelection: false,
|
||||
maxLines: widget.maxlines,
|
||||
autovalidateMode: AutovalidateMode.onUserInteraction,
|
||||
obscureText: obscureText,
|
||||
controller: widget.textEditingController,
|
||||
decoration: InputDecoration(
|
||||
contentPadding: const EdgeInsets.symmetric(
|
||||
vertical: 15,
|
||||
horizontal: 14,
|
||||
),
|
||||
hintText: widget.hintText,
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(8.r),
|
||||
borderSide: const BorderSide(color: Color(0XFF3A3A3A), width: 1),
|
||||
),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(8.r),
|
||||
borderSide: const BorderSide(color: Color(0XFF3A3A3A), width: 1),
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(8.r),
|
||||
borderSide: const BorderSide(color: Color(0XFF3A3A3A), width: 1),
|
||||
),
|
||||
errorBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
borderSide: const BorderSide(color: Colors.red, width: 1),
|
||||
),
|
||||
focusedErrorBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
borderSide: const BorderSide(color: Colors.red, width: 1),
|
||||
),
|
||||
hintStyle: TextStyle(
|
||||
fontSize: 16.sp, fontFamily: "manrope", color: Colors.white),
|
||||
prefixIconColor: widget.prefixIconColor,
|
||||
// ignore: prefer_null_aware_operators
|
||||
prefixIcon: widget.leadingIcon == null ? null : widget.leadingIcon!,
|
||||
suffixIcon: widget.isInputPassword
|
||||
? GestureDetector(
|
||||
onTap: () => setState(() => obscureText = !obscureText),
|
||||
child: obscureText
|
||||
? const Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Padding(
|
||||
padding: EdgeInsets.only(right: 20.0),
|
||||
child: Icon(Icons.remove_red_eye),
|
||||
),
|
||||
],
|
||||
)
|
||||
: const Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Padding(
|
||||
padding: EdgeInsets.only(right: 20.0),
|
||||
child: Icon(
|
||||
Icons.remove_red_eye_outlined,
|
||||
color: Color(0xFF959595),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
: widget.suffixIcon == null
|
||||
? null
|
||||
: widget.suffixIcon!,
|
||||
),
|
||||
style: const TextStyle(color: Colors.white),
|
||||
keyboardType: widget.texttype,
|
||||
validator: widget.validator ??
|
||||
(value) {
|
||||
if (value == null || value.isEmpty) {
|
||||
return "Empty value";
|
||||
}
|
||||
return null;
|
||||
},
|
||||
inputFormatters: widget.inputFormatters,
|
||||
onChanged: (value) {
|
||||
widget.onInput?.call(value);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
40
lib/Utils/Common/FilePicker.dart
Normal file
40
lib/Utils/Common/FilePicker.dart
Normal file
@@ -0,0 +1,40 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:file_picker/file_picker.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:traderscircuit/Utils/Dialogs.dart';
|
||||
|
||||
import 'package:path/path.dart' as path;
|
||||
import 'package:traderscircuit/controller/contact_us_controller.dart';
|
||||
|
||||
class FilePickerMethod {
|
||||
ContactUsController contactUsController = Get.put(ContactUsController());
|
||||
String extractFileName(String filePath) {
|
||||
return path.basename(filePath);
|
||||
}
|
||||
|
||||
Future<List<File?>?> pickFile() async {
|
||||
FilePickerResult? result = await FilePicker.platform.pickFiles(
|
||||
allowMultiple: true,
|
||||
allowCompression: true, compressionQuality: 50,
|
||||
type: FileType.custom,
|
||||
allowedExtensions: [
|
||||
'jpg',
|
||||
'jpeg',
|
||||
'png',
|
||||
'pdf'
|
||||
], // Define the allowed file types
|
||||
);
|
||||
|
||||
if (result != null) {
|
||||
if (contactUsController.attachmentFileList.length + result.count > 3) {
|
||||
utils.showToast("Can Select Max 3 Files");
|
||||
return null;
|
||||
} else {
|
||||
return result.paths.map((path) => File(path!)).toList();
|
||||
}
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -45,13 +45,16 @@ Widget text18W500(String text) {
|
||||
);
|
||||
}
|
||||
|
||||
Widget text18W400(String text) {
|
||||
Widget text18W400(String text,
|
||||
{TextAlign texAl = TextAlign.start, double heightV = 1.5}) {
|
||||
return Text(
|
||||
text,
|
||||
textAlign: texAl,
|
||||
style: TextStyle(
|
||||
fontSize: 18.sp,
|
||||
color: Colors.white,
|
||||
fontWeight: FontWeight.w400,
|
||||
height: heightV,
|
||||
fontFamily: 'manrope'),
|
||||
);
|
||||
}
|
||||
@@ -69,12 +72,14 @@ Widget text24W500(String text) {
|
||||
);
|
||||
}
|
||||
|
||||
Widget text16W400(String text) {
|
||||
Widget text16W400(String text,
|
||||
{Color clr = Colors.white, TextOverflow textOver = TextOverflow.clip}) {
|
||||
return Text(
|
||||
text,
|
||||
overflow: textOver,
|
||||
style: TextStyle(
|
||||
fontSize: 16.sp,
|
||||
color: Colors.white,
|
||||
color: clr,
|
||||
fontWeight: FontWeight.w400,
|
||||
fontFamily: 'manrope'),
|
||||
);
|
||||
@@ -124,12 +129,12 @@ Widget text16W600(String text) {
|
||||
);
|
||||
}
|
||||
|
||||
Widget text16W500(String text) {
|
||||
Widget text16W500(String text, {Color clr = Colors.white}) {
|
||||
return Text(
|
||||
text,
|
||||
style: TextStyle(
|
||||
fontSize: 16.sp,
|
||||
color: Colors.white,
|
||||
color: clr,
|
||||
fontWeight: FontWeight.w500,
|
||||
fontFamily: 'manrope'),
|
||||
);
|
||||
@@ -167,6 +172,7 @@ Widget text12W400(String text) {
|
||||
fontFamily: 'manrope'),
|
||||
);
|
||||
}
|
||||
|
||||
Widget text12W500(String text) {
|
||||
return Text(
|
||||
text,
|
||||
|
||||
Reference in New Issue
Block a user