Flutter Architecture
Flutter Architecture
Center(
child: Container(
height: 110.0,
width: 110.0,
color: Colors.blue,
child: Align(
alignment: Alignment.topLeft,
child: FlutterLogo(
size: 50,
),
),
),
SizedBox:
This widget allows you to give the specified size
to the child widget through all screens.
SizedBox(
width: 300.0,
height: 450.0,
child: const Card(child: Text('Hello JavaTpoint
!'),
)
AspectRatio
• This widget allows you to keep the size of the child
widget to a specified aspect ratio.
AspectRatio(
aspectRatio: 5/3,
child: Container(
color: Colors.bluel,
),
),
Baseline
• This widget shifts the child widget according to the
child's baseline.
child: Baseline(
baseline: 30.0,
baselineType: TextBaseline.alphabetic,
child: Container(
height: 60,
width: 50,
color: Colors.blue,
),
ConstrainedBox
import 'package:flutter/material.dart';
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: Text("FittedBox Widget")),
body: Center(
child: FittedBox(child: Row(
children: <Widget>[
Container(
child: Image.asset('assets/computer.png'),
),
Container(
child: Text("This is a widget"),
)
],
),
fit: BoxFit.contain,
)
),
);
}
Output
Setup
• Set up Android Studio to run Flutter
Applications. Android Studio is one of the
popular IDE developed by Google itself to
create cross-platform android applications.
First, you have to install Android
Studio of version 3.0 or later, as it offers an
integrated IDE experience for a Flutter
Install the Flutter and Dart plugins
• After the successful installation of Android Studio, you
have to install Flutter and Dart plugins. To do so follow
the steps mentioned below:
• Start Android Studio.
• Open plugin preferences (Configure > Plugins as of
v3.6.3.0 or later).
• Select the Flutter plugin and click Install.
• Click Yes when prompted to install the Dart plugin.
• Click Restart when prompted.
• Open plugin preferences:
• For macOS: Preferences > Plugins on macOS,
Creating the application: