0% found this document useful (0 votes)
83 views

Flutter Basics

The document discusses the Dart programming language and Flutter framework. It provides an overview of key Dart concepts like data types, functions, classes, and type inference. It also demonstrates how to create a basic Flutter app with Material widgets like Scaffold, AppBar, Column, Text, and RaisedButton. Flutter allows building native cross-platform apps using the Dart language and is based on Material, Cupertino, and widget design principles.

Uploaded by

vignesh waran
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
83 views

Flutter Basics

The document discusses the Dart programming language and Flutter framework. It provides an overview of key Dart concepts like data types, functions, classes, and type inference. It also demonstrates how to create a basic Flutter app with Material widgets like Scaffold, AppBar, Column, Text, and RaisedButton. Flutter allows building native cross-platform apps using the Dart language and is based on Material, Cupertino, and widget design principles.

Uploaded by

vignesh waran
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

flutter is a programming framework for the dart language.

It is actually a cross
native platform.

widgets are components, the building block of your user interface.

Data Types in dart:


Text,numbers,Strings,Integers,Floats

double addNumbers(double num1,double num2)


{
print(num1+num2);
}
void main()
{
addNumbers(2,2.0);
}
// To use variable in dart we use var keyword

double addNumbers(double num1,double num2)


{
print(num1+num2);
}
void main()
{
var firstResult=addNumbers(2,2.0);
print(firstResult);
}

dart also has a concept called type inference that means the var automatically
knows which data to store.

Dart is also an oops language;

class Person
{
String name="john;
int age=23;

}
double addNumbers(double num1,double num2)
{
print(num1+num2);
}
void main()
{
var P1=Person();//creating an instance /object for class person.

print (p1);// output: Instance of class.


print(p1.age);
print(p1.name);
String name="john";
int age=23;
var firstResult=addNumbers(2,2.0);
print(firstResult);
}
import 'package:flutter/material.dart';

void main() {
runApp(MyApp());
}
// we can even write main() like below:
//void main()=>runApp(MyApp());

class MyApp extends StatelessWidget {


@override //decorator optional works without it bus makes it look clear and clean
Widget build(BuildContext context) {
var questions = ['What\'s your favourite color?',
'What'\s your favourite animal?'];
//return MaterialApp(home: Text('Hello!!!')); //dart classes
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: Text('My First App'),
),
body: Column(children:[
Text('The Question!'),
RaisedButton(child: Text('Answer 1'),onPressed: null),
RaisedButton(child: Text('Answer 2'),onPressed: null),
RaisedButton(child: Text('Answer 3'),onPressed: null),
]),
),
);
}
}

3 types of design:
material design
cupertino design
widget design

You might also like