novel_summary_view.dart 876 B

1234567891011121314151617181920212223242526272829303132
  1. import 'package:flutter/material.dart';
  2. class NovelSummaryView extends StatelessWidget {
  3. final String summary;
  4. final bool isUnfold;
  5. final VoidCallback onPressed;
  6. NovelSummaryView(this.summary, this.isUnfold, this.onPressed);
  7. @override
  8. Widget build(BuildContext context) {
  9. return GestureDetector(
  10. onTap: onPressed,
  11. child: Container(
  12. color: Colors.white,
  13. padding: EdgeInsets.fromLTRB(15, 15, 15, 15),
  14. child: Stack(
  15. alignment: AlignmentDirectional.bottomEnd,
  16. children: <Widget>[
  17. Text(
  18. summary,
  19. maxLines: isUnfold ? null : 3,
  20. style: TextStyle(fontSize: 14),
  21. ),
  22. Image.asset('img/detail_fold_bg.png'),
  23. Image.asset(isUnfold ? 'img/detail_up.png' : 'img/detail_down.png'),
  24. ],
  25. ),
  26. ),
  27. );
  28. }
  29. }