image.dart 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. import 'package:cached_network_image/cached_network_image.dart';
  2. import 'package:flutter/material.dart';
  3. Widget arrowBack() => Image.asset("lib/assets/img/topbar_return.png");
  4. Widget arrowBackWhite() => Image.asset("lib/assets/img/topbar_return_white.png");
  5. Widget arrowLeft({Color? color}) => Image.asset("lib/assets/img/btn_arrow_left.png", color: color,);
  6. Widget arrowRight({Color? color}) => Image.asset("lib/assets/img/btn_arrow_right.png", color: color,);
  7. Widget arrowTop({Color? color}) => Image.asset("lib/assets/img/btn_arrow_top.png", color: color,);
  8. Widget arrowBottom({Color? color}) => Image.asset("lib/assets/img/btn_arrow_bottom.png", color: color,);
  9. Widget arrowRight1() => Image.asset("lib/assets/img/btn_arrow_right1.png");
  10. Widget arrowRight2() => Image.asset("lib/assets/img/btn_arrow_right2.png");
  11. Widget arrowRight4() => Image.asset("lib/assets/img/btn_arrow_right4.png");
  12. Widget arrowRight5() => Image.asset("lib/assets/img/btn_arrow_right5.png");
  13. Widget arrowRight6() => Image.asset("lib/assets/img/btn_arrow_right6.png");
  14. Widget arrowRight7() => Image.asset("lib/assets/img/btn_arrow_right7.png");
  15. Widget arrowBackShoe({Color? color}) => Padding(
  16. padding: const EdgeInsets.only(right: 6.0),
  17. child: Image.asset("lib/assets/img/sdk_gamepop_close.png", height: 22.0, color: color,),
  18. );
  19. ImageProvider<Object> userAvatarProvider(String? url) {
  20. if(url == null || url == ""){
  21. return AssetImage("lib/assets/img/user_default_avatar.png");
  22. }else {
  23. return CachedNetworkImageProvider(url);
  24. }
  25. }
  26. Widget userAvatar(String url) => (url == null || url == "")
  27. ? Image.asset("lib/assets/img/user_default_avatar.png")
  28. : CachedNetworkImage(imageUrl: url);
  29. Widget iconMore() => Image.asset(
  30. "lib/assets/img/topbar_more_white.png",
  31. );
  32. Widget iconMoreGray() => Image.asset(
  33. "lib/assets/img/topbar_more.png",
  34. );
  35. Widget iconClose() => Image.asset(
  36. "lib/assets/img/topbar_cancel.png",
  37. );
  38. final Widget dot = Container(
  39. margin: const EdgeInsets.symmetric(horizontal: 10.0),
  40. width: 2,
  41. height: 2,
  42. color: Color(0xff999999),
  43. );