Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
2 views

Flutter_Fundamentals

Flutter is an open-source UI toolkit by Google for developing cross-platform applications using the Dart language. It is built on a widget-based architecture, where everything is a widget, and includes features like state management, navigation, and hot reload. Developers can utilize a rich ecosystem of packages to enhance functionality and use the Flutter CLI for building and running apps.

Uploaded by

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

Flutter_Fundamentals

Flutter is an open-source UI toolkit by Google for developing cross-platform applications using the Dart language. It is built on a widget-based architecture, where everything is a widget, and includes features like state management, navigation, and hot reload. Developers can utilize a rich ecosystem of packages to enhance functionality and use the Flutter CLI for building and running apps.

Uploaded by

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

Flutter Fundamentals

1. Introduction to Flutter

Flutter is an open-source UI software development toolkit created by Google. It is used to develop

cross-platform applications from a single codebase using the Dart language.

2. Flutter Architecture

Flutter apps are built using widgets. Everything in Flutter is a widget, including layout models and UI

elements.

3. Main Function and runApp()

The entry point of a Flutter app is the main() function, which calls runApp() to start the app.

Example:

void main() {

runApp(MyApp());

4. Widgets

Widgets are the building blocks of a Flutter app. There are two types:

- StatelessWidget: for static UI

- StatefulWidget: for dynamic UI

Example:

class MyApp extends StatelessWidget {

@override

Widget build(BuildContext context) {


return MaterialApp(

home: Scaffold(

appBar: AppBar(title: Text('Hello Flutter')),

body: Center(child: Text('Welcome to Flutter')),

),

);

5. Layouts

Flutter uses widgets for layout as well, such as Column, Row, Container, Padding, etc.

Example:

Column(

children: [

Text('Item 1'),

Text('Item 2'),

],

6. Navigation

Flutter provides a Navigator for navigating between screens.

Example:

Navigator.push(

context,

MaterialPageRoute(builder: (context) => SecondScreen()),


);

7. State Management

Managing state is crucial in Flutter. Common methods include:

- setState()

- Provider

- Riverpod

- Bloc

8. Hot Reload

Flutter supports hot reload, which allows developers to see changes instantly without restarting the

app.

9. Packages and Plugins

Flutter has a rich ecosystem of packages available through pub.dev to extend functionality (e.g.,

HTTP requests, local storage, Firebase).

10. Building and Running Apps

Use the Flutter CLI to build and run apps:

- flutter create my_app

- flutter run

- flutter build apk / ios

You might also like