Skip to content

pascalchibuikem/Widget-class-task

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 

Repository files navigation

Widget-class-task

This exercise will help the student of code Anambra to improve on there understanding flutter widgets and how it is implemented

import 'package:flutter/material.dart';

void main() { runApp(const Calculator()); }

class Calculator extends StatelessWidget { const Calculator({super.key});

@override Widget build(BuildContext context) { return MaterialApp( debugShowCheckedModeBanner: false, home: Scaffold( backgroundColor: Colors.black, appBar: AppBar( backgroundColor: Colors.white, title: Text( " Container", ), ), body: Column( crossAxisAlignment: CrossAxisAlignment.stretch, children: [ Expanded( child: Row( crossAxisAlignment: CrossAxisAlignment.stretch, children: [ Expanded( child: Padding( padding: const EdgeInsets.all(8.0), child: GestureDetector( onTap: () {}, child: Container( decoration: BoxDecoration( color: Colors.grey, borderRadius: BorderRadius.circular(10)), child: Center( child: Text( ' 1', style: TextStyle( color: Colors.white, fontSize: 35, fontWeight: FontWeight.bold), ))), ), ), ), Expanded( child: Padding( padding: const EdgeInsets.all(8.0), child: Container( decoration: BoxDecoration( color: Colors.grey, borderRadius: BorderRadius.circular(10)), child: Center( child: Text( ' 2', style: TextStyle( color: Colors.white, fontSize: 35, fontWeight: FontWeight.bold), ))), ), ), Expanded( child: Padding( padding: const EdgeInsets.all(8.0), child: Container( decoration: BoxDecoration( color: Colors.grey, borderRadius: BorderRadius.circular(10)), child: Center( child: Text( ' 3', style: TextStyle( color: Colors.white, fontSize: 35, fontWeight: FontWeight.bold), ))), ), ), ], ), ), SizedBox( height: 10, ), Expanded( child: Padding( padding: const EdgeInsets.all(8.0), child: Container( decoration: BoxDecoration( color: Colors.grey, borderRadius: BorderRadius.circular(10)), child: Center( child: Text( " white container", style: TextStyle( color: Colors.white, fontSize: 35, fontWeight: FontWeight.bold), )), ), ), ), SizedBox( height: 10, ), Expanded( child: Padding( padding: const EdgeInsets.all(8.0), child: Container( decoration: BoxDecoration( color: Colors.grey, borderRadius: BorderRadius.circular(10)), child: Center( child: Text( " Green container", style: TextStyle( color: Colors.white, fontSize: 35, fontWeight: FontWeight.bold), ), ), ), ), ) ], ), ), ); } }

About

This exercise will help the student of code Anambra to improve on there understanding flutter widgets and how it is implemented

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors