YSCollection.dart 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. import 'package:flutter/material.dart';
  2. import 'package:flutter/cupertino.dart';
  3. import 'package:ysairplane/base/YSBase.dart';
  4. class YSCollection extends StatefulWidget {
  5. @override
  6. _YSCollectionState createState() => _YSCollectionState();
  7. }
  8. class _YSCollectionState extends State<YSCollection> {
  9. @override
  10. Widget build(BuildContext context) {
  11. return YSBase(
  12. ystitle: '收藏',
  13. yschild: Container(
  14. height: MediaQuery.of(context).size.height-MediaQuery.of(context).padding.top-44,
  15. width: MediaQuery.of(context).size.width,
  16. color: Color(0xFFF5F6F8),
  17. child: ListView.separated(
  18. itemBuilder: (context,index){
  19. return Container(
  20. height: 100,
  21. padding: EdgeInsets.all(10),
  22. decoration: BoxDecoration(
  23. color: Colors.white,
  24. borderRadius: BorderRadius.all(Radius.circular(5)),
  25. ),
  26. child: Column(
  27. children: [
  28. Row(
  29. children: [
  30. Container(
  31. height: 50,
  32. width: 50,
  33. decoration: BoxDecoration(
  34. color: Colors.lightBlue,
  35. borderRadius: BorderRadius.all(Radius.circular(5))
  36. ),
  37. ),
  38. Container(
  39. margin: EdgeInsets.only(left: 10),
  40. height: 50,
  41. width: MediaQuery.of(context).size.width-100,
  42. child: Text('最美白头山的夏天最美白头山的夏天',style: TextStyle(fontWeight: FontWeight.bold,fontSize: 16,color: Color(0xFF333333)),overflow: TextOverflow.ellipsis,maxLines: 2,),
  43. )
  44. ],
  45. ),
  46. Container(
  47. margin: EdgeInsets.only(top: 15),
  48. width: MediaQuery.of(context).size.width-40,
  49. child: Text('小精灵小姐 2020-08-14 14:12',style: TextStyle(fontSize: 10,color: Color(0xFF999999))),
  50. )
  51. ],
  52. ),
  53. );
  54. },
  55. separatorBuilder: (context,index){
  56. return Container(
  57. height: 10,
  58. );
  59. },
  60. itemCount: 10,
  61. padding: EdgeInsets.only(top: 10,bottom: 30,left: 10,right: 10),
  62. ),
  63. ),
  64. );
  65. }
  66. }