Skip to main content

Posts

Showing posts with the label hello world

A simple hello world app in flutter

In Flutter we primarily use widgets. There are all sorts of widgets to look out for and each providing a specific functionality. Flutter allows you to implement various things at ease with the help of widgets. A simple hello world app in flutter looks like this import 'package:flutter/material.dart' ; void main() { runApp(MyApp()); } class MyApp extends StatelessWidget { @ override Widget build(BuildContext context) { return MaterialApp( home: MyHomePage(), ); } } class MyHomePage extends StatefulWidget { @ override _MyHomePageState createState() => _MyHomePageState(); } class _MyHomePageState extends State<MyHomePage> { @ override Widget build(BuildContext context) { return Scaffold( body: Center( child: Text( 'Hello,World!' ), ), ); } } MaterialApp Widget allows us to use the material widgets within the application where as scaffold provides additional functionalities such as ad...