DEV Community

TINTU JOSEPH
TINTU JOSEPH

Posted on

MAKE YOUR FIRST APP IN FLUTTER

INTRODUCTION

it is open source UI developing kit ,that developed by google in 2015 but it was released in 2017.Main feature of the flutter is used in cross platform application developing.

DART

The one and only programming language that used in flutter is dart.The main feature of the dart language is it is an platform Independent programming language .object oriented ,Mainly it it is a opensource programming language and it easy to learn

Let Started....

Firstly we install the flutter from given (https://docs.flutter.dev/get-started/install)

Create Project

flutter create command used to create the flutter project

syntax:

flutter create flutters
cd flutters
code .

Enter fullscreen mode Exit fullscreen mode

(here we are use vs code to create our project)

Lets Start Our Code

In flutter mainly we are importing to libraries one is cupertino.dart and material.dart. the first one is for Ios app and second one is Android app.

package:flutter/material.dart
package:flutter/cupertino.dart'
Enter fullscreen mode Exit fullscreen mode

Here we use material.dart.which include may widgets materialapp , statefull and stateless etc..

The sample Code given below:

package:flutter/material.dart
void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter',
      home: Scaffold(
        appBar: AppBar(
          title:  Text(' Our Project'),
        ),
        body:  Center(
          child: Text('HELLO'),
        ),
      ),
    );
  }

}
Enter fullscreen mode Exit fullscreen mode

void main() -it is the main method \ function of our project.

Scaffold -It is from the Material library, It provides app bar, and a body which contain homescreen.

title - which give title of our app.
center - which is widget which give the text in the center of the screen.

Top comments (0)