基础组件库
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 
 

44 行
1.6 KiB

  1. import 'dart:convert';
  2. import 'package:flutter/material.dart';
  3. import 'package:zhiying_comm/util/log/let_log.dart';
  4. import 'package:zhiying_comm/zhiying_comm.dart';
  5. import 'bottom_pic_style.dart';
  6. ////自定义页面底部固定图片
  7. class BottomPic extends StatelessWidget {
  8. final Map<String, dynamic> model;
  9. BottomPic({Key key, this.model}) : super(key: key);
  10. @override
  11. BottomPicStyle style;
  12. Widget build(BuildContext context) {
  13. style = BottomPicStyle.fromJson(json.decode(model['data']));
  14. Logger.log(model['data']);
  15. if (style == null) {
  16. return Container();
  17. }
  18. return GestureDetector(
  19. onTap: () {
  20. RouterUtil.route(SkipModel.fromJson(style.toJson()), style.toJson(), context);
  21. },
  22. child: Container(
  23. margin: EdgeInsets.only(
  24. left: double.tryParse(style?.leftRightMargin ?? "0"), right: double.tryParse(style?.leftRightMargin ?? "0"), top: double.tryParse(style?.topMargin ?? "0"), bottom: 0),
  25. decoration: BoxDecoration(
  26. color: HexColor.fromHex(style?.bgColor ?? ''),
  27. borderRadius: BorderRadius.only(
  28. topLeft: Radius.circular(double.tryParse(style?.topLeftRadius ?? "0")),
  29. topRight: Radius.circular(double.tryParse(style?.topRightRadius ?? "0")),
  30. bottomLeft: Radius.circular(double.tryParse(style?.bottomLeftRadius ?? "0")),
  31. bottomRight: Radius.circular(double.tryParse(style?.bottomRightRadius ?? "0")))),
  32. child: CachedNetworkImage(
  33. imageUrl: style?.bgImage ?? "",
  34. ),
  35. ),
  36. );
  37. }
  38. }