YSExchange.dart 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. import 'package:flutter/cupertino.dart';
  2. import 'package:flutter/material.dart';
  3. import 'package:flutter_wallet/generated/l10n.dart';
  4. import 'package:flutter_wallet/tools/YSColors.dart';
  5. import 'package:flutter_wallet/tools/YSTools.dart';
  6. import 'package:skeletons/skeletons.dart';
  7. import '../login/view/YSHelpView.dart';
  8. import '../shop/YSShop.dart';
  9. class YSExchange extends StatefulWidget {
  10. const YSExchange({Key? key}) : super(key: key);
  11. @override
  12. YSExchangeState createState() => YSExchangeState();
  13. }
  14. class YSExchangeState extends State<YSExchange> {
  15. @override
  16. Widget build(BuildContext context) {
  17. return Scaffold(
  18. backgroundColor: YSColors.backgroundColor(context),
  19. body: GestureDetector(
  20. onTap: (){
  21. FocusScope.of(context).unfocus();
  22. },
  23. behavior: HitTestBehavior.opaque,
  24. child: SingleChildScrollView(
  25. child: SizedBox(
  26. width: ysWidth(context),
  27. height: ysHeight(context)-ystabBarHeight,
  28. child: Skeleton(
  29. isLoading: false,
  30. skeleton: SizedBox(
  31. width: ysWidth(context),
  32. height: ysHeight(context)-ystabBarHeight,
  33. child: Stack(
  34. children: [
  35. Container(
  36. height: hsp(300),
  37. decoration: const BoxDecoration(
  38. borderRadius: BorderRadius.only(bottomLeft: Radius.circular(20),bottomRight: Radius.circular(20)),
  39. color: Colors.grey,
  40. ),
  41. ),
  42. Padding(
  43. padding: EdgeInsets.only(top: hsp(320)),
  44. child: Column(
  45. children: [
  46. Container(
  47. height: hsp(25),
  48. margin: EdgeInsets.only(left: hsp(20),right: hsp(20)),
  49. child: ListView.separated(
  50. itemBuilder: (context,index){
  51. return SkeletonAvatar( style: SkeletonAvatarStyle(width: (ysWidth(context)-hsp(130))/4, height: 25,borderRadius: const BorderRadius.all(Radius.circular(50))));
  52. },
  53. separatorBuilder: (context,index){
  54. return Container(width: hsp(30),);
  55. },
  56. itemCount: 4,
  57. scrollDirection: Axis.horizontal,
  58. ),
  59. ),
  60. Padding(
  61. padding: EdgeInsets.only(top: hsp(20)),
  62. child: SkeletonAvatar( style: SkeletonAvatarStyle(width: ysWidth(context)-hsp(40), height: hsp(50)))
  63. ),
  64. Padding(
  65. padding: EdgeInsets.all(hsp(20)),
  66. child: SkeletonAvatar(
  67. style: SkeletonAvatarStyle(
  68. width: double.infinity,
  69. height: hsp(100)
  70. ),
  71. ),
  72. ),
  73. ],
  74. ),
  75. )
  76. ],
  77. ),
  78. ),
  79. child: Stack(
  80. children: [
  81. const YSHeadView(),
  82. Padding(
  83. padding: EdgeInsets.only(top: ysTOP(context)+hsp(10),left: hsp(20),right: hsp(20)),
  84. child: LayoutBuilder(
  85. builder: (context,conSize){
  86. return Column(
  87. children: [
  88. Container(
  89. height: hsp(30),
  90. margin: EdgeInsets.only(left: hsp(30),right: hsp(30)),
  91. child: Text(S.current.DUIHUAN,style: YSColors.title2Style(context),),
  92. ),
  93. Container(
  94. height: conSize.maxHeight-hsp(30),
  95. padding: EdgeInsets.only(top: hsp(20)),
  96. child: YSChangeView(key: changeKey,),
  97. )
  98. ],
  99. );
  100. },
  101. ),
  102. ),
  103. GestureDetector(
  104. onTap: (){
  105. changeKey.currentState?.change();
  106. },
  107. child: Padding(
  108. padding: EdgeInsets.only(top: ysTOP(context)+hsp(145),left: ysWidth(context)/2-hsp(25)),
  109. child: Transform.rotate(angle: 1.55,child: Image.asset(YSColors.imageStyle(context, '交换 反向'),height: hsp(50),width: hsp(50),),)
  110. ),
  111. )
  112. ],
  113. ),
  114. ),
  115. ),
  116. ),
  117. ),
  118. );
  119. }
  120. }