Thursday, 28 March 2019

Flutter Simple Hello World Program By Using Android Studio

  1. Select File > New Flutter Project.
  2. Select Flutter application as the project type, and press Next.
  3. Make sure that the Flutter SDK Path text field specifies the location of the SDK. Install the SDK if you haven’t yet done so.
  4. Enter a project name (for example, myapp), and press Next.
  5. Click Finish.
  6. Wait for Android Studio to install the SDK, and create the project.
In the project structure find lib folder and open main.dart file.

replace the below code in main.dart file 

import 'package:flutter/material.dart';

void main(){

  runApp(
    Center(
      child:  Text(
          "Hello World",
          textDirection: TextDirection.ltr      ),
    )
  );
}

Run the app

  1. Locate the main Android Studio toolbar: Main IntelliJ toolbar
  2. In the target selector, select an Android device for running the app. If none are listed as available, select Tools> Android > AVD Manager and create one there. For details, see Managing AVDs.
  3. Click the run icon in the toolbar, or invoke the menu item Run > Run.

No comments:

Post a Comment

Error While embed the video in Your website page

Error:- Refused to display '<URL>' in a frame because it set 'X-Frame-Options' to 'sameorigin Solution:- if ...