|
@@ -25,6 +25,7 @@ import 'package:widgets/ext/ex_widget.dart';
|
|
|
import 'package:widgets/load_state_layout.dart';
|
|
|
import 'package:widgets/my_appbar.dart';
|
|
|
import 'package:widgets/my_load_image.dart';
|
|
|
+import 'package:widgets/utils/dark_theme_util.dart';
|
|
|
import 'package:widgets/widget_export.dart';
|
|
|
|
|
|
import 'package:intl/intl.dart';
|
|
@@ -113,64 +114,64 @@ class RewardsPage extends HookConsumerWidget {
|
|
|
)),
|
|
|
),
|
|
|
),
|
|
|
- ]).backgroundColor(ColorUtils.string2Color('#F2F3F6')),
|
|
|
+ ]).backgroundColor(context.appColors.backgroundDark),
|
|
|
);
|
|
|
}
|
|
|
|
|
|
Widget _buildTop(BuildContext context, WidgetRef ref, _vm, RewardsIndexEntity? list) {
|
|
|
int points = list?.points ?? 0;
|
|
|
return Container(
|
|
|
- decoration: BoxDecoration(
|
|
|
- border: Border(
|
|
|
- bottom: BorderSide(
|
|
|
- color: ColorUtils.string2Color('#4161D0'), // 设置bottom边框的颜色
|
|
|
- width: 45.0, // 设置bottom边框的宽度
|
|
|
- )),
|
|
|
- borderRadius: const BorderRadius.only(
|
|
|
- topLeft: Radius.circular(0.0),
|
|
|
- topRight: Radius.circular(0.0),
|
|
|
- bottomLeft: Radius.circular(30.0),
|
|
|
- bottomRight: Radius.circular(30.0),
|
|
|
- ), // 圆角
|
|
|
- ),
|
|
|
- child: Column(
|
|
|
- crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
- children: [
|
|
|
-
|
|
|
- Row(
|
|
|
- crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
- children: [
|
|
|
- Text(
|
|
|
- S.current.available_points,
|
|
|
- style: const TextStyle(fontSize: 17.0, color: Colors.white, fontWeight: FontWeight.w500), // 设置字体大小
|
|
|
- ),
|
|
|
- Container(
|
|
|
- decoration: BoxDecoration(
|
|
|
- border: Border.all(color: Colors.white, width: 1), // 边框
|
|
|
- borderRadius: BorderRadius.circular(8), // 圆角
|
|
|
- ),
|
|
|
- child: Row(
|
|
|
- children: [
|
|
|
- const MyAssetImage(
|
|
|
- Assets.rewardsRewardsIconJb,
|
|
|
- width: 23,
|
|
|
- height: 23,
|
|
|
- ).marginOnly(right: 5),
|
|
|
- Text(
|
|
|
- '$points',
|
|
|
- style: const TextStyle(fontSize: 15.0, color: Colors.white, fontWeight: FontWeight.w400), // 设置字体大小
|
|
|
- ),
|
|
|
- ],
|
|
|
- ).paddingOnly(left: 10, top: 7, bottom: 7, right: 10),
|
|
|
+ decoration: BoxDecoration(
|
|
|
+ border: Border(
|
|
|
+ bottom: BorderSide(
|
|
|
+ color: context.appColors.btnBgDefault, // 设置bottom边框的颜色
|
|
|
+ width: 45.0, // 设置bottom边框的宽度
|
|
|
+ )),
|
|
|
+ borderRadius: const BorderRadius.only(
|
|
|
+ topLeft: Radius.circular(0.0),
|
|
|
+ topRight: Radius.circular(0.0),
|
|
|
+ bottomLeft: Radius.circular(30.0),
|
|
|
+ bottomRight: Radius.circular(30.0),
|
|
|
+ ), // 圆角
|
|
|
+ ),
|
|
|
+ child: Column(
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
+ children: [
|
|
|
+ Row(
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
+ children: [
|
|
|
+ Text(
|
|
|
+ S.current.available_points,
|
|
|
+ style: const TextStyle(fontSize: 17.0, color: Colors.white, fontWeight: FontWeight.w500), // 设置字体大小
|
|
|
+ ),
|
|
|
+ Container(
|
|
|
+ decoration: BoxDecoration(
|
|
|
+ border: Border.all(color: Colors.white, width: 1), // 边框
|
|
|
+ borderRadius: BorderRadius.circular(8), // 圆角
|
|
|
),
|
|
|
- ],
|
|
|
- ).paddingOnly(left: 10, top: 0, bottom: 18),
|
|
|
- ],
|
|
|
- )
|
|
|
- .paddingOnly(top: 15, left: 5, right: 15, bottom: 0)
|
|
|
- .border(bottom: 0, color: ColorUtils.string2Color('#4161D0'))
|
|
|
- .backgroundColor(ColorUtils.string2Color('#4161D0')));
|
|
|
+ child: Row(
|
|
|
+ children: [
|
|
|
+ const MyAssetImage(
|
|
|
+ Assets.rewardsRewardsIconJb,
|
|
|
+ width: 23,
|
|
|
+ height: 23,
|
|
|
+ ).marginOnly(right: 5),
|
|
|
+ Text(
|
|
|
+ '$points',
|
|
|
+ style: const TextStyle(fontSize: 15.0, color: Colors.white, fontWeight: FontWeight.w400), // 设置字体大小
|
|
|
+ ),
|
|
|
+ ],
|
|
|
+ ).paddingOnly(left: 10, top: 7, bottom: 7, right: 10),
|
|
|
+ ),
|
|
|
+ ],
|
|
|
+ ).paddingOnly(left: 10, top: 0, bottom: 18),
|
|
|
+ ],
|
|
|
+ )
|
|
|
+ .paddingOnly(top: 15, left: 5, right: 15, bottom: 0)
|
|
|
+ .border(bottom: 0, color: context.appColors.btnBgDefault)
|
|
|
+ .backgroundColor(context.appColors.btnBgDefault),
|
|
|
+ );
|
|
|
}
|
|
|
|
|
|
Widget _buildSearch(BuildContext context, WidgetRef ref, _vm, RewardsIndexEntity? list) {
|
|
@@ -188,9 +189,9 @@ class RewardsPage extends HookConsumerWidget {
|
|
|
return Container(
|
|
|
width: MediaQuery.of(context).size.width - 30,
|
|
|
decoration: BoxDecoration(
|
|
|
- color: Colors.white,
|
|
|
+ color: context.appColors.whiteBG,
|
|
|
borderRadius: BorderRadius.circular(10),
|
|
|
- boxShadow: const [BoxShadow(color: Color.fromRGBO(184, 191, 217, 0.3), blurRadius: 6)],
|
|
|
+ boxShadow: [BoxShadow(color: context.appColors.itemBGShadow)],
|
|
|
),
|
|
|
child: Column(
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
@@ -198,7 +199,7 @@ class RewardsPage extends HookConsumerWidget {
|
|
|
children: [
|
|
|
Text(
|
|
|
S.current.continuous_login_8_day,
|
|
|
- style: TextStyle(fontSize: 15.0, color: ColorUtils.string2Color('#000000'), fontWeight: FontWeight.w500), // 设置字体大小
|
|
|
+ style: TextStyle(fontSize: 15.0, color: context.appColors.textBlack, fontWeight: FontWeight.w500), // 设置字体大小
|
|
|
),
|
|
|
Flex(
|
|
|
direction: Axis.horizontal,
|
|
@@ -207,9 +208,9 @@ class RewardsPage extends HookConsumerWidget {
|
|
|
flex: 1,
|
|
|
child: Container(
|
|
|
decoration: BoxDecoration(
|
|
|
- color: ColorUtils.string2Color('#F2F3F6'),
|
|
|
+ color: context.appColors.whiteSecondBG,
|
|
|
borderRadius: BorderRadius.circular(10),
|
|
|
- border: Border.all(color: ColorUtils.string2Color('#4161D0'), width: 1),
|
|
|
+ border: Border.all(color: context.appColors.textPrimary, width: 1),
|
|
|
),
|
|
|
height: 78,
|
|
|
child: Column(
|
|
@@ -217,8 +218,8 @@ class RewardsPage extends HookConsumerWidget {
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
children: [
|
|
|
Text(
|
|
|
- '$date0',
|
|
|
- style: TextStyle(fontSize: 13.0, color: ColorUtils.string2Color('#4161D0'), fontWeight: FontWeight.w400), // 设置字体大小
|
|
|
+ date0,
|
|
|
+ style: TextStyle(fontSize: 13.0, color: context.appColors.textPrimary, fontWeight: FontWeight.w400), // 设置字体大小
|
|
|
),
|
|
|
const MyAssetImage(
|
|
|
Assets.rewardsRewardsIconJb,
|
|
@@ -227,7 +228,7 @@ class RewardsPage extends HookConsumerWidget {
|
|
|
),
|
|
|
Text(
|
|
|
'+2',
|
|
|
- style: TextStyle(fontSize: 15.0, color: ColorUtils.string2Color('#4161D0'), fontWeight: FontWeight.w500), // 设置字体大小
|
|
|
+ style: TextStyle(fontSize: 15.0, color: context.appColors.textPrimary, fontWeight: FontWeight.w500), // 设置字体大小
|
|
|
),
|
|
|
],
|
|
|
),
|
|
@@ -442,9 +443,9 @@ class RewardsPage extends HookConsumerWidget {
|
|
|
// color: Colors.white,
|
|
|
height: 55,
|
|
|
decoration: BoxDecoration(
|
|
|
- color: Colors.white,
|
|
|
+ color: context.appColors.whiteBG,
|
|
|
borderRadius: BorderRadius.circular(10),
|
|
|
- boxShadow: const [BoxShadow(color: Color.fromRGBO(184, 191, 217, 0.3), blurRadius: 6)],
|
|
|
+ boxShadow: [BoxShadow(color: context.appColors.itemBGShadow)],
|
|
|
),
|
|
|
child: Row(
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
@@ -452,12 +453,12 @@ class RewardsPage extends HookConsumerWidget {
|
|
|
children: [
|
|
|
Text(
|
|
|
S.current.how_to_get_rewards,
|
|
|
- style: TextStyle(fontSize: 15.0, color: ColorUtils.string2Color('#000000'), fontWeight: FontWeight.w500), // 设置字体大小
|
|
|
+ style: TextStyle(fontSize: 15.0, color: context.appColors.textBlack, fontWeight: FontWeight.w500), // 设置字体大小
|
|
|
),
|
|
|
Container(
|
|
|
padding: const EdgeInsets.only(top: 10, bottom: 10, left: 17, right: 17),
|
|
|
decoration: BoxDecoration(
|
|
|
- color: ColorUtils.string2Color('#4161D0'),
|
|
|
+ color: context.appColors.btnBgDefaultDark,
|
|
|
borderRadius: BorderRadius.circular(5),
|
|
|
),
|
|
|
child: Text(
|
|
@@ -477,9 +478,9 @@ class RewardsPage extends HookConsumerWidget {
|
|
|
int giveLikes = list?.tasks?.give10Likes ?? 0;
|
|
|
return Container(
|
|
|
decoration: BoxDecoration(
|
|
|
- color: Colors.white,
|
|
|
+ color: context.appColors.whiteBG,
|
|
|
borderRadius: BorderRadius.circular(10),
|
|
|
- boxShadow: const [BoxShadow(color: Color.fromRGBO(184, 191, 217, 0.3), blurRadius: 6)],
|
|
|
+ boxShadow: [BoxShadow(color: context.appColors.itemBGShadow)],
|
|
|
),
|
|
|
child: Column(
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
@@ -491,7 +492,7 @@ class RewardsPage extends HookConsumerWidget {
|
|
|
border: Border(
|
|
|
bottom: BorderSide(
|
|
|
width: 1.0, // 底边边框的宽度
|
|
|
- color: ColorUtils.string2Color('#F2F3F6'), // 底边边框的颜色
|
|
|
+ color: context.appColors.backgroundDark, // 底边边框的颜色
|
|
|
))),
|
|
|
child: Row(
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
@@ -517,13 +518,13 @@ class RewardsPage extends HookConsumerWidget {
|
|
|
children: [
|
|
|
Text(
|
|
|
S.current.daily_login,
|
|
|
- style: TextStyle(fontSize: 15.0, color: ColorUtils.string2Color('#000000'), fontWeight: FontWeight.w500), // 设置字体大小
|
|
|
+ style: TextStyle(fontSize: 15.0, color: context.appColors.textBlack, fontWeight: FontWeight.w500), // 设置字体大小
|
|
|
).marginOnly(bottom: 6),
|
|
|
Row(
|
|
|
children: [
|
|
|
Text(
|
|
|
'+2',
|
|
|
- style: TextStyle(fontSize: 15.0, color: ColorUtils.string2Color('#4161D0'), fontWeight: FontWeight.w500), // 设置字体大小
|
|
|
+ style: TextStyle(fontSize: 15.0, color: context.appColors.textPrimary, fontWeight: FontWeight.w500), // 设置字体大小
|
|
|
),
|
|
|
const MyAssetImage(
|
|
|
Assets.rewardsRewardsIconJb,
|
|
@@ -540,14 +541,14 @@ class RewardsPage extends HookConsumerWidget {
|
|
|
width: 86,
|
|
|
height: 30,
|
|
|
decoration: BoxDecoration(
|
|
|
- color: ColorUtils.string2Color('#ffffff'),
|
|
|
+ color: Colors.transparent,
|
|
|
borderRadius: BorderRadius.circular(5),
|
|
|
- border: Border.all(color: ColorUtils.string2Color('#4161D0'), width: 1),
|
|
|
+ border: Border.all(color: context.appColors.btnBgDefaultDark, width: 1),
|
|
|
),
|
|
|
child: Center(
|
|
|
child: Text(
|
|
|
S.current.check_in,
|
|
|
- style: TextStyle(fontSize: 14.0, color: ColorUtils.string2Color('#4161D0'), fontWeight: FontWeight.w400), // 设置字体大小
|
|
|
+ style: TextStyle(fontSize: 14.0, color: context.appColors.textPrimary, fontWeight: FontWeight.w400), // 设置字体大小
|
|
|
),
|
|
|
),
|
|
|
),
|
|
@@ -560,7 +561,7 @@ class RewardsPage extends HookConsumerWidget {
|
|
|
border: Border(
|
|
|
bottom: BorderSide(
|
|
|
width: 1.0, // 底边边框的宽度
|
|
|
- color: ColorUtils.string2Color('#F2F3F6'), // 底边边框的颜色
|
|
|
+ color: context.appColors.backgroundDark, // 底边边框的颜色
|
|
|
))),
|
|
|
child: Row(
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
@@ -586,13 +587,13 @@ class RewardsPage extends HookConsumerWidget {
|
|
|
children: [
|
|
|
Text(
|
|
|
S.current.news_feed_post,
|
|
|
- style: TextStyle(fontSize: 15.0, color: ColorUtils.string2Color('#000000'), fontWeight: FontWeight.w500), // 设置字体大小
|
|
|
+ style: TextStyle(fontSize: 15.0, color: context.appColors.textBlack, fontWeight: FontWeight.w500), // 设置字体大小
|
|
|
).marginOnly(bottom: 6),
|
|
|
Row(
|
|
|
children: [
|
|
|
Text(
|
|
|
'+2',
|
|
|
- style: TextStyle(fontSize: 15.0, color: ColorUtils.string2Color('#4161D0'), fontWeight: FontWeight.w500), // 设置字体大小
|
|
|
+ style: TextStyle(fontSize: 15.0, color: context.appColors.textPrimary, fontWeight: FontWeight.w500), // 设置字体大小
|
|
|
),
|
|
|
const MyAssetImage(
|
|
|
Assets.rewardsRewardsIconJb,
|
|
@@ -609,14 +610,14 @@ class RewardsPage extends HookConsumerWidget {
|
|
|
width: 86,
|
|
|
height: 30,
|
|
|
decoration: BoxDecoration(
|
|
|
- color: ColorUtils.string2Color('#ffffff'),
|
|
|
+ color: Colors.transparent,
|
|
|
borderRadius: BorderRadius.circular(5),
|
|
|
- border: Border.all(color: ColorUtils.string2Color('#4161D0'), width: 1),
|
|
|
+ border: Border.all(color: context.appColors.btnBgDefaultDark, width: 1),
|
|
|
),
|
|
|
child: Center(
|
|
|
child: Text(
|
|
|
newsFeed == true ? S.current.completed : S.current.incomplete,
|
|
|
- style: TextStyle(fontSize: 14.0, color: ColorUtils.string2Color('#4161D0'), fontWeight: FontWeight.w400), // 设置字体大小
|
|
|
+ style: TextStyle(fontSize: 14.0, color: context.appColors.textPrimary, fontWeight: FontWeight.w400), // 设置字体大小
|
|
|
),
|
|
|
),
|
|
|
),
|
|
@@ -629,7 +630,7 @@ class RewardsPage extends HookConsumerWidget {
|
|
|
border: Border(
|
|
|
bottom: BorderSide(
|
|
|
width: 1.0, // 底边边框的宽度
|
|
|
- color: ColorUtils.string2Color('#F2F3F6'), // 底边边框的颜色
|
|
|
+ color: context.appColors.backgroundDark, // 底边边框的颜色
|
|
|
))),
|
|
|
child: Row(
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
@@ -655,13 +656,13 @@ class RewardsPage extends HookConsumerWidget {
|
|
|
children: [
|
|
|
Text(
|
|
|
S.current.give_10_likes,
|
|
|
- style: TextStyle(fontSize: 15.0, color: ColorUtils.string2Color('#000000'), fontWeight: FontWeight.w500), // 设置字体大小
|
|
|
+ style: TextStyle(fontSize: 15.0, color: context.appColors.textBlack, fontWeight: FontWeight.w500), // 设置字体大小
|
|
|
).marginOnly(bottom: 6),
|
|
|
Row(
|
|
|
children: [
|
|
|
Text(
|
|
|
'+2',
|
|
|
- style: TextStyle(fontSize: 15.0, color: ColorUtils.string2Color('#4161D0'), fontWeight: FontWeight.w500), // 设置字体大小
|
|
|
+ style: TextStyle(fontSize: 15.0, color: context.appColors.textPrimary, fontWeight: FontWeight.w500), // 设置字体大小
|
|
|
),
|
|
|
const MyAssetImage(
|
|
|
Assets.rewardsRewardsIconJb,
|
|
@@ -678,14 +679,14 @@ class RewardsPage extends HookConsumerWidget {
|
|
|
width: 86,
|
|
|
height: 30,
|
|
|
decoration: BoxDecoration(
|
|
|
- color: ColorUtils.string2Color('#ffffff'),
|
|
|
+ color: Colors.transparent,
|
|
|
borderRadius: BorderRadius.circular(5),
|
|
|
- border: Border.all(color: ColorUtils.string2Color('#4161D0'), width: 1),
|
|
|
+ border: Border.all(color: context.appColors.btnBgDefaultDark, width: 1),
|
|
|
),
|
|
|
child: Center(
|
|
|
child: Text(
|
|
|
giveLikes == 10 ? S.current.completed : '$giveLikes/10',
|
|
|
- style: TextStyle(fontSize: 14.0, color: ColorUtils.string2Color('#4161D0'), fontWeight: FontWeight.w400), // 设置字体大小
|
|
|
+ style: TextStyle(fontSize: 14.0, color: context.appColors.textPrimary, fontWeight: FontWeight.w400), // 设置字体大小
|
|
|
),
|
|
|
),
|
|
|
),
|
|
@@ -699,12 +700,11 @@ class RewardsPage extends HookConsumerWidget {
|
|
|
|
|
|
Widget _buildHistory(BuildContext context, WidgetRef ref, _vm, RewardsIndexEntity? list) {
|
|
|
List latest = list?.latest ?? [];
|
|
|
- Log.d("list是空吗? $list 最近的信息:$latest");
|
|
|
return Container(
|
|
|
decoration: BoxDecoration(
|
|
|
- color: Colors.white,
|
|
|
+ color: context.appColors.whiteBG,
|
|
|
borderRadius: BorderRadius.circular(10),
|
|
|
- boxShadow: const [BoxShadow(color: Color.fromRGBO(184, 191, 217, 0.3), blurRadius: 6)],
|
|
|
+ boxShadow: [BoxShadow(color: context.appColors.itemBGShadow)],
|
|
|
),
|
|
|
child: Column(
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
@@ -713,11 +713,11 @@ class RewardsPage extends HookConsumerWidget {
|
|
|
Row(crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [
|
|
|
Text(
|
|
|
S.current.points_history,
|
|
|
- style: TextStyle(fontSize: 15.0, color: ColorUtils.string2Color('#000000'), fontWeight: FontWeight.w500), // 设置字体大小
|
|
|
+ style: TextStyle(fontSize: 15.0, color: context.appColors.textBlack, fontWeight: FontWeight.w500), // 设置字体大小
|
|
|
),
|
|
|
Text(
|
|
|
S.current.more_arrow,
|
|
|
- style: TextStyle(fontSize: 15.0, color: ColorUtils.string2Color('#4161D0'), fontWeight: FontWeight.w500), // 设置字体大小
|
|
|
+ style: TextStyle(fontSize: 15.0, color: context.appColors.textPrimary, fontWeight: FontWeight.w500), // 设置字体大小
|
|
|
).onTap(() {
|
|
|
RewardsHistoryPage.startInstance();
|
|
|
})
|
|
@@ -733,7 +733,7 @@ class RewardsPage extends HookConsumerWidget {
|
|
|
border: Border(
|
|
|
bottom: BorderSide(
|
|
|
width: 1.0, // 底边边框的宽度
|
|
|
- color: ColorUtils.string2Color('#F2F3F6'), // 底边边框的颜色
|
|
|
+ color: context.appColors.backgroundDark, // 底边边框的颜色
|
|
|
))),
|
|
|
child: Row(
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
@@ -745,17 +745,23 @@ class RewardsPage extends HookConsumerWidget {
|
|
|
children: [
|
|
|
Text(
|
|
|
latest[index]['short_description'],
|
|
|
- style: TextStyle(fontSize: 15.0, color: ColorUtils.string2Color('#000000'), fontWeight: FontWeight.w500), // 设置字体大小
|
|
|
+ style: TextStyle(fontSize: 15.0, color: context.appColors.textBlack, fontWeight: FontWeight.w500), // 设置字体大小
|
|
|
).marginOnly(bottom: 6),
|
|
|
Text(
|
|
|
latest[index]['created_at'],
|
|
|
- style: TextStyle(fontSize: 13.0, color: ColorUtils.string2Color('#808DAF'), fontWeight: FontWeight.w400), // 设置字体大小
|
|
|
+ style: TextStyle(
|
|
|
+ fontSize: 13.0,
|
|
|
+ color: DarkThemeUtil.multiColors(context, ColorUtils.string2Color('#808DAF'), darkColor: Colors.white),
|
|
|
+ fontWeight: FontWeight.w400), // 设置字体大小
|
|
|
),
|
|
|
],
|
|
|
),
|
|
|
Text(
|
|
|
"$point",
|
|
|
- style: TextStyle(fontSize: 20.0, color: ColorUtils.string2Color('#FDB429'), fontWeight: FontWeight.w500), // 设置字体大小
|
|
|
+ style: TextStyle(
|
|
|
+ fontSize: 20.0,
|
|
|
+ color: DarkThemeUtil.multiColors(context, ColorUtils.string2Color('#FDB429'), darkColor: Colors.white),
|
|
|
+ fontWeight: FontWeight.w500), // 设置字体大小
|
|
|
),
|
|
|
],
|
|
|
),
|