inputDecorationTheme comming error with me - flutter

The function 'InputDecorationTheme' isn't defined.
Try importing the library that defines 'InputDecorationTheme', correcting the name to the name of an existing function, or defining a function named 'InputDecorationTheme'
inputDecorationTheme: InputDecorationTheme (
contentPadding: EdgeInsets.all(
AppPadding.p8,
),
hintStyle: getReglarStyle(
color: ColorManager.grey,
fontSize: FontSize.s14,
),
labelStyle: getReglarStyle(
color: ColorManager.grey,
fontSize: FontSize.s14,
),
errorStyle: getReglarStyle(
color: ColorManager.error,
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(
color: ColorManager.grey,
width: AppSize.s1_5,
),
borderRadius: BorderRadius.circular(AppSize.s8),
),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(
color: ColorManager.primary,
width: AppSize.s1_5,
),
borderRadius: BorderRadius.circular(AppSize.s8),
),
errorBorder: OutlineInputBorder(
borderSide: BorderSide(
color: ColorManager.primary,
width: AppSize.s14,
),
borderRadius: BorderRadius.circular(AppSize.s8),
),
)
);
}

Related

I am getting "constraintsError"

I tried to create an addImage page but getting "constraintsError" every time.
I tried to solve this with "Flexible", "Expanded", "Container" etc. widgets. But I dont get the solution.
Here is the my current page.
#override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Soru Ekleyin'),
),
body: Padding(
padding: const EdgeInsets.all(8.0),
child: SingleChildScrollView(
child: Column(
children: [
TextFormField(
controller: _nameController,
decoration: InputDecoration(
labelText: '_nameController',
hintText: '_nameController',
filled: true,
fillColor: Color.fromARGB(255, 249, 249, 249),
errorBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(25.0),
borderSide: BorderSide(color: Colors.green),
),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(25.0),
borderSide: BorderSide(
// style: BorderStyle.none,
color: Colors.blue,
),
),
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(25.0),
borderSide: BorderSide(
style: BorderStyle.none, color: Colors.green),
),
disabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(25.0),
borderSide: BorderSide(
// style: BorderStyle.none,
color: Colors.green),
),
// border: OutlineInputBorder(
// borderRadius: BorderRadius.circular(20.0)
// ),
),
),
TextFormField(
controller: _categoryController,
decoration: InputDecoration(
labelText: '_categoryController',
hintText: '_categoryController',
filled: true,
fillColor: Color.fromARGB(255, 249, 249, 249),
errorBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(25.0),
borderSide: BorderSide(color: Colors.green),
),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(25.0),
borderSide: BorderSide(
// style: BorderStyle.none,
color: Colors.blue,
),
),
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(25.0),
borderSide: BorderSide(
style: BorderStyle.none, color: Colors.green),
),
disabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(25.0),
borderSide: BorderSide(
// style: BorderStyle.none,
color: Colors.green),
),
// border: OutlineInputBorder(
// borderRadius: BorderRadius.circular(20.0)
// ),
),
),
ElevatedButton(
onPressed: () {
question = Question(
_nameController.text.trim(),
false,
_categoryController.text.trim(),
);
_snackbarGoster(context, 'Soru eklendi.');
//Created the question variable.
// addQuestion(question!);
},
child: Text('Ekle')),
Spacer(),
image != null ? Image.file(image!) : FlutterLogo(),
ElevatedButton(
child: Text('Görsel Ekle'),
onPressed: () {
addImage();
_snackbarGoster(context, 'Görsel eklendi.');
}),
TextField(
decoration: InputDecoration(
labelText: 'Soru ve Açıklama',
hintText: 'Soru ve Açıklama'),
),
ElevatedButton(
onPressed: () async {
await uploadQuestion(question!);
},
child: Text('Yükle'))
],
),
),
),
);
}
Can someone help me with this. How can I solve this. The error is coming from "flex.dart".
I think you need to place your SingleChildScrollView inside sized widget.

flutter/dart: How to create circular Text Field with one side border

I need the login screen with the shared images text field look so I am stock if anyone have idea so kindly share with me. thanks:
You can use Container and InputDecoration:
Container(
clipBehavior: Clip.antiAlias,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
boxShadow: [
BoxShadow(
color: Colors.black.withOpacity(0.1),
blurRadius: 10,
offset: Offset(1, -1),
),
],
),
child: TextField(
decoration: InputDecoration(
fillColor: Colors.white,
filled: true,
disabledBorder: UnderlineInputBorder(
borderSide: BorderSide(
color: Colors.blue, width: 4, style: BorderStyle.solid),
),
enabledBorder: UnderlineInputBorder(
borderSide: BorderSide(
color: Colors.blue, width: 4, style: BorderStyle.solid),
),
focusedBorder: UnderlineInputBorder(
borderSide: BorderSide(
color: Colors.blue, width: 4, style: BorderStyle.solid),
),
errorBorder: UnderlineInputBorder(
borderSide: BorderSide(width: 4, style: BorderStyle.solid),
),
),
),
)
Wrap your TextField with DecoratedBox.
DecoratedBox(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
border: Border(
bottom: BorderSide(color: Colors.blue),
),
),
child: TextField(),
);

TextFiled border disappear when click it flutter

Here my style of my textfiled and when ever i click to write the border is disappear
decoration: InputDecoration(
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(
color: white,
),
borderRadius: BorderRadius.circular(30.0),
),
hintText: (hintText),
hintStyle: TextStyle(
fontSize: 23, fontWeight: FontWeight.bold, color: white),
You need to set focusedBorder as well for InputDecoration.
TextField(
decoration: InputDecoration(
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(
color: Colors.white,
),
borderRadius: BorderRadius.circular(30.0),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(
color: Colors.white,
),
borderRadius: BorderRadius.circular(30.0),
),
),
);

Flutter TextFormField inpy border color not chaning

I am trying to change the color of input border but its not changing. Only the color change when its on focus but normally its not changing the color
Code
Container(
height: Height * 0.08,
width: Width * 0.9,
child: TextFormField(
style: TextStyle(
fontSize: 15,
color: Color(0xff04385f),
fontFamily: 'UbuntuRegular'),
decoration: new InputDecoration(
border: new OutlineInputBorder(
borderSide: const BorderSide(
color: Colors.red, width: 1.25),
borderRadius: const BorderRadius.all(
const Radius.circular(10.0),
),
),
filled: true,
hintStyle: new TextStyle(
color: Colors.grey[800],
fontFamily: 'UbuntuRegular'),
hintText: "Username",
fillColor: Colors.white70,
focusedBorder: OutlineInputBorder(
borderSide: const BorderSide(
color: Color(0xff04385f), width: 1.25),
borderRadius: const BorderRadius.all(
const Radius.circular(10.0),
),
),
),
),
),
As you can see i define red color on inputborder but its showing some dark grey color
add enabledColor:
enabledBorder: OutlineInputBorder(
borderSide: const BorderSide(
color: Colors.red, width: 1.25),
borderRadius: const BorderRadius.all(
const Radius.circular(10.0),
),
),

Flutter how to add shadow on textfield

I need to add shadow on my textfield
My code
TextField(
style: TextStyle(
fontSize: 25.0,
color: Colors.blueAccent,
),
decoration: InputDecoration(
contentPadding: EdgeInsets.fromLTRB(20.0, 15.0, 20.0, 15.0),
prefixIcon: Image.asset('assets/searchIcon#2x.png'),
hintText: "Search services",
border: OutlineInputBorder(
borderSide:
BorderSide(color: Colors.white, width: 32.0),
borderRadius: BorderRadius.circular(25.0),
),
focusedBorder: OutlineInputBorder(
borderSide:
BorderSide(color: Colors.white, width: 32.0),
borderRadius: BorderRadius.circular(25.0))))
Also i want to change the inside color of textfied in white
Want to achieve something like this
You can try something like this below or you can wrap your TextField with Container and use BoxDecoration --> BoxShadow to add drop down shadow to it:
Material(
elevation: 20.0,
shadowColor: Colors.blue,
child: TextField(
obscureText: true,
autofocus: false,
decoration: InputDecoration(
icon: new Icon(Icons.lock, color: Color(0xff224597)),
hintText: 'Password',
fillColor: Colors.white,
filled: true,
contentPadding: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0),
enabledBorder: OutlineInputBorder(borderRadius:BorderRadius.circular(5.0),
borderSide: BorderSide(color: Colors.white, width: 3.0))
),
),
)
You can wrap your TextField widget with Material. Material has property about the shadow. You can use it like this:
Material(
elevation: 3.0, // Set here what you wish!
shadowColor: Colors.grey,
child: TextField(
style: TextStyle(
fontSize: 25.0,
color: Colors.blueAccent,
),
decoration: InputDecoration(
contentPadding: EdgeInsets.fromLTRB(20.0, 15.0, 20.0, 15.0),
prefixIcon: Image.asset('assets/searchIcon#2x.png'),
hintText: "Search services",
border: OutlineInputBorder(
borderSide:
BorderSide(color: Colors.white, width: 32.0),
borderRadius: BorderRadius.circular(25.0),
),
focusedBorder: OutlineInputBorder(
borderSide:
BorderSide(color: Colors.white, width: 32.0),
borderRadius: BorderRadius.circular(25.0))))
I could give you an idea. Try something like this,
Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(25.0),
boxShadow: [
BoxShadow(
offset: Offset(0,5),
blurRadius: 10.0,
color: Colors.black.withOpacity(0.5),
),
],
),
child: TextField(
style: TextStyle(
fontSize: 25.0,
color: Colors.blueAccent,
),
decoration: InputDecoration(
contentPadding: EdgeInsets.fromLTRB(20.0, 15.0, 20.0, 15.0),
prefixIcon: Image.asset('assets/searchIcon#2x.png'),
hintText: "Search services",
border: OutlineInputBorder(
borderSide: BorderSide(color: Colors.white, width: 32.0),
borderRadius: BorderRadius.circular(25.0),
),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.white, width: 32.0),
borderRadius: BorderRadius.circular(25.0),
),
),
),
),
Play around with the color and offset value, you will get the desired output!
Hope that suits your case!
Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(6),
boxShadow: const [
BoxShadow(
color: Colors.grey,
blurRadius: 10.0, // soften the shadow
spreadRadius: 1.0, //extend the shadow
offset: Offset(
1.0, // Move to right 5 horizontally
1.0, // Move to bottom 5 Vertically
),
)
]),
child: Row(
children: [
Expanded(
child: TextField(
decoration: InputDecoration(
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(6),
borderSide: const BorderSide(
color: Colors.transparent,
)),
disabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(6),
borderSide: const BorderSide(
color: Colors.transparent,
)),
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(6),
borderSide: const BorderSide(
color: Colors.transparent,
)),
fillColor: Colors.white,
filled: true,
hintText: "Search by Jewelers Name",
border: InputBorder.none,
hintStyle:
const TextStyle(color: Colors.grey))),
),
],
),
),