Skip to content

Instantly share code, notes, and snippets.

@felipecastrosales
Created April 20, 2021 15:28
Show Gist options
  • Save felipecastrosales/21f02ad143a1c3ad97bcd596aa08373b to your computer and use it in GitHub Desktop.
Save felipecastrosales/21f02ad143a1c3ad97bcd596aa08373b to your computer and use it in GitHub Desktop.
NLW05 - Home Page
import 'package:flutter/material.dart';
import 'package:devquiz/home/widgets/appbar/app_bar_widget.dart';
import 'package:devquiz/home/widgets/quiz_card/quiz_card_widget.dart';
import 'package:devquiz/home/widgets/level_button/level_button_widget.dart';
class HomePage extends StatefulWidget {
HomePage({Key? key}) : super(key: key);
@override
_HomePageState createState() => _HomePageState();
}
class _HomePageState extends State<HomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBarWidget(),
body: Padding(
padding: const EdgeInsets.symmetric(horizontal: 20),
child: Column(
children: [
SizedBox(
height: 32,
child: ListView(
scrollDirection: Axis.horizontal,
shrinkWrap: true,
children: [
LevelButtonWidget(label: 'Easy'),
SizedBox(width: 10),
LevelButtonWidget(label: 'Middle'),
SizedBox(width: 10),
LevelButtonWidget(label: 'Hard'),
SizedBox(width: 10),
LevelButtonWidget(label: 'Expert'),
],
),
),
SizedBox(height: 20),
Expanded(
child: GridView.count(
crossAxisSpacing: 16,
mainAxisSpacing:16,
crossAxisCount: 2,
children: [
QuizCardWidget(),
QuizCardWidget(),
QuizCardWidget(),
QuizCardWidget(),
],
),
),
],
),
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment