dreampad/lib/app/modules/home/widgets/explore_widget.dart

69 lines
2.0 KiB
Dart
Raw Permalink Normal View History

2023-11-28 10:44:58 +08:00
import 'package:dreampad/app/shared/shared.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
class ExploreWidget extends GetView {
const ExploreWidget({
super.key,
required this.explored,
required this.exploreCount,
});
final bool explored;
final int exploreCount;
@override
Widget build(BuildContext context) {
return Container(
height: 67.h,
width: 201.w,
decoration: BoxDecoration(
image: DecorationImage(
image: explored ? Images.homeExplorePre : Images.homeExploreDefault,
fit: BoxFit.fill,
),
),
child: Row(
children: [
const RSizedBox(width: 10.0),
GestureDetector(
onTap: () {
if (explored) {}
},
child: explored ? Images.homeExploreBegin : Images.homeBeginGray,
),
Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'自由探索',
style: explored
? TextStyles.boldWhiteShadow22_101
: TextStyles.boldWhiteShadow22_100,
),
const RSizedBox(height: 4.0),
explored
? Text(
'剩余时间45:00',
style: TextStyles.mediumWhiteShadow14_101,
)
: Row(
children: [
exploreCount == 0
? Images.homeProgressBar
: Images.homeProgressBarIn,
const RSizedBox(width: 1.0),
exploreCount >= 2
? Images.homeProgressBarIn
: Images.homeProgressBar,
],
),
],
),
],
),
);
}
}