novel_cover_image.dart 643 B

123456789101112131415161718192021222324
  1. import 'package:flutter/material.dart';
  2. import 'package:cached_network_image/cached_network_image.dart';
  3. import 'package:shuqi/model/sq_color.dart';
  4. class NovelCoverImage extends StatelessWidget {
  5. final String imgUrl;
  6. final double? width;
  7. final double? height;
  8. NovelCoverImage(this.imgUrl, {this.width, this.height});
  9. @override
  10. Widget build(BuildContext context) {
  11. return Container(
  12. child: Image(
  13. image: CachedNetworkImageProvider(imgUrl),
  14. fit: BoxFit.cover,
  15. width: width,
  16. height: height,
  17. ),
  18. decoration: BoxDecoration(border: Border.all(color: SQColor.paper)),
  19. );
  20. }
  21. }