import 'package:flutter/material.dart'; class ConstImage { ConstImage._(); /// main static const String appBottom = "assets/main/app_bottom.png"; static const String pageBg = "assets/main/page_bg.png"; static const String btHomeUnsel = "assets/main/bt_home_unsel.png"; static const String btPlayUnsel = "assets/main/bt_play_unsel.png"; static const String btCollectUnsel = "assets/main/bt_collect_unsel.png"; static const String btMineUnsel = "assets/main/bt_mine_unsel.png"; static const String btHomeSel = "assets/main/bt_home_seled.png"; static const String btPlaySel = "assets/main/bt_play_seled.png"; static const String btCollectSel = "assets/main/bt_collect_seled.png"; static const String btMineSel = "assets/main/bt_mine_seled.png"; static const String spaceImg = "assets/main/space_img.png"; static const String launcher = "assets/main/launcher.png"; /// imgs static const String searchBg = "assets/imgs/search_bg.png"; // home_search top_logo static const String homeSearch = "assets/imgs/home_search.png"; static const String homeTopLogo = "assets/imgs/home_top_logo.png"; static const String homeFirst = "assets/imgs/home_first.png"; static const String homeCurrentTag = "assets/imgs/home_current_tag.png"; static const String homeRank = "assets/imgs/home_rank_bg.png"; // btn_two_bg static const String btnTwoBg = "assets/imgs/btn_two_bg.png"; // cate_bg static const String cateBg = "assets/imgs/cate_bg.png"; // hot static const String hot = "assets/imgs/hot.png"; // btn_bg_rad1 static const String btnBgRad1 = "assets/imgs/btn_bg_rad1.png"; static const String btnBgRad2 = "assets/imgs/btn_bg_rad2.png"; // remove static const String remove = "assets/imgs/remove.png"; static const String homeEyes = "assets/imgs/home_eyes.png"; // home_head static const String homeHead = "assets/imgs/home_head.png"; /// other static const String mineBg = "assets/other/mine_bg.png"; // mine_card about history settings static const String mineCard = "assets/other/mine_card.png"; static const String about = "assets/other/about.png"; static const String history = "assets/other/history.png"; static const String settings = "assets/other/settings.png"; // copy static const String copy = "assets/other/copy.png"; // pricary web_site static const String primary = "assets/other/pricary.png"; static const String webSite = "assets/other/web_site.png"; static const String emptyImg = "assets/other/empty_img.png"; // app_logo static const String appLogo = "assets/other/app_logo.png"; } class HelpImage { static Widget asset( String path, { BoxFit? fit, double? width, double? height, Color? color, bool isDartData = false, String? dartPath, }) { return Image.asset( path, fit: fit, width: width, height: height, color: color, ); } static Widget networkRadius( String path, { BoxFit? fit, double? width, double? height, BoxShape? shape, BorderRadius? borderRadius, Widget? errorWidget, }) { return ClipRRect( borderRadius: borderRadius ?? BorderRadius.circular(3), child: network( path, fit: fit, width: width, height: height, shape: shape, errorWidget: errorWidget, ), ); } /// load network static Widget network( String path, { BoxFit? fit, double? width, double? height, Color? color, BoxShape? shape, BorderRadius? borderRadius, Widget? errorWidget, }) { return FadeInImage.assetNetwork( placeholder: ConstImage.spaceImg, image: path, width: width, height: height, fit: BoxFit.cover, imageErrorBuilder: (context, error, stackTrace) { return asset( ConstImage.spaceImg, fit: BoxFit.fill, width: width, height: height ); }, ); } }