Created
January 12, 2024 20:22
-
-
Save faroukelhamdi/3f1760f93f1ddfaaf4bd371b798ad120 to your computer and use it in GitHub Desktop.
Flutter Lecture 4 - Assignment 1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
void main() { | |
runApp( | |
MaterialApp( | |
home: Scaffold( | |
appBar: AppBar( | |
title: Icon( | |
Icons.arrow_back_ios, | |
size: 25, | |
), | |
), | |
body: Padding( | |
padding: const EdgeInsets.all(16.0), | |
child: Column( | |
crossAxisAlignment: CrossAxisAlignment.start, | |
children: [ | |
Text( | |
'Categories', | |
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 18), | |
), | |
SizedBox( | |
height: 16, | |
), | |
Row( | |
children: [ | |
Container( | |
width: 150, | |
height: 150, | |
color: const Color(0xfffecb85), | |
padding: EdgeInsets.all(16), | |
child: Container( | |
child: Column( | |
crossAxisAlignment: CrossAxisAlignment.start, | |
mainAxisAlignment: MainAxisAlignment.spaceBetween, | |
children: [ | |
Icon( | |
Icons.insert_chart_outlined_sharp, | |
size: 40, | |
), | |
Text( | |
'Politics', | |
style: TextStyle(fontWeight: FontWeight.bold), | |
), | |
], | |
), | |
), | |
), | |
SizedBox( | |
width: 16, | |
), | |
Container( | |
width: 150, | |
height: 150, | |
color: Color(0xff92cbf7), | |
padding: EdgeInsets.all(16), | |
child: Column( | |
crossAxisAlignment: CrossAxisAlignment.start, | |
mainAxisAlignment: MainAxisAlignment.spaceBetween, | |
children: [ | |
Icon( | |
Icons.insert_chart_outlined_sharp, | |
size: 40, | |
), | |
Text( | |
'Sports', | |
style: TextStyle(fontWeight: FontWeight.bold), | |
), | |
], | |
), | |
), | |
], | |
), | |
SizedBox( | |
height: 10, | |
), | |
Row( | |
children: [ | |
Container( | |
width: 150, | |
height: 150, | |
color: Color(0xffed9a9b), | |
padding: EdgeInsets.all(16), | |
child: Container( | |
child: Column( | |
crossAxisAlignment: CrossAxisAlignment.start, | |
mainAxisAlignment: MainAxisAlignment.spaceBetween, | |
children: [ | |
Icon( | |
Icons.insert_chart_outlined_sharp, | |
size: 40, | |
), | |
SizedBox( | |
height: 0, | |
), | |
Text( | |
'Science', | |
style: TextStyle(fontWeight: FontWeight.bold), | |
), | |
], | |
), | |
), | |
), | |
SizedBox( | |
width: 16, | |
), | |
Container( | |
width: 150, | |
height: 150, | |
color: Color(0xfff290b1), | |
padding: EdgeInsets.all(16), | |
child: Column( | |
crossAxisAlignment: CrossAxisAlignment.start, | |
mainAxisAlignment: MainAxisAlignment.spaceBetween, | |
children: [ | |
Icon( | |
Icons.insert_chart_outlined_sharp, | |
size: 40, | |
), | |
Text( | |
'Technology', | |
style: TextStyle(fontWeight: FontWeight.bold), | |
), | |
], | |
), | |
), | |
], | |
), | |
SizedBox( | |
height: 10, | |
), | |
Row( | |
children: [ | |
Container( | |
width: 150, | |
height: 150, | |
color: Color(0xffcd95d6), | |
padding: EdgeInsets.all(16), | |
child: Container( | |
child: Column( | |
crossAxisAlignment: CrossAxisAlignment.start, | |
mainAxisAlignment: MainAxisAlignment.spaceBetween, | |
children: [ | |
Icon( | |
Icons.insert_chart_outlined_sharp, | |
size: 40, | |
), | |
SizedBox( | |
height: 0, | |
), | |
Text( | |
'Travel', | |
style: TextStyle(fontWeight: FontWeight.bold), | |
), | |
], | |
), | |
), | |
), | |
SizedBox( | |
width: 16, | |
), | |
Container( | |
width: 150, | |
height: 150, | |
color: Color(0xff79909b), | |
padding: EdgeInsets.all(16), | |
// decoration: BoxDecoration( | |
// borderRadius: BorderRadius.circular(62), | |
// ), | |
child: Column( | |
crossAxisAlignment: CrossAxisAlignment.start, | |
mainAxisAlignment: MainAxisAlignment.spaceBetween, | |
children: [ | |
Icon( | |
Icons.insert_chart_outlined_sharp, | |
size: 40, | |
), | |
SizedBox( | |
height: 0, | |
), | |
Text( | |
'Entertainment', | |
style: TextStyle(fontWeight: FontWeight.bold), | |
), | |
], | |
), | |
), | |
], | |
), | |
], | |
), | |
), | |
), | |
), | |
); | |
} | |
// I've tried to add a box decoration to the container, but unfortunately, it did not work! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment