|
|
@ -1,9 +1,9 @@ |
|
|
import 'package:flutter/material.dart'; |
|
|
import 'package:flutter/material.dart'; |
|
|
import 'package:shia_game_flutter/common_ui/resources/my_assets.dart'; |
|
|
import 'package:shia_game_flutter/common_ui/resources/my_assets.dart'; |
|
|
import 'package:shia_game_flutter/common_ui/resources/my_colors.dart'; |
|
|
import 'package:shia_game_flutter/common_ui/resources/my_colors.dart'; |
|
|
import 'package:shia_game_flutter/common_ui/resources/my_spaces.dart'; |
|
|
|
|
|
import 'package:shia_game_flutter/core/utils/my_localization.dart'; |
|
|
import 'package:shia_game_flutter/core/utils/my_localization.dart'; |
|
|
import 'package:shia_game_flutter/core/utils/number_format.dart'; |
|
|
import 'package:shia_game_flutter/core/utils/number_format.dart'; |
|
|
|
|
|
import 'package:shia_game_flutter/core/utils/screen_size.dart'; |
|
|
import 'package:shia_game_flutter/core/widgets/button/enum/my_button_type.dart'; |
|
|
import 'package:shia_game_flutter/core/widgets/button/enum/my_button_type.dart'; |
|
|
import 'package:shia_game_flutter/core/widgets/button/my_gradient_button.dart'; |
|
|
import 'package:shia_game_flutter/core/widgets/button/my_gradient_button.dart'; |
|
|
import 'package:shia_game_flutter/core/widgets/image/my_image.dart'; |
|
|
import 'package:shia_game_flutter/core/widgets/image/my_image.dart'; |
|
|
@ -16,99 +16,96 @@ class CharacterStyle extends StatelessWidget { |
|
|
|
|
|
|
|
|
@override |
|
|
@override |
|
|
Widget build(BuildContext context) { |
|
|
Widget build(BuildContext context) { |
|
|
return SizedBox( |
|
|
|
|
|
height: 190, |
|
|
|
|
|
child: Column( |
|
|
|
|
|
spacing: MySpaces.s8, |
|
|
|
|
|
children: [ |
|
|
|
|
|
Expanded( |
|
|
|
|
|
child: AnimatedContainer( |
|
|
|
|
|
width: 118, |
|
|
|
|
|
duration: const Duration(milliseconds: 200), |
|
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
|
border:Border.all(width: 2, color: const Color(0xFFB37EFA)), |
|
|
|
|
|
borderRadius: const BorderRadius.all(Radius.circular(8)), |
|
|
|
|
|
boxShadow: shop.isActive == true |
|
|
|
|
|
? [ |
|
|
|
|
|
const BoxShadow( |
|
|
|
|
|
color: Color(0xFFB37EFA), |
|
|
|
|
|
spreadRadius: 0, |
|
|
|
|
|
blurRadius: 22, |
|
|
|
|
|
offset: Offset(0, 0), |
|
|
|
|
|
), |
|
|
|
|
|
] |
|
|
|
|
|
: null, |
|
|
|
|
|
), |
|
|
|
|
|
child: ClipRRect( |
|
|
|
|
|
borderRadius: const BorderRadius.all(Radius.circular(6)), |
|
|
|
|
|
child: Stack( |
|
|
|
|
|
alignment: AlignmentDirectional.bottomEnd, |
|
|
|
|
|
children: [ |
|
|
|
|
|
MyImage(asset: shop.image ?? '', fit: BoxFit.cover, size: 150,), |
|
|
|
|
|
if (shop.isActive == true) |
|
|
|
|
|
PositionedDirectional( |
|
|
|
|
|
end: MySpaces.s8, |
|
|
|
|
|
bottom: MySpaces.s8, |
|
|
|
|
|
child: Stack( |
|
|
|
|
|
clipBehavior: Clip.none, |
|
|
|
|
|
children: [ |
|
|
|
|
|
Container( |
|
|
|
|
|
height: 42, |
|
|
|
|
|
width: 42, |
|
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
|
borderRadius: const BorderRadius.all( |
|
|
|
|
|
Radius.circular(5), |
|
|
|
|
|
), |
|
|
|
|
|
color: MyColors.black.withValues(alpha: 0.8), |
|
|
|
|
|
), |
|
|
|
|
|
), |
|
|
|
|
|
const PositionedDirectional( |
|
|
|
|
|
top: -0, |
|
|
|
|
|
end: -5, |
|
|
|
|
|
child: MyImage(asset: MyAssets.done), |
|
|
|
|
|
), |
|
|
|
|
|
], |
|
|
|
|
|
), |
|
|
|
|
|
|
|
|
return Column( |
|
|
|
|
|
spacing: 8, |
|
|
|
|
|
children: [ |
|
|
|
|
|
Expanded( |
|
|
|
|
|
child: AnimatedContainer( |
|
|
|
|
|
width: 120.w, |
|
|
|
|
|
duration: const Duration(milliseconds: 200), |
|
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
|
border:Border.all(width: 2, color: const Color(0xFFB37EFA)), |
|
|
|
|
|
borderRadius: const BorderRadius.all(Radius.circular(8)), |
|
|
|
|
|
boxShadow: shop.isActive == true |
|
|
|
|
|
? [ |
|
|
|
|
|
const BoxShadow( |
|
|
|
|
|
color: Color(0xFFB37EFA), |
|
|
|
|
|
spreadRadius: 0, |
|
|
|
|
|
blurRadius: 22, |
|
|
|
|
|
offset: Offset(0, 0), |
|
|
), |
|
|
), |
|
|
if (shop.isBuy == false) |
|
|
|
|
|
PositionedDirectional( |
|
|
|
|
|
end: MySpaces.s8, |
|
|
|
|
|
bottom: MySpaces.s8, |
|
|
|
|
|
child: Container( |
|
|
|
|
|
height: 42, |
|
|
|
|
|
width: 42, |
|
|
|
|
|
padding: const EdgeInsets.all(MySpaces.s10), |
|
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
|
borderRadius: const BorderRadius.all( |
|
|
|
|
|
Radius.circular(5), |
|
|
|
|
|
|
|
|
] |
|
|
|
|
|
: null, |
|
|
|
|
|
), |
|
|
|
|
|
child: ClipRRect( |
|
|
|
|
|
borderRadius: const BorderRadius.all(Radius.circular(6)), |
|
|
|
|
|
child: Stack( |
|
|
|
|
|
alignment: AlignmentDirectional.bottomEnd, |
|
|
|
|
|
children: [ |
|
|
|
|
|
MyImage(asset: shop.image ?? '', fit: BoxFit.cover, size: 150,), |
|
|
|
|
|
if (shop.isActive == true) |
|
|
|
|
|
PositionedDirectional( |
|
|
|
|
|
end: 8, |
|
|
|
|
|
bottom: 8, |
|
|
|
|
|
child: Stack( |
|
|
|
|
|
clipBehavior: Clip.none, |
|
|
|
|
|
children: [ |
|
|
|
|
|
Container( |
|
|
|
|
|
height: 42, |
|
|
|
|
|
width: 42, |
|
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
|
borderRadius: const BorderRadius.all( |
|
|
|
|
|
Radius.circular(5), |
|
|
|
|
|
), |
|
|
|
|
|
color: MyColors.black.withValues(alpha: 0.8), |
|
|
), |
|
|
), |
|
|
color: MyColors.black.withValues(alpha: 0.8), |
|
|
|
|
|
), |
|
|
), |
|
|
child: const MyImage( |
|
|
|
|
|
asset: MyAssets.lock, |
|
|
|
|
|
|
|
|
const PositionedDirectional( |
|
|
|
|
|
top: -0, |
|
|
|
|
|
end: -5, |
|
|
|
|
|
child: MyImage(asset: MyAssets.done), |
|
|
|
|
|
), |
|
|
|
|
|
], |
|
|
|
|
|
), |
|
|
|
|
|
), |
|
|
|
|
|
if (shop.isBuy == false) |
|
|
|
|
|
PositionedDirectional( |
|
|
|
|
|
end: 8, |
|
|
|
|
|
bottom: 8, |
|
|
|
|
|
child: Container( |
|
|
|
|
|
height: 42, |
|
|
|
|
|
width: 42, |
|
|
|
|
|
padding: const EdgeInsets.all(10), |
|
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
|
borderRadius: const BorderRadius.all( |
|
|
|
|
|
Radius.circular(5), |
|
|
), |
|
|
), |
|
|
|
|
|
color: MyColors.black.withValues(alpha: 0.8), |
|
|
|
|
|
), |
|
|
|
|
|
child: const MyImage( |
|
|
|
|
|
asset: MyAssets.lock, |
|
|
), |
|
|
), |
|
|
), |
|
|
), |
|
|
], |
|
|
|
|
|
), |
|
|
|
|
|
|
|
|
), |
|
|
|
|
|
], |
|
|
), |
|
|
), |
|
|
), |
|
|
), |
|
|
), |
|
|
), |
|
|
MyGradientButton( |
|
|
|
|
|
onTap: () {}, |
|
|
|
|
|
title: shop.isActive == true |
|
|
|
|
|
? context.translate.active |
|
|
|
|
|
: shop.isBuy == true |
|
|
|
|
|
? context.translate.select |
|
|
|
|
|
: '${shop.price?.priceFormat}', |
|
|
|
|
|
icon: shop.isBuy == true ? null : const MyImage(asset: MyAssets.gem), |
|
|
|
|
|
fontSize: 20, |
|
|
|
|
|
type: shop.isActive == true |
|
|
|
|
|
? MyButtonType.activeType |
|
|
|
|
|
: MyButtonType.defaultType, |
|
|
|
|
|
), |
|
|
|
|
|
], |
|
|
|
|
|
), |
|
|
|
|
|
|
|
|
), |
|
|
|
|
|
MyGradientButton( |
|
|
|
|
|
onTap: () {}, |
|
|
|
|
|
title: shop.isActive == true |
|
|
|
|
|
? context.translate.active |
|
|
|
|
|
: shop.isBuy == true |
|
|
|
|
|
? context.translate.select |
|
|
|
|
|
: '${shop.price?.priceFormat}', |
|
|
|
|
|
icon: shop.isBuy == true ? null : const MyImage(asset: MyAssets.gem), |
|
|
|
|
|
fontSize: 20.sp, |
|
|
|
|
|
type: shop.isActive == true |
|
|
|
|
|
? MyButtonType.activeType |
|
|
|
|
|
: MyButtonType.defaultType, |
|
|
|
|
|
), |
|
|
|
|
|
], |
|
|
); |
|
|
); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |