|
@@ -6,6 +6,9 @@ import 'package:flutter/material.dart';
|
|
|
import 'package:flutter/src/widgets/framework.dart';
|
|
|
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
|
|
import 'package:auto_route/auto_route.dart';
|
|
|
+import 'package:plugin_platform/engine/toast/toast_engine.dart';
|
|
|
+import 'package:router/componentRouter/community_service.dart';
|
|
|
+import 'package:router/componentRouter/component_service_manager.dart';
|
|
|
import 'package:widgets/ext/ex_widget.dart';
|
|
|
import 'package:widgets/my_appbar.dart';
|
|
|
import 'package:widgets/my_load_image.dart';
|
|
@@ -29,38 +32,46 @@ class HomePage extends HookConsumerWidget {
|
|
|
|
|
|
return Scaffold(
|
|
|
appBar: MyAppBar.appBar(context, "Good Afternoon,Mike",
|
|
|
+ backIconPath: Assets.mainTabMeSelected,
|
|
|
+ backIconWidth: 18.5,
|
|
|
+ backIconHeight: 20,
|
|
|
+ showBackButton: true,
|
|
|
backgroundColor: context.appColors.whiteBG,
|
|
|
+ backCallback: (){
|
|
|
+ ToastEngine.show("测试去登录页面");
|
|
|
+ ComponentServiceManager().authService.startLoginPage();
|
|
|
+ },
|
|
|
actions: [
|
|
|
Center(
|
|
|
- child: Stack(
|
|
|
- clipBehavior: Clip.none, // 不裁剪超出边界的内容
|
|
|
- alignment: Alignment.topLeft,
|
|
|
- children: <Widget>[
|
|
|
- // 通知图标
|
|
|
- const MyAssetImage(Assets.mainHomeNotificationIcon, width: 19, height: 20),
|
|
|
+ child: Stack(
|
|
|
+ clipBehavior: Clip.none, // 不裁剪超出边界的内容
|
|
|
+ alignment: Alignment.topLeft,
|
|
|
+ children: <Widget>[
|
|
|
+ // 通知图标
|
|
|
+ const MyAssetImage(Assets.mainHomeNotificationIcon, width: 19, height: 20),
|
|
|
|
|
|
- //未读消息
|
|
|
- Positioned(
|
|
|
- left: 0,
|
|
|
- top: 0,
|
|
|
- child: Transform.translate(
|
|
|
- offset: const Offset(-10, -5),
|
|
|
- child: MyTextView(
|
|
|
- "99",
|
|
|
- boxWidth: 20.0,
|
|
|
- textColor: Colors.white,
|
|
|
- fontSize: 10,
|
|
|
- isFontLight: true,
|
|
|
- backgroundColor: context.appColors.redDefault,
|
|
|
- cornerRadius: 8,
|
|
|
- paddingTop: 2,
|
|
|
- paddingBottom: 2,
|
|
|
- textAlign: TextAlign.center,
|
|
|
- ),
|
|
|
- ),
|
|
|
+ //未读消息
|
|
|
+ Positioned(
|
|
|
+ left: 0,
|
|
|
+ top: 0,
|
|
|
+ child: Transform.translate(
|
|
|
+ offset: const Offset(-10, -5),
|
|
|
+ child: MyTextView(
|
|
|
+ "99",
|
|
|
+ boxWidth: 20.0,
|
|
|
+ textColor: Colors.white,
|
|
|
+ fontSize: 10,
|
|
|
+ isFontLight: true,
|
|
|
+ backgroundColor: context.appColors.redDefault,
|
|
|
+ cornerRadius: 8,
|
|
|
+ paddingTop: 2,
|
|
|
+ paddingBottom: 2,
|
|
|
+ textAlign: TextAlign.center,
|
|
|
),
|
|
|
- ],
|
|
|
- ).onTap(viewModel.gotoNotificationPage))
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ ],
|
|
|
+ ).onTap(viewModel.gotoNotificationPage))
|
|
|
.marginOnly(right: 15),
|
|
|
],
|
|
|
showBottomDivider: true),
|
|
@@ -165,7 +176,13 @@ class HomePage extends HookConsumerWidget {
|
|
|
textColor: context.appColors.textBlack,
|
|
|
fontSize: 15,
|
|
|
isFontMedium: true,
|
|
|
- ).paddingOnly(left: 13, right: 13).expanded(),
|
|
|
+ ).paddingOnly(left: 13, right: 4).expanded(),
|
|
|
+ MyTextView(
|
|
|
+ "9568",
|
|
|
+ textColor: context.appColors.textBlack,
|
|
|
+ fontSize: 15,
|
|
|
+ isFontBold: true,
|
|
|
+ ).paddingOnly(left: 1, right: 4),
|
|
|
const MyAssetImage(Assets.mainHomeMoreIcon, width: 6, height: 8.5).marginOnly(right: 15),
|
|
|
],
|
|
|
).onTap(viewModel.gotoRewardsPage).expanded(),
|
|
@@ -193,12 +210,12 @@ class HomePage extends HookConsumerWidget {
|
|
|
return SliverGrid(
|
|
|
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
|
|
|
crossAxisCount: 3, // 三列
|
|
|
- mainAxisSpacing: 14.0, // 主轴(上下)的间距
|
|
|
+ mainAxisSpacing: 10.0, // 主轴(上下)的间距
|
|
|
crossAxisSpacing: 0.0, // 交叉轴(左右)的间距
|
|
|
- childAspectRatio: 9 / 7, // 子组件的宽高比
|
|
|
+ childAspectRatio: 9 / 8, // 子组件的宽高比
|
|
|
),
|
|
|
delegate: SliverChildBuilderDelegate(
|
|
|
- (BuildContext context, int index) {
|
|
|
+ (BuildContext context, int index) {
|
|
|
return HomeCategoryItem(
|
|
|
category: state.homeCategory[index],
|
|
|
).onTap(() {
|
|
@@ -231,32 +248,32 @@ class HomePage extends HookConsumerWidget {
|
|
|
|
|
|
return SliverToBoxAdapter(
|
|
|
child: Column(
|
|
|
- crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
- mainAxisAlignment: MainAxisAlignment.start,
|
|
|
- children: [
|
|
|
- MyTextView(
|
|
|
- S.current.latest_news,
|
|
|
- fontSize: 16,
|
|
|
- marginTop: 14,
|
|
|
- marginBottom: 14,
|
|
|
- isFontMedium: true,
|
|
|
- onClick: viewModel.gotoLastNewsPage,
|
|
|
- textColor: context.appColors.textPrimary,
|
|
|
- ),
|
|
|
- SingleChildScrollView(
|
|
|
- scrollDirection: Axis.horizontal,
|
|
|
- physics: const BouncingScrollPhysics(),
|
|
|
- clipBehavior: Clip.none,
|
|
|
- child: Row(
|
|
|
- children: List.generate(state.lastNews.length, (index) {
|
|
|
- return LastNewsItem(
|
|
|
- lastNews: state.lastNews[index],
|
|
|
- );
|
|
|
- }),
|
|
|
- ),
|
|
|
- )
|
|
|
- ],
|
|
|
- ).paddingOnly(left: 15, right: 15));
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
+ mainAxisAlignment: MainAxisAlignment.start,
|
|
|
+ children: [
|
|
|
+ MyTextView(
|
|
|
+ S.current.latest_news,
|
|
|
+ fontSize: 16,
|
|
|
+ marginTop: 14,
|
|
|
+ marginBottom: 14,
|
|
|
+ isFontMedium: true,
|
|
|
+ onClick: viewModel.gotoLastNewsPage,
|
|
|
+ textColor: context.appColors.textPrimary,
|
|
|
+ ),
|
|
|
+ SingleChildScrollView(
|
|
|
+ scrollDirection: Axis.horizontal,
|
|
|
+ physics: const BouncingScrollPhysics(),
|
|
|
+ clipBehavior: Clip.none,
|
|
|
+ child: Row(
|
|
|
+ children: List.generate(state.lastNews.length, (index) {
|
|
|
+ return LastNewsItem(
|
|
|
+ lastNews: state.lastNews[index],
|
|
|
+ );
|
|
|
+ }),
|
|
|
+ ),
|
|
|
+ )
|
|
|
+ ],
|
|
|
+ ).paddingOnly(left: 15, right: 15));
|
|
|
}
|
|
|
|
|
|
//最新的交易列表
|
|
@@ -280,7 +297,7 @@ class HomePage extends HookConsumerWidget {
|
|
|
padding: const EdgeInsets.symmetric(vertical: 12, horizontal: 20),
|
|
|
sliver: SliverList(
|
|
|
delegate: SliverChildBuilderDelegate(
|
|
|
- (BuildContext context, int index) {
|
|
|
+ (BuildContext context, int index) {
|
|
|
return Padding(
|
|
|
padding: const EdgeInsets.symmetric(vertical: 10),
|
|
|
child: LastTransItem(
|
|
@@ -335,31 +352,31 @@ class HomePage extends HookConsumerWidget {
|
|
|
|
|
|
return SliverToBoxAdapter(
|
|
|
child: Column(
|
|
|
- crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
- mainAxisAlignment: MainAxisAlignment.start,
|
|
|
- children: [
|
|
|
- MyTextView(
|
|
|
- S.current.strata_management_guides,
|
|
|
- fontSize: 16,
|
|
|
- marginTop: 14,
|
|
|
- marginBottom: 14,
|
|
|
- onClick: viewModel.gotoManageGuidePage,
|
|
|
- isFontMedium: true,
|
|
|
- textColor: context.appColors.textPrimary,
|
|
|
- ),
|
|
|
- SingleChildScrollView(
|
|
|
- scrollDirection: Axis.horizontal,
|
|
|
- physics: const BouncingScrollPhysics(),
|
|
|
- clipBehavior: Clip.none,
|
|
|
- child: Row(
|
|
|
- children: List.generate(state.manage_guide.length, (index) {
|
|
|
- return ManageGuideItem(
|
|
|
- manageGuide: state.manage_guide[index],
|
|
|
- );
|
|
|
- }),
|
|
|
- ),
|
|
|
- )
|
|
|
- ],
|
|
|
- ).paddingOnly(left: 15, right: 15));
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
+ mainAxisAlignment: MainAxisAlignment.start,
|
|
|
+ children: [
|
|
|
+ MyTextView(
|
|
|
+ S.current.strata_management_guides,
|
|
|
+ fontSize: 16,
|
|
|
+ marginTop: 14,
|
|
|
+ marginBottom: 14,
|
|
|
+ onClick: viewModel.gotoManageGuidePage,
|
|
|
+ isFontMedium: true,
|
|
|
+ textColor: context.appColors.textPrimary,
|
|
|
+ ),
|
|
|
+ SingleChildScrollView(
|
|
|
+ scrollDirection: Axis.horizontal,
|
|
|
+ physics: const BouncingScrollPhysics(),
|
|
|
+ clipBehavior: Clip.none,
|
|
|
+ child: Row(
|
|
|
+ children: List.generate(state.manage_guide.length, (index) {
|
|
|
+ return ManageGuideItem(
|
|
|
+ manageGuide: state.manage_guide[index],
|
|
|
+ );
|
|
|
+ }),
|
|
|
+ ),
|
|
|
+ )
|
|
|
+ ],
|
|
|
+ ).paddingOnly(left: 15, right: 15));
|
|
|
}
|
|
|
}
|