Хитрость заключается в том, чтобы не изгибать панель приложения, а вместо этого изгибать нижний контейнер. Посмотрите на код ниже, и вы поймете его.
class LoginPage extends StatefulWidget {
@override
_LoginPageState createState() => _LoginPageState();
}
class _LoginPageState extends State<LoginPage> {
final key = GlobalKey<ScaffoldState>();
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Color(0xFF012B44),
key: key,
appBar: AppBar(
title: Text("OTP Verification"),
backgroundColor: Colors.transparent,
),
body: SingleChildScrollView(
child: Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(15),
topRight: Radius.circular(15),
)
),
height: MediaQuery.of(context).size.height,
width: MediaQuery.of(context).size.width,
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Text(
"Welcome to the login page",
style: Theme.of(context).textTheme.display1,
),
TextField(
decoration: InputDecoration(hintText: "Name"),
),
FlatButton(
onPressed: () {
key.currentState.showSnackBar(SnackBar(
content:
Text("I won't say your name but stay home, stay safe!"),
));
},
child: Text("Say my name"))
],
),
),
),
);
}
}