mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
opt mine page
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -48,6 +48,7 @@ class _MediaPageState extends CommonPageState<MinePage, MineController>
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
super.build(context);
|
super.build(context);
|
||||||
final theme = Theme.of(context);
|
final theme = Theme.of(context);
|
||||||
|
final secondary = theme.colorScheme.secondary;
|
||||||
return Column(
|
return Column(
|
||||||
children: [
|
children: [
|
||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
@@ -60,12 +61,12 @@ class _MediaPageState extends CommonPageState<MinePage, MineController>
|
|||||||
controller: controller.scrollController,
|
controller: controller.scrollController,
|
||||||
physics: const AlwaysScrollableScrollPhysics(),
|
physics: const AlwaysScrollableScrollPhysics(),
|
||||||
children: [
|
children: [
|
||||||
_buildUserInfo(theme),
|
_buildUserInfo(theme, secondary),
|
||||||
_buildActions(theme.colorScheme.primary),
|
_buildActions(secondary),
|
||||||
Obx(
|
Obx(
|
||||||
() => controller.loadingState.value is Loading
|
() => controller.loadingState.value is Loading
|
||||||
? const SizedBox.shrink()
|
? const SizedBox.shrink()
|
||||||
: _buildFav(theme),
|
: _buildFav(theme, secondary),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@@ -172,7 +173,7 @@ class _MediaPageState extends CommonPageState<MinePage, MineController>
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildUserInfo(ThemeData theme) {
|
Widget _buildUserInfo(ThemeData theme, Color secondary) {
|
||||||
final style = TextStyle(
|
final style = TextStyle(
|
||||||
fontSize: theme.textTheme.titleMedium!.fontSize,
|
fontSize: theme.textTheme.titleMedium!.fontSize,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
@@ -187,7 +188,7 @@ class _MediaPageState extends CommonPageState<MinePage, MineController>
|
|||||||
final coinValStyle = TextStyle(
|
final coinValStyle = TextStyle(
|
||||||
fontSize: theme.textTheme.labelMedium!.fontSize,
|
fontSize: theme.textTheme.labelMedium!.fontSize,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
color: theme.colorScheme.primary,
|
color: secondary,
|
||||||
);
|
);
|
||||||
return Obx(() {
|
return Obx(() {
|
||||||
final UserInfoData userInfo = controller.userInfo.value;
|
final UserInfoData userInfo = controller.userInfo.value;
|
||||||
@@ -305,10 +306,10 @@ class _MediaPageState extends CommonPageState<MinePage, MineController>
|
|||||||
value: levelInfo != null
|
value: levelInfo != null
|
||||||
? (levelInfo.currentExp! / levelInfo.nextExp!)
|
? (levelInfo.currentExp! / levelInfo.nextExp!)
|
||||||
: 0,
|
: 0,
|
||||||
backgroundColor: theme.colorScheme.inversePrimary,
|
backgroundColor: theme.colorScheme.outline.withValues(
|
||||||
valueColor: AlwaysStoppedAnimation<Color>(
|
alpha: 0.4,
|
||||||
theme.colorScheme.primary,
|
|
||||||
),
|
),
|
||||||
|
valueColor: AlwaysStoppedAnimation<Color>(secondary),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@@ -384,7 +385,7 @@ class _MediaPageState extends CommonPageState<MinePage, MineController>
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildFav(ThemeData theme) {
|
Widget _buildFav(ThemeData theme, Color secondary) {
|
||||||
return Column(
|
return Column(
|
||||||
children: [
|
children: [
|
||||||
Divider(
|
Divider(
|
||||||
@@ -416,14 +417,14 @@ class _MediaPageState extends CommonPageState<MinePage, MineController>
|
|||||||
text: "${controller.favFoldercount} ",
|
text: "${controller.favFoldercount} ",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: theme.textTheme.titleSmall!.fontSize,
|
fontSize: theme.textTheme.titleSmall!.fontSize,
|
||||||
color: theme.colorScheme.primary,
|
color: secondary,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
WidgetSpan(
|
WidgetSpan(
|
||||||
child: Icon(
|
child: Icon(
|
||||||
Icons.arrow_forward_ios,
|
Icons.arrow_forward_ios,
|
||||||
size: 18,
|
size: 18,
|
||||||
color: theme.colorScheme.primary,
|
color: secondary,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@@ -439,14 +440,18 @@ class _MediaPageState extends CommonPageState<MinePage, MineController>
|
|||||||
SizedBox(
|
SizedBox(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
height: 200,
|
height: 200,
|
||||||
child: _buildFavBody(theme, controller.loadingState.value),
|
child: _buildFavBody(theme, secondary, controller.loadingState.value),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 100),
|
const SizedBox(height: 100),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildFavBody(ThemeData theme, LoadingState loadingState) {
|
Widget _buildFavBody(
|
||||||
|
ThemeData theme,
|
||||||
|
Color secondary,
|
||||||
|
LoadingState loadingState,
|
||||||
|
) {
|
||||||
return switch (loadingState) {
|
return switch (loadingState) {
|
||||||
Loading() => const SizedBox.shrink(),
|
Loading() => const SizedBox.shrink(),
|
||||||
Success(:var response) => Builder(
|
Success(:var response) => Builder(
|
||||||
@@ -469,7 +474,7 @@ class _MediaPageState extends CommonPageState<MinePage, MineController>
|
|||||||
style: ButtonStyle(
|
style: ButtonStyle(
|
||||||
padding: WidgetStateProperty.all(EdgeInsets.zero),
|
padding: WidgetStateProperty.all(EdgeInsets.zero),
|
||||||
backgroundColor: WidgetStatePropertyAll(
|
backgroundColor: WidgetStatePropertyAll(
|
||||||
theme.colorScheme.primaryContainer.withValues(
|
theme.colorScheme.secondaryContainer.withValues(
|
||||||
alpha: 0.5,
|
alpha: 0.5,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -483,7 +488,7 @@ class _MediaPageState extends CommonPageState<MinePage, MineController>
|
|||||||
icon: Icon(
|
icon: Icon(
|
||||||
Icons.arrow_forward_ios,
|
Icons.arrow_forward_ios,
|
||||||
size: 18,
|
size: 18,
|
||||||
color: theme.colorScheme.primary,
|
color: secondary,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user