release
This commit is contained in:
@@ -25,10 +25,12 @@ class DiscoverPage extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _DiscoverPageState extends State<DiscoverPage>
|
||||
with SingleTickerProviderStateMixin {
|
||||
with TickerProviderStateMixin {
|
||||
late TabController _tabController;
|
||||
final controller = Get.put(DiscoverController());
|
||||
late ThemeController _themeController;
|
||||
late AnimationController _tipsAnimationController;
|
||||
late Animation<double> _tipsAnimation;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
@@ -40,6 +42,17 @@ class _DiscoverPageState extends State<DiscoverPage>
|
||||
vsync: this,
|
||||
);
|
||||
|
||||
_tipsAnimationController = AnimationController(
|
||||
duration: const Duration(milliseconds: 300),
|
||||
vsync: this,
|
||||
);
|
||||
_tipsAnimation = CurvedAnimation(
|
||||
parent: _tipsAnimationController,
|
||||
curve: Curves.easeInOut,
|
||||
);
|
||||
|
||||
_tipsAnimationController.value = 1.0;
|
||||
|
||||
_tabController.addListener(() {
|
||||
setState(() {});
|
||||
});
|
||||
@@ -48,6 +61,7 @@ class _DiscoverPageState extends State<DiscoverPage>
|
||||
@override
|
||||
void dispose() {
|
||||
_tabController.dispose();
|
||||
_tipsAnimationController.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@@ -130,43 +144,52 @@ class _DiscoverPageState extends State<DiscoverPage>
|
||||
}
|
||||
|
||||
Widget _buildTopicChips(DiscoverController controller, bool isDark) {
|
||||
return Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
|
||||
color: isDark ? const Color(0xFF1E1E1E) : Colors.grey[50],
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Text(
|
||||
'💡 探索更多精彩内容,发现你感兴趣的诗词世界',
|
||||
style: TextStyle(
|
||||
color: _themeController.currentThemeColor,
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w400,
|
||||
return SizeTransition(
|
||||
sizeFactor: _tipsAnimation,
|
||||
axisAlignment: -1.0,
|
||||
child: FadeTransition(
|
||||
opacity: _tipsAnimation,
|
||||
child: Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
|
||||
color: isDark ? const Color(0xFF1E1E1E) : Colors.grey[50],
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Text(
|
||||
'💡 探索更多精彩内容,发现你感兴趣的诗词世界',
|
||||
style: TextStyle(
|
||||
color: _themeController.currentThemeColor,
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
GestureDetector(
|
||||
behavior: HitTestBehavior.opaque,
|
||||
onTap: () async {
|
||||
_tipsAnimationController.reverse();
|
||||
await Future.delayed(const Duration(milliseconds: 300));
|
||||
controller.toggleTips();
|
||||
},
|
||||
child: Container(
|
||||
width: 30,
|
||||
height: 30,
|
||||
decoration: BoxDecoration(
|
||||
color: isDark
|
||||
? Colors.grey[800]
|
||||
: Colors.grey.withValues(alpha: 0.1),
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
child: Icon(
|
||||
Icons.close,
|
||||
size: 16,
|
||||
color: isDark ? Colors.grey[400] : Colors.grey[600],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
GestureDetector(
|
||||
behavior: HitTestBehavior.opaque,
|
||||
onTap: () {
|
||||
controller.toggleTips();
|
||||
},
|
||||
child: Container(
|
||||
width: 30,
|
||||
height: 30,
|
||||
decoration: BoxDecoration(
|
||||
color: isDark
|
||||
? Colors.grey[800]
|
||||
: Colors.grey.withValues(alpha: 0.1),
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
child: Icon(
|
||||
Icons.close,
|
||||
size: 16,
|
||||
color: isDark ? Colors.grey[400] : Colors.grey[600],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -430,7 +453,7 @@ class _DiscoverPageState extends State<DiscoverPage>
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
Text(
|
||||
'展示诗词的浏览量和点赞数排行,包括总榜、日榜、月榜三种类型。帮助您发现最受欢迎的诗词作品。',
|
||||
'统计开源:来自本软件各个平台的数据,安卓 鸿蒙 web 小程序等平台。',
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color: isDark ? Colors.grey[400] : Colors.grey[600],
|
||||
|
||||
Reference in New Issue
Block a user