feat: 视频详情页,分类页。个人中心
This commit is contained in:
1 parent
b5bce6edcf
commit
a3426831ed
26 files changed
+2878
-1077
No files matched your search
@@ -0,0 +1,70 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:novyronst/common/const/const_color.dart';
|
||||
import 'package:novyronst/root/lib_export.dart';
|
||||
|
||||
class NyLoadingWidget extends StatefulWidget {
|
||||
final double size;
|
||||
|
||||
const NyLoadingWidget({
|
||||
super.key,
|
||||
this.size = 10,
|
||||
});
|
||||
|
||||
@override
|
||||
State<NyLoadingWidget> createState() => _ThreeDotLoadingState();
|
||||
}
|
||||
|
||||
class _ThreeDotLoadingState extends State<NyLoadingWidget>
|
||||
with SingleTickerProviderStateMixin {
|
||||
late AnimationController _controller;
|
||||
int _currentIndex = 0;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_controller = AnimationController(
|
||||
vsync: this,
|
||||
duration: const Duration(milliseconds: 600),
|
||||
)..addListener(() {
|
||||
// 每完成一次动画循环,更新索引
|
||||
if (_controller.isCompleted) {
|
||||
_controller.reset();
|
||||
setState(() {
|
||||
_currentIndex = (_currentIndex + 1) % 3;
|
||||
});
|
||||
_controller.forward();
|
||||
}
|
||||
});
|
||||
_controller.forward();
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_controller.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return SizedBox(
|
||||
width: AppScreen.screenWidth,
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: List.generate(3, (index) {
|
||||
final isDark = index == _currentIndex;
|
||||
return AnimatedContainer(
|
||||
duration: const Duration(milliseconds: 200),
|
||||
margin: const EdgeInsets.symmetric(horizontal: 6),
|
||||
width: widget.size,
|
||||
height: widget.size,
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: isDark ? ConstColor.withValue('#89F011') : ConstColor.withValue('#E2FFC0'),
|
||||
),
|
||||
);
|
||||
}),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:novyronst/common/const/const_color.dart';
|
||||
import 'package:novyronst/common/help/help_image.dart';
|
||||
import 'package:novyronst/tools/widgets/novy_com_widget.dart';
|
||||
@@ -16,6 +17,10 @@ class NyTagWidget extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
String _tag = text;
|
||||
if (text.length > 12) {
|
||||
_tag = text.substring(0, 12);
|
||||
}
|
||||
return Container(
|
||||
height: 20,
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8),
|
||||
@@ -23,8 +28,9 @@ class NyTagWidget extends StatelessWidget {
|
||||
color: bgColor ?? ConstColor.withValue('EEEEEE'),
|
||||
borderRadius: BorderRadius.circular(4),
|
||||
),
|
||||
// constraints: BoxConstraints(maxWidth: 100.w),
|
||||
child: Center(
|
||||
child: NovyText(text,
|
||||
child: NovyText(_tag,
|
||||
fontSize: 10,
|
||||
color: textColor ?? ConstColor.black,
|
||||
),
|
||||
|
||||
Reference in new issue
Block a user