flutter_mobx
MobX 的 Flutter 結合。它提供了一組 Observer 小部件,當追蹤的可觀察物件變更時會自動重新建構。
從世界各地的城市取得天氣資料!
MobX 的 Flutter 結合。它提供了一組 Observer 小部件,當追蹤的可觀察物件變更時會自動重新建構。
MobX 是一個用於反應式管理應用程式狀態的程式庫。利用可觀察物件、動作和反應的力量,為您的 Dart 和 Flutter 應用程式加速。
用於 MobX 的程式碼產生器,可支援以 @observable、@computed、@action 註解您的程式碼,並建立 Store 類別。
以下為英文專案原文快照,最新內容請造訪 GitHub。
This project is my first one built in flutter, and I was inspired by the Flutter Modular architecture to structure the folders:
Weather Today app preview
The project uses the MetaWeather API to fetch a list of cities and their respective weather data such as minimum and maximum temperature, weather state, date, wind speed and direction.
You can install this app on your android phone downloading the apk file weather-today.apk in this repository.
The application is pretty simple, it is a one page application with a search bar and it has mainly three states: the first screen when the user is not searching anything, the main screen that shows the user data fetched from the API, and an error screen in case something wrong happens.
This app was made as an extension of the terminal app built in the Dart complete course from Andrea Bizzotto on Udemy, but as I transformed it into a flutter app, I felt the need of a project architecture. For that reason I chose to sctucture my project based on the Flutter Modular architecture, because I find it easy to understand and also scalable.
The project folders are structured like this:
/lib
/models
/modules
/search
/repositories
/results
/theme
Inside models you can find the classes created to best represent data from the API.
Modulesare the pages inside the app and since it is a unique page application, we only have the search module. Inside it we have the repository, responsible for fetching data from the API.
This project was made inspired by the app built on the Dart complete course by Andrea Bizzotto. I have to thank the girls from Flutter Girls who always support and help me in every issue I bump into, you are the best!