Valorant 指南
设计
设计者: Malik Abimanyu
应用
Valorant Guide app 是一款小型演示应用程序,用于展示 Flutter 应用程序技术栈与 MobX 和 Provider。我没有设计稿,所以只是尝试照搬我看到的。它仍在开发中,欢迎 PR。
使用的库和工具
架构
我使用了 MobX 和 Provider 样板库。该样板库包含创建新库或项目所需的最少实现。存储库代码预先加载了一些基本组件,如基本应用架构、应用主题、常量和创建新项目所需的依赖项。通过使用样板代码作为标准初始化程序,我们可以在所有继承它的项目中拥有相同的模式。这也有助于通过允许您使用相同的代码模式并避免从头开始重写来减少设置和开发时间。
文件夹结构
这是 Flutter 提供的核心文件夹结构。
flutter-app/
|- android
|- build
|- ios
|- lib
|- test
这是我们在此项目中使用的文件夹结构
lib/
|- constants/
|- data/
|- stores/
|- ui/
|- utils/
|- widgets/
|- main.dart
|- routes.dart
现在,让我们深入 `lib` 文件夹,其中包含应用程序的主要代码。
1- constants - All the application level constants are defined in this directory with-in their respective files. This directory contains the constants for `theme`, `dimentions`, `api endpoints`, `preferences` and `strings`.
2- data - Contains the data layer of your project, includes directories for local, network and shared pref/cache.
3- stores - Contains store(s) for state-management of your application, to connect the reactive data of your application with the UI.
4- ui — Contains all the ui of your project, contains sub directory for each screen.
5- util — Contains the utilities/common functions of your application.
6- widgets — Contains the common widgets for your applications. For example, Button, TextField etc.
7- routes.dart — This file contains all the routes for your application.
8- main.dart - This is the starting point of the application. All the application level configurations are defined in this file i.e, theme, routes, title, orientation etc.
常量
此目录包含所有应用程序级别的常量。如下面的示例所示,为每种类型创建一个单独的文件
constants/
|- app_theme.dart
|- dimens.dart
|- endpoints.dart
|- preferences.dart
|- strings.dart
开放 API
Valorant Agents 使用 Valorant-api 提供所需数据。
Valorant-api 提供了一个广泛的 API,其中包含游戏内大部分物品、资源等数据!
任务
-
使主页项目背景颜色动态化
-
从 API 获取更多数据并添加更多页面
-
本地化
-
Widget 测试
许可证
Copyright 2022 by Umit Duran
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://apache.ac.cn/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

