|
|
@@ -4,6 +4,7 @@ import 'package:get/get.dart';
|
|
|
import 'package:keyboard/module/keyboard_guide/keyboard_guide_controller.dart';
|
|
|
import 'package:keyboard/router/app_pages.dart';
|
|
|
import 'package:keyboard/utils/toast_util.dart';
|
|
|
+import 'package:lottie/lottie.dart';
|
|
|
|
|
|
import '../../base/base_page.dart';
|
|
|
import '../../data/bean/keyboard_guide_msg.dart';
|
|
|
@@ -48,19 +49,7 @@ class KeyboardGuidePage extends BasePage<KeyboardGuidePageController> {
|
|
|
// 标题栏
|
|
|
_buildTitleBar(),
|
|
|
// 消息列表
|
|
|
- Expanded(
|
|
|
- flex: 1,
|
|
|
- child: Obx(() {
|
|
|
- return ListView.builder(
|
|
|
- controller: controller.scrollController,
|
|
|
- itemCount: controller.msgList.length,
|
|
|
- itemBuilder: (BuildContext context, int index) {
|
|
|
- KeyboardGuideMsg msg = controller.msgList[index];
|
|
|
- return _buildMsgItem(msg, index);
|
|
|
- },
|
|
|
- );
|
|
|
- }),
|
|
|
- ),
|
|
|
+ Expanded(flex: 1, child: _buildContent()),
|
|
|
// 底部输入栏
|
|
|
_buildBottomInput(),
|
|
|
],
|
|
|
@@ -134,6 +123,43 @@ class KeyboardGuidePage extends BasePage<KeyboardGuidePageController> {
|
|
|
);
|
|
|
}
|
|
|
|
|
|
+ /// 内容
|
|
|
+ Widget _buildContent() {
|
|
|
+ return Obx(() {
|
|
|
+ // 键盘已启用,显示聊天列表
|
|
|
+ if (controller.isChooseKeyboard.value) {
|
|
|
+ return _buildChatList();
|
|
|
+ } else {
|
|
|
+ // 未启用,显示引导动画
|
|
|
+ return _buildGuideAnimation();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ /// 引导动画
|
|
|
+ Widget _buildGuideAnimation() {
|
|
|
+ return Container(
|
|
|
+ child: Lottie.asset(
|
|
|
+ Assets.anim.animKeyboardFloatingWindowChooseKeyboard,
|
|
|
+ repeat: true,
|
|
|
+ ),
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
+ /// 聊天列表
|
|
|
+ Widget _buildChatList() {
|
|
|
+ return Obx(() {
|
|
|
+ return ListView.builder(
|
|
|
+ controller: controller.scrollController,
|
|
|
+ itemCount: controller.msgList.length,
|
|
|
+ itemBuilder: (BuildContext context, int index) {
|
|
|
+ KeyboardGuideMsg msg = controller.msgList[index];
|
|
|
+ return _buildMsgItem(msg, index);
|
|
|
+ },
|
|
|
+ );
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
/// 构建底部输入框
|
|
|
Widget _buildBottomInput() {
|
|
|
return Center(
|