'SingleChildScrollView is not working on stack
I'm new to flutter. In the bottom code, I've tried to wrap stack with SingleChildScrollView, but, even then, when I tap to type the keyboard covers the TextFormFields. The column's MainAxisSize is also set to minimum.Is this because of MediaQuery
Please help.
Note: In the below code there are three more containers of TextFormField
enum CircleAlignment {
topLeft,
// topRight,
// bottomLeft,
bottomRight,
}
MaterialApp(
debugShowCheckedModeBanner: false,
home: SafeArea(
child: Scaffold(
backgroundColor: Colors.white,
body: Stack(
children: [
Positioned(
top: MediaQuery.of(context).size.height / 9,
child: Column(
children: [
Image.asset(
'assets/images/signup_2.jpg',
width: MediaQuery.of(context).size.width,
height: (8 * MediaQuery.of(context).size.height) / 19,
),
],
),
),
SizedBox.expand(
child: ClipRect(
child: CustomPaint(
painter: QuarterCirclePainter(
circleAlignment: CircleAlignment.topLeft,
color: Color(0xff1CEEEE)
),
),
),
),
SizedBox.expand(
child: ClipRect(
child: CustomPaint(
painter: QuarterCirclePainter(
circleAlignment: CircleAlignment.topLeft,
color: Colors.deepPurpleAccent
),
),
),
),
SizedBox.expand(
child: ClipRect(
child: CustomPaint(
painter: QuarterCirclePainter(
circleAlignment: CircleAlignment.bottomRight,
color: Color(0xff1CEEEE)
),
),
),
),
SizedBox.expand(
child: ClipRect(
child: CustomPaint(
painter: QuarterCirclePainter(
circleAlignment: CircleAlignment.bottomRight,
color: Colors.deepPurpleAccent
),
),
),
),
Positioned(
width: MediaQuery.of(context).size.width / 3,
right: MediaQuery.of(context).size.width / 8,
top: MediaQuery.of(context).size.height / 30,
child: Text(
"Create new Account",
style: TextStyle(
fontSize: MediaQuery.of(context).size.width / 14,
fontWeight: FontWeight.w900,
fontFamily: 'Roboto',
color: Color(0xff000000),
),
),
),
Positioned.fill(
left: MediaQuery.of(context).size.width / 14,
right: MediaQuery.of(context).size.width / 14,
top: (40 * MediaQuery.of(context).size.height) / 79,
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisSize: MainAxisSize.min,
children: [
Container(
height: MediaQuery.of(context).size.height / 10,
child: TextFormField(
decoration: InputDecoration(
contentPadding: EdgeInsets.only(
top: 0,
bottom: 0,
left: MediaQuery.of(context).size.width / 25,
),
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(15),
borderSide: BorderSide(
color: Color(0xff000000),
width: 2,
)
),
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(15),
borderSide: BorderSide(
color: Color(0xff000000),
width: 2,
)
),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(15),
borderSide: BorderSide(
color: Color(0xff000000),
width: 2,
)
),
hintText: "Full Name",
hintStyle: TextStyle(
color: Color(0xff000000),
fontFamily: 'Roboto',
fontWeight: FontWeight.w700,
fontSize: MediaQuery.of(context).size.width / 20,
)
),
),
)
],
),
),
],
),
),
),
)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
