Flutter for a very beginner

閱讀時間約 4 分鐘

Introduction

Flutter is a powerful framework for developing the app for different platforms without redevelopment.
Although I still want to use Vue and Django as the main skill in my full-stack career, I think it’s a good idea to learn Flutter as my secondary skill due to the main idea of Flutter being quite attractive.

Set up for windows desktop app development

To concentrate learn Flutter, I convinced my team to develop a windows desktop app. Therefore, I can learn Flutter at work.
The set-up is quite simple, just follow the “Get started” of the document.

main.dart

main.dart is the entry point of your app, which is located at your-project/lib.
material is the default UI component library for Flutter. Basically, we would import ‘package:flutter/material.dart’; in every dart file.
The runApp in main() is to decide how to run this app. We create MyApp for example. We should return a MaterialApp in it to create an app.

route

routing map

Let’s add the routing settings for this app.
Add routes in MaterialApp , and define the URL to which page. I prefer to write the different pages in each dart file. For example, I define the HomePage() in home.dart and import it from above. Then set the URL for it in routes .
initialRoute is which page would show when this app is opened.

pushNamed

In home.dart
we could use Navigator.pushNamed to go to another URL.

MaterialAPP & Scaffold

To build an app, we need to build a MaterialAPP . To write a page, we need to write it in a Scaffold .
That’s what I learn so far. Maybe what I write above is not perfect, but I think it’s still useful for a beginner.
為什麼會看到廣告
9會員
49內容數
比起詳細教學單一技能,網路上或者市面上整合多項技能的教學相對少很多,但要真的完成一項專案往往不是只靠一項技能便能做到。 而且教科書式的完整教學也比較枯燥乏味,因此我想以自身的經驗為例,以全端開發各項技能中最常用到的部分進行講解,讓讀者能夠快速上手掌握全端技能。
留言0
查看全部
發表第一個留言支持創作者!
張哲嘉的沙龍 的其他內容
msix After comparing different methods, I think the most stable way is using msix to package the windows desktop app. Installation download
Introduction Set DDNS on Google Domains To set your DDNS record on Google Domains, just follow this document. ddclient installation ddclient.conf
msix After comparing different methods, I think the most stable way is using msix to package the windows desktop app. Installation download
Introduction Set DDNS on Google Domains To set your DDNS record on Google Domains, just follow this document. ddclient installation ddclient.conf
你可能也想看
Google News 追蹤
Thumbnail
這個秋,Chill 嗨嗨!穿搭美美去賞楓,裝備款款去露營⋯⋯你的秋天怎麼過?秋日 To Do List 等你分享! 秋季全站徵文,我們準備了五個創作主題,參賽還有機會獲得「火烤兩用鍋」,一起來看看如何參加吧~
Thumbnail
Flutter is a powerful, open-source UI software development kit created by Google.
Thumbnail
解析成List List items=json.decode(jsonStr); print(items[0]["your_key"]); 解析成Map Map<String, dynamic> user = json.decode(json); print('${user['your_k
Thumbnail
這邊會使用WebSocketChannel去與http://www.websocket.org做連線。 連線 final channel = IOWebSocketChannel.connect('wss://echo.websocket.events'); 接收 StreamBui
Thumbnail
Dio是一個Dart Http請求庫,支援Restful API、FormData、攔截器、請求取消、Cookie管理、檔案上傳/下載、逾時等。 加入 dependencies: dio: ^x.x.x #请使用pub上的最新版本 使用 GET Response response;
Thumbnail
配置 idleTimeout:在httpClient請求結束後,會繼續保持連線,直到超過idleTimeout值才會關閉連接。 connectionTimeout:和伺服器建立連線逾時,如果超過connectionTimeout值則會拋出SocketException異常。 maxConnec
Thumbnail
這個秋,Chill 嗨嗨!穿搭美美去賞楓,裝備款款去露營⋯⋯你的秋天怎麼過?秋日 To Do List 等你分享! 秋季全站徵文,我們準備了五個創作主題,參賽還有機會獲得「火烤兩用鍋」,一起來看看如何參加吧~
Thumbnail
Flutter is a powerful, open-source UI software development kit created by Google.
Thumbnail
解析成List List items=json.decode(jsonStr); print(items[0]["your_key"]); 解析成Map Map<String, dynamic> user = json.decode(json); print('${user['your_k
Thumbnail
這邊會使用WebSocketChannel去與http://www.websocket.org做連線。 連線 final channel = IOWebSocketChannel.connect('wss://echo.websocket.events'); 接收 StreamBui
Thumbnail
Dio是一個Dart Http請求庫,支援Restful API、FormData、攔截器、請求取消、Cookie管理、檔案上傳/下載、逾時等。 加入 dependencies: dio: ^x.x.x #请使用pub上的最新版本 使用 GET Response response;
Thumbnail
配置 idleTimeout:在httpClient請求結束後,會繼續保持連線,直到超過idleTimeout值才會關閉連接。 connectionTimeout:和伺服器建立連線逾時,如果超過connectionTimeout值則會拋出SocketException異常。 maxConnec