iampawan/30DaysOfFlutter

Detail page says Bottom overflowed by 80 pixels.

codydecode opened this issue · 1 comments

I guess the size problem comes from parent widgets. I tried using SingleChildScrolView but didnt work.

Here is the sample code

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';

class CupertinoFormdemo extends StatelessWidget {
const CupertinoFormdemo({Key? key}) : super(key: key);

@OverRide
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.cyan,
body: SafeArea(
child: SingleChildScrollView(
child: Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
'Sign Up',
style: TextStyle(
fontSize: 30,
fontWeight: FontWeight.bold,
color: Colors.redAccent),
),
Text(
'Create your account',
style: TextStyle(
fontSize: 15,
fontWeight: FontWeight.bold,
color: Colors.redAccent),
),
CupertinoFormSection(
header: Text("Personal Details"),
children: [
CupertinoFormRow(
child: CupertinoTextFormFieldRow(
placeholder: "Enter name",
),
prefix: Text('Name'),
),
CupertinoFormRow(
child: CupertinoTextFormFieldRow(
placeholder: "Enter phone",
),
prefix: Text('Phone'),
error: Text("Phone no is not valid"),
helper: Text("Eg- 9876****"),
),
]),
CupertinoFormSection(header: Text("User Details"), children: [
CupertinoFormRow(
child: CupertinoTextFormFieldRow(
keyboardType: TextInputType.emailAddress,
placeholder: "Enter Email",
),
prefix: Text('Email'),
),
CupertinoFormRow(
child: CupertinoTextFormFieldRow(
obscureText: true,
placeholder: "Enter password",
),
prefix: Text('Password'),
),
CupertinoFormRow(
child: CupertinoTextFormFieldRow(
obscureText: true,
placeholder: "Re enter password",
),
prefix: Text('Re enter password'),
),
]),
CupertinoFormSection(
header: Text("Terms and Conditions"),
children: [
CupertinoFormRow(
child: CupertinoSwitch(
value: true, onChanged: (value) {}),
prefix: Text('I agree')),
],
),
SizedBox(
height: 20,
),
Container(
width: 150,
alignment: Alignment.center,
height: 50,
color: Colors.green,
child: TextButton(
onPressed: () {},
child: Text(
'Sign Up',
style: TextStyle(color: Colors.white),
)))
],
),
),
),
));
}
}