Skip to content

Instantly share code, notes, and snippets.

@fatihhcan
Created September 4, 2020 16:14
Show Gist options
  • Save fatihhcan/dc8fd0e5f286c93a71e69ed59f3fedd0 to your computer and use it in GitHub Desktop.
Save fatihhcan/dc8fd0e5f286c93a71e69ed59f3fedd0 to your computer and use it in GitHub Desktop.
class PlanetsView extends StatefulWidget {
PlanetsView({Key key}) : super(key: key);
@override
_PlanetsViewState createState() => _PlanetsViewState();
}
class _PlanetsViewState extends State<PlanetsView> {
@override
Widget build(BuildContext context) {
return SafeArea(
child: Scaffold(
appBar: buildAppBar(),
backgroundColor: secondColor,
body: buildCardList()),
);
}
Container buildCardList() {
return Container(
child: Column(
children: [
Expanded(
child: PlanetsCard(),
)
],
));
}
AppBar buildAppBar() {
return AppBar(backgroundColor: thirdColor, leading: buildBackButton());
}
IconButton buildBackButton() {
return IconButton(
icon: Icon(
Icons.arrow_back,
color: sixthColor,
),
onPressed: () {
Navigator.pushNamed(context, '/home');
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment