Browse Source

图片优化

ff_new
w-R 3 years ago
parent
commit
132033c083
  1. 3
      lib/integral_store/integral_store_details_page.dart
  2. 20
      lib/mine/mine_page.dart
  3. 7
      lib/mine/mine_vip/mine_vip_core.dart
  4. 3
      lib/mine/user_info_page.dart
  5. 2
      lib/view_widget/hot_item.dart
  6. 4
      lib/view_widget/icon_text.dart
  7. 4
      lib/view_widget/message_item.dart
  8. 1
      lib/view_widget/mine_vip_view.dart

3
lib/integral_store/integral_store_details_page.dart

@ -12,6 +12,7 @@ import 'package:huixiang/retrofit/data/goods.dart';
import 'package:huixiang/retrofit/data/user_info.dart';
import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/custom_image.dart';
import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
@ -296,7 +297,7 @@ class _IntegralStoreDetailsPage extends State<IntegralStoreDetailsPage> {
itemBuilder: (context, position) {
return goods == null
? Container()
: Image.network(
: MImage(
goods.viceImgPaths.elementAt(position),
fit: BoxFit.cover,
)

20
lib/mine/mine_page.dart

@ -32,7 +32,7 @@ class MinePage extends StatefulWidget {
}
}
class _MinePage extends State<MinePage> with AutomaticKeepAliveClientMixin ,WidgetsBindingObserver{
class _MinePage extends State<MinePage> with AutomaticKeepAliveClientMixin {
ApiService apiService;
UserInfo userInfo;
List<Rank> ranks = [];
@ -55,29 +55,13 @@ class _MinePage extends State<MinePage> with AutomaticKeepAliveClientMixin ,Widg
super.dispose();
if (_refreshController != null)
_refreshController.dispose();
WidgetsBinding.instance.removeObserver(this); //
}
@override
void didChangeAppLifecycleState(AppLifecycleState state) {
print("-didChangeAppLifecycleState-" + state.toString());
switch (state) {
case AppLifecycleState.inactive: //
break;
case AppLifecycleState.resumed: //
querySocialInfo();
break;
case AppLifecycleState.paused: //
break;
case AppLifecycleState.detached: // APP结束时调用
break;
}
}
@override
void initState() {
super.initState();
WidgetsBinding.instance.addObserver(this);
querySocialInfo();
eventBus.on<EventType>().listen((event) {

7
lib/mine/mine_vip/mine_vip_core.dart

@ -152,7 +152,9 @@ class _MineVipCore extends State<MineVipCore> {
@override
Widget build(BuildContext context) {
return Stack(
return Container(
color: Color(0xFFF7F7F7),
child: Stack(
children: [
Container(
// padding: EdgeInsets.only(top: 40.h),
@ -232,6 +234,7 @@ class _MineVipCore extends State<MineVipCore> {
child: Column(
children: [
///
if(ranks.length > 0)
Container(
height: (MediaQuery.of(context).size.width) /
1.78 *
@ -566,8 +569,10 @@ class _MineVipCore extends State<MineVipCore> {
)
],
),
);
}
///vip

3
lib/mine/user_info_page.dart

@ -11,6 +11,7 @@ import 'package:huixiang/retrofit/data/user_info.dart';
import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/utils/flutter_utils.dart';
import 'package:huixiang/view_widget/cupertino_date_picker.dart';
import 'package:huixiang/view_widget/custom_image.dart';
import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:image_pickers/image_pickers.dart';
import 'package:intl/intl.dart';
@ -410,7 +411,7 @@ class _UserInfoPage extends State<UserInfoPage> {
borderRadius: BorderRadius.circular(4),
child: filePath == null || filePath == ""
? (modifyInfo["headimg"] != null && modifyInfo["headimg"] != ""
? Image.network(
? MImage(
modifyInfo["headimg"],
width: 42,
height: 42,

2
lib/view_widget/hot_item.dart

@ -176,7 +176,7 @@ class _HotArticleItem extends State<HotArticleItem> {
child:Stack(
alignment: Alignment.center,
children: [
Image.network(
MImage(
widget.article?.coverImg ?? "",
fit: BoxFit.fill,
height: double.infinity,

4
lib/view_widget/icon_text.dart

@ -1,6 +1,8 @@
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'custom_image.dart';
class IconText extends StatelessWidget {
final String leftImage;
final String rightImage;
@ -48,7 +50,7 @@ class IconText extends StatelessWidget {
widgets.add(Padding(
padding: EdgeInsets.only(left: 2),
child: leftImage.startsWith("http")
? Image.network(
? MImage(
leftImage,
width: iconSize,
height: iconSize,

4
lib/view_widget/message_item.dart

@ -2,6 +2,8 @@ import 'package:flutter/material.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'custom_image.dart';
class MessageItem extends StatefulWidget {
final int stStatus;
@ -19,7 +21,7 @@ class _MessageItemState extends State<MessageItem> {
if (widget.stStatus != 0) checkView(),
Container(
margin: EdgeInsets.only(left: widget.stStatus == 0 ? 16 : 0),
child: Image.network(
child: MImage(
"https://t7.baidu.com/it/u=1297102096,3476971300&fm=193&f=GIF",
width: 44.w,
fit: BoxFit.cover,

1
lib/view_widget/mine_vip_view.dart

@ -331,7 +331,6 @@ class MineVipView extends StatelessWidget {
.pushNamed('/router/mine_vip_core', arguments: {
"rankLevel": curLevel,
"userInfo":userInfo.masterCardRankName,
"createTime": (userInfo != null) ? "${userInfo.createTime}" : "",
"expendAmount": double.tryParse(userInfo?.expendAmount??"0").toInt(),
});

Loading…
Cancel
Save