优化配置,修复 demo bug
1,network 框架完善 2,websocket 机制完善 3,设计文档整理到架构文档 4,脚本,配置完善
This commit is contained in:
30
apps/im_app/lib/core/ui/base/assets.dart
Normal file
30
apps/im_app/lib/core/ui/base/assets.dart
Normal file
@@ -0,0 +1,30 @@
|
||||
/// 静态资源路径常量,统一维护,避免路径字符串散落在业务代码中。
|
||||
///
|
||||
/// 所有路径须与 pubspec.yaml 的 flutter.assets 声明保持一致。
|
||||
/// 新增资源:① 文件放入 assets/ ② pubspec.yaml 声明 ③ 此处加常量。
|
||||
///
|
||||
/// 渲染逻辑(缓存、占位、错误态)由 core/ui/components/ 下的组件负责,不在此处封装。
|
||||
///
|
||||
/// ## 使用
|
||||
/// ```dart
|
||||
/// Image.asset(AppAssets.logo)
|
||||
/// Image.asset(AppAssets.logo, width: 80, fit: BoxFit.cover)
|
||||
/// ```
|
||||
abstract final class AppAssets {
|
||||
AppAssets._();
|
||||
|
||||
// ── 品牌 ──────────────────────────────────────────────────
|
||||
static const logo = 'assets/images/logo.png';
|
||||
static const logoLight = 'assets/images/logo_light.png';
|
||||
|
||||
// ── 占位图 ────────────────────────────────────────────────
|
||||
static const avatarPlaceholder = 'assets/images/avatar_placeholder.png';
|
||||
|
||||
// ── 空状态插图(SVG,引入 flutter_svg 后启用) ─────────────
|
||||
// static const emptyChat = 'assets/svg/empty_chat.svg';
|
||||
// static const emptyContact = 'assets/svg/empty_contact.svg';
|
||||
// static const emptySearch = 'assets/svg/empty_search.svg';
|
||||
|
||||
// ── 动画 ──────────────────────────────────────────────────
|
||||
// static const loading = 'assets/gif/loading.gif';
|
||||
}
|
||||
44
apps/im_app/lib/core/ui/base/icons.dart
Normal file
44
apps/im_app/lib/core/ui/base/icons.dart
Normal file
@@ -0,0 +1,44 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
/// 项目图标常量,统一维护,避免 Icons.xxx 散落在业务代码中。
|
||||
///
|
||||
/// 渲染逻辑(大小、颜色、点击态)由调用方负责,不在此处封装。
|
||||
///
|
||||
/// ## 使用
|
||||
/// ```dart
|
||||
/// Icon(AppIcons.send)
|
||||
/// Icon(AppIcons.send, size: 20, color: Colors.white)
|
||||
/// IconButton(icon: Icon(AppIcons.back), onPressed: ...)
|
||||
/// ```
|
||||
abstract final class AppIcons {
|
||||
AppIcons._();
|
||||
|
||||
// ── 底部导航 ──────────────────────────────────────────────
|
||||
static const chat = Icons.chat_bubble_outline_rounded;
|
||||
static const contact = Icons.people_outline_rounded;
|
||||
static const settings = Icons.settings_outlined;
|
||||
|
||||
// ── 通用操作 ──────────────────────────────────────────────
|
||||
static const back = Icons.arrow_back_ios_new_rounded;
|
||||
static const close = Icons.close_rounded;
|
||||
static const more = Icons.more_horiz_rounded;
|
||||
static const search = Icons.search_rounded;
|
||||
static const add = Icons.add_rounded;
|
||||
|
||||
// ── 聊天输入区 ────────────────────────────────────────────
|
||||
static const send = Icons.send_rounded;
|
||||
static const attach = Icons.attach_file_rounded;
|
||||
static const emoji = Icons.emoji_emotions_outlined;
|
||||
static const camera = Icons.camera_alt_outlined;
|
||||
static const voice = Icons.mic_outlined;
|
||||
|
||||
// ── 用户 / 联系人 ─────────────────────────────────────────
|
||||
static const avatar = Icons.account_circle_outlined;
|
||||
static const addUser = Icons.person_add_outlined;
|
||||
|
||||
// ── 状态反馈 ──────────────────────────────────────────────
|
||||
static const success = Icons.check_circle_outline_rounded;
|
||||
static const warning = Icons.warning_amber_rounded;
|
||||
static const error = Icons.error_outline_rounded;
|
||||
static const info = Icons.info_outline_rounded;
|
||||
}
|
||||
Reference in New Issue
Block a user