how to see the element in emulator ui in flutter - flutter

Now I am adding a scrollbar to my app, this is my code:
final ScrollController _scrollController = ScrollController();
return GestureDetector(
onHorizontalDragStart: _onHorizontalDragStart,
onHorizontalDragUpdate: _onHorizontalDragUpdate,
onHorizontalDragEnd: _onHorizontalDragEnd,
child: Container(
constraints: BoxConstraints(
minHeight: MediaQuery.of(context).size.height * 0.9,
),
color: Theme.of(context).scaffoldBackgroundColor,
child: CupertinoScrollbar(
isAlwaysShown: true,
controller: _scrollController,
child: Padding(
padding: const EdgeInsets.all(16.0),
child: buildListView(item, context),
),
)));
but in the UI, I did not find the ScrollBar. How to make the scrollbar show on the UI? or like inspect element like html in Chrome. this is the UI:
I have wake up the Flutter Inspector, but when I click the element, nothing happen in the emulator. Now I am using SingleChildScrollView:
SingleChildScrollView buildListView(Item item, BuildContext context) {
return SingleChildScrollView(
controller: _scrollController,
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
InkWell(
onTap: () => CommonUtils.launchUrl(item.link),
child: Padding(
padding: const EdgeInsets.only(bottom: 8.0),
child: Container(
child: Text(
item.title == "" ? "Comment" : item.title,
style: Theme.of(context).textTheme.headline5!.copyWith(
fontWeight: FontWeight.w600,
),
),
),
),
),
if (item.domain != "")
Padding(
padding: const EdgeInsets.only(bottom: 8.0),
child: InkWell(
onTap: () async {
navToChannelDetail();
},
child: Text(
item.domain,
style: Theme.of(context).textTheme.caption!.copyWith(color: Theme.of(context).primaryColor),
)),
),
InkWell(
onTap: () {},
child: RichText(
text: TextSpan(
children: <TextSpan>[
TextSpan(
text: item.author,
style: Theme.of(context).textTheme.caption,
),
TextSpan(
text: " ${String.fromCharCode(8226)} ",
style: Theme.of(context).textTheme.caption,
),
TextSpan(
text: item.ago,
style: Theme.of(context).textTheme.caption,
),
],
),
),
),
if (item.content != "")
Html(
data: item.content,
style: {
"body": Style(
fontSize: FontSize(19.0),
),
},
//sonLinkTap: (url) => CommonUtils.launchUrl(url),
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
Padding(
padding: const EdgeInsets.only(right: 16.0),
child: Row(
children: [
if (item.isFav == 1)
IconButton(
icon: Icon(Icons.bookmark, color: Theme.of(context).primaryColor),
onPressed: () => touchFav("unfav", FavStatus.UNFAV),
),
if (item.isFav != 1)
IconButton(
icon: Icon(Icons.bookmark),
onPressed: () => touchFav("fav", FavStatus.FAV),
),
Padding(
padding: const EdgeInsets.only(left: 0.0),
child: Text(
"${item.favCount}",
textAlign: TextAlign.center,
style: Theme.of(context).textTheme.caption!.copyWith(
color: Theme.of(context).primaryColor,
),
),
),
],
),
),
Padding(
padding: const EdgeInsets.only(bottom: 0.0),
child: Row(
children: [
if (item.isUpvote == 1)
IconButton(
icon: Icon(Icons.thumb_up, color: Theme.of(context).primaryColor),
onPressed: () => touchUpvote("unupvote", UpvoteStatus.UNUPVOTE),
),
if (item.isUpvote != 1)
IconButton(
icon: Icon(Icons.thumb_up),
onPressed: () => touchUpvote("upvote", UpvoteStatus.UPVOTE),
),
Padding(
padding: const EdgeInsets.only(left: 8.0),
child: Text(
"${item.upvoteCount}",
textAlign: TextAlign.center,
style: Theme.of(context).textTheme.caption!.copyWith(
color: Theme.of(context).primaryColor,
),
),
),
],
),
),
],
),
IconButton(
icon: Icon(
Feather.share_2,
),
onPressed: () => handleShare(id: item.id, title: item.title, postUrl: item.link),
),
],
),
],
));
}

You must add the _scrollController to ListView
You can try this , I hope to help you :
return Container(
constraints: BoxConstraints(
minHeight: MediaQuery.of(context).size.height * 0.9,
),
color: Theme.of(context).scaffoldBackgroundColor,
child: CupertinoScrollbar(
isAlwaysShown: true,
controller: _scrollController,
child: Padding(
padding: const EdgeInsets.all(16.0),
child: ListView.builder(
controller: _scrollController,
itemCount: 500,
shrinkWrap: true,
itemBuilder:(_, index){
return Text('Index Number : '+index.toString());
}),
),
));

Related

Widget buildRow not appearing

I am working on one of the screens of my app, my first widget buildrow shows up perfectly however the second one does not appear, is this because my screen is not wide enough? I do have 3 buttons within the first buildrow, does that mean it will not show up because it is below it? Here is my code! Please let me know if anyone can help!
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(widget.task.name),
),
body: Material(
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
Expanded(
child: timerText,
),
Expanded(
flex: 0,
child: Padding(
padding: const EdgeInsets.only(bottom: 24.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
RaisedButton(
onPressed: disable
? null
: () {
setState(() {
StudyViewModel.stopwatch.reset();
});
},
color: Colors.red,
padding: EdgeInsets.symmetric(
horizontal: 60.0,
vertical: 20.0,
),
child: Text(
"Reset",
style: TextStyle(fontSize: 20.0, color: Colors.white),
),
),
RaisedButton(
onPressed: () {
setState(() {
if (StudyViewModel.stopwatch.isRunning) {
StudyViewModel.stopwatch.stop();
disable = false;
} else {
StudyViewModel.stopwatch.start();
disable = true;
}
});
},
color: Colors.green,
padding: EdgeInsets.symmetric(
horizontal: 60.0,
vertical: 20.0,
),
child: Text(
"Play/Pause",
style: TextStyle(fontSize: 24.0, color: Colors.white),
),
),
RaisedButton(
onPressed: disable
? null
: () async {
widget.task.elapsedTime =
StudyViewModel.milliToElapsedString(
StudyViewModel
.stopwatch.elapsedMilliseconds);
await StudyViewModel.saveFile();
Navigator.of(context).pop();
},
color: Colors.yellow,
padding: EdgeInsets.symmetric(
horizontal: 60.0,
vertical: 20.0,
),
child: Text(
"Save",
style: TextStyle(fontSize: 24.0, color: Colors.white),
),
),
],
),
),
),
],
),
),
);
}
Widget buildRow(BuildContext context, int index) {
return ListView(
children: <Widget>[
Text(StudyViewModel.studies[index].name,
style: TextStyle(fontSize: 18.0),
),
ListView.builder(
shrinkWrap: true,
primary: false,
itemCount: StudyViewModel.studies[index].tasks.length,
itemBuilder: (context, int taskIndex) {
return ListTile(
title: Text(StudyViewModel.studies[index].tasks[taskIndex].name),
contentPadding: EdgeInsets.symmetric(horizontal: 32.0),
subtitle: Text(
StudyViewModel.studies[index].tasks[taskIndex].elapsedTime),
);
},
),
],
);
}
}
Try to wrap your middle RaisedButton with Flexible.
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(widget.task.name),
),
body: Material(
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
Expanded(
child: timerText,
),
Expanded(
flex: 0,
child: Padding(
padding: const EdgeInsets.only(bottom: 24.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
RaisedButton(
onPressed: disable
? null
: () {
setState(() {
StudyViewModel.stopwatch.reset();
});
},
color: Colors.red,
padding: EdgeInsets.symmetric(
horizontal: 60.0,
vertical: 20.0,
),
child: Text(
"Reset",
style: TextStyle(fontSize: 20.0, color: Colors.white),
),
),
Flexible(
child: RaisedButton(
onPressed: () {
setState(() {
if (StudyViewModel.stopwatch.isRunning) {
StudyViewModel.stopwatch.stop();
disable = false;
} else {
StudyViewModel.stopwatch.start();
disable = true;
}
});
},
color: Colors.green,
padding: EdgeInsets.symmetric(
horizontal: 60.0,
vertical: 20.0,
),
child: Text(
"Play/Pause",
style: TextStyle(fontSize: 24.0, color: Colors.white),
),
),
),
RaisedButton(
onPressed: disable
? null
: () async {
widget.task.elapsedTime =
StudyViewModel.milliToElapsedString(
StudyViewModel
.stopwatch.elapsedMilliseconds);
await StudyViewModel.saveFile();
Navigator.of(context).pop();
},
color: Colors.yellow,
padding: EdgeInsets.symmetric(
horizontal: 60.0,
vertical: 20.0,
),
child: Text(
"Save",
style: TextStyle(fontSize: 24.0, color: Colors.white),
),
),
],
),
),
),
],
),
),
);
}

How can i add expansion tile widgets inside GridView.builder() in flutter?

I was working on grid views and got stuck when trying to insert expansion tiles inside the grid view.The problem that i am facing is, when tring to expand the tile, i am getting an overflow error. Is there any way to use expansion tile inside grid view in such a way that when one of the tiles is expanded, the other tiles moves down without causing any overflow error ?
Here's my code snippet :
Expanded(
child: GridView.builder(
itemCount: 21,
physics: BouncingScrollPhysics(),
gridDelegate:
SliverGridDelegateWithFixedCrossAxisCount(
crossAxisSpacing: 10,
mainAxisSpacing: 10,
childAspectRatio: (1 / 0.46),
crossAxisCount:
(MediaQuery.of(context).orientation ==
Orientation.landscape)
? 4
: 1,
),
itemBuilder:
(BuildContext context, int index) => Card(
elevation: 6.0,
child: ClipRRect(
borderRadius: BorderRadius.circular(10.0),
child: ExpansionTile(
// collapsedBackgroundColor: Colors.white,
// backgroundColor: Colors.white,
trailing: FadeInImage.memoryNetwork(
image:
'https://picsum.photos/250?image=123',
placeholder: kTransparentImage,
),
title: Container(
child: Text(
'Pencil Pen Test Long String Again Test Long String',
),
),
subtitle: Padding(
padding:
const EdgeInsets.only(top: 8.0),
child: Text(
'\u{20B9} $myAmount',
style: TextStyle(
fontWeight: FontWeight.bold,
),
),
),
children: <Widget>[
Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
Align(
alignment: Alignment.topLeft,
child: Text('Price 1 :' +
' \u{20B9} $myAmount'),
),
Align(
alignment: Alignment.topLeft,
child: Text('Price 2 :' +
' \u{20B9} $myAmount'),
),
Align(
alignment: Alignment.topLeft,
child: Text('Price 3 :' +
' \u{20B9} $myAmount'),
),
SizedBox(
height: 6.0,
),
Column(
children: [
Container(
padding:
EdgeInsets.all(20.0),
child: Align(
alignment:
Alignment.centerLeft,
child: Text(
'TAGS',
style: TextStyle(
color: Colors.white,
decoration:
TextDecoration
.underline,
),
),
),
),
Row(
children: [
Expanded(
child: InputChip(
onDeleted: () {},
onPressed: () {},
label: Text('Chip a'),
avatar: Icon(
Icons.ac_unit),
),
),
Expanded(
child: InputChip(
onDeleted: () {},
onPressed: () {},
label: Text('Chip b'),
avatar: Icon(Icons
.e_mobiledata),
),
),
Expanded(
child: InputChip(
onDeleted: () {},
onPressed: () {},
label: Text('Chip c'),
avatar: Icon(Icons
.format_align_justify_outlined),
),
),
],
),
],
),
Divider(),
Row(
mainAxisAlignment:
MainAxisAlignment
.spaceBetween,
children: <Widget>[
Row(
children: [
Text(
'In Hand : ',
style: TextStyle(
fontWeight:
FontWeight.bold,
color:
Theme.of(context)
.colorScheme
.secondary,
),
),
],
),
Row(
children: [
IconButton(
onPressed: () {
displayBottomSheetAddInventory(
context);
},
icon: Icon(
Icons.add_circle),
),
IconButton(
onPressed: () {
displayBottomSheetSubtractInventory(
context);
},
icon: Icon(Icons
.remove_circle),
),
IconButton(
onPressed: () {
displayBottomSheetEditInventory(
context);
},
icon: Icon(
Icons.edit,
),
),
],
),
],
)
],
),
)
],
),
),
),
),
),
This is what i'm getting:
And this is want i want : (The other tiles should be below this tile and readjust when collapsed.)
Can anyone help ?

Flutter / Dart - Problem with SetState called from a Floating Action Button

I am having trouble with calling SetState when pressing a FAB. Nothing changes on the screen...
Here's the code :
bool _editMode = false;
return DefaultTabController(
length: 3,
child: Scaffold(
backgroundColor: Colors.orange[100],
appBar: AppBar(
backgroundColor: Colors.white,
automaticallyImplyLeading: false,
title: Center(
child: Text(
'Liste de vocabulaire n°${userData.selectedCarnetList + 1}'
.toUpperCase(),
style: TextStyle(
fontSize: 20.0,
fontWeight: FontWeight.bold,
color: Colors.blue[800],
),
maxLines: 2,
textAlign: TextAlign.center,
),
),
actions: [
GestureDetector(
child: Container(
padding: EdgeInsets.all(16.0),
child: listsProvider.dicoLanguage == Language.french
? Image.asset(
'icons/french_flag.png',
height: 45.0,
width: 45.0,
)
: Image.asset(
'icons/english_flag.png',
height: 45.0,
width: 45.0,
),
),
onTap: () => listsProvider.dicoLanguage == Language.french
? listsProvider.setDicoLanguage(Language.english)
: listsProvider.setDicoLanguage(Language.french),
),
],
bottom: TabBar(
indicatorWeight: 10,
indicatorColor: Colors.green[800],
tabs: [
Tab(
child: Text(
'Ordre alphabétique',
textAlign: TextAlign.center,
style: TextStyle(color: Colors.red[800]),
),
),
Tab(
child: Text(
'Catégorie grammaticale',
textAlign: TextAlign.center,
style: TextStyle(color: Colors.red[800]),
),
),
Tab(
child: Text(
'Niveau',
textAlign: TextAlign.center,
style: TextStyle(color: Colors.red[800]),
),
),
]),
),
body: TabBarView(
children: [
ListView(
children: [
Padding(
padding: const EdgeInsets.all(8.0),
child: CarnetListCard(
index: index,
taille:
userData.userInfo.carnetVoc[index].wordId.length,
titre: userData.userInfo
.carnetVoc[userData.selectedCarnetList].titre
.toUpperCase(),
dateCreation:
userData.userInfo.carnetVoc[index].creation,
dateModification:
userData.userInfo.carnetVoc[index].modification,
mots: ListView.builder(
itemCount: userData
.userInfo.carnetVoc[index].wordId.length,
itemBuilder: (context, index2) {
return ListTile(
contentPadding: EdgeInsets.all(0),
title: Container(
decoration: BoxDecoration(
color: Colors.red[800],
borderRadius: BorderRadius.circular(10.0),
),
child: Padding(
padding: const EdgeInsets.all(12.0),
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceAround,
children: [
Expanded(
child: Text(
listsProvider.dicoLanguage ==
Language.english
? wordBank[userData
.userInfo
.carnetVoc[index]
.wordId[index2]]
.main
: wordBank[userData
.userInfo
.carnetVoc[index]
.wordId[index2]]
.mainFr,
style: TextStyle(
color: Colors.white,
fontSize: 13.0,
),
),
),
Expanded(
child: Text(
listsProvider.dicoLanguage ==
Language.english
? wordBank[userData
.userInfo
.carnetVoc[index]
.wordId[index2]]
.mainFr
: wordBank[userData
.userInfo
.carnetVoc[index]
.wordId[index2]]
.main,
style: TextStyle(
color: Colors.orange[100],
fontSize: 13.0),
),
),
],
),
),
),
onTap: () => Navigator.push(context,
MaterialPageRoute(builder: (context) {
return DisplayThematicList(
subTheme: listsProvider
.themeBank[index].subTheme[index2],
langue: listsProvider.dicoLanguage,
image: listsProvider.themeBank[index].thema,
);
})),
);
},
),
),
),
],
),
ListView(),
ListView(),
],
),
floatingActionButton: _editMode == false
? Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Padding(
padding: const EdgeInsets.symmetric(horizontal: 25.0),
child: FloatingActionButton(
heroTag: 'Back',
backgroundColor: Colors.red[800],
child: Icon(Icons.arrow_back),
onPressed: () => Navigator.pushReplacementNamed(
context, CarnetScreen.id),
),
),
FloatingActionButton.extended(
heroTag: 'Edit',
backgroundColor: Colors.blue[800],
icon: Icon(Icons.edit),
label: Text('Modifier'),
onPressed: () {
setState(() {
_editMode = true;
print(_editMode);
});
})
],
)
: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Padding(
padding: const EdgeInsets.symmetric(horizontal: 25.0),
child: FloatingActionButton(
heroTag: 'Close',
backgroundColor: Colors.red[800],
child: Icon(Icons.close),
onPressed: () => Navigator.pushReplacementNamed(
context, CarnetScreen.id),
),
),
FloatingActionButton.extended(
heroTag: 'Valider',
backgroundColor: Colors.green[800],
icon: Icon(Icons.library_add_check_rounded),
label: Text('Valider'),
onPressed: () {
setState(() {
_editMode = false;
print(_editMode);
});
}),
],
),
),
);
}
}
When tapping FAB ('EDIT'), I set (_editMode) to TRUE, and it should rebuild with new buttons showing... but for some reason nothing happens...
Is there anything in a FAB which separates the action from the State of the Screen ? or could it be due to the TAB BAR ?
Any idea why ?
Put your variable bool _editMode = false; above build method
bool _editMode = false;
#override
Widget build(BuildContext context) {

How to align a Column's child to the bottom in container in flutter

I am using Column in container component in flutter,now I want the row component to align the button, this is my code:
return Container(
color: Theme
.of(context)
.scaffoldBackgroundColor,
child: GestureDetector(
onHorizontalDragStart: _onHorizontalDragStart,
onHorizontalDragUpdate: _onHorizontalDragUpdate,
onHorizontalDragEnd: _onHorizontalDragEnd,
child: Padding(
padding: const EdgeInsets.all(
16.0,
),
child:Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
InkWell(
onTap: () => launchUrl(item.link),
child: Padding(
padding: const EdgeInsets.only(bottom: 8.0),
child: Container(
child: Text(
item.title == "" ? "Comment" : item.title,
style: Theme
.of(context)
.textTheme
.headline5
.copyWith(
fontWeight: FontWeight.w600,
),
),
),
),
),
if (item.domain != "")
Padding(
padding: const EdgeInsets.only(bottom: 8.0),
child: InkWell(
onTap: () async {
Channel channel = await Repo.fetchChannelItem(int.parse(item.subSourceId));
Navigator.push(
context,
MaterialPageRoute(builder: (context) => ChannelPage(item:channel)),
//ProfilePage(username: item.author))
);
}, child: Text(
item.domain,
style: Theme
.of(context)
.textTheme
.caption,
)
),
),
InkWell(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
ProfilePage(username: item.author)),
);
},
child: RichText(
text: TextSpan(
children: <TextSpan>[
TextSpan(
text: item.author,
style: Theme
.of(context)
.textTheme
.caption
.copyWith(
color: Theme
.of(context)
.primaryColor,
),
),
TextSpan(
text: " ${String.fromCharCode(8226)} ",
style: Theme
.of(context)
.textTheme
.caption,
),
TextSpan(
text: item.ago,
style: Theme
.of(context)
.textTheme
.caption,
),
],
),
),
),
if (item.content != "")
Html(
data: item.content,
style: {
"body": Style(
fontSize: FontSize(19.0),
),
},
onLinkTap: (url) => launchUrl(url),
),
if (item.parts.isNotEmpty)
Padding(
padding: const EdgeInsets.only(top: 8.0),
child: ListView.builder(
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
itemCount: item.parts.length,
itemBuilder: (context, index) {
return PartSnippet(part: parts[index]);
},
),
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
Padding(
padding: const EdgeInsets.only(right: 16.0),
child: Row(
children: [
if(item.isFav == 1)
IconButton(
icon:Icon(Feather.bookmark,
color: Theme
.of(context)
.primaryColor),
onPressed: () => touchFav("unfav"),
),
if(item.isFav != 1)
IconButton(
icon:Icon(Feather.bookmark,
color: Theme
.of(context)
.primaryColor),
onPressed: () => touchFav("fav"),
),
Padding(
padding: const EdgeInsets.only(left: 8.0),
child: Text(
"${item.score}",
textAlign: TextAlign.center,
style: Theme
.of(context)
.textTheme
.caption
.copyWith(
color: Theme
.of(context)
.primaryColor,
),
),
),
],
),
),
Padding(
padding: const EdgeInsets.only(bottom: 0.0),
child: Row(
children: [
Icon(
Feather.arrow_up,
),
Padding(
padding: const EdgeInsets.only(left: 8.0),
child: Text(
"${item.score}",
textAlign: TextAlign.center,
style: Theme
.of(context)
.textTheme
.caption
.copyWith(
color: Theme
.of(context)
.primaryColor,
),
),
),
],
),
),
Padding(
padding: const EdgeInsets.only(right: 16.0),
child: Row(
children: [
Icon(
Feather.message_square,
),
Padding(
padding: const EdgeInsets.only(left: 8.0),
child: Text(
item.descendants.toString(),
textAlign: TextAlign.center,
style: Theme
.of(context)
.textTheme
.caption,
),
),
],
),
),
],
),
IconButton(
icon: Icon(
Feather.share_2,
),
onPressed: () =>
handleShare(
id: item.id,
title: item.title,
postUrl: item.link),
),
Expanded(
flex: 1,
child: new RaisedButton(
onPressed: () {
print('');
},
color: const Color(0xfff1c232),
child: new Text(''),
),
)
],
),
],
),
),
));
the container shows some article content, then some icon's like like\upvote\share in the button, but sometimes the article content is very short, now I want the like\upvote\share icon align the button of screen, not in the middle of screen, what should I do to make it? I am trying using Expand but do not work.
if you want to align every child of the Column at the bottom use:
mainAxisAlignment: MainAxisAlignment.end,
if you want to align only the last Widget of the Column I would place a Spacer() before the last Widget:
Column(
children: [
FirstWidget,
SecondWidget,
Spacer(), //use this widget to take the available space
LastWidget,
],
),
Just wrap the widget which is right above your Row wrap it inside an Expanded widget and give it a flex =1

Flutter Login Screen UI Scrollable

I'm trying to make a login screen in Flutter. This login contains fields like e-mail and password, forgot password, sign up. The problem is in some devices the keyboard hides the password filed, I want to make the screen scroll.
My code looks like:
return Scaffold(
key: _scaffoldKey,
resizeToAvoidBottomPadding: false,
body: Container(
decoration: new BoxDecoration(
image: new DecorationImage(
image: new ExactAssetImage("graphics/register_bg.png"),
fit: BoxFit.cover,
),
),
child: LoadingIndicatorPage(
loading: _loading,
child: Padding(
padding: EdgeInsets.only(
left: LEFTRIGHT_PADDING, right: LEFTRIGHT_PADDING),
child: AnimatedOpacity(
opacity: _currentOpacity,
duration: const Duration(seconds: 1),
child: Column(
children: <Widget>[
Expanded(
child: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Padding(
padding: EdgeInsets.only(top: 90),
child: Text(
AppLocalizations.of(context).loginTitle,
style: TextStyle(fontSize: 32),
),
),
Padding(
padding: EdgeInsets.only(top: 90),
child: Align(
alignment: Alignment.centerLeft,
child: Text(
AppLocalizations.of(context).loginEmailHint,
style: TextStyle(color: brownishGrey),
),
),
),
TextFieldInput(
inputType: TextInputType.emailAddress,
textEditingController: emailController,
),
Padding(
padding: EdgeInsets.only(top: INPUT_FIELDS_SPACING),
child: Align(
alignment: Alignment.centerLeft,
child: Text(
AppLocalizations.of(context).loginPasswordHint,
style: TextStyle(color: brownishGrey),
),
),
),
TextFieldInput(
inputType: TextInputType.text,
textEditingController: passwordController,
obscureText: true,
),
Padding(
padding:
EdgeInsets.only(top: PAGE_TOP_NO_TITLE_PADDING),
child: Align(
alignment: Alignment.centerLeft,
child: GestureDetector(
onTap: () {
_showForgotPassword();
},
child: Text(
AppLocalizations.of(context)
.loginForgotPassword +
'?',
style: TextStyle(color: purpleishBlueThree),
),
),
),
),
],
),
),
),
Padding(
padding: EdgeInsets.only(top: 0.0),
child: Button(
text: AppLocalizations.of(context).loginLogin,
buttonOnPressed: () {
_login();
},
),
),
Padding(
padding: const EdgeInsets.fromLTRB(8.0, 15.0, 8.0, 0),
child: Divider(
thickness: 1,
color: whiteTwo,
),
),
Padding(
padding: EdgeInsets.only(top: 15.0, bottom: 15.0),
child: GestureDetector(
child: RichText(
text: TextSpan(
text: AppLocalizations.of(context)
.loginCreateAccountPre,
style: TextStyle(color: brownishGrey),
children: <TextSpan>[
TextSpan(
text: AppLocalizations.of(context)
.loginCreateAccountPost,
style: TextStyle(
color: purpleishBlueThree,
decoration: TextDecoration.underline,
),
)
],
),
),
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => new RegisterPage(),
),
);
},
),
),
],
),
),
),
),
),
);
Try wrapping your body: Container with SingleChildScrollView
and remove the resizeToAvoidBottomPadding from the Scaffold
Wrap LoadingIndicatorPage inside SingleChildScrollView
return Scaffold(
key: _scaffoldKey,
body: Container(
decoration: new BoxDecoration(
image: new DecorationImage(
image: new ExactAssetImage("graphics/register_bg.png"),
fit: BoxFit.cover,
),
),
child: SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: LoadingIndicatorPage(
loading: _loading,
child: Padding(
padding: EdgeInsets.only(
left: LEFTRIGHT_PADDING, right: LEFTRIGHT_PADDING),
child: AnimatedOpacity(
opacity: _currentOpacity,
duration: const Duration(seconds: 1),
child: Column(
children: <Widget>[
Expanded(
child: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Padding(
padding: EdgeInsets.only(top: 90),
child: Text(
AppLocalizations.of(context).loginTitle,
style: TextStyle(fontSize: 32),
),
),
Padding(
padding: EdgeInsets.only(top: 90),
child: Align(
alignment: Alignment.centerLeft,
child: Text(
AppLocalizations.of(context).loginEmailHint,
style: TextStyle(color: brownishGrey),
),
),
),
TextFieldInput(
inputType: TextInputType.emailAddress,
textEditingController: emailController,
),
Padding(
padding: EdgeInsets.only(top: INPUT_FIELDS_SPACING),
child: Align(
alignment: Alignment.centerLeft,
child: Text(
AppLocalizations.of(context).loginPasswordHint,
style: TextStyle(color: brownishGrey),
),
),
),
TextFieldInput(
inputType: TextInputType.text,
textEditingController: passwordController,
obscureText: true,
),
Padding(
padding:
EdgeInsets.only(top: PAGE_TOP_NO_TITLE_PADDING),
child: Align(
alignment: Alignment.centerLeft,
child: GestureDetector(
onTap: () {
_showForgotPassword();
},
child: Text(
AppLocalizations.of(context)
.loginForgotPassword +
'?',
style: TextStyle(color: purpleishBlueThree),
),
),
),
),
],
),
),
),
Padding(
padding: EdgeInsets.only(top: 0.0),
child: Button(
text: AppLocalizations.of(context).loginLogin,
buttonOnPressed: () {
_login();
},
),
),
Padding(
padding: const EdgeInsets.fromLTRB(8.0, 15.0, 8.0, 0),
child: Divider(
thickness: 1,
color: whiteTwo,
),
),
Padding(
padding: EdgeInsets.only(top: 15.0, bottom: 15.0),
child: GestureDetector(
child: RichText(
text: TextSpan(
text: AppLocalizations.of(context)
.loginCreateAccountPre,
style: TextStyle(color: brownishGrey),
children: <TextSpan>[
TextSpan(
text: AppLocalizations.of(context)
.loginCreateAccountPost,
style: TextStyle(
color: purpleishBlueThree,
decoration: TextDecoration.underline,
),
)
],
),
),
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => new RegisterPage(),
),
);
},
),
),
],
),
),
),
),
),
),
);