Flutter
Flutter — It is an open-source UI software development kit created by Google. It is used to develop applications for Android, iOS, Windows, Mac, Linux, Google Fuchsia and the web.
Async UI
In Flutter, use the asynchronous facilities that the Dart language provides, such as async/await.
Import 'dart:convert';
import 'package:flutter/material.dart';
import 'package:http/http.dart' as http;
void main() {
runApp(SampleApp());
}
class SampleApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Sample App',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: SampleAppPage(),
);
}
}
class SampleAppPage extends StatefulWidget {
SampleAppPage({Key key}) : super(key: key);
@override
_SampleAppPageState createState() => _SampleAppPageState();
}
class _SampleAppPageState extends State<SampleAppPage> {
List widgets = [];
@override
void initState() {
super.initState();
loadData();
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("Sample App"),
),
body: ListView.builder(
itemCount: widgets.length,
itemBuilder: (BuildContext context, int position) {
return getRow(position);
}));
}
Widget getRow(int i) {
return Padding(
padding: EdgeInsets.all(10.0),
child: Text("Row ${widgets[i]["title"]}")
);
}
loadData() async {
String dataURL = "https://jsonplaceholder.typicode.com/posts";
http.Response response = await http.get(dataURL);
setState(() {
widgets = json.decode(response.body);
});
}
}
Notifications
Related concepts
- Linux install: System requirements
- MacOS install: System requirements
- Android setup: Install Android Studio
- Android setup: Install Android Studio
- Android setup: Set up your Android device
- Android setup: Set up your Android device
- Android setup: Set up your Android device
- Android setup: Install Android Studio
- Get the Flutter SDK: Update your path
- Get the Flutter SDK: Update path directly
- IOS setup: Deploy to iOS devices
- Get the Flutter SDK: Update your path
- Get the Flutter SDK: Update your path
→
Flutter
→
- Flutter install
- Windows install: Get the Flutter SDK
- Get the Flutter SDK: Run flutter doctor
- Windows install: Web setup
- MacOS install: Get the Flutter SDK
- Get the Flutter SDK: Run flutter doctor
- MacOS install: Platform setup
- IOS setup: Create and run a simple Flutter app
- MacOS install: Web setup
- Flutter install: VS Code
- Flutter install: Android Studio
- Widget
- Flutter: Async UI
- Async UI: Isolate
- Flutter for web developers
- Basic layout operations: Setting background color
- Working with text: Set custom fonts
- Basic layout operations: Setting container width
- Linux install: Get the Flutter SDK
- Get the Flutter SDK: Run flutter doctor
- Android setup: Web setup
- Manipulating shapes: Making circles and ellipses
- Manipulating text: Adjusting text spacing
- Manipulating text: Creating text excerpts
- Row and Column
- Touch listeners
- Activities and fragments
- Activity
- ListView
- a “hint” or a placeholder text
- Flutter plugins
- Themes
- Flutter plugins: Log in with Facebook
- Flutter plugins: Firebase features
- Flutter plugins: Own custom native integrations
- Flutter plugins: Use the NDK
- Navigator
- Databases and local storage: Shared Preferences
- Databases and local storage: SQLite
- Navigator: The Navigator class
- Debugging
- Flutter: Notifications
- Layouts: Lay out a widget
- Assets: Specifying assets
- Common layout widgets
- Loading text assets: RootBundle
- Loading assets: Loading images
- Assets: Sharing assets with the underlying platform
- Sharing assets with the underlying platform: Loading Flutter assets in Android
- Sharing assets with the underlying platform: Loading Flutter assets in iOS
- Platform assets: Updating the app icon
- Platform assets: Updating the launch screen
- Creating responsive apps
- Dealing with box constraints
- Flutter animation
- SchedulerBinding
- scheduleFrameCallback
- Databases and local storage
- RunApp()
- Assets