基础组件库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

wallet_bil.dart 2.2 KiB

4 years ago
4 years ago
4 years ago
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. import 'dart:convert';
  2. import 'package:cached_network_image/cached_network_image.dart';
  3. import 'package:flutter/cupertino.dart';
  4. import 'package:flutter/material.dart';
  5. import 'package:zhiying_base_widget/pages/wallet_page/wallet_detail_page.dart';
  6. import 'package:zhiying_base_widget/widgets/wallet/wallet_bil/model/wallet_bli_model.dart';
  7. import 'package:zhiying_base_widget/widgets/wallet/wallet_income/wallet_income_sk.dart';
  8. import 'package:zhiying_comm/zhiying_comm.dart';
  9. ///查看明细部件
  10. class WalletBil extends StatelessWidget {
  11. Map<String, dynamic> data;
  12. WalletBil(this.data, {Key key}) : super(key: key);
  13. @override
  14. Widget build(BuildContext context) {
  15. WalletBilModel model;
  16. if (data != null) {
  17. model = WalletBilModel.fromJson(json.decode(data['data']));
  18. }
  19. return data == null
  20. ? WalletIncomeSkeleton()
  21. : GestureDetector(
  22. onTap: () {
  23. Navigator.push(
  24. context,
  25. CupertinoPageRoute(
  26. builder: (context) => WalletDetailPage(),
  27. ),
  28. );
  29. },
  30. child: Container(
  31. decoration: BoxDecoration(
  32. color: Colors.white,
  33. borderRadius: BorderRadius.circular(8)),
  34. margin: EdgeInsets.only(left: 12.5, right: 12.5, top: 10),
  35. child: ListTile(
  36. title: Row(
  37. mainAxisSize: MainAxisSize.min,
  38. children: <Widget>[
  39. CachedNetworkImage(
  40. imageUrl: model.bilIcon,
  41. width: 36.w,
  42. height: 36.w,
  43. fit: BoxFit.fill,
  44. ),
  45. SizedBox(
  46. width: 15.w,
  47. ),
  48. Text(
  49. model.bilText,
  50. style: TextStyle(fontSize: 24.sp),
  51. ),
  52. ],
  53. ),
  54. trailing: Text(
  55. model.skipText,
  56. style: TextStyle(color: Colors.grey),
  57. ),
  58. )),
  59. );
  60. }
  61. }