Posts

Showing posts from January, 2021

Android Studio - Assignment [Containers Solution]

Image
Assignment : Create an app using Containers and its functions as shown in the image below Code : import 'package:flutter/material.dart' ; void main () { runApp( MyApp ()) ; } class MyApp extends StatelessWidget { @override Widget build (BuildContext context) { return MaterialApp ( home: Scaffold ( backgroundColor: Colors. amber , appBar: AppBar ( backgroundColor: Colors. white70 , title: Text ( 'Myapp' ) , ) , body: SafeArea ( child: Row ( mainAxisAlignment: MainAxisAlignment. spaceBetween , children: <Widget>[ Container ( width: 80.0 , color: Colors. orange , height: double. infinity , ) , Column ( mainAxisAlignment: MainAxisAlignment. center , children: <Widget>[ Container ( width: 100.0 , ...

#5 Android Studio - Columns & Rows

Image
Tutorial on how to add multiple widgets using Column and Row functions We are adding multiple widgets by using the functions Column() or Row() . Inorder to add multiple widgets we have to add a function called children <Widget>[] inside which we can add our multiple containers as shown in the image below.  Refer #4 Android Studio - Container to learn about containers and how to add them   Here in the image below i have given different colors and removed padding and margins to avoid confusions     Using different functions to re-arrange widgets 1. a) verticalDirection: VerticalDirection.up, is used to arrange the containers in the top     b) verticalDirection: VerticalDirection.down,   is used to arrange the containers in the bottom   2. a) mainAxisAlignment: MainAxisAlignment.start, is similar to verticalDirection: VerticalDirection.up as it places the children close to the main Axis ie, the top      b) mainAxisA...