YSWalletTokenChoose.dart 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. import 'package:flutter/material.dart';
  2. import 'package:flutter_wallet/base/YSBase.dart';
  3. import 'package:flutter_wallet/tools/YSRefrehLoad.dart';
  4. import 'package:flutter_wallet/tools/YSTools.dart';
  5. import 'package:flutter_wallet/wallet/view/YSWalletListItemView.dart';
  6. class YSWalletTokenChoose extends StatefulWidget {
  7. const YSWalletTokenChoose({Key? key}) : super(key: key);
  8. @override
  9. YSWalletTokenChooseState createState() => YSWalletTokenChooseState();
  10. }
  11. class YSWalletTokenChooseState extends State<YSWalletTokenChoose> {
  12. List _dataArray = [];
  13. @override
  14. Widget build(BuildContext context) {
  15. return YSBase(
  16. ysTitle: '资产',
  17. ysChild: Container(
  18. height: ysHeight(context),
  19. width: ysWidth(context),
  20. child: YSRefreshLoad(
  21. url: 'tokens',
  22. request: {'chain_id':YSData().typeId},
  23. postData: (value) {
  24. _dataArray = value;
  25. setState(() {});
  26. },
  27. isLoading: true,
  28. child: ListView.builder(
  29. itemBuilder: (context, index) {
  30. Map item = _dataArray[index];
  31. return YSWalletListChooseItemView(item: item,);
  32. },
  33. itemCount: _dataArray.length,
  34. padding: const EdgeInsets.all(0),
  35. shrinkWrap: true,
  36. physics: const NeverScrollableScrollPhysics(),
  37. ),
  38. ),
  39. ),
  40. );
  41. }
  42. }