关怀模式
This commit is contained in:
@@ -12,6 +12,7 @@ import 'package:get/get.dart';
|
||||
import 'package:path_provider/path_provider.dart';
|
||||
import 'package:share_plus/share_plus.dart';
|
||||
import '../../../constants/app_constants.dart';
|
||||
import '../../../services/get/theme_controller.dart';
|
||||
import '../../../utils/http/poetry_api.dart';
|
||||
import 'home-load.dart';
|
||||
|
||||
@@ -23,14 +24,14 @@ class LoadingWidget extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final themeController = Get.find<ThemeController>();
|
||||
final themeColor = themeController.currentThemeColor;
|
||||
return Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
CircularProgressIndicator(
|
||||
valueColor: AlwaysStoppedAnimation<Color>(
|
||||
AppConstants.primaryColor,
|
||||
),
|
||||
valueColor: AlwaysStoppedAnimation<Color>(themeColor),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
Text(
|
||||
@@ -145,7 +146,7 @@ class CustomErrorWidget extends StatelessWidget {
|
||||
ElevatedButton(
|
||||
onPressed: onRetry,
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: AppConstants.primaryColor,
|
||||
backgroundColor: Get.find<ThemeController>().currentThemeColor,
|
||||
),
|
||||
child: const Text('重试'),
|
||||
),
|
||||
@@ -401,15 +402,17 @@ class FloatingShareButton extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final themeController = Get.find<ThemeController>();
|
||||
final themeColor = themeController.currentThemeColor;
|
||||
return Container(
|
||||
width: 56,
|
||||
height: 56,
|
||||
decoration: BoxDecoration(
|
||||
color: AppConstants.secondaryColor,
|
||||
color: themeColor,
|
||||
shape: BoxShape.circle,
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: AppConstants.secondaryColor.withAlpha(76),
|
||||
color: themeColor.withAlpha(76),
|
||||
blurRadius: 8,
|
||||
offset: const Offset(0, 4),
|
||||
),
|
||||
@@ -470,7 +473,9 @@ class FloatingPreviousButton extends StatelessWidget {
|
||||
child: Center(
|
||||
child: Icon(
|
||||
Icons.arrow_back,
|
||||
color: isDark ? Colors.grey[300] : AppConstants.primaryColor,
|
||||
color: isDark
|
||||
? Colors.grey[300]
|
||||
: Get.find<ThemeController>().currentThemeColor,
|
||||
size: 28,
|
||||
),
|
||||
),
|
||||
@@ -518,7 +523,9 @@ class FloatingNextButton extends StatelessWidget {
|
||||
child: Center(
|
||||
child: Icon(
|
||||
Icons.arrow_forward,
|
||||
color: isDark ? Colors.grey[300] : AppConstants.primaryColor,
|
||||
color: isDark
|
||||
? Colors.grey[300]
|
||||
: Get.find<ThemeController>().currentThemeColor,
|
||||
size: 28,
|
||||
),
|
||||
),
|
||||
@@ -581,7 +588,9 @@ class FloatingLikeButton extends StatelessWidget {
|
||||
child: CircularProgressIndicator(
|
||||
strokeWidth: 2,
|
||||
valueColor: AlwaysStoppedAnimation<Color>(
|
||||
isDark ? Colors.grey[300]! : AppConstants.primaryColor,
|
||||
isDark
|
||||
? Colors.grey[300]!
|
||||
: Get.find<ThemeController>().currentThemeColor,
|
||||
),
|
||||
),
|
||||
)
|
||||
@@ -608,6 +617,8 @@ class StatsCard extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final themeController = Get.find<ThemeController>();
|
||||
final themeColor = themeController.currentThemeColor;
|
||||
return Container(
|
||||
margin: const EdgeInsets.symmetric(horizontal: 16),
|
||||
padding: const EdgeInsets.all(16),
|
||||
@@ -631,7 +642,7 @@ class StatsCard extends StatelessWidget {
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: AppConstants.primaryColor,
|
||||
color: themeColor,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
|
||||
Reference in New Issue
Block a user