I am making a cross platform app using Flutter with a responsive layout. I'll describe the problem using the login page layout. The layout is divided into 3 widgets (Desktop, Tablet, Mobile) each of which has a ListView with its graphic components, images, text etc ... Inside this ListView the 3 widgets share the Login Form another ListView with its components (text fields, buttons ...)
The problem: when opened the keyboard does not scroll the text fields covering them
Below is a draft of the code:
//The form shared by the 3 Widgets
class SignInFrom extends StatelessWidget {
const SignInFrom({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Form(
child: ListView(
shrinkWrap: true,
physics: const ClampingScrollPhysics(),
children: [
//COMPONENTS
],
),
);
}
}
This is one of the 3 widgets (Mobile):
class SignInPageMobile extends StatelessWidget {
const SignInPageMobile({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return SafeArea(
child: ListView(
children: [
/* COMPONENTS
* ...
*/
const SignInForm(), //The above SignInFrom widget
],
),
);
}
}
The SignInPage widget:
class SignInPage extends StatelessWidget {
const SignInPage({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
resizeToAvoidBottomInset: false,
body: BlocProvider(
create: (context) => getIt<SignInFormBloc>(),
child: Responsive(
mobile: SignInPageMobile(),
tablet: SignInPageTablet(),
desktop: SignInPageDesktop(),
),
),
);
}
}
Edit
I want to mention that in the Scaffold that will contain one of the 3 widgets it is set:
resizeToAvoidBottomInset: false
Because my components are built on dynamic values of height and width using flutter_screenutil based on the sacaffold size so it needs to keep its dimensions even when the keyboard is open