You can scroll `pageView` on `Switch` toggle like this:
Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Center(
child: Switch(
value: value,
onChanged: (val) {
setState(() {
value = val;
if (value) {
controller.nextPage(
duration: Duration(milliseconds: 300),
curve: Curves.easeInOut);
} else {
controller.previousPage(
duration: Duration(milliseconds: 300),
curve: Curves.easeInOut);
}
});
})),
Expanded(
child: PageView(
controller: controller,
children: [
Container(
color: Colors.red,
),
Container(
color: Colors.yellow,
),
],
),
),
],
)
[![enter image description here][1]][1]
[1]: https://i.stack.imgur.com/qrCVM.gif
Removing Space-:
new Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
GestureDetector(
child: new Text('Don\'t have an account?',
style: new TextStyle(color: Color(0xFF2E3233))),
onTap: () {},
),
GestureDetector(
onTap: (){},
child: new Text(
'Register.',
style: new TextStyle(
color: Color(0xFF84A2AF), fontWeight: FontWeight.bold),
))
],
),
OR
GestureDetector(
onTap: (){},
child: new Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
new Text('Don\'t have an account?',
style: new TextStyle(color: Color(0xFF2E3233))),
new Text(
'Register.',
style: new TextStyle(
color: Color(0xFF84A2AF), fontWeight: FontWeight.bold),
)
],
),
),