YSWalletCollection.dart 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. import 'package:flutter/material.dart';
  2. import 'package:flutter_wallet/base/YSBase.dart';
  3. import 'package:flutter_wallet/generated/l10n.dart';
  4. import 'package:flutter_wallet/login/view/YSHelpView.dart';
  5. import 'package:flutter_wallet/tools/YSColors.dart';
  6. import 'package:flutter_wallet/tools/YSNetWork.dart';
  7. import 'package:flutter_wallet/tools/YSTools.dart';
  8. class YSWalletCollection extends StatefulWidget {
  9. final Map wallet;
  10. const YSWalletCollection({Key? key, required this.wallet}) : super(key: key);
  11. @override
  12. YSWalletCollectionState createState() => YSWalletCollectionState();
  13. }
  14. class YSWalletCollectionState extends State<YSWalletCollection> {
  15. bool _isTips = false;
  16. @override
  17. Widget build(BuildContext context) {
  18. return YSBase2(
  19. ysTitle: S.current.SHOUKUAN,
  20. ysChild: Container(
  21. margin: EdgeInsets.only(left: hsp(20),right: hsp(20)),
  22. decoration: BoxDecoration(
  23. color: YSColors.containColor(context),
  24. borderRadius: const BorderRadius.all(Radius.circular(10))
  25. ),
  26. padding: EdgeInsets.all(hsp(15)),
  27. child: Column(
  28. children: [
  29. if(_isTips==true)YSShowTipsView(tipStr: S.current.GAIDIZHIJINZHICHIBSC,callback: (){
  30. _isTips = false;
  31. setState(() {});
  32. },),
  33. Padding(
  34. padding: EdgeInsets.only(top: hsp(30),bottom: hsp(30)),
  35. child: YSCodeImage.codeImage(widget.wallet['public']),
  36. ),
  37. Container(
  38. width: ysWidth(context),
  39. margin: EdgeInsets.only(bottom: hsp(30)),
  40. decoration: BoxDecoration(
  41. color: YSColors.contain2Color(context),
  42. borderRadius: const BorderRadius.all(Radius.circular(10))
  43. ),
  44. padding: EdgeInsets.all(hsp(15)),
  45. child: Column(
  46. children: [
  47. Text(S.current.JIESHOUDIZHI,style: YSColors.contentStyle(context),),
  48. Text(widget.wallet['public'],style: YSColors.subStyle(context),textAlign: TextAlign.center,)
  49. ],
  50. ),
  51. ),
  52. SizedBox(
  53. height: hsp(50),
  54. child: Row(
  55. children: [
  56. Expanded(child: GestureDetector(
  57. onTap: (){},
  58. behavior: HitTestBehavior.opaque,
  59. child: Align(
  60. alignment: Alignment.center,
  61. child: Row(
  62. mainAxisSize: MainAxisSize.min,
  63. children: [
  64. Image.asset(YSColors.imageStyle(context, '导出 (2)'),height: hsp(15),width: hsp(15),),
  65. Text(' ${S.current.FENXIANG}',style: YSColors.subStyle(context),)
  66. ],
  67. ),
  68. ),
  69. )),
  70. Container(
  71. height: hsp(15),
  72. width: hsp(1),
  73. color: YSColors.lineColor(context),
  74. ),
  75. Expanded(child: GestureDetector(
  76. onTap: (){
  77. YSCopyPaste.copy(widget.wallet['public']);
  78. },
  79. behavior: HitTestBehavior.opaque,
  80. child: Align(
  81. alignment: Alignment.center,
  82. child: Row(
  83. mainAxisSize: MainAxisSize.min,
  84. children: [
  85. Image.asset(YSColors.imageStyle(context, '复制'),height: hsp(15),width: hsp(15),),
  86. Text(' ${S.current.FUZHI}',style: YSColors.subStyle(context),)
  87. ],
  88. ),
  89. ),
  90. ))
  91. ],
  92. ),
  93. )
  94. ],
  95. ),
  96. ),
  97. );
  98. }
  99. }