btn_content.dart 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. import 'package:douyin_demo/providers/recommend_provider.dart';
  2. import 'package:flutter/material.dart';
  3. import 'package:provider/provider.dart';
  4. class BtnContent extends StatelessWidget {
  5. const BtnContent({Key? key}) : super(key: key);
  6. @override
  7. Widget build(BuildContext context) {
  8. RecommendProvider provider = Provider.of<RecommendProvider>(context);
  9. return Container(
  10. child: Column(
  11. mainAxisSize: MainAxisSize.min,
  12. children: [
  13. ListTile(
  14. title: Text(
  15. "@${provider.mainInfo.userName}",
  16. style: TextStyle(color: Colors.white, fontSize: 16),
  17. ),
  18. subtitle: Text(
  19. "${provider.mainInfo.content}",
  20. style: TextStyle(color: Colors.white, fontSize: 16),
  21. maxLines: 3,
  22. overflow: TextOverflow.ellipsis,
  23. ),
  24. ),
  25. Row(
  26. children: [
  27. SizedBox(
  28. width: 10,
  29. ),
  30. Icon(
  31. Icons.music_note,
  32. color: Colors.white,
  33. ),
  34. ],
  35. )
  36. ],
  37. ),
  38. );
  39. }
  40. }