97 lines
3.2 KiB
Dart
97 lines
3.2 KiB
Dart
import 'package:flutter/cupertino.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
|
import 'package:aslan/chatvibe_ui/components/at_compontent.dart';
|
|
import 'package:aslan/chatvibe_ui/components/text/at_text.dart';
|
|
import 'package:aslan/chatvibe_core/utilities/at_path_utils.dart';
|
|
import 'package:aslan/chatvibe_domain/models/res/at_material_badge_res.dart';
|
|
|
|
import 'package:aslan/chatvibe_ui/widgets/headdress/headdress_widget.dart';
|
|
|
|
class BadgeDetailDialog extends StatefulWidget {
|
|
BadgeTables res;
|
|
|
|
BadgeDetailDialog(this.res);
|
|
|
|
@override
|
|
_BadgeDetailDialogState createState() => _BadgeDetailDialogState();
|
|
}
|
|
|
|
class _BadgeDetailDialogState extends State<BadgeDetailDialog> {
|
|
@override
|
|
void initState() {
|
|
super.initState();
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Stack(
|
|
children: [
|
|
Container(
|
|
width: 220.w,
|
|
height: 220.w,
|
|
decoration: BoxDecoration(
|
|
image: DecorationImage(
|
|
image: AssetImage("atu_images/index/at_icon_medal_detail_bg.png"),
|
|
fit: BoxFit.fill,
|
|
),
|
|
),
|
|
child: Column(
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
children: [
|
|
widget.res.badgeConfig?.animationUrl != null &&
|
|
ATPathUtils.fileTypeIsPicOperation(
|
|
widget.res.badgeConfig?.animationUrl ?? "",
|
|
)
|
|
? netImage(
|
|
url: widget.res.badgeConfig?.animationUrl ?? "",
|
|
width: 120,
|
|
height: 120,
|
|
)
|
|
: (ATPathUtils.fetchFileExtensionFunction(
|
|
widget.res.badgeConfig?.animationUrl ?? "",
|
|
).toLowerCase() ==
|
|
".svga"
|
|
? SVGAHeadwearWidget(
|
|
width: 120.w,
|
|
height: 120.w,
|
|
resource: widget.res.badgeConfig?.animationUrl ?? "",
|
|
)
|
|
: netImage(
|
|
url: widget.res.badgeConfig?.animationUrl ?? "",
|
|
width: 120.w,
|
|
height: 120.w,
|
|
)),
|
|
|
|
SizedBox(height: 5.w),
|
|
Container(
|
|
margin: EdgeInsetsDirectional.symmetric(horizontal: 8.w),
|
|
alignment: AlignmentDirectional.center,
|
|
child: text(
|
|
textAlign: TextAlign.center,
|
|
maxLines: 2,
|
|
widget.res.badgeConfig?.badgeName ?? "",
|
|
fontSize: 14.sp,
|
|
fontWeight: FontWeight.bold,
|
|
textColor: CupertinoColors.white,
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
Positioned(
|
|
right: 15.w,
|
|
top: 10.w,
|
|
child: GestureDetector(
|
|
child: Icon(Icons.close, size: 20.w, color: Color(0xFFF8E090)),
|
|
onTap: () {
|
|
SmartDialog.dismiss(tag: "showBadgeDetail");
|
|
},
|
|
),
|
|
),
|
|
],
|
|
);
|
|
}
|
|
}
|