Loading, please wait...

VTU Circulars & Notifications

VTU Exam Circulars & Notifications

VTU Exam Time Table

VTU Academic Calendar

BCGL657A Program 1

1. Develop an application using Flutter to print “Hello world and Hello Flutter”.

Step to Run

  1. Open your Flutter project in VS Code.
  2. Open lib/main.dart.
  3. Delete the existing code.
  4. Paste the program code given below.
  5. Save the file.
  6. Run the program using flutter run cmd

PROGRAM:

import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Lab Program 1',
      debugShowCheckedModeBanner: false,
      home: const HelloFlutterScreen(),
    );
  }
}

class HelloFlutterScreen extends StatelessWidget {
  const HelloFlutterScreen({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Program 1'),
        centerTitle: true,
        backgroundColor: Colors.blue,
        foregroundColor: Colors.white,
      ),
      body: const Center(
        child: Text(
          'Hello world\nHello Flutter',
          textAlign: TextAlign.center,
          style: TextStyle(
            fontSize: 30,
            fontWeight: FontWeight.bold,
            color: Colors.blue,
          ),
        ),
      ),
    );
  }
}

OUTPUT:

BCGL657A Program 1
Syllabus Papers
SGPA CGPA