diff --git a/lib/base/base_style.dart b/lib/base/base_style.dart index c212bb23..216b680b 100644 --- a/lib/base/base_style.dart +++ b/lib/base/base_style.dart @@ -4,27 +4,27 @@ import 'package:akuCommunity/utils/screenutil.dart'; class BaseStyle { ///字体类 - static final double fontSize18 = Screenutil.size(18); + static final double fontSize18 = 18.sp; - static final double fontSize22 = Screenutil.size(22); + static final double fontSize22 = 22.sp; - static final double fontSize24 = Screenutil.size(24); + static final double fontSize24 = 24.sp; - static final double fontSize26 = Screenutil.size(26); + static final double fontSize26 = 26.sp; - static final double fontSize28 = Screenutil.size(28); + static final double fontSize28 = 28.sp; - static final double fontSize30 = Screenutil.size(30); + static final double fontSize30 = 30.sp; - static final double fontSize32 = Screenutil.size(32); + static final double fontSize32 = 32.sp; - static final double fontSize34 = Screenutil.size(34); + static final double fontSize34 = 34.sp; - static final double fontSize36 = Screenutil.size(36); + static final double fontSize36 = 36.sp; - static final double fontSize38 = Screenutil.size(38); + static final double fontSize38 = 38.sp; - static final double fontSize52 = Screenutil.size(52); + static final double fontSize52 = 52.sp; ///颜色 static final Color color333333 = Color(0xff333333); diff --git a/lib/pages/activities_page/activities_details_page/activities_details_page.dart b/lib/pages/activities_page/activities_details_page/activities_details_page.dart index cd7ebf13..b896e474 100644 --- a/lib/pages/activities_page/activities_details_page/activities_details_page.dart +++ b/lib/pages/activities_page/activities_details_page/activities_details_page.dart @@ -93,7 +93,7 @@ class _ActivitiesDetailsPageState extends State { title: Text( '是否确定投${url}一票', style: TextStyle( - fontSize: Screenutil.size(34), + fontSize: 34.sp, color: Color(0xff030303), ), ), @@ -102,7 +102,7 @@ class _ActivitiesDetailsPageState extends State { child: Text( '取消', style: TextStyle( - fontSize: Screenutil.size(34), + fontSize: 34.sp, color: Color(0xff333333), ), ), @@ -115,7 +115,7 @@ class _ActivitiesDetailsPageState extends State { '确定', style: TextStyle( fontWeight: FontWeight.w600, - fontSize: Screenutil.size(34), + fontSize: 34.sp, color: Color(0xffff8200), ), ), @@ -143,9 +143,9 @@ class _ActivitiesDetailsPageState extends State { setState(() {}); }, child: Container( - margin: EdgeInsets.only(top: Screenutil.length(39)), + margin: EdgeInsets.only(top: 39.w), padding: EdgeInsets.only( - left: Screenutil.length(41), bottom: Screenutil.length(40)), + left: 41.w, bottom: 40.w), decoration: BoxDecoration( border: Border( bottom: BorderSide(color: BaseStyle.colord8d8d8, width: 0.5), @@ -156,7 +156,7 @@ class _ActivitiesDetailsPageState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - height: Screenutil.length(150), + height: 150.w, alignment: Alignment.center, child: Icon( isOver @@ -169,20 +169,20 @@ class _ActivitiesDetailsPageState extends State { : _listView[index]['isCheck'] ? Colors.red : BaseStyle.color979797, - size: Screenutil.length(36), + size: 36.w, ), ), Container( margin: EdgeInsets.only( - left: Screenutil.length(17), - right: Screenutil.length(30), + left: 17.w, + right: 30.w, ), child: ClipRRect( borderRadius: BorderRadius.all(Radius.circular(4)), child: CachedImageWrapper( url: imagePath, - width: Screenutil.length(150), - height: Screenutil.length(150), + width: 150.w, + height: 150.w, ), ), ), @@ -197,7 +197,7 @@ class _ActivitiesDetailsPageState extends State { color: BaseStyle.color333333, ), ), - SizedBox(height: Screenutil.length(10)), + SizedBox(height: 10.w), Text( name, style: TextStyle( @@ -219,7 +219,7 @@ class _ActivitiesDetailsPageState extends State { Navigator.pushNamed(context, PageName.member_list_page.toString()); }, child: Container( - padding: EdgeInsets.only(bottom: Screenutil.length(24)), + padding: EdgeInsets.only(bottom: 24.w), decoration: BoxDecoration( border: Border( bottom: BorderSide(color: BaseStyle.coloreeeeee, width: 0.5)), @@ -228,10 +228,10 @@ class _ActivitiesDetailsPageState extends State { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Container( - margin: EdgeInsets.only(left: Screenutil.length(80)), + margin: EdgeInsets.only(left: 80.w), child: ImageStack( imageList: memberList, - imageRadius: Screenutil.size(44), + imageRadius: 44.sp, imageCount: 3, imageBorderWidth: 1, totalCount: 3, @@ -240,7 +240,7 @@ class _ActivitiesDetailsPageState extends State { Row( children: [ Container( - margin: EdgeInsets.only(right: Screenutil.length(16)), + margin: EdgeInsets.only(right: 16.w), child: Text( '已有${320}人参加', style: TextStyle( @@ -250,7 +250,7 @@ class _ActivitiesDetailsPageState extends State { ), Icon( AntDesign.right, - size: Screenutil.size(36), + size: 36.sp, color: BaseStyle.color999999, ), ], @@ -276,15 +276,14 @@ class _ActivitiesDetailsPageState extends State { color: Colors.white, child: ListView( padding: EdgeInsets.only( - bottom: Screenutil.length( - widget.bundle.getMap('details')['isVote'] ? 0 : 170)), + bottom: ( widget.bundle.getMap('details')['isVote'] ? 0 : 170).w), children: [ Container( padding: EdgeInsets.only( - top: Screenutil.length(26), - left: Screenutil.length(32), - right: Screenutil.length(32), - bottom: Screenutil.length(60)), + top: 26.w, + left: 32.w, + right: 32.w, + bottom: 60.w), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -296,19 +295,19 @@ class _ActivitiesDetailsPageState extends State { fontWeight: FontWeight.w600), ), Container( - margin: EdgeInsets.only(top: Screenutil.length(45)), + margin: EdgeInsets.only(top: 45.w), child: ClipRRect( borderRadius: BorderRadius.all(Radius.circular(6)), child: CachedImageWrapper( url: widget.bundle.getMap('details')['imagePath'], - width: Screenutil.length(686), - height: Screenutil.length(228), + width: 686.w, + height: 228.w, ), ), ), Container( - margin: EdgeInsets.only(top: Screenutil.length(44)), - width: Screenutil.length(647), + margin: EdgeInsets.only(top: 44.w), + width: 647.w, child: Html( data: widget.bundle.getMap('details')['isVote'] ? htmlData @@ -320,23 +319,23 @@ class _ActivitiesDetailsPageState extends State { widget.bundle.getMap('details')['isVote'] ? SizedBox() : SizedBox( - height: Screenutil.length(24), + height: 24.w, child: Container(color: BaseStyle.colorf9f9f9), ), Container( padding: EdgeInsets.only( - top: Screenutil.length(26), - left: Screenutil.length(32), - right: Screenutil.length(32), - bottom: Screenutil.length(60)), + top: 26.w, + left: 32.w, + right: 32.w, + bottom: 60.w), child: widget.bundle.getMap('details')['isVote'] ? Container( - margin: EdgeInsets.only(top: Screenutil.length(44)), + margin: EdgeInsets.only(top: 44.w), padding: EdgeInsets.only( - top: Screenutil.length(50), - left: Screenutil.length(32), - right: Screenutil.length(25)), - width: Screenutil.length(686), + top: 50.w, + left: 32.w, + right: 25.w), + width: 686.w, decoration: BoxDecoration( color: BaseStyle.colorf3f3f3, borderRadius: BorderRadius.all(Radius.circular(6)), @@ -354,7 +353,7 @@ class _ActivitiesDetailsPageState extends State { ), Container( padding: - EdgeInsets.only(left: Screenutil.length(3)), + EdgeInsets.only(left: 3.w), child: Column( children: _listView .asMap() diff --git a/lib/pages/activities_page/member_list_page/member_list_page.dart b/lib/pages/activities_page/member_list_page/member_list_page.dart index 36fc4866..c37a47d8 100644 --- a/lib/pages/activities_page/member_list_page/member_list_page.dart +++ b/lib/pages/activities_page/member_list_page/member_list_page.dart @@ -101,12 +101,12 @@ class _MemberListPageState extends State { Container _memberCard(String imagePath, name, phone) { return Container( padding: EdgeInsets.only( - top: Screenutil.length(18), - bottom: Screenutil.length(18), - left: Screenutil.length(20), - right: Screenutil.length(10), + top: 18.w, + bottom: 18.w, + left: 20.w, + right: 10.w, ), - margin: EdgeInsets.symmetric(horizontal: Screenutil.length(32)), + margin: EdgeInsets.symmetric(horizontal: 32.w), decoration: BoxDecoration( border: Border( bottom: BorderSide(color: BaseStyle.coloreeeeee, width: 0.5)), @@ -117,12 +117,12 @@ class _MemberListPageState extends State { Row( children: [ Container( - margin: EdgeInsets.only(right: Screenutil.length(18)), + margin: EdgeInsets.only(right: 18.w), child: ClipOval( child: CachedImageWrapper( url: imagePath, - width: Screenutil.length(60), - height: Screenutil.length(60), + width: 60.w, + height: 60.w, ), ), ), diff --git a/lib/pages/address_page/address_edit_page.dart b/lib/pages/address_page/address_edit_page.dart index 853d3aa4..f0a17528 100644 --- a/lib/pages/address_page/address_edit_page.dart +++ b/lib/pages/address_page/address_edit_page.dart @@ -22,10 +22,10 @@ class _AddressEditPageState extends State { Widget _containerSelectDefault() { return Container( color: Colors.white, - height: Screenutil.length(96), + height: 96.w, padding: EdgeInsets.symmetric( - vertical: Screenutil.length(28), - horizontal: Screenutil.length(32), + vertical: 28.w, + horizontal: 32.w, ), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, @@ -33,7 +33,7 @@ class _AddressEditPageState extends State { Text( '设为默认地址', style: TextStyle( - fontSize: Screenutil.size(28), + fontSize: 28.sp, color: Color(0xff333333), ), ), @@ -63,16 +63,16 @@ class _AddressEditPageState extends State { onTap: () {}, child: Container( color: Colors.white, - height: Screenutil.length(96), + height: 96.w, padding: EdgeInsets.symmetric( - vertical: Screenutil.length(28), - horizontal: Screenutil.length(32), + vertical: 28.w, + horizontal: 32.w, ), alignment: Alignment.center, child: Text( '删除地址', style: TextStyle( - fontSize: Screenutil.size(28), + fontSize: 28.sp, color: Color(0xffe60e0e), ), ), @@ -113,9 +113,9 @@ class _AddressEditPageState extends State { ], ), ), - SizedBox(height: Screenutil.length(66)), + SizedBox(height: 66.w), _containerSelectDefault(), - SizedBox(height: Screenutil.length(66)), + SizedBox(height: 66.w), widget.bundle.getMap('details')['isDelete'] ? _containerDelete() : SizedBox(), diff --git a/lib/pages/address_page/widget/address_edit_item.dart b/lib/pages/address_page/widget/address_edit_item.dart index 84c99bc7..f98171e1 100644 --- a/lib/pages/address_page/widget/address_edit_item.dart +++ b/lib/pages/address_page/widget/address_edit_item.dart @@ -53,36 +53,36 @@ class _AddressEditItemState extends State { ? TextInputType.number : TextInputType.name, cursorColor: Color(0xffffc40c), - style: TextStyle(fontSize: Screenutil.size(28)), + style: TextStyle(fontSize: 28.sp), controller: item['controller'], onChanged: (String value) {}, maxLines: item['title'] == '详细地址' ? 5 : 1, decoration: InputDecoration( contentPadding: EdgeInsets.only( - right: Screenutil.length(32), - top: Screenutil.length(28), - bottom: Screenutil.length(28), + right: 32.w, + top: 28.w, + bottom: 28.w, ), hintText: item['hintText'], border: InputBorder.none, //去掉输入框的下滑线 fillColor: Colors.white, filled: true, hintStyle: TextStyle( - color: Color(0xff999999), fontSize: Screenutil.size(28)), + color: Color(0xff999999), fontSize: 28.sp), prefixIcon: Padding( padding: EdgeInsets.only( - left: Screenutil.length(32), + left: 32.w, right: - Screenutil.length(item['title'] == '收货人' ? 88 : 60), - top: Screenutil.length(28), + (item['title'] == '收货人' ? 88 : 60).w, + top: 28.w, bottom: - Screenutil.length(item['title'] == '详细地址' ? 158 : 28), + (item['title'] == '详细地址' ? 158 : 28).w, ), child: Text( item['title'], style: TextStyle( color: Color(0xff333333), - fontSize: Screenutil.size(28), + fontSize: 28.sp, fontWeight: FontWeight.w500, ), ), diff --git a/lib/pages/address_page/widget/address_item.dart b/lib/pages/address_page/widget/address_item.dart index 470ff0b3..aa921751 100644 --- a/lib/pages/address_page/widget/address_item.dart +++ b/lib/pages/address_page/widget/address_item.dart @@ -15,12 +15,12 @@ class AddressItem extends StatelessWidget { Widget _containerImage() { return Container( alignment: Alignment.center, - width: Screenutil.length(76), - height: Screenutil.length(76), + width: 76.w, + height: 76.w, margin: EdgeInsets.only( - right: Screenutil.length(20), + right: 20.w, ), - padding: EdgeInsets.symmetric(vertical: Screenutil.length(12)), + padding: EdgeInsets.symmetric(vertical: 12.w), decoration: BoxDecoration( gradient: LinearGradient( begin: Alignment.centerLeft, @@ -29,7 +29,7 @@ class AddressItem extends StatelessWidget { ? [Color(0xffffd000), Color(0xffff8500)] : [Color(0xffd8d8d8), Color(0xffd8d8d8)], ), - borderRadius: BorderRadius.all(Radius.circular(Screenutil.length(76))), + borderRadius: BorderRadius.all(Radius.circular(76.w)), ), child: Icon(SimpleLineIcons.location_pin, color: Colors.white), ); @@ -45,23 +45,23 @@ class AddressItem extends StatelessWidget { Text( name, style: TextStyle( - fontSize: Screenutil.size(28), + fontSize: 28.sp, color: Color(0xff333333), ), ), - SizedBox(width: Screenutil.length(20)), + SizedBox(width: 20.w), Text( phone, style: TextStyle( - fontSize: Screenutil.size(24), + fontSize: 24.sp, color: Color(0xff999999), ), ), ], ), - SizedBox(height: Screenutil.length(12)), + SizedBox(height: 12.w), Container( - width: Screenutil.length(432), + width: 432.w, child: ExtendedText.rich( TextSpan( children: [ @@ -69,7 +69,7 @@ class AddressItem extends StatelessWidget { ? ExtendedWidgetSpan( child: Container( margin: - EdgeInsets.only(right: Screenutil.length(16)), + EdgeInsets.only(right: 16.w), decoration: BoxDecoration( color: Color(0xfffff7d2), border: Border.all( @@ -77,13 +77,13 @@ class AddressItem extends StatelessWidget { borderRadius: BorderRadius.all(Radius.circular(4))), padding: EdgeInsets.symmetric( - horizontal: Screenutil.length(20), - vertical: Screenutil.length(4), + horizontal: 20.w, + vertical: 4.w, ), child: Text( '默认', style: TextStyle( - fontSize: Screenutil.size(24), + fontSize: 24.sp, color: Color(0xff333333), ), ), @@ -93,7 +93,7 @@ class AddressItem extends StatelessWidget { TextSpan( text: address, style: TextStyle( - fontSize: Screenutil.size(24), + fontSize: 24.sp, color: Color(0xff999999), height: 1.5), ) @@ -111,7 +111,7 @@ class AddressItem extends StatelessWidget { Widget _positionedEdit(BuildContext context) { return Positioned( right: 0, - top: Screenutil.length(55), + top: 55.w, child: InkWell( onTap: () { Navigator.pushNamed(context, PageName.address_edit_page.toString(), @@ -126,19 +126,19 @@ class AddressItem extends StatelessWidget { }, child: Row( children: [ - SizedBox(width: Screenutil.length(13)), + SizedBox(width: 13.w), SizedBox( width: 1, - height: Screenutil.length(30), + height: 30.w, child: DecoratedBox( decoration: BoxDecoration(color: Color(0xffd8d8d8)), ), ), - SizedBox(width: Screenutil.length(13)), + SizedBox(width: 13.w), Text( '编辑', style: TextStyle( - fontSize: Screenutil.size(24), + fontSize: 24.sp, color: Color(0xff999999), ), ), @@ -156,13 +156,13 @@ class AddressItem extends StatelessWidget { borderRadius: BorderRadius.all(Radius.circular(8)), ), margin: EdgeInsets.only( - left: Screenutil.length(32), - right: Screenutil.length(32), - top: Screenutil.length(20), + left: 32.w, + right: 32.w, + top: 20.w, ), padding: EdgeInsets.symmetric( - horizontal: Screenutil.length(20), - vertical: Screenutil.length(32), + horizontal: 20.w, + vertical: 32.w, ), child: Stack( children: [ diff --git a/lib/pages/certification_page/certification_page.dart b/lib/pages/certification_page/certification_page.dart index 0b3c2ecd..7fa16b29 100644 --- a/lib/pages/certification_page/certification_page.dart +++ b/lib/pages/certification_page/certification_page.dart @@ -37,10 +37,10 @@ class _CertificationPageState extends State { Widget _idCardType() { return Container( padding: EdgeInsets.only( - top: Screenutil.length(23), - bottom: Screenutil.length(24), + top: 23.w, + bottom: 24.w, ), - margin: EdgeInsets.only(bottom: Screenutil.length(60)), + margin: EdgeInsets.only(bottom: 60.w), decoration: BoxDecoration( border: Border(bottom: BorderSide(color: Color(0xffeeeeee), width: 0.5)), @@ -51,15 +51,15 @@ class _CertificationPageState extends State { Text( '证件类型', style: TextStyle( - fontSize: Screenutil.size(28), color: Color(0xff333333)), + fontSize: 28.sp, color: Color(0xff333333)), ), - SizedBox(height: Screenutil.length(25)), + SizedBox(height: 25.w), Container( - width: Screenutil.length(686), + width: 686.w, child: Text( '身份证', style: TextStyle( - fontSize: Screenutil.size(36), + fontSize: 36.sp, color: Color(0xff333333), fontWeight: FontWeight.w600, ), @@ -73,19 +73,19 @@ class _CertificationPageState extends State { Widget _upLoadImage() { return Container( padding: EdgeInsets.only( - top: Screenutil.length(23), - bottom: Screenutil.length(24), + top: 23.w, + bottom: 24.w, ), - margin: EdgeInsets.only(bottom: Screenutil.length(60)), + margin: EdgeInsets.only(bottom: 60.w), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( '上传证件照片', style: TextStyle( - fontSize: Screenutil.size(28), color: Color(0xff333333)), + fontSize: 28.sp, color: Color(0xff333333)), ), - SizedBox(height: Screenutil.length(25)), + SizedBox(height: 25.w), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: List.generate( @@ -104,10 +104,10 @@ class _CertificationPageState extends State { Widget _input(String title, hintText, TextEditingController controller) { return Container( padding: EdgeInsets.only( - top: Screenutil.length(23), - bottom: Screenutil.length(24), + top: 23.w, + bottom: 24.w, ), - margin: EdgeInsets.only(bottom: Screenutil.length(60)), + margin: EdgeInsets.only(bottom: 60.w), decoration: BoxDecoration( border: Border(bottom: BorderSide(color: Color(0xffeeeeee), width: 0.5)), @@ -118,9 +118,9 @@ class _CertificationPageState extends State { Text( title, style: TextStyle( - fontSize: Screenutil.size(28), color: Color(0xff333333)), + fontSize: 28.sp, color: Color(0xff333333)), ), - SizedBox(height: Screenutil.length(25)), + SizedBox(height: 25.w), CommonInput(inputController: controller, hintText: hintText) ], ), @@ -131,10 +131,10 @@ class _CertificationPageState extends State { return InkWell( child: Container( alignment: Alignment.center, - height: Screenutil.length(96), - width: Screenutil.length(686), + height: 96.w, + width: 686.w, padding: EdgeInsets.symmetric( - vertical: Screenutil.length(26), + vertical: 26.w, ), decoration: BoxDecoration( color: Color(0xffffc40c), @@ -143,7 +143,7 @@ class _CertificationPageState extends State { '确认提交', style: TextStyle( fontWeight: FontWeight.w600, - fontSize: Screenutil.size(32), + fontSize: 32.sp, color: Color(0xff333333)), ), ), @@ -161,9 +161,9 @@ class _CertificationPageState extends State { ), body: Container( padding: EdgeInsets.only( - top: Screenutil.length(32), - left: Screenutil.length(32), - right: Screenutil.length(32), + top: 32.w, + left: 32.w, + right: 32.w, ), color: Colors.white, child: ListView( diff --git a/lib/pages/common/common_page.dart b/lib/pages/common/common_page.dart index 5160ab16..86cb5714 100644 --- a/lib/pages/common/common_page.dart +++ b/lib/pages/common/common_page.dart @@ -145,11 +145,11 @@ class _CommonPageState extends State { showSearch(context: context, delegate: searchBarDelegate()); }, child: Container( - margin: EdgeInsets.only(right: Screenutil.length(32)), + margin: EdgeInsets.only(right: 32.w), padding: EdgeInsets.only( - left: Screenutil.length(40), - top: Screenutil.length(15), - bottom: Screenutil.length(15)), + left: 40.w, + top: 15.w, + bottom: 15.w), decoration: BoxDecoration( color: BaseStyle.colorf3f3f3, borderRadius: BorderRadius.all(Radius.circular(36)), @@ -179,7 +179,7 @@ class _CommonPageState extends State { backgroundColor: Color(0xffffffff), leading: InkWell( onTap: () => Navigator.pop(context), - child: Icon(AntDesign.left, size: Screenutil.size(40)), + child: Icon(AntDesign.left, size: 40.sp), ), centerTitle: true, title: Builder(builder: (_) { @@ -195,7 +195,7 @@ class _CommonPageState extends State { : widget.bundle.getMap('commentMap')['title'], style: TextStyle( fontWeight: FontWeight.w600, - fontSize: Screenutil.size(32), + fontSize: 32.sp, color: Color(0xff333333), ), ); @@ -249,7 +249,7 @@ class _CommonPageState extends State { } }, child: Container( - margin: EdgeInsets.only(right: Screenutil.length(32)), + margin: EdgeInsets.only(right: 32.w), child: Row( crossAxisAlignment: CrossAxisAlignment.center, children: [ @@ -294,7 +294,7 @@ class _CommonPageState extends State { return Text( title, style: TextStyle( - fontSize: Screenutil.size(28), + fontSize: 28.sp, color: Color(0xff333333), ), ); diff --git a/lib/pages/community/community_index.dart b/lib/pages/community/community_index.dart index ce71e147..43df68b2 100644 --- a/lib/pages/community/community_index.dart +++ b/lib/pages/community/community_index.dart @@ -74,7 +74,7 @@ class _CommunityIndexState extends State indicatorWeight: 2.0, indicatorSize: TabBarIndicatorSize.label, labelStyle: TextStyle( - fontSize: Screenutil.size(28), + fontSize: 28.sp, color: Color(0xff333333), fontWeight: FontWeight.w600, ), @@ -96,7 +96,7 @@ class _CommunityIndexState extends State child: Icon( Icons.add, color: Colors.white, - size: Screenutil.size(40), + size: 40.sp, ), onPressed: noteCreateRouter, ); diff --git a/lib/pages/community/note_create_page.dart b/lib/pages/community/note_create_page.dart index f7b5c911..afc8991f 100644 --- a/lib/pages/community/note_create_page.dart +++ b/lib/pages/community/note_create_page.dart @@ -34,19 +34,19 @@ class _NoteCreatePageState extends State { title: Text( '社区', style: TextStyle( - fontSize: Screenutil.size(36), + fontSize: 36.sp, color: Color(0xff333333), ), ), leading: InkWell( onTap: () => Navigator.pop(context), child: Container( - padding: EdgeInsets.only(left: Screenutil.length(32)), + padding: EdgeInsets.only(left: 32.w), alignment: Alignment.center, child: Text( '取消', style: TextStyle( - fontSize: Screenutil.size(34), + fontSize: 34.sp, color: Color(0xff030303), ), ), @@ -55,12 +55,12 @@ class _NoteCreatePageState extends State { actions: [ Container( alignment: Alignment.center, - padding: EdgeInsets.only(right: Screenutil.length(32)), + padding: EdgeInsets.only(right: 32.w), child: InkWell( onTap: () {}, child: Container( - height: Screenutil.length(64), - width: Screenutil.length(116), + height: 64.w, + width: 116.w, alignment: Alignment.center, decoration: BoxDecoration( color: Color(0xffffd000), @@ -69,7 +69,7 @@ class _NoteCreatePageState extends State { child: Text( '发表', style: TextStyle( - fontSize: Screenutil.size(34), + fontSize: 34.sp, color: Color(0xff030303), ), ), @@ -85,7 +85,7 @@ class _NoteCreatePageState extends State { child: TextFormField( cursorColor: Color(0xffffc40c), style: TextStyle( - fontSize: Screenutil.size(34), + fontSize: 34.sp, ), controller: _noteContent, onChanged: (String value) {}, @@ -93,8 +93,8 @@ class _NoteCreatePageState extends State { decoration: InputDecoration( isDense: true, contentPadding: EdgeInsets.only( - top: Screenutil.length(0), - bottom: Screenutil.length(0), + top: 0.w, + bottom: 0.w, ), hintText: hintText, border: InputBorder.none, //去掉输入框的下滑线 @@ -102,7 +102,7 @@ class _NoteCreatePageState extends State { filled: true, hintStyle: TextStyle( color: Color(0xff999999), - fontSize: Screenutil.size(34), + fontSize: 34.sp, fontWeight: FontWeight.normal, ), ), @@ -114,8 +114,8 @@ class _NoteCreatePageState extends State { return InkWell( onTap: () {}, child: Container( - width: Screenutil.length(196), - height: Screenutil.length(196), + width: 196.w, + height: 196.w, decoration: BoxDecoration( color: Colors.white, image: DecorationImage( @@ -134,7 +134,7 @@ class _NoteCreatePageState extends State { }); }, child: Container( - padding: EdgeInsets.symmetric(vertical: Screenutil.length(30)), + padding: EdgeInsets.symmetric(vertical: 30.w), decoration: BoxDecoration( border: Border( top: BorderSide(color: Color(0xffd8d8d8), width: 1), @@ -150,13 +150,13 @@ class _NoteCreatePageState extends State { Icon( AntDesign.message1, color: Color(0xff333333), - size: Screenutil.size(28), + size: 28.sp, ), - SizedBox(width: Screenutil.length(10)), + SizedBox(width: 10.w), Text( '不可评论', style: TextStyle( - fontSize: Screenutil.size(28), + fontSize: 28.sp, color: Color(0xff333333), ), ), @@ -166,9 +166,9 @@ class _NoteCreatePageState extends State { ? Icon( AntDesign.check, color: Color(0xffffd003), - size: Screenutil.size(40), + size: 40.sp, ) - : SizedBox(height: Screenutil.size(40)), + : SizedBox(height: 40.sp), ], ), ), @@ -177,20 +177,20 @@ class _NoteCreatePageState extends State { Wrap _wrapThemeList() { return Wrap( - spacing: Screenutil.length(15), - runSpacing: Screenutil.length(20), + spacing: 15.w, + runSpacing: 20.w, children: _themeList .asMap() .keys .map((index) => index == 0 ? Container( - padding: EdgeInsets.only(top: Screenutil.length(10)), - width: Screenutil.length(156), + padding: EdgeInsets.only(top: 10.w), + width: 156.w, alignment: Alignment.centerLeft, child: Text( _themeList[index]['title'], style: TextStyle( - fontSize: Screenutil.size(34), + fontSize: 34.sp, color: Color(0xff333333), ), ), @@ -216,13 +216,13 @@ class _NoteCreatePageState extends State { width: 0.5), borderRadius: BorderRadius.all(Radius.circular(36))), padding: EdgeInsets.symmetric( - horizontal: Screenutil.length(29), - vertical: Screenutil.length(13), + horizontal: 29.w, + vertical: 13.w, ), child: Text( _themeList[index]['title'], style: TextStyle( - fontSize: Screenutil.size(34), + fontSize: 34.sp, color: _themeList[index]['isSelect'] ? Color(0xff333333) : Color(0xff999999), @@ -251,18 +251,18 @@ class _NoteCreatePageState extends State { }, child: Container( padding: EdgeInsets.only( - top: Screenutil.length(49), - left: Screenutil.length(62), - right: Screenutil.length(62), + top: 49.w, + left: 62.w, + right: 62.w, ), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ _containerTextField(), _containerAddImage(), - SizedBox(height: Screenutil.length(202)), + SizedBox(height: 202.w), _inkWellSelect(), - SizedBox(height: Screenutil.length(28)), + SizedBox(height: 28.w), _wrapThemeList(), ], ), diff --git a/lib/pages/community/topice_detail_page.dart b/lib/pages/community/topice_detail_page.dart index eba4dafc..8f2173c5 100644 --- a/lib/pages/community/topice_detail_page.dart +++ b/lib/pages/community/topice_detail_page.dart @@ -52,13 +52,13 @@ class _TopiceDetailPageState extends State { SliverAppBar _sliverAppBar(String imagePath) { return SliverAppBar( - expandedHeight: Screenutil.length(500), + expandedHeight: 500.w, pinned: true, floating: true, elevation: 0, backgroundColor: Colors.white, leading: IconButton( - icon: Icon(AntDesign.left, size: Screenutil.size(40)), + icon: Icon(AntDesign.left, size: 40.sp), onPressed: () { Navigator.pop(context); }, @@ -75,14 +75,14 @@ class _TopiceDetailPageState extends State { Positioned _positionedFloatActionButton(){ return Positioned( - bottom: Screenutil.length(124), - right: Screenutil.length(32), + bottom: 124.w, + right: 32.w, child: FloatingActionButton( backgroundColor: Color(0xffffd000), child: Icon( Icons.add, color: Colors.white, - size: Screenutil.size(40), + size: 40.sp, ), onPressed: noteCreateRouter, )); diff --git a/lib/pages/community/widget/tab_list.dart b/lib/pages/community/widget/tab_list.dart index d28fbd06..333418f4 100644 --- a/lib/pages/community/widget/tab_list.dart +++ b/lib/pages/community/widget/tab_list.dart @@ -168,7 +168,7 @@ class _TabListState extends State with AutomaticKeepAliveClientMixin { hotNum: _topicList[index]['hotNum'], ) : Container( - margin: EdgeInsets.only(top: Screenutil.length(32)), + margin: EdgeInsets.only(top: 32.w), child: CircleTrend( title: _circleList[index]['title'], contentList: _circleList[index]['contentList'], diff --git a/lib/pages/community/widget/topic_card.dart b/lib/pages/community/widget/topic_card.dart index f7871ca4..4e931713 100644 --- a/lib/pages/community/widget/topic_card.dart +++ b/lib/pages/community/widget/topic_card.dart @@ -15,15 +15,15 @@ class TopicCard extends StatefulWidget { class _TopicCardState extends State { TextStyle _textStyleTitle() { - return TextStyle(fontSize: Screenutil.size(28), color: Color(0xff333333)); + return TextStyle(fontSize: 28.sp, color: Color(0xff333333)); } TextStyle _textStyleSubtitle() { - return TextStyle(fontSize: Screenutil.size(22), color: Color(0xff666666)); + return TextStyle(fontSize: 22.sp, color: Color(0xff666666)); } TextStyle _textStyleHot() { - return TextStyle(fontSize: Screenutil.size(22), color: Color(0xff333333)); + return TextStyle(fontSize: 22.sp, color: Color(0xff333333)); } void topiceDetailRouter(String subtitle, String imagePath) { @@ -38,16 +38,16 @@ class _TopicCardState extends State { children: [ Image.asset( imagePath, - height: Screenutil.length(160), - width: Screenutil.length(250), + height: 160.w, + width: 250.w, ), - SizedBox(width: Screenutil.length(12)), + SizedBox(width: 12.w), Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - width: Screenutil.length(383), - height: Screenutil.length(80), + width: 383.w, + height: 80.w, child: Text( title, maxLines: 2, @@ -55,9 +55,9 @@ class _TopicCardState extends State { style: _textStyleTitle(), ), ), - SizedBox(width: Screenutil.length(10)), + SizedBox(width: 10.w), Container( - width: Screenutil.length(365), + width: 365.w, child: Text( subtitle, maxLines: 1, @@ -80,9 +80,9 @@ class _TopicCardState extends State { Icon( MaterialIcons.whatshot, color: Color(0xffd4270a), - size: Screenutil.size(23), + size: 23.sp, ), - SizedBox(width: Screenutil.length(10)), + SizedBox(width: 10.w), Text( hotNum, style: _textStyleHot(), @@ -97,11 +97,11 @@ class _TopicCardState extends State { return Container( color: Colors.white, margin: EdgeInsets.only( - left: Screenutil.length(32), - right: Screenutil.length(32), - top: Screenutil.length(20), + left: 32.w, + right: 32.w, + top: 20.w, ), - padding: EdgeInsets.all(Screenutil.length(20)), + padding: EdgeInsets.all(20.w), child: InkWell( onTap: () { topiceDetailRouter( diff --git a/lib/pages/community/widget/trend_card.dart b/lib/pages/community/widget/trend_card.dart index 9cb1a527..bd9ed8c5 100644 --- a/lib/pages/community/widget/trend_card.dart +++ b/lib/pages/community/widget/trend_card.dart @@ -36,7 +36,7 @@ class _TrendCardState extends State { title: Text( '是否${url}?', style: TextStyle( - fontSize: Screenutil.size(34), + fontSize: 34.sp, color: Color(0xff030303), ), ), @@ -45,7 +45,7 @@ class _TrendCardState extends State { child: Text( '取消', style: TextStyle( - fontSize: Screenutil.size(34), + fontSize: 34.sp, color: Color(0xff333333), ), ), @@ -58,7 +58,7 @@ class _TrendCardState extends State { '确定', style: TextStyle( fontWeight: FontWeight.w600, - fontSize: Screenutil.size(34), + fontSize: 34.sp, color: Color(0xffff8200), ), ), @@ -84,11 +84,11 @@ class _TrendCardState extends State { return Container( color: Colors.white, height: - Screenutil.length(300) + MediaQuery.of(context).viewPadding.bottom, + 300.w + MediaQuery.of(context).viewPadding.bottom, child: Stack( children: [ Container( - height: Screenutil.length(160), + height: 160.w, child: ListView.builder( scrollDirection: Axis.horizontal, itemBuilder: (BuildContext context, int index) { @@ -98,12 +98,12 @@ class _TrendCardState extends State { _showDialog(nameItems[index]['title']); }, child: Container( - height: Screenutil.length(160), - width: Screenutil.length(160), + height: 160.w, + width: 160.w, margin: EdgeInsets.only( - left: Screenutil.length(10), - right: Screenutil.length(10), - top: Screenutil.length(40), + left: 10.w, + right: 10.w, + top: 40.w, ), alignment: Alignment.center, child: Column( @@ -111,15 +111,15 @@ class _TrendCardState extends State { children: [ Image.asset( nameItems[index]['image'], - width: Screenutil.length(65), - height: Screenutil.length(65), + width: 65.w, + height: 65.w, ), Container( - margin: EdgeInsets.only(top: Screenutil.length(10)), + margin: EdgeInsets.only(top: 10.w), child: Text( nameItems[index]['title'], style: TextStyle( - fontSize: Screenutil.size(26), + fontSize: 26.sp, color: Color(0xff333333), ), ), @@ -140,7 +140,7 @@ class _TrendCardState extends State { }, child: Container( width: MediaQuery.of(context).size.width, - height: Screenutil.length(98), + height: 98.w, alignment: Alignment.center, decoration: BoxDecoration( color: Colors.white, @@ -155,7 +155,7 @@ class _TrendCardState extends State { child: Text( '取消', style: TextStyle( - fontSize: Screenutil.size(38), + fontSize: 38.sp, color: Color(0xff333333), ), ), @@ -175,28 +175,28 @@ class _TrendCardState extends State { TextStyle _textStyleName() { return TextStyle( - fontSize: Screenutil.size(36), + fontSize: 36.sp, color: Color(0xff333333), ); } TextStyle _textStyleContent() { return TextStyle( - fontSize: Screenutil.size(32), + fontSize: 32.sp, color: Color(0xff333333), ); } TextStyle _textStyleTag() { return TextStyle( - fontSize: Screenutil.size(28), + fontSize: 28.sp, color: Color(0xff999999), ); } TextStyle _textStylePopup() { return TextStyle( - fontSize: Screenutil.size(28), + fontSize: 28.sp, color: Color(0xff333333), ); } @@ -211,7 +211,7 @@ class _TrendCardState extends State { elevation: 0, offset: Offset(0, -53), child: Container( - width: Screenutil.length(54), + width: 54.w, decoration: BoxDecoration( color: Color(0xffd8d8d8), borderRadius: BorderRadius.all(Radius.circular(4)), @@ -219,7 +219,7 @@ class _TrendCardState extends State { child: Icon( Feather.more_horizontal, color: Colors.white, - size: Screenutil.size(36), + size: 36.sp, ), ), onSelected: (String value) { @@ -243,17 +243,17 @@ class _TrendCardState extends State { Navigator.pop(context); }, child: Container( - height: Screenutil.length(68), - width: Screenutil.length(181), + height: 68.w, + width: 181.w, child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ Icon( AntDesign.hearto, - size: Screenutil.size(30), + size: 30.sp, color: Color(0xff000000), ), - SizedBox(width: Screenutil.length(11)), + SizedBox(width: 11.w), Text( '赞', style: _textStylePopup(), @@ -264,7 +264,7 @@ class _TrendCardState extends State { ), SizedBox( width: 1, - height: Screenutil.length(48), + height: 48.w, child: DecoratedBox( decoration: BoxDecoration(color: Color(0xff979797)), ), @@ -275,17 +275,17 @@ class _TrendCardState extends State { Navigator.pop(context); }, child: Container( - height: Screenutil.length(68), - width: Screenutil.length(181), + height: 68.w, + width: 181.w, child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ Icon( Feather.message_square, - size: Screenutil.size(30), + size: 30.sp, color: Color(0xff000000), ), - SizedBox(width: Screenutil.length(11)), + SizedBox(width: 11.w), Text( '评论', style: _textStylePopup(), @@ -317,20 +317,20 @@ class _TrendCardState extends State { height: 86.w, child: avatar, ), - SizedBox(width: Screenutil.length(9)), + SizedBox(width: 9.w), Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - padding: EdgeInsets.only(left: Screenutil.length(10)), + padding: EdgeInsets.only(left: 10.w), child: Text( name, style: _textStyleName(), ), ), - SizedBox(height: Screenutil.length(6)), + SizedBox(height: 6.w), Container( - padding: EdgeInsets.only(left: Screenutil.length(14)), + padding: EdgeInsets.only(left: 14.w), child: ExpandableText( text: content, maxLines: 2, @@ -342,13 +342,13 @@ class _TrendCardState extends State { ), ], ), - SizedBox(height: Screenutil.length(20)), + SizedBox(height: 20.w), Padding( - padding: EdgeInsets.only(left: Screenutil.length(95)), + padding: EdgeInsets.only(left: 95.w), child: Column( children: [ ImageGrid(widget.imageUrl), - SizedBox(height: Screenutil.length(20)), + SizedBox(height: 20.w), Stack( children: [ Row( @@ -374,7 +374,7 @@ class _TrendCardState extends State { _isLike ? AntDesign.heart : AntDesign.hearto, color: _isLike ? Color(0xffff6666) : Color(0xffd8d8d8), - size: Screenutil.size(36), + size: 36.sp, ), ), ), @@ -386,7 +386,7 @@ class _TrendCardState extends State { child: Icon( AntDesign.message1, color: Color(0xffd8d8d8), - size: Screenutil.size(36), + size: 36.sp, ), ), ), @@ -426,10 +426,10 @@ class _TrendCardState extends State { ), ), padding: EdgeInsets.only( - top: Screenutil.length(46), - left: Screenutil.length(32), - bottom: Screenutil.length(22), - right: Screenutil.length(32), + top: 46.w, + left: 32.w, + bottom: 22.w, + right: 32.w, ), child: _columnCard(widget.name, widget.content,widget.avatar) ); diff --git a/lib/pages/confirm_order_page/confirm_order_page.dart b/lib/pages/confirm_order_page/confirm_order_page.dart index 787e115e..4ee0f197 100644 --- a/lib/pages/confirm_order_page/confirm_order_page.dart +++ b/lib/pages/confirm_order_page/confirm_order_page.dart @@ -22,11 +22,11 @@ class ConfirmOrderPage extends StatelessWidget { body: Stack( children: [ ListView( - padding: EdgeInsets.only(bottom: Screenutil.length(98)), + padding: EdgeInsets.only(bottom: 98.w), children: [ - SizedBox(height: Screenutil.length(20)), + SizedBox(height: 20.w), ConfirmAddress(), - SizedBox(height: Screenutil.length(20)), + SizedBox(height: 20.w), ConfirmContent(cartMap: bundle.getMap('cartMap')), ], ), diff --git a/lib/pages/confirm_order_page/pay_order_page.dart b/lib/pages/confirm_order_page/pay_order_page.dart index 8552ba61..9d21db4e 100644 --- a/lib/pages/confirm_order_page/pay_order_page.dart +++ b/lib/pages/confirm_order_page/pay_order_page.dart @@ -15,7 +15,7 @@ class PayOrderPage extends StatelessWidget { isCloseButton: false, isOverlayTapDismiss: false, titleStyle: - TextStyle(fontSize: Screenutil.size(38), color: Color(0xff333333)), + TextStyle(fontSize: 38.sp, color: Color(0xff333333)), ); List> _listPay = [ @@ -24,7 +24,7 @@ class PayOrderPage extends StatelessWidget { 'widget': Icon( AntDesign.alipay_circle, color: Color(0xff06b4fd), - size: Screenutil.length(50), + size: 50.w, ), 'id': 'alipay', 'isCheck': true @@ -33,8 +33,8 @@ class PayOrderPage extends StatelessWidget { 'title': '微信支付', 'widget': Image.asset( AssetsImage.WXPAY, - height: Screenutil.length(60), - width: Screenutil.length(60), + height: 60.w, + width: 60.w, ), 'id': 'wxpay', 'isCheck': false @@ -57,9 +57,9 @@ class PayOrderPage extends StatelessWidget { context: context, title: "支付成功!~", image: Container( - margin: EdgeInsets.only(top: Screenutil.length(40)), - height: Screenutil.length(200), - width: Screenutil.length(200), + margin: EdgeInsets.only(top: 40.w), + height: 200.w, + width: 200.w, alignment: Alignment.center, decoration: BoxDecoration( gradient: LinearGradient( @@ -68,12 +68,12 @@ class PayOrderPage extends StatelessWidget { colors: [Color(0xffffe16b), Color(0xffffc40d)], ), borderRadius: - BorderRadius.all(Radius.circular(Screenutil.length(200))), + BorderRadius.all(Radius.circular(200.w)), ), child: Icon( Icons.check, color: Colors.white, - size: Screenutil.length(150), + size: 150.w, ), ), style: alertStyle, @@ -86,7 +86,7 @@ class PayOrderPage extends StatelessWidget { ), onPressed: () => Navigator.pop(context), color: Color(0xffffc40d), - radius: BorderRadius.circular(Screenutil.length(8)), + radius: BorderRadius.circular(8.w), ), ], ).show(); @@ -94,8 +94,8 @@ class PayOrderPage extends StatelessWidget { }, child: Container( padding: EdgeInsets.only( - bottom: Screenutil.length(27), - top: Screenutil.length(28), + bottom: 27.w, + top: 28.w, ), decoration: BoxDecoration( border: @@ -107,18 +107,18 @@ class PayOrderPage extends StatelessWidget { Row( children: [ widget, - SizedBox(width: Screenutil.length(24)), + SizedBox(width: 24.w), Text( title, style: TextStyle( - fontSize: Screenutil.size(28), color: Color(0xff333333)), + fontSize: 28.sp, color: Color(0xff333333)), ), ], ), Icon( AntDesign.right, color: Color(0xff999999), - size: Screenutil.length(32), + size: 32.w, ), ], ), @@ -139,21 +139,21 @@ class PayOrderPage extends StatelessWidget { children: [ Container( margin: EdgeInsets.only( - top: Screenutil.length(130), - bottom: Screenutil.length(130), + top: 130.w, + bottom: 130.w, ), alignment: Alignment.center, child: Text( '¥${(double.parse(bundle.getMap('cartMap')["itemprice"]) * bundle.getMap('cartMap')["count"]).toStringAsFixed(2)}', style: TextStyle( fontWeight: FontWeight.w600, - fontSize: Screenutil.size(48), + fontSize: 48.sp, color: Color(0xffe60e0e), ), ), ), Container( - margin: EdgeInsets.symmetric(horizontal: Screenutil.length(32)), + margin: EdgeInsets.symmetric(horizontal: 32.w), child: Column( children: List.generate( _listPay.length, diff --git a/lib/pages/confirm_order_page/widget/confirm_address.dart b/lib/pages/confirm_order_page/widget/confirm_address.dart index 7ad9fee9..a8f69d92 100644 --- a/lib/pages/confirm_order_page/widget/confirm_address.dart +++ b/lib/pages/confirm_order_page/widget/confirm_address.dart @@ -15,11 +15,11 @@ class ConfirmAddress extends StatefulWidget { class _ConfirmAddressState extends State { Container _containerImage() { return Container( - padding: EdgeInsets.symmetric(vertical: Screenutil.length(12)), + padding: EdgeInsets.symmetric(vertical: 12.w), child: Image.asset( AssetsImage.LOCATION, - height: Screenutil.length(54), - width: Screenutil.length(54), + height: 54.w, + width: 54.w, ), ); } @@ -34,27 +34,27 @@ class _ConfirmAddressState extends State { Text( '周玲慧', style: TextStyle( - fontSize: Screenutil.size(28), + fontSize: 28.sp, color: Color(0xff333333), ), ), - SizedBox(width: Screenutil.length(20)), + SizedBox(width: 20.w), Text( '18868945727', style: TextStyle( - fontSize: Screenutil.size(24), + fontSize: 24.sp, color: Color(0xff999999), ), ), ], ), - SizedBox(height: Screenutil.length(6)), + SizedBox(height: 6.w), Text( '浙江省 宁波市 江北区 工程学院阿库旅游f6', maxLines: 1, overflow: TextOverflow.ellipsis, style: TextStyle( - fontSize: Screenutil.size(24), + fontSize: 24.sp, color: Color(0xff999999), ), ), @@ -65,11 +65,11 @@ class _ConfirmAddressState extends State { Positioned _positionedIcon() { return Positioned( - bottom: Screenutil.length(58), + bottom: 58.w, right: 0, child: Icon( AntDesign.right, - size: Screenutil.size(34), + size: 34.sp, color: Color(0xff999999), ), ); @@ -84,8 +84,8 @@ class _ConfirmAddressState extends State { ..putMap('commentMap', {'title': '我的地址', 'isActions': true})); }, child: Container( - margin: EdgeInsets.symmetric(horizontal: Screenutil.length(32)), - padding: EdgeInsets.symmetric(horizontal: Screenutil.length(18)), + margin: EdgeInsets.symmetric(horizontal: 32.w), + padding: EdgeInsets.symmetric(horizontal: 18.w), decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.all(Radius.circular(8)), @@ -94,14 +94,14 @@ class _ConfirmAddressState extends State { children: [ Padding( padding: EdgeInsets.symmetric( - horizontal: Screenutil.length(18), - vertical: Screenutil.length(32), + horizontal: 18.w, + vertical: 32.w, ), child: Row( mainAxisAlignment: MainAxisAlignment.start, children: [ _containerImage(), - SizedBox(width: Screenutil.length(18)), + SizedBox(width: 18.w), _containerContent(), ], ), diff --git a/lib/pages/confirm_order_page/widget/confirm_bottom_bar.dart b/lib/pages/confirm_order_page/widget/confirm_bottom_bar.dart index 6b749de7..d0c1ca25 100644 --- a/lib/pages/confirm_order_page/widget/confirm_bottom_bar.dart +++ b/lib/pages/confirm_order_page/widget/confirm_bottom_bar.dart @@ -19,7 +19,7 @@ class ConfirmBottomBar extends StatelessWidget { fontSize: BaseStyle.fontSize24, ), ), - SizedBox(width: Screenutil.length(10)), + SizedBox(width: 10.w), Text( '合计:¥${(double.parse(cartMap["itemprice"]) * cartMap["count"]).toStringAsFixed(2)}', style: TextStyle( @@ -43,8 +43,8 @@ class ConfirmBottomBar extends StatelessWidget { borderRadius: BorderRadius.all(Radius.circular(33)), ), padding: EdgeInsets.symmetric( - horizontal: Screenutil.length(39), - vertical: Screenutil.length(12), + horizontal: 39.w, + vertical: 12.w, ), child: Text( '提交订单', @@ -62,18 +62,18 @@ class ConfirmBottomBar extends StatelessWidget { return Container( color: Colors.white, width: MediaQuery.of(context).size.width, - height: Screenutil.length(98), + height: 98.w, padding: EdgeInsets.only( - top: Screenutil.length(15), - bottom: Screenutil.length(17), - right: Screenutil.length(34), + top: 15.w, + bottom: 17.w, + right: 34.w, ), child: Row( crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.end, children: [ _countPrice(), - SizedBox(width: Screenutil.length(12)), + SizedBox(width: 12.w), _submit(context), ], ), diff --git a/lib/pages/confirm_order_page/widget/confirm_content.dart b/lib/pages/confirm_order_page/widget/confirm_content.dart index f98e6db9..6b322735 100644 --- a/lib/pages/confirm_order_page/widget/confirm_content.dart +++ b/lib/pages/confirm_order_page/widget/confirm_content.dart @@ -16,28 +16,28 @@ class ConfirmContent extends StatelessWidget { children: [ CachedImageWrapper( url: cartMap["itempic"], - height: Screenutil.length(210), - width: Screenutil.length(210), + height: 210.w, + width: 210.w, ), - SizedBox(width: Screenutil.length(20)), + SizedBox(width: 20.w), Column( children: [ Container( - width: Screenutil.length(288), + width: 288.w, child: Text( cartMap["itemtitle"], overflow: TextOverflow.ellipsis, maxLines: 2, style: TextStyle( - fontSize: Screenutil.size(24), + fontSize: 24.sp, color: Color(0xff333333), ), ), ), - SizedBox(height: Screenutil.length(10)), + SizedBox(height: 10.w), Container( - width: Screenutil.length(280), - padding: EdgeInsets.all(Screenutil.length(10)), + width: 280.w, + padding: EdgeInsets.all(10.w), decoration: BoxDecoration( color: Color(0xfff0f0f0), borderRadius: BorderRadius.all(Radius.circular(2)), @@ -53,7 +53,7 @@ class ConfirmContent extends StatelessWidget { overflow: TextOverflow.ellipsis, maxLines: 2, style: TextStyle( - fontSize: Screenutil.size(20), + fontSize: 20.sp, color: Color(0xff666666), ), ), @@ -73,15 +73,15 @@ class ConfirmContent extends StatelessWidget { Text( '共计${cartMap["count"]}件', style: TextStyle( - fontSize: Screenutil.size(24), + fontSize: 24.sp, color: Color(0xff999999), ), ), - SizedBox(width: Screenutil.length(10)), + SizedBox(width: 10.w), Text( '合计:¥${(double.parse(cartMap["itemprice"]) * cartMap["count"]).toStringAsFixed(2)}', style: TextStyle( - fontSize: Screenutil.size(24), + fontSize: 24.sp, color: Color(0xffe60e0e), ), ) @@ -98,7 +98,7 @@ class ConfirmContent extends StatelessWidget { child: Text( '¥${cartMap["itemprice"]}', style: TextStyle( - fontSize: Screenutil.size(24), + fontSize: 24.sp, color: Color(0xffe60e0e), fontWeight: FontWeight.w600, ), @@ -110,12 +110,12 @@ class ConfirmContent extends StatelessWidget { Widget _cartNum() { return Positioned( right: 0, - top: Screenutil.length(38), + top: 38.w, child: Container( child: Text( 'x${cartMap["count"]}', style: TextStyle( - fontSize: Screenutil.size(20), + fontSize: 20.sp, color: Color(0xff999999), fontWeight: FontWeight.w600, ), @@ -131,10 +131,10 @@ class ConfirmContent extends StatelessWidget { color: Colors.white, borderRadius: BorderRadius.all(Radius.circular(8)), ), - margin: EdgeInsets.symmetric(horizontal: Screenutil.length(32)), + margin: EdgeInsets.symmetric(horizontal: 32.w), padding: EdgeInsets.symmetric( - horizontal: Screenutil.length(20), - vertical: Screenutil.length(32), + horizontal: 20.w, + vertical: 32.w, ), child: Stack( children: [ @@ -144,15 +144,15 @@ class ConfirmContent extends StatelessWidget { Container( color: Colors.white, padding: EdgeInsets.only( - left: Screenutil.length(30), - right: Screenutil.length(12), + left: 30.w, + right: 12.w, ), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( margin: EdgeInsets.only( - top: Screenutil.length(56), + top: 56.w, ), child: Row( mainAxisAlignment: MainAxisAlignment.start, @@ -160,14 +160,14 @@ class ConfirmContent extends StatelessWidget { Text( '配送方式', style: TextStyle( - fontSize: Screenutil.size(28), + fontSize: 28.sp, color: Color(0xff333333)), ), - SizedBox(width: Screenutil.length(26)), + SizedBox(width: 26.w), Text( '普通配送', style: TextStyle( - fontSize: Screenutil.size(28), + fontSize: 28.sp, color: Color(0xff999999)), ), ], @@ -175,7 +175,7 @@ class ConfirmContent extends StatelessWidget { ), Container( margin: EdgeInsets.only( - top: Screenutil.length(56), + top: 56.w, ), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, @@ -183,7 +183,7 @@ class ConfirmContent extends StatelessWidget { Text( '开具发票', style: TextStyle( - fontSize: Screenutil.size(28), + fontSize: 28.sp, color: Color(0xff333333)), ), InkWell( @@ -196,22 +196,22 @@ class ConfirmContent extends StatelessWidget { child: Row( children: [ Container( - height: Screenutil.length(80), - width: Screenutil.length(353), + height: 80.w, + width: 353.w, child: Text( '增值税电子普通发票-明显-企业-宁波阿库旅游有限公司', maxLines: 2, overflow: TextOverflow.ellipsis, style: TextStyle( - fontSize: Screenutil.size(28), + fontSize: 28.sp, color: Color(0xff999999), ), ), ), - SizedBox(width: Screenutil.length(10)), + SizedBox(width: 10.w), Icon( AntDesign.right, - size: Screenutil.size(30), + size: 30.sp, color: Color(0xff999999), ), ], @@ -222,7 +222,7 @@ class ConfirmContent extends StatelessWidget { ), Container( margin: EdgeInsets.only( - top: Screenutil.length(56), + top: 56.w, ), child: Row( mainAxisAlignment: MainAxisAlignment.start, @@ -230,14 +230,14 @@ class ConfirmContent extends StatelessWidget { Text( '订单备注', style: TextStyle( - fontSize: Screenutil.size(28), + fontSize: 28.sp, color: Color(0xff333333)), ), - SizedBox(width: Screenutil.length(14)), + SizedBox(width: 14.w), Text( '选填', style: TextStyle( - fontSize: Screenutil.size(28), + fontSize: 28.sp, color: Color(0xff999999)), ), ], @@ -246,7 +246,7 @@ class ConfirmContent extends StatelessWidget { ], ), ), - SizedBox(height: Screenutil.length(104)), + SizedBox(height: 104.w), ], ), _cartFooter(), diff --git a/lib/pages/convenient_phone/convenient_phone_page.dart b/lib/pages/convenient_phone/convenient_phone_page.dart index 95c4c14a..41cc3197 100644 --- a/lib/pages/convenient_phone/convenient_phone_page.dart +++ b/lib/pages/convenient_phone/convenient_phone_page.dart @@ -24,14 +24,14 @@ class _ConvenientPhonePageState extends State { }, child: Container( margin: EdgeInsets.only( - left: Screenutil.length(32), - right: Screenutil.length(32), - top: Screenutil.length(12), - bottom: Screenutil.length(20), + left: 32.w, + right: 32.w, + top: 12.w, + bottom: 20.w, ), padding: EdgeInsets.symmetric( - horizontal: Screenutil.length(32), - vertical: Screenutil.length(16), + horizontal: 32.w, + vertical: 16.w, ), decoration: BoxDecoration( color: Color(0xfff9f9f9), @@ -54,7 +54,7 @@ class _ConvenientPhonePageState extends State { List _silverBuilder(BuildContext context, bool innerBoxIsScrolled) { double statusBarHeight = MediaQuery.of(context).padding.top; - double _swiperHeight = Screenutil.length(122); + double _swiperHeight = 122.w; double _spikeHeight = 25; double _appBarHeight = _swiperHeight - _spikeHeight - statusBarHeight; return [ @@ -63,7 +63,7 @@ class _ConvenientPhonePageState extends State { automaticallyImplyLeading: false, bottom: PreferredSize( child: Container(), - preferredSize: Size.fromHeight(Screenutil.length(_appBarHeight))), + preferredSize: Size.fromHeight((_appBarHeight).h)), flexibleSpace: Column( children: [ _containerSearch(), @@ -78,11 +78,11 @@ class _ConvenientPhonePageState extends State { child: Container( color: Colors.white, alignment: Alignment.centerLeft, - padding: EdgeInsets.symmetric(horizontal: Screenutil.length(32)), + padding: EdgeInsets.symmetric(horizontal: 32.w), child: Text( '小区服务电话', style: TextStyle( - fontSize: Screenutil.size(32), + fontSize: 32.sp, ), ), )), diff --git a/lib/pages/convenient_phone/widget/phone_list.dart b/lib/pages/convenient_phone/widget/phone_list.dart index e8b7deb8..85b9911d 100644 --- a/lib/pages/convenient_phone/widget/phone_list.dart +++ b/lib/pages/convenient_phone/widget/phone_list.dart @@ -50,7 +50,7 @@ class _PhoneListState extends State { title: Text( url, style: TextStyle( - fontSize: Screenutil.size(34), + fontSize: 34.sp, color: Color(0xff030303), ), ), @@ -59,7 +59,7 @@ class _PhoneListState extends State { child: Text( '取消', style: TextStyle( - fontSize: Screenutil.size(34), + fontSize: 34.sp, color: Color(0xff333333), ), ), @@ -72,7 +72,7 @@ class _PhoneListState extends State { '呼叫', style: TextStyle( fontWeight: FontWeight.w600, - fontSize: Screenutil.size(34), + fontSize: 34.sp, color: Color(0xffff8200), ), ), @@ -89,10 +89,10 @@ class _PhoneListState extends State { Widget _phoneCard(String name, String phone) { return Container( - margin: EdgeInsets.symmetric(horizontal: Screenutil.length(32)), + margin: EdgeInsets.symmetric(horizontal: 32.w), padding: EdgeInsets.only( - top: Screenutil.length(23), - bottom: Screenutil.length(20), + top: 23.w, + bottom: 20.w, ), decoration: BoxDecoration( color: Color(0xffffffff), @@ -108,15 +108,15 @@ class _PhoneListState extends State { Text( name, style: TextStyle( - fontSize: Screenutil.size(32), + fontSize: 32.sp, color: Color(0xff333333), ), ), - SizedBox(height: Screenutil.length(12)), + SizedBox(height: 12.w), Text( phone, style: TextStyle( - fontSize: Screenutil.size(28), + fontSize: 28.sp, color: Color(0xff999999), ), ), @@ -128,8 +128,8 @@ class _PhoneListState extends State { }, child: Image.asset( AssetsImage.PHONE, - height: Screenutil.length(60), - width: Screenutil.length(60), + height: 60.w, + width: 60.w, ), ), ], diff --git a/lib/pages/fitup_manage/fitup_manage_page.dart b/lib/pages/fitup_manage/fitup_manage_page.dart index 78763445..d874c090 100644 --- a/lib/pages/fitup_manage/fitup_manage_page.dart +++ b/lib/pages/fitup_manage/fitup_manage_page.dart @@ -53,11 +53,11 @@ class _FitupManagePageState extends State fontSize: BaseStyle.fontSize28, ), labelPadding: - EdgeInsets.symmetric(horizontal: Screenutil.length(131.5)), + EdgeInsets.symmetric(horizontal: (131.5).w), indicatorColor: Color(0xffffc40c), indicatorSize: TabBarIndicatorSize.label, indicatorPadding: - EdgeInsets.symmetric(horizontal: Screenutil.length(21)), + EdgeInsets.symmetric(horizontal: 21.w), isScrollable: true, controller: _controller, tabs: List.generate( diff --git a/lib/pages/fitup_manage/widget/common_select.dart b/lib/pages/fitup_manage/widget/common_select.dart index 583eb000..6d2b4dbd 100644 --- a/lib/pages/fitup_manage/widget/common_select.dart +++ b/lib/pages/fitup_manage/widget/common_select.dart @@ -47,16 +47,16 @@ class _CommonSelectState extends State { title: Text( "证件类型", style: TextStyle( - fontSize: Screenutil.size(32), + fontSize: 32.sp, color: Color(0xff333333), ), ), confirmTextStyle: TextStyle( - fontSize: Screenutil.size(28), + fontSize: 28.sp, color: Color(0xffffc40c), ), cancelTextStyle: TextStyle( - fontSize: Screenutil.size(28), + fontSize: 28.sp, color: Color(0xff333333), ), onConfirm: (Picker picker, List value) { @@ -84,7 +84,7 @@ class _CommonSelectState extends State { Icon( AntDesign.right, color: BaseStyle.color999999, - size: Screenutil.length(32), + size: 32.w, ), ], ), diff --git a/lib/pages/fitup_manage/widget/decorator_info.dart b/lib/pages/fitup_manage/widget/decorator_info.dart index 48568ba6..2c88c832 100644 --- a/lib/pages/fitup_manage/widget/decorator_info.dart +++ b/lib/pages/fitup_manage/widget/decorator_info.dart @@ -39,8 +39,8 @@ class _DecoratorInfoState extends State { Widget _cardList(String title, Widget widget) { return Container( padding: EdgeInsets.only( - top: Screenutil.length(23), - bottom: Screenutil.length(24), + top: 23.w, + bottom: 24.w, ), decoration: BoxDecoration( border: Border( @@ -52,9 +52,9 @@ class _DecoratorInfoState extends State { Text( title, style: TextStyle( - fontSize: Screenutil.size(28), color: Color(0xff333333)), + fontSize: 28.sp, color: Color(0xff333333)), ), - SizedBox(height: Screenutil.length(25)), + SizedBox(height: 25.w), widget ], ), @@ -64,8 +64,8 @@ class _DecoratorInfoState extends State { Widget _upLoadImage() { return Container( padding: EdgeInsets.only( - top: Screenutil.length(23), - bottom: Screenutil.length(24), + top: 23.w, + bottom: 24.w, ), decoration: BoxDecoration( border: Border( @@ -77,9 +77,9 @@ class _DecoratorInfoState extends State { Text( '上传证件照片', style: TextStyle( - fontSize: Screenutil.size(28), color: Color(0xff333333)), + fontSize: 28.sp, color: Color(0xff333333)), ), - SizedBox(height: Screenutil.length(25)), + SizedBox(height: 25.w), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: List.generate( diff --git a/lib/pages/fitup_manage/widget/director_manage.dart b/lib/pages/fitup_manage/widget/director_manage.dart index 22e59cc5..f32485a2 100644 --- a/lib/pages/fitup_manage/widget/director_manage.dart +++ b/lib/pages/fitup_manage/widget/director_manage.dart @@ -49,7 +49,7 @@ class _DirectorManageState extends State Widget _doorIdCard() { return Container( - width: Screenutil.length(686), + width: 686.w, child: RichText( text: TextSpan(children: [ TextSpan( @@ -76,8 +76,8 @@ class _DirectorManageState extends State Widget _cardList(String title, Widget widget) { return Container( padding: EdgeInsets.only( - top: Screenutil.length(23), - bottom: Screenutil.length(24), + top: 23.w, + bottom: 24.w, ), decoration: BoxDecoration( border: Border( @@ -89,9 +89,9 @@ class _DirectorManageState extends State Text( title, style: TextStyle( - fontSize: Screenutil.size(28), color: Color(0xff333333)), + fontSize: 28.sp, color: Color(0xff333333)), ), - SizedBox(height: Screenutil.length(25)), + SizedBox(height: 25.w), widget ], ), @@ -101,8 +101,8 @@ class _DirectorManageState extends State Widget _upLoadImage() { return Container( padding: EdgeInsets.only( - top: Screenutil.length(23), - bottom: Screenutil.length(24), + top: 23.w, + bottom: 24.w, ), decoration: BoxDecoration( border: Border( @@ -114,9 +114,9 @@ class _DirectorManageState extends State Text( '上传凭证', style: TextStyle( - fontSize: Screenutil.size(28), color: Color(0xff333333)), + fontSize: 28.sp, color: Color(0xff333333)), ), - SizedBox(height: Screenutil.length(25)), + SizedBox(height: 25.w), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: List.generate( @@ -127,7 +127,7 @@ class _DirectorManageState extends State ), ), ), - SizedBox(height: Screenutil.length(25)), + SizedBox(height: 25.w), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: List.generate( @@ -140,7 +140,7 @@ class _DirectorManageState extends State ), ), ), - SizedBox(height: Screenutil.length(25)), + SizedBox(height: 25.w), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: List.generate( @@ -162,16 +162,16 @@ class _DirectorManageState extends State return InkWell( child: Center( child: Container( - margin: EdgeInsets.only(bottom: Screenutil.length(64)), + margin: EdgeInsets.only(bottom: 64.w), decoration: BoxDecoration( color: BaseStyle.colorffc40c, borderRadius: BorderRadius.all(Radius.circular(36)), ), - width: Screenutil.length(426), - height: Screenutil.length(82), + width: 426.w, + height: 82.w, padding: EdgeInsets.only( - top: Screenutil.length(19), - bottom: Screenutil.length(18), + top: 19.w, + bottom: 18.w, ), alignment: Alignment.center, child: Text( @@ -201,9 +201,9 @@ class _DirectorManageState extends State children: [ Container( margin: EdgeInsets.only( - top: Screenutil.length(32), - left: Screenutil.length(32), - right: Screenutil.length(32), + top: 32.w, + left: 32.w, + right: 32.w, ), child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -223,7 +223,7 @@ class _DirectorManageState extends State hintText: '请输入公司名称')), _cardList('门禁卡数量', _doorIdCard()), _upLoadImage(), - SizedBox(height: Screenutil.length(78)), + SizedBox(height: 78.w), Text( '装修人员', style: TextStyle( @@ -242,10 +242,10 @@ class _DirectorManageState extends State }); }, child: Container( - margin: EdgeInsets.only(top: Screenutil.length(54)), + margin: EdgeInsets.only(top: 54.w), padding: EdgeInsets.only( - top: Screenutil.length(16), - bottom: Screenutil.length(16), + top: 16.w, + bottom: 16.w, ), alignment: Alignment.center, child: Text( diff --git a/lib/pages/fitup_manage/widget/house_info.dart b/lib/pages/fitup_manage/widget/house_info.dart index 2d47609e..ef6568bf 100644 --- a/lib/pages/fitup_manage/widget/house_info.dart +++ b/lib/pages/fitup_manage/widget/house_info.dart @@ -17,7 +17,7 @@ class _HouseInfoState extends State { Widget build(BuildContext context) { return Container( padding: EdgeInsets.only( - bottom: Screenutil.length(32), + bottom: 32.w, ), decoration: BoxDecoration( border: Border( @@ -29,10 +29,10 @@ class _HouseInfoState extends State { children: [ Image.asset( AssetsImage.HOUSEATTESTATION, - height: Screenutil.length(48), - width: Screenutil.length(48), + height: 48.w, + width: 48.w, ), - SizedBox(width: Screenutil.length(20)), + SizedBox(width: 20.w), Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -43,7 +43,7 @@ class _HouseInfoState extends State { color: BaseStyle.color474747, ), ), - SizedBox(height: Screenutil.length(10)), + SizedBox(height: 10.w), Text( widget.subtitle, style: TextStyle( diff --git a/lib/pages/fitup_manage/widget/owner_manage.dart b/lib/pages/fitup_manage/widget/owner_manage.dart index 2fb5db83..757fd59d 100644 --- a/lib/pages/fitup_manage/widget/owner_manage.dart +++ b/lib/pages/fitup_manage/widget/owner_manage.dart @@ -78,11 +78,11 @@ class _OwnerManageState extends State .keys .map((index) => Container( padding: EdgeInsets.only( - top: Screenutil.length(23), - bottom: Screenutil.length(24), + top: 23.w, + bottom: 24.w, ), margin: EdgeInsets.only( - bottom: Screenutil.length(index == 2 ? 117 : 0)), + bottom:(index == 2 ? 117 : 0).w), decoration: BoxDecoration( border: Border( bottom: @@ -97,7 +97,7 @@ class _OwnerManageState extends State fontSize: BaseStyle.fontSize28, color: BaseStyle.color333333), ), - SizedBox(height: Screenutil.length(25)), + SizedBox(height: 25.w), _listWidget[index]['widget'], ], ), @@ -120,9 +120,9 @@ class _OwnerManageState extends State }, child: Container( margin: EdgeInsets.only( - top: Screenutil.length(32), - left: Screenutil.length(32), - right: Screenutil.length(32), + top: 32.w, + left: 32.w, + right: 32.w, ), child: Column( crossAxisAlignment: CrossAxisAlignment.center, @@ -138,7 +138,7 @@ class _OwnerManageState extends State Column( children: _listView(), ), - SizedBox(height: Screenutil.length(89)), + SizedBox(height: 89.w), ], ), ), diff --git a/lib/pages/fitup_manage/widget/pay_model_sheet.dart b/lib/pages/fitup_manage/widget/pay_model_sheet.dart index 3ac75db2..8241b25d 100644 --- a/lib/pages/fitup_manage/widget/pay_model_sheet.dart +++ b/lib/pages/fitup_manage/widget/pay_model_sheet.dart @@ -20,7 +20,7 @@ class _PayModelSheetState extends State { 'widget': Icon( AntDesign.alipay_circle, color: Color(0xff06b4fd), - size: Screenutil.length(50), + size: 50.w, ), 'id': 'alipay', 'isCheck': true @@ -29,8 +29,8 @@ class _PayModelSheetState extends State { 'title': '微信支付', 'widget': Image.asset( AssetsImage.WXPAY, - height: Screenutil.length(60), - width: Screenutil.length(60), + height: 60.w, + width: 60.w, ), 'id': 'wxpay', 'isCheck': false @@ -53,9 +53,9 @@ class _PayModelSheetState extends State { builder: (context) { return Container( margin: EdgeInsets.only( - top: Screenutil.length(20), - left: Screenutil.length(20), - right: Screenutil.length(20), + top: 20.w, + left: 20.w, + right: 20.w, ), child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -73,7 +73,7 @@ class _PayModelSheetState extends State { IconButton( icon: Icon( AntDesign.left, - size: Screenutil.size(40), + size: 40.sp, color: BaseStyle.color999999, ), onPressed: () { @@ -81,7 +81,7 @@ class _PayModelSheetState extends State { }, ), Container( - padding: EdgeInsets.only(left: Screenutil.length(190)), + padding: EdgeInsets.only(left: 190.w), child: Text( '选择付款方式', style: TextStyle( @@ -123,18 +123,18 @@ class _PayModelSheetState extends State { }, child: Container( padding: EdgeInsets.only( - top: Screenutil.length(10), + top: 10.w, ), child: Row( mainAxisAlignment: MainAxisAlignment.start, children: [ logo, - SizedBox(width: Screenutil.length(24)), + SizedBox(width: 24.w), Expanded( child: Container( padding: EdgeInsets.only( - bottom: Screenutil.length(27), - top: Screenutil.length(28), + bottom: 27.w, + top: 28.w, ), decoration: BoxDecoration( border: Border( @@ -154,7 +154,7 @@ class _PayModelSheetState extends State { ? Icon( AntDesign.check, color: BaseStyle.colorffc40c, - size: Screenutil.length(50), + size: 50.w, ) : SizedBox(), ], @@ -172,8 +172,8 @@ class _PayModelSheetState extends State { onTap: _showModelBotoomSheet, child: Container( padding: EdgeInsets.only( - bottom: Screenutil.length(27), - top: Screenutil.length(28), + bottom: 27.w, + top: 28.w, ), decoration: BoxDecoration( border: Border( @@ -185,7 +185,7 @@ class _PayModelSheetState extends State { Row( children: [ _listPay[_currentindex]['widget'], - SizedBox(width: Screenutil.length(24)), + SizedBox(width: 24.w), Text( _listPay[_currentindex]['title'], style: TextStyle( @@ -197,7 +197,7 @@ class _PayModelSheetState extends State { Icon( AntDesign.right, color: BaseStyle.color999999, - size: Screenutil.length(32), + size: 32.w, ), ], ), @@ -212,9 +212,9 @@ class _PayModelSheetState extends State { children: [ Container( margin: EdgeInsets.only( - top: Screenutil.length(36), - left: Screenutil.length(32), - right: Screenutil.length(32), + top: 36.w, + left: 32.w, + right: 32.w, ), child: Column( children: [ @@ -225,7 +225,7 @@ class _PayModelSheetState extends State { bottom: BorderSide( color: BaseStyle.coloreeeeee, width: 0.5)), ), - padding: EdgeInsets.only(bottom: Screenutil.length(20)), + padding: EdgeInsets.only(bottom: 20.w), child: Text( '付款详情', style: TextStyle( @@ -237,8 +237,8 @@ class _PayModelSheetState extends State { ), Container( padding: EdgeInsets.only( - bottom: Screenutil.length(80), - top: Screenutil.length(89), + bottom: 80.w, + top: 89.w, ), decoration: BoxDecoration( border: Border( @@ -258,7 +258,7 @@ class _PayModelSheetState extends State { fontWeight: FontWeight.w600, ), ), - SizedBox(height: Screenutil.length(20)), + SizedBox(height: 20.w), Text( '注释:装修押金${5000}元,垃圾清理费${300}元', style: TextStyle( diff --git a/lib/pages/goods_details/goods_details_page.dart b/lib/pages/goods_details/goods_details_page.dart index 7989aa53..c6588f50 100644 --- a/lib/pages/goods_details/goods_details_page.dart +++ b/lib/pages/goods_details/goods_details_page.dart @@ -42,7 +42,7 @@ class _GoodsDetailsPageState extends State { body: Stack( children: [ ListView( - padding: EdgeInsets.only(bottom: Screenutil.length(100)), + padding: EdgeInsets.only(bottom: 100.w), children: [ ProductSwiper(imageUrl: params), ProductContent( diff --git a/lib/pages/goods_details/view_comments_page.dart b/lib/pages/goods_details/view_comments_page.dart index 0a5a3e32..60a16861 100644 --- a/lib/pages/goods_details/view_comments_page.dart +++ b/lib/pages/goods_details/view_comments_page.dart @@ -108,16 +108,16 @@ class _ViewCommentsPageState extends State { return Container( color: Colors.white, padding: EdgeInsets.only( - top: Screenutil.length(29), - left: Screenutil.length(32), - bottom: Screenutil.length(40), + top: 29.w, + left: 32.w, + bottom: 40.w, ), width: MediaQuery.of(context).size.width, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - margin: EdgeInsets.only(bottom: Screenutil.length(25)), + margin: EdgeInsets.only(bottom: 25.w), child: Text( '按分类评价', style: TextStyle( @@ -127,8 +127,8 @@ class _ViewCommentsPageState extends State { ), ), Wrap( - spacing: Screenutil.length(10), - runSpacing: Screenutil.length(20), + spacing: 10.w, + runSpacing: 20.w, children: _commentsClassList .map((item) => InkWell( onTap: () { @@ -143,10 +143,10 @@ class _ViewCommentsPageState extends State { borderRadius: BorderRadius.all(Radius.circular(24)), child: Container( padding: EdgeInsets.only( - left: Screenutil.length(24), - right: Screenutil.length(23), - top: Screenutil.length(9), - bottom: Screenutil.length(10), + left: 24.w, + right: 23.w, + top: 9.w, + bottom: 10.w, ), decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(24)), @@ -198,7 +198,7 @@ class _ViewCommentsPageState extends State { onLoading: _onLoading, enablePullUp: true, child: ListView.builder( - padding: EdgeInsets.only(top: Screenutil.length(30)), + padding: EdgeInsets.only(top: 30.w), itemBuilder: (BuildContext context, int index) => Container( color: Colors.white, child: GoodsCommentsCard( diff --git a/lib/pages/goods_details/widget/goods_app_bar.dart b/lib/pages/goods_details/widget/goods_app_bar.dart index 8bf75e3e..c6f4307c 100644 --- a/lib/pages/goods_details/widget/goods_app_bar.dart +++ b/lib/pages/goods_details/widget/goods_app_bar.dart @@ -24,15 +24,15 @@ class _GoodsAppBarState extends State { backgroundColor: Color(0xffffffff), titleSpacing: 0, leading: IconButton( - icon: Icon(AntDesign.left, size: Screenutil.size(40)), + icon: Icon(AntDesign.left, size: 40.sp), onPressed: () { Navigator.pop(context); }, ), title: Container( padding: EdgeInsets.symmetric( - horizontal: Screenutil.length(40), - vertical: Screenutil.length(15), + horizontal: 40.w, + vertical: 15.w, ), decoration: BoxDecoration( color: Color(0xfff3f3f3), @@ -66,7 +66,7 @@ class _GoodsAppBarState extends State { IconButton( icon: Icon( SimpleLineIcons.share, - size: Screenutil.size(40), + size: 40.sp, color: Color(0xff666666), ), onPressed: () { @@ -81,7 +81,7 @@ class _GoodsAppBarState extends State { IconButton( icon: Icon( AntDesign.shoppingcart, - size: Screenutil.size(40), + size: 40.sp, color: Color(0xff666666), ), onPressed: () { diff --git a/lib/pages/goods_details/widget/goods_comments_card.dart b/lib/pages/goods_details/widget/goods_comments_card.dart index 026da95d..4928702b 100644 --- a/lib/pages/goods_details/widget/goods_comments_card.dart +++ b/lib/pages/goods_details/widget/goods_comments_card.dart @@ -41,12 +41,12 @@ class _GoodsCommentsCardState extends State { child: Row( children: [ Container( - margin: EdgeInsets.only(right: Screenutil.length(12)), + margin: EdgeInsets.only(right: 12.w), child: ClipOval( child: CachedImageWrapper( url: imagePath, - width: Screenutil.length(50), - height: Screenutil.length(50), + width: 50.w, + height: 50.w, ), ), ), @@ -60,7 +60,7 @@ class _GoodsCommentsCardState extends State { color: BaseStyle.color333333, ), ), - SizedBox(height: Screenutil.length(4)), + SizedBox(height: 4.w), Text( subtitle, style: TextStyle( @@ -80,13 +80,13 @@ class _GoodsCommentsCardState extends State { List contentImageList, ) { return Container( - margin: EdgeInsets.only(top: Screenutil.length(15)), - padding: EdgeInsets.only(bottom: Screenutil.length(20)), + margin: EdgeInsets.only(top: 15.w), + padding: EdgeInsets.only(bottom: 20.w), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - margin: EdgeInsets.only(bottom: Screenutil.length(20)), + margin: EdgeInsets.only(bottom: 20.w), child: ExpandableText( text: content, maxLines: 3, @@ -124,7 +124,7 @@ class _GoodsCommentsCardState extends State { size: BaseStyle.fontSize22, color: BaseStyle.color333333, ), - SizedBox(width: Screenutil.length(10)), + SizedBox(width: 10.w), Text( '有用', style: TextStyle( @@ -144,11 +144,11 @@ class _GoodsCommentsCardState extends State { Widget build(BuildContext context) { return Container( margin: EdgeInsets.only( - top: Screenutil.length(32), - left: Screenutil.length(32), - right: Screenutil.length(32), + top: 32.w, + left: 32.w, + right: 32.w, ), - padding: EdgeInsets.only(bottom: Screenutil.length(32)), + padding: EdgeInsets.only(bottom: 32.w), decoration: BoxDecoration( border: Border(bottom: BorderSide(color: Color(0xffd8d8d8), width: 0.5)), diff --git a/lib/pages/goods_details/widget/product_detail.dart b/lib/pages/goods_details/widget/product_detail.dart index 312d95db..afb85198 100644 --- a/lib/pages/goods_details/widget/product_detail.dart +++ b/lib/pages/goods_details/widget/product_detail.dart @@ -12,12 +12,12 @@ class ProductDetail extends StatelessWidget { Widget build(BuildContext context) { return Container( color: Color(0xffffffff), - margin: EdgeInsets.only(top: Screenutil.length(30)), + margin: EdgeInsets.only(top: 30.w), padding: EdgeInsets.only( - top: Screenutil.length(20), - left: Screenutil.length(32), - right: Screenutil.length(32), - bottom: Screenutil.length(32), + top: 20.w, + left: 32.w, + right: 32.w, + bottom: 32.w, ), child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -29,7 +29,7 @@ class ProductDetail extends StatelessWidget { color: Color(0xff333333), ), ), - SizedBox(height: Screenutil.length(12)), + SizedBox(height: 12.w), Container( child: AspectRatio( aspectRatio: 1, diff --git a/lib/pages/goods_deto_page/deto_code_page/deto_code_page.dart b/lib/pages/goods_deto_page/deto_code_page/deto_code_page.dart index 422e740f..550be963 100644 --- a/lib/pages/goods_deto_page/deto_code_page/deto_code_page.dart +++ b/lib/pages/goods_deto_page/deto_code_page/deto_code_page.dart @@ -18,13 +18,13 @@ class DetoCodePage extends StatelessWidget { Text( '宁波华茂悦峰', style: TextStyle( - fontSize: Screenutil.size(40), color: Color(0xffffffff)), + fontSize: 40.sp, color: Color(0xffffffff)), ), - SizedBox(height: Screenutil.length(10)), + SizedBox(height: 10.w), Text( '1幢-1单元-702室', style: TextStyle( - fontSize: Screenutil.size(26), color: Color(0xffffffff)), + fontSize: 26.sp, color: Color(0xffffffff)), ), ], ), @@ -35,7 +35,7 @@ class DetoCodePage extends StatelessWidget { return Container( decoration: BoxDecoration( color: Color(0xffffffff), - borderRadius: BorderRadius.all(Radius.circular(Screenutil.length(16))), + borderRadius: BorderRadius.all(Radius.circular(16.w)), boxShadow: [ BoxShadow( color: Colors.grey.withOpacity(0.2), @@ -44,14 +44,14 @@ class DetoCodePage extends StatelessWidget { ], ), margin: EdgeInsets.symmetric( - horizontal: Screenutil.length(75), - vertical: Screenutil.length(32), + horizontal: 75.w, + vertical: 32.w, ), padding: EdgeInsets.only( - bottom: Screenutil.length(16), - left: Screenutil.length(32), - right: Screenutil.length(21), - top: Screenutil.length(25), + bottom: 16.w, + left: 32.w, + right: 21.w, + top: 25.w, ), child: Column( mainAxisAlignment: MainAxisAlignment.center, @@ -64,39 +64,39 @@ class DetoCodePage extends StatelessWidget { children: [ Icon( AntDesign.contacts, - size: Screenutil.size(40), + size: 40.sp, color: Color(0xff999999), ), - SizedBox(width: Screenutil.length(10)), + SizedBox(width: 10.w), Text( '马成泽先生', maxLines: 1, overflow: TextOverflow.ellipsis, style: TextStyle( fontWeight: FontWeight.w600, - fontSize: Screenutil.size(36), + fontSize: 36.sp, color: Color(0xff333333)), ), ], ), ], ), - SizedBox(height: Screenutil.length(13)), + SizedBox(height: 13.w), Text( '有限时间:2020年6月30日', style: TextStyle( - fontSize: Screenutil.size(26), + fontSize: 26.sp, color: Color(0xff999999), ), ), - SizedBox(height: Screenutil.length(23)), + SizedBox(height: 23.w), DottedLine(color: Color(0xfff5f5f5)), Container( padding: EdgeInsets.only( - top: Screenutil.length(30), - bottom: Screenutil.length(38), + top: 30.w, + bottom: 38.w, ), - height: Screenutil.length(389), + height: 389.w, alignment: Alignment.center, child: Column( children: [ @@ -104,27 +104,27 @@ class DetoCodePage extends StatelessWidget { '020-598-230', style: TextStyle( fontWeight: FontWeight.w600, - fontSize: Screenutil.size(36), + fontSize: 36.sp, color: Color(0xff333333), ), ), - SizedBox(height: Screenutil.length(11)), + SizedBox(height: 11.w), QrImage( padding: EdgeInsets.zero, data: '智慧社区开门码', - size: Screenutil.length(260), + size: 260.w, ), ], ), ), DottedLine(color: Color(0xfff5f5f5)), - SizedBox(height: Screenutil.length(16)), + SizedBox(height: 16.w), Container( alignment: Alignment.center, child: Text( '出户时,请出示此证给门岗', style: TextStyle( - fontSize: Screenutil.size(24), + fontSize: 24.sp, color: Color(0xff999999), ), ), @@ -149,9 +149,9 @@ class DetoCodePage extends StatelessWidget { children: [ Column( children: [ - SizedBox(height: Screenutil.length(192) - kToolbarHeight), + SizedBox(height: 192.w - kToolbarHeight), _header(), - SizedBox(height: Screenutil.length(32)), + SizedBox(height: 32.w), _card(), ], ), diff --git a/lib/pages/goods_deto_page/deto_create_page/deto_create_page.dart b/lib/pages/goods_deto_page/deto_create_page/deto_create_page.dart index 29490e58..f14b8170 100644 --- a/lib/pages/goods_deto_page/deto_create_page/deto_create_page.dart +++ b/lib/pages/goods_deto_page/deto_create_page/deto_create_page.dart @@ -32,8 +32,8 @@ class _DetoCreatePageState extends State { Widget _houseAddress(String title, subtitle) { return Container( - padding: EdgeInsets.only(bottom: Screenutil.length(24)), - margin: EdgeInsets.only(bottom: Screenutil.length(40)), + padding: EdgeInsets.only(bottom: 24.w), + margin: EdgeInsets.only(bottom: 40.w), decoration: BoxDecoration( border: Border(bottom: BorderSide(color: Color(0xffeeeeee), width: 0.5)), @@ -42,11 +42,11 @@ class _DetoCreatePageState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - margin: EdgeInsets.only(bottom: Screenutil.length(32)), + margin: EdgeInsets.only(bottom: 32.w), child: Text( '出户房屋', style: TextStyle( - fontSize: Screenutil.size(28), + fontSize: 28.sp, color: Color(0xff333333), ), ), @@ -56,11 +56,11 @@ class _DetoCreatePageState extends State { crossAxisAlignment: CrossAxisAlignment.center, children: [ Container( - margin: EdgeInsets.only(right: Screenutil.length(42)), + margin: EdgeInsets.only(right: 42.w), child: Image.asset( AssetsImage.HOUSEATTESTATION, - height: Screenutil.length(59), - width: Screenutil.length(59), + height: 59.w, + width: 59.w, ), ), Column( @@ -70,16 +70,16 @@ class _DetoCreatePageState extends State { title, style: TextStyle( fontWeight: FontWeight.w600, - fontSize: Screenutil.size(32), + fontSize: 32.sp, color: Color(0xff333333), ), ), - SizedBox(height: Screenutil.length(10)), + SizedBox(height: 10.w), Text( subtitle, style: TextStyle( fontWeight: FontWeight.w600, - fontSize: Screenutil.size(32), + fontSize: 32.sp, color: Color(0xff333333), ), ) @@ -95,7 +95,7 @@ class _DetoCreatePageState extends State { Widget _inkWellCheckbox() { return InkWell( child: Container( - padding: EdgeInsets.only(bottom: Screenutil.length(24)), + padding: EdgeInsets.only(bottom: 24.w), child: Row( mainAxisAlignment: MainAxisAlignment.start, children: [ @@ -112,7 +112,7 @@ class _DetoCreatePageState extends State { child: Text( '是否需要物业提供搬家公司联系方式', style: TextStyle( - fontSize: Screenutil.size(28), + fontSize: 28.sp, color: Color(0xff333333), ), ), @@ -125,8 +125,8 @@ class _DetoCreatePageState extends State { Widget _checkCard(String title, List> list) { return Container( - height: Screenutil.length(96), - padding: EdgeInsets.symmetric(vertical: Screenutil.length(28)), + height: 96.w, + padding: EdgeInsets.symmetric(vertical: 28.w), decoration: BoxDecoration( border: Border(bottom: BorderSide(color: Color(0xffeeeeee), width: 0.5)), @@ -134,11 +134,11 @@ class _DetoCreatePageState extends State { child: Row( children: [ Container( - margin: EdgeInsets.only(right: Screenutil.length(30)), + margin: EdgeInsets.only(right: 30.w), child: Text( title, style: TextStyle( - fontSize: Screenutil.size(28), color: Color(0xff333333)), + fontSize: 28.sp, color: Color(0xff333333)), ), ), CommonRadio( @@ -172,9 +172,9 @@ class _DetoCreatePageState extends State { children: [ Container( padding: EdgeInsets.only( - left: Screenutil.length(32), - right: Screenutil.length(32), - top: Screenutil.length(32), + left: 32.w, + right: 32.w, + top: 32.w, ), child: ListView( children: [ @@ -186,12 +186,12 @@ class _DetoCreatePageState extends State { _inkWellCheckbox(), Container( margin: EdgeInsets.only( - top: Screenutil.length(54), - bottom: Screenutil.length(24)), + top: 54.w, + bottom: 24.w), child: Text( '添加图片信息(0/9)', style: TextStyle( - fontSize: Screenutil.size(28), + fontSize: 28.sp, color: Color(0xff333333), ), ), diff --git a/lib/pages/goods_deto_page/deto_create_page/widget/common_picker.dart b/lib/pages/goods_deto_page/deto_create_page/widget/common_picker.dart index a18c94be..72a3c9f7 100644 --- a/lib/pages/goods_deto_page/deto_create_page/widget/common_picker.dart +++ b/lib/pages/goods_deto_page/deto_create_page/widget/common_picker.dart @@ -18,8 +18,8 @@ class _CommonPickerState extends State { @override Widget build(BuildContext context) { return Container( - height: Screenutil.length(96), - padding: EdgeInsets.symmetric(vertical: Screenutil.length(28)), + height: 96.w, + padding: EdgeInsets.symmetric(vertical: 28.w), decoration: BoxDecoration( border: Border(bottom: BorderSide(color: Color(0xffeeeeee), width: 0.5)), @@ -27,11 +27,11 @@ class _CommonPickerState extends State { child: Row( children: [ Container( - margin: EdgeInsets.only(right: Screenutil.length(30)), + margin: EdgeInsets.only(right: 30.w), child: Text( widget.title, style: TextStyle( - fontSize: Screenutil.size(28), color: Color(0xff333333)), + fontSize: 28.sp, color: Color(0xff333333)), ), ), InkWell( @@ -62,16 +62,16 @@ class _CommonPickerState extends State { title: Text( "物品名称", style: TextStyle( - fontSize: Screenutil.size(32), + fontSize: 32.sp, color: Color(0xff333333), ), ), confirmTextStyle: TextStyle( - fontSize: Screenutil.size(28), + fontSize: 28.sp, color: Color(0xffffc40c), ), cancelTextStyle: TextStyle( - fontSize: Screenutil.size(28), + fontSize: 28.sp, color: Color(0xff333333), ), onConfirm: (Picker picker, List value) { @@ -85,21 +85,21 @@ class _CommonPickerState extends State { } }, child: Container( - width: Screenutil.length(538), - height: Screenutil.length(40), + width: 538.w, + height: 40.w, child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text( pickerData, style: TextStyle( - fontSize: Screenutil.size(28), + fontSize: 28.sp, color: Color(0xff999999)), ), Icon( AntDesign.right, color: Color(0xff999999), - size: Screenutil.size(32), + size: 32.sp, ), ], ), diff --git a/lib/pages/goods_deto_page/deto_create_page/widget/common_radio.dart b/lib/pages/goods_deto_page/deto_create_page/widget/common_radio.dart index b330dcc6..1570049a 100644 --- a/lib/pages/goods_deto_page/deto_create_page/widget/common_radio.dart +++ b/lib/pages/goods_deto_page/deto_create_page/widget/common_radio.dart @@ -19,17 +19,17 @@ class _CommonRadioState extends State { fun(index); }, child: Container( - margin: EdgeInsets.only(left: Screenutil.length(20)), + margin: EdgeInsets.only(left: 20.w), child: Row( children: [ Icon( isCheck ? Icons.radio_button_checked : Icons.radio_button_unchecked, - size: Screenutil.length(32), + size: 32.w, color: isCheck ? BaseStyle.colorffc40c : BaseStyle.color979797, ), - SizedBox(width: Screenutil.length(10)), + SizedBox(width: 10.w), Text( title, style: TextStyle( diff --git a/lib/pages/goods_deto_page/goods_deto_page.dart b/lib/pages/goods_deto_page/goods_deto_page.dart index c3349cb3..32568e8a 100644 --- a/lib/pages/goods_deto_page/goods_deto_page.dart +++ b/lib/pages/goods_deto_page/goods_deto_page.dart @@ -105,7 +105,7 @@ class _GoodsDetoPageState extends State { body: Stack( children: [ Padding( - padding: EdgeInsets.only(bottom: Screenutil.length(98)), + padding: EdgeInsets.only(bottom: 98.w), child: RefreshConfiguration( hideFooterWhenNotFull: true, child: SmartRefresher( diff --git a/lib/pages/goods_deto_page/widget/goods_info_card.dart b/lib/pages/goods_deto_page/widget/goods_info_card.dart index fe46b9ea..677d500d 100644 --- a/lib/pages/goods_deto_page/widget/goods_info_card.dart +++ b/lib/pages/goods_deto_page/widget/goods_info_card.dart @@ -14,9 +14,9 @@ class GoodsInfoCard extends StatelessWidget { Widget build(BuildContext context) { return Container( margin: EdgeInsets.only( - top: Screenutil.length(32), - left: Screenutil.length(32), - right: Screenutil.length(32), + top: 32.w, + left: 32.w, + right: 32.w, ), decoration: BoxDecoration( color: Colors.white, @@ -39,13 +39,13 @@ class GoodsInfoCard extends StatelessWidget { ], ), padding: EdgeInsets.only( - top: Screenutil.length(25), - left: Screenutil.length(24), - right: Screenutil.length(24)), + top: 25.w, + left: 24.w, + right: 24.w), child: Column( children: [ Container( - padding: EdgeInsets.only(bottom: Screenutil.length(24)), + padding: EdgeInsets.only(bottom: 24.w), decoration: BoxDecoration( border: Border( bottom: BorderSide( @@ -58,14 +58,14 @@ class GoodsInfoCard extends StatelessWidget { '出户信息', style: TextStyle( fontWeight: FontWeight.w600, - fontSize: Screenutil.size(32), + fontSize: 32.sp, color: Color(0xff333333)), ), Text( status, style: TextStyle( fontWeight: FontWeight.w600, - fontSize: Screenutil.size(28), + fontSize: 28.sp, color: Color(0xff333333)) ), ], @@ -73,8 +73,8 @@ class GoodsInfoCard extends StatelessWidget { ), Container( padding: EdgeInsets.only( - bottom: Screenutil.length(33), - top: Screenutil.length(16), + bottom: 33.w, + top: 16.w, ), decoration: BoxDecoration( border: Border( @@ -85,20 +85,20 @@ class GoodsInfoCard extends StatelessWidget { children: detoInfoList .map( (item) => Container( - padding: EdgeInsets.only(top: Screenutil.length(8)), + padding: EdgeInsets.only(top: 8.w), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text( item['title'], style: TextStyle( - fontSize: Screenutil.size(28), + fontSize: 28.sp, color: Color(0xff999999)), ), Text( item['content'], style: TextStyle( - fontSize: Screenutil.size(28), + fontSize: 28.sp, color: Color(0xff333333)), ), ], @@ -110,18 +110,18 @@ class GoodsInfoCard extends StatelessWidget { ), Container( margin: EdgeInsets.only( - top: Screenutil.length(19), - bottom: Screenutil.length(30), + top: 19.w, + bottom: 30.w, ), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - margin: EdgeInsets.only(bottom: Screenutil.length(25)), + margin: EdgeInsets.only(bottom: 25.w), child: Text( '图片信息', style: TextStyle( - fontSize: Screenutil.size(28), + fontSize: 28.sp, color: Color(0xff333333)), ), ), diff --git a/lib/pages/goods_deto_page/widget/goods_info_card_button.dart b/lib/pages/goods_deto_page/widget/goods_info_card_button.dart index 1e85b510..f66ce714 100644 --- a/lib/pages/goods_deto_page/widget/goods_info_card_button.dart +++ b/lib/pages/goods_deto_page/widget/goods_info_card_button.dart @@ -28,7 +28,7 @@ class GoodsInfoCardButton extends StatelessWidget { title: Text( url, style: TextStyle( - fontSize: Screenutil.size(34), + fontSize: 34.sp, color: Color(0xff030303), ), ), @@ -37,7 +37,7 @@ class GoodsInfoCardButton extends StatelessWidget { child: Text( '取消', style: TextStyle( - fontSize: Screenutil.size(34), + fontSize: 34.sp, color: Color(0xff333333), ), ), @@ -50,7 +50,7 @@ class GoodsInfoCardButton extends StatelessWidget { '呼叫', style: TextStyle( fontWeight: FontWeight.w600, - fontSize: Screenutil.size(34), + fontSize: 34.sp, color: Color(0xffff8200), ), ), @@ -75,7 +75,7 @@ class GoodsInfoCardButton extends StatelessWidget { bottomRight: Radius.circular(6), ), ), - height: Screenutil.length(96), + height: 96.w, child: Row( children: _listButton .asMap() @@ -97,7 +97,7 @@ class GoodsInfoCardButton extends StatelessWidget { child: Container( alignment: Alignment.center, padding: EdgeInsets.symmetric( - vertical: Screenutil.length(26.5), + vertical: 26.5.w, ), decoration: BoxDecoration( border: Border( @@ -112,17 +112,17 @@ class GoodsInfoCardButton extends StatelessWidget { children: [ Icon( _listButton[index]['icon'], - size: Screenutil.size(36), + size: 36.sp, color: Color(0xff333333), ), Container( margin: - EdgeInsets.only(left: Screenutil.length(14)), + EdgeInsets.only(left: 14.w), child: Text( _listButton[index]['title'], style: TextStyle( fontWeight: FontWeight.w600, - fontSize: Screenutil.size(32), + fontSize: 32.sp, color: Color(0xff333333), ), ), diff --git a/lib/pages/goods_deto_page/widget/image_horizontal_list.dart b/lib/pages/goods_deto_page/widget/image_horizontal_list.dart index b34a76c1..6e0b1e19 100644 --- a/lib/pages/goods_deto_page/widget/image_horizontal_list.dart +++ b/lib/pages/goods_deto_page/widget/image_horizontal_list.dart @@ -26,7 +26,7 @@ class ImageHorizontalList extends StatelessWidget { @override Widget build(BuildContext context) { return Container( - height: Screenutil.length(184), + height: 184.w, child: ListView.builder( shrinkWrap: true, scrollDirection: Axis.horizontal, @@ -34,7 +34,7 @@ class ImageHorizontalList extends StatelessWidget { return AspectRatio( aspectRatio: 1, child: Container( - margin: EdgeInsets.only(right: Screenutil.length(16)), + margin: EdgeInsets.only(right: 16.w), child: ClipRRect( borderRadius: BorderRadius.all(Radius.circular(4)), child: GalleryExampleItemThumbnail( diff --git a/lib/pages/goods_manage_page/goods_manage_page.dart b/lib/pages/goods_manage_page/goods_manage_page.dart index b8c9101a..ccfa82e4 100644 --- a/lib/pages/goods_manage_page/goods_manage_page.dart +++ b/lib/pages/goods_manage_page/goods_manage_page.dart @@ -60,15 +60,15 @@ class _GoodsManagePageState extends State { Container _goodsCard(String imagePath, title, int goodsNum) { return Container( margin: EdgeInsets.only( - top: Screenutil.length(20), - left: Screenutil.length(32), - right: Screenutil.length(32), + top: 20.w, + left: 32.w, + right: 32.w, ), padding: EdgeInsets.only( - top: Screenutil.length(12), - left: Screenutil.length(10), - right: Screenutil.length(10), - bottom: Screenutil.length(17), + top: 12.w, + left: 10.w, + right: 10.w, + bottom: 17.w, ), decoration: BoxDecoration( color: Colors.white, @@ -79,12 +79,12 @@ class _GoodsManagePageState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - margin: EdgeInsets.only(right: Screenutil.length(20)), + margin: EdgeInsets.only(right: 20.w), child: ClipRRect( child: CachedImageWrapper( url: imagePath, - width: Screenutil.length(160), - height: Screenutil.length(120), + width: 160.w, + height: 120.w, ), ), ), @@ -95,15 +95,15 @@ class _GoodsManagePageState extends State { Text( '物品名称:${title}', style: TextStyle( - fontSize: Screenutil.size(28), + fontSize: 28.sp, color: Color(0xff4a4b51), ), ), - SizedBox(height: Screenutil.length(20)), + SizedBox(height: 20.w), Text( '数量剩余:${goodsNum}个', style: TextStyle( - fontSize: Screenutil.size(24), + fontSize: 24.sp, color: Color(0xff999999), ), ), diff --git a/lib/pages/goods_manage_page/mine_goods_page/mine_goods_page.dart b/lib/pages/goods_manage_page/mine_goods_page/mine_goods_page.dart index 5809516c..0195311f 100644 --- a/lib/pages/goods_manage_page/mine_goods_page/mine_goods_page.dart +++ b/lib/pages/goods_manage_page/mine_goods_page/mine_goods_page.dart @@ -88,17 +88,17 @@ class _MineGoodsPageState extends State { return InkWell( onTap: () {}, child: Container( - width: Screenutil.length(120), - height: Screenutil.length(44), + width: 120.w, + height: 44.w, alignment: Alignment.center, - padding: EdgeInsets.symmetric(vertical: Screenutil.length(7)), + padding: EdgeInsets.symmetric(vertical: 7.w), decoration: BoxDecoration( color: Color(0xff2a2a2a), borderRadius: BorderRadius.all(Radius.circular(20)), ), child: Text( '报损', - style: TextStyle(fontSize: Screenutil.size(22), color: Colors.white), + style: TextStyle(fontSize: 22.sp, color: Colors.white), ), ), ); @@ -108,14 +108,14 @@ class _MineGoodsPageState extends State { String title, borrowTime, timeLength, status, int goodsNum) { return Container( margin: EdgeInsets.only( - top: Screenutil.length(20), - left: Screenutil.length(32), - right: Screenutil.length(32), + top: 20.w, + left: 32.w, + right: 32.w, ), padding: EdgeInsets.only( - top: Screenutil.length(30), - left: Screenutil.length(38), - right: Screenutil.length(34), + top: 30.w, + left: 38.w, + right: 34.w, ), decoration: BoxDecoration( color: Colors.white, @@ -133,49 +133,49 @@ class _MineGoodsPageState extends State { Text( '物品名称:${title}', style: TextStyle( - fontSize: Screenutil.size(28), + fontSize: 28.sp, color: Color(0xff4a4b51), ), ), Container( - margin: EdgeInsets.only(top: Screenutil.length(16)), + margin: EdgeInsets.only(top: 16.w), child: Text( '借还数量:${goodsNum}个', style: TextStyle( - fontSize: Screenutil.size(24), + fontSize: 24.sp, color: Color(0xff333333), ), ), ), Container( - margin: EdgeInsets.only(top: Screenutil.length(16)), + margin: EdgeInsets.only(top: 16.w), child: Text( '借用时间: ${borrowTime}', style: TextStyle( - fontSize: Screenutil.size(24), + fontSize: 24.sp, color: Color(0xff999999), ), ), ), Container( - margin: EdgeInsets.only(top: Screenutil.length(16)), + margin: EdgeInsets.only(top: 16.w), child: Text( '借用时长: ${timeLength}日', style: TextStyle( - fontSize: Screenutil.size(24), + fontSize: 24.sp, color: Color(0xff999999), ), ), ), Container( - margin: EdgeInsets.only(top: Screenutil.length(16)), + margin: EdgeInsets.only(top: 16.w), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text( '借用状态: ${status}', style: TextStyle( - fontSize: Screenutil.size(24), + fontSize: 24.sp, color: Color(0xff999999), ), ), @@ -183,15 +183,15 @@ class _MineGoodsPageState extends State { ], ), ), - SizedBox(height: Screenutil.length(12)), + SizedBox(height: 12.w), Divider(color: Color(0xfff9f9f9)), status == '未还' ? Container( - margin: EdgeInsets.only(bottom: Screenutil.length(9)), + margin: EdgeInsets.only(bottom: 9.w), child: Text( '温馨提示:您的物品已借用${timeLength}天,如果用完,请及时归还', style: TextStyle( - fontSize: Screenutil.size(22), + fontSize: 22.sp, color: Color(0xff999999), ), ), diff --git a/lib/pages/home/home_page.dart b/lib/pages/home/home_page.dart index a25135a7..de969880 100644 --- a/lib/pages/home/home_page.dart +++ b/lib/pages/home/home_page.dart @@ -100,7 +100,7 @@ class _HomePageState extends State children: [ HomeSearch(), HomeSwiper(), - SizedBox(height: Screenutil.length(100)), + SizedBox(height: 100.w), ContainerComment( radius: 8, customWidget: GridButton( @@ -138,7 +138,7 @@ class _HomePageState extends State ), ], ), - SizedBox(height: Screenutil.length(24)), + SizedBox(height: 24.w), Column( children: [ HomeTagBar( @@ -164,7 +164,7 @@ class _HomePageState extends State ), ], ), - SizedBox(height: Screenutil.length(30)), + SizedBox(height: 30.w), HomeTagBar( title: '社区商城', tag: '团购', @@ -176,9 +176,9 @@ class _HomePageState extends State ), SliverPadding( padding: EdgeInsets.only( - top: Screenutil.length(30), - left: Screenutil.length(32), - right: Screenutil.length(32), + top: 30.w, + left: 32.w, + right: 32.w, ), sliver: _shopList.length == 0 ? SliverToBoxAdapter(child: GoodsCardSkeleton()) diff --git a/lib/pages/home/widget/home_app_bar.dart b/lib/pages/home/widget/home_app_bar.dart index fe1b536b..aa27be2b 100644 --- a/lib/pages/home/widget/home_app_bar.dart +++ b/lib/pages/home/widget/home_app_bar.dart @@ -42,14 +42,14 @@ class _HomeAppBarState extends State { '皇冠花园二期', style: TextStyle( fontWeight: FontWeight.w600, - fontSize: Screenutil.size(36), + fontSize: 36.sp, color: Color(0xff333333), ), ), centerTitle: true, backgroundColor: Colors.transparent, leading: Container( - margin: EdgeInsets.only(left: Screenutil.length(32)), + margin: EdgeInsets.only(left: 32.w), child: Column( mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.start, @@ -58,14 +58,14 @@ class _HomeAppBarState extends State { '深圳', style: TextStyle( fontWeight: FontWeight.w600, - fontSize: Screenutil.size(24), + fontSize: 24.sp, color: Color(0xff333333), ), ), Text( '阴 27℃', style: TextStyle( - fontSize: Screenutil.size(20), + fontSize: 20.sp, color: Color(0xff333333), ), ) diff --git a/lib/pages/home/widget/home_card.dart b/lib/pages/home/widget/home_card.dart index fa39826c..f0274dd7 100644 --- a/lib/pages/home/widget/home_card.dart +++ b/lib/pages/home/widget/home_card.dart @@ -35,35 +35,35 @@ class _HomeCardState extends State { Widget _countDown() { return Container( - width: Screenutil.length(638), + width: 638.w, color: Color(0xff333333).withOpacity(0.8), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Container( padding: EdgeInsets.only( - left: Screenutil.length(24), - top: Screenutil.length(11), - bottom: Screenutil.length(12), + left: 24.w, + top: 11.w, + bottom: 12.w, ), child: Text( '剩余时间:09天13时46分', style: TextStyle( fontWeight: FontWeight.w600, color: Color(0xffffffff), - fontSize: Screenutil.size(24)), + fontSize: 24.sp), ), ), Container( padding: EdgeInsets.only( - right: Screenutil.length(24), - top: Screenutil.length(7), - bottom: Screenutil.length(7), + right: 24.w, + top: 7.w, + bottom: 7.w, ), child: Text( '¥99.9', style: TextStyle( - color: Color(0xffff8200), fontSize: Screenutil.size(36)), + color: Color(0xffff8200), fontSize: 36.sp), ), ), ], @@ -109,21 +109,21 @@ class _HomeCardState extends State { } }, child: Container( - height: Screenutil.length(44), - width: Screenutil.length(120), + height: 44.w, + width: 120.w, alignment: Alignment.center, decoration: BoxDecoration( color: Color(0xffffc40c), borderRadius: - BorderRadius.all(Radius.circular(Screenutil.length(22))), + BorderRadius.all(Radius.circular(22.w)), ), - padding: EdgeInsets.symmetric(vertical: Screenutil.length(8)), + padding: EdgeInsets.symmetric(vertical: 8.w), child: Text( buttonName, style: TextStyle( fontWeight: FontWeight.w600, color: Color(0xff4a4b51), - fontSize: Screenutil.size(20)), + fontSize: 20.sp), ), ), ); @@ -134,21 +134,21 @@ class _HomeCardState extends State { return Container( color: Colors.white, margin: EdgeInsets.symmetric( - horizontal: Screenutil.length(32), + horizontal: 32.w, ), padding: EdgeInsets.only( - left: Screenutil.length(24), - right: Screenutil.length(24), - bottom: Screenutil.length(40), + left: 24.w, + right: 24.w, + bottom: 40.w, ), child: Container( decoration: BoxDecoration( color: Colors.white, - borderRadius: BorderRadius.all(Radius.circular(Screenutil.length(8))), + borderRadius: BorderRadius.all(Radius.circular(8.w)), border: - Border.all(color: Color(0xffe8e8e8), width: Screenutil.length(2)), + Border.all(color: Color(0xffe8e8e8), width: 2.w), ), - padding: EdgeInsets.only(bottom: Screenutil.length(24)), + padding: EdgeInsets.only(bottom: 24.w), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -157,13 +157,13 @@ class _HomeCardState extends State { Container( child: ClipRRect( borderRadius: BorderRadius.only( - topLeft: Radius.circular(Screenutil.length(8)), - topRight: Radius.circular(Screenutil.length(8)), + topLeft: Radius.circular(8.w), + topRight: Radius.circular(8.w), ), child: CachedImageWrapper( url: widget.imagePath, - width: Screenutil.length(638), - height: Screenutil.length(210), + width: 638.w, + height: 210.w, ), ), ), @@ -171,22 +171,22 @@ class _HomeCardState extends State { ), Container( margin: EdgeInsets.only( - top: Screenutil.length(16), - left: Screenutil.length(24), + top: 16.w, + left: 24.w, ), child: Text( widget.title, style: TextStyle( fontWeight: FontWeight.w600, color: Color(0xff4a4b51), - fontSize: Screenutil.size(28)), + fontSize: 28.sp), ), ), Container( margin: EdgeInsets.only( - top: Screenutil.length(16), - left: Screenutil.length(24), - right: Screenutil.length(24), + top: 16.w, + left: 24.w, + right: 24.w, ), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, @@ -196,7 +196,7 @@ class _HomeCardState extends State { children: [ RichText( text: TextSpan( - style: TextStyle(fontSize: Screenutil.size(24)), + style: TextStyle(fontSize: 24.sp), children: [ TextSpan( text: widget.isActivity ? '地点:' : '原产地区:', @@ -208,10 +208,10 @@ class _HomeCardState extends State { ), ), Container( - margin: EdgeInsets.only(top: Screenutil.length(8)), + margin: EdgeInsets.only(top: 8.w), child: RichText( text: TextSpan( - style: TextStyle(fontSize: Screenutil.size(24)), + style: TextStyle(fontSize: 24.sp), children: [ TextSpan( text: widget.isActivity ? '活动时间:' : '预计到货:', @@ -232,17 +232,17 @@ class _HomeCardState extends State { widget.isActivity ? Container( margin: EdgeInsets.only( - top: Screenutil.length(16), - right: Screenutil.length(24), + top: 16.w, + right: 24.w, ), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Container( - margin: EdgeInsets.only(left: Screenutil.length(80)), + margin: EdgeInsets.only(left: 80.w), child: ImageStack( imageList: images, - imageRadius: Screenutil.size(44), + imageRadius: 44.sp, imageCount: 3, imageBorderWidth: 1, totalCount: 3, diff --git a/lib/pages/home/widget/home_search.dart b/lib/pages/home/widget/home_search.dart index cca8ece8..1c905e3e 100644 --- a/lib/pages/home/widget/home_search.dart +++ b/lib/pages/home/widget/home_search.dart @@ -23,39 +23,39 @@ class _HomeSearchState extends State { ), ), padding: EdgeInsets.only( - top: Screenutil.length(9), - left: Screenutil.length(32), - right: Screenutil.length(32), - bottom: Screenutil.length(17), + top: 9.w, + left: 32.w, + right: 32.w, + bottom: 17.w, ), child: InkWell( onTap: () { showSearch(context: context, delegate: searchBarDelegate()); }, child: Container( - width: Screenutil.length(686), - height: Screenutil.length(72), + width: 686.w, + height: 72.w, padding: EdgeInsets.only( - top: Screenutil.length(16), - bottom: Screenutil.length(16), - left: Screenutil.length(24), + top: 16.w, + bottom: 16.w, + left: 24.w, ), decoration: BoxDecoration( color: Colors.white, borderRadius: - BorderRadius.all(Radius.circular(Screenutil.length(36))), + BorderRadius.all(Radius.circular(36.w)), ), child: Row(children: [ Icon( AntDesign.search1, color: Color(0xff999999), - size: Screenutil.size(28), + size: 28.sp, ), - SizedBox(width: Screenutil.length(16)), + SizedBox(width: 16.w), Text( '搜索商品、活动、帖子、应用', style: TextStyle( - fontSize: Screenutil.size(28), + fontSize: 28.sp, color: Color(0xff999999), ), ) diff --git a/lib/pages/home/widget/home_swiper.dart b/lib/pages/home/widget/home_swiper.dart index 8c25b8f5..b15ef5d7 100644 --- a/lib/pages/home/widget/home_swiper.dart +++ b/lib/pages/home/widget/home_swiper.dart @@ -23,7 +23,7 @@ class _HomeSwiperState extends State { overflow: Overflow.visible, children: [ Container( - height: Screenutil.length(181), + height: 181.w, decoration: BoxDecoration( gradient: LinearGradient( begin: Alignment.centerLeft, @@ -33,10 +33,10 @@ class _HomeSwiperState extends State { ), ), Positioned( - top: Screenutil.length(17), + top: 17.w, left: 0, right: 0, - bottom: -Screenutil.length(76), + bottom: -76.w, child: Swiper( itemBuilder: (BuildContext context, int index) { return Container( @@ -51,8 +51,8 @@ class _HomeSwiperState extends State { ), child: CachedImageWrapper( url: imageList[index], - height: Screenutil.length(240), - width: Screenutil.length(686), + height: 240.w, + width: 686.w, ), ); }, @@ -74,9 +74,9 @@ class _HomeSwiperState extends State { builder: DotSwiperPaginationBuilder( activeColor: Color(0xffFEC200), color: Colors.white, - size: Screenutil.length(15), - activeSize: Screenutil.length(20), - space: Screenutil.length(10), + size: 15.w, + activeSize: 20.w, + space: 10.w, ), ), autoplayDelay: 5000, diff --git a/lib/pages/home/widget/home_tag_bar.dart b/lib/pages/home/widget/home_tag_bar.dart index 07c2f83f..1a9b398f 100644 --- a/lib/pages/home/widget/home_tag_bar.dart +++ b/lib/pages/home/widget/home_tag_bar.dart @@ -22,9 +22,9 @@ class _HomeTagBarState extends State { return Container( color: widget.isShowTitle ? Colors.transparent : Colors.white, margin: EdgeInsets.symmetric( - horizontal: Screenutil.length(32), + horizontal: 32.w, ), - padding: EdgeInsets.all(Screenutil.length(24)), + padding: EdgeInsets.all(24.w), child: Stack( children: [ Row( @@ -34,11 +34,11 @@ class _HomeTagBarState extends State { children: [ widget.isShowImage ? Container( - margin: EdgeInsets.only(right: Screenutil.length(24)), + margin: EdgeInsets.only(right: 24.w), child: Image.asset( AssetsImage.NOTIFICATION, - height: Screenutil.length(38), - width: Screenutil.length(38), + height: 38.w, + width: 38.w, ), ) : SizedBox(), @@ -46,8 +46,8 @@ class _HomeTagBarState extends State { widget.title, style: TextStyle( fontSize: widget.isShowImage - ? Screenutil.size(28) - : Screenutil.size(32), + ? 28.sp + : 32.sp, fontWeight: widget.isShowImage ? FontWeight.normal : FontWeight.w600, @@ -64,13 +64,13 @@ class _HomeTagBarState extends State { '更多${widget.tag}', style: TextStyle( color: Color(0xff999999), - fontSize: Screenutil.size(20)), + fontSize: 20.sp), ), - SizedBox(width: Screenutil.length(8)), + SizedBox(width: 8.w), Icon( AntDesign.right, color: Color(0xff999999), - size: Screenutil.size(20), + size: 20.sp, ), ]), ), @@ -79,7 +79,7 @@ class _HomeTagBarState extends State { widget.isShowImage ? SizedBox() : Positioned( - top: Screenutil.length(30), + top: 30.w, left: 0, child: Container( decoration: BoxDecoration( @@ -91,8 +91,8 @@ class _HomeTagBarState extends State { blurRadius: 10.0), ], ), - width: Screenutil.length(126), - height: Screenutil.length(8)), + width: 126.w, + height: 8.w), ) ], ), diff --git a/lib/pages/industry_committee/committee_mailbox/committee_mailbox_page.dart b/lib/pages/industry_committee/committee_mailbox/committee_mailbox_page.dart index 5d151446..56ff27f1 100644 --- a/lib/pages/industry_committee/committee_mailbox/committee_mailbox_page.dart +++ b/lib/pages/industry_committee/committee_mailbox/committee_mailbox_page.dart @@ -16,9 +16,9 @@ class _CommitteeMailboxPageState extends State { Widget _input() { return Container( padding: EdgeInsets.only( - top: Screenutil.length(32), - left: Screenutil.length(22), - right: Screenutil.length(35)), + top: 32.w, + left: 22.w, + right: 35.w), decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(8)), border: Border.all(color: Color(0xffd4cfbe), width: 1.0), @@ -26,7 +26,7 @@ class _CommitteeMailboxPageState extends State { child: TextFormField( cursorColor: Color(0xffffc40c), style: TextStyle( - fontSize: Screenutil.size(28), + fontSize: 28.sp, fontWeight: FontWeight.w600, ), controller: _thingsContent, @@ -35,8 +35,8 @@ class _CommitteeMailboxPageState extends State { decoration: InputDecoration( isDense: true, contentPadding: EdgeInsets.only( - top: Screenutil.length(0), - bottom: Screenutil.length(0), + top: 0.w, + bottom: 0.w, ), hintText: '', border: InputBorder.none, //去掉输入框的下滑线 @@ -44,7 +44,7 @@ class _CommitteeMailboxPageState extends State { filled: true, hintStyle: TextStyle( color: Color(0xff999999), - fontSize: Screenutil.size(28), + fontSize: 28.sp, fontWeight: FontWeight.normal, ), ), @@ -56,21 +56,21 @@ class _CommitteeMailboxPageState extends State { return InkWell( child: Container( alignment: Alignment.center, - height: Screenutil.length(96), - width: Screenutil.length(686), + height: 96.w, + width: 686.w, padding: EdgeInsets.symmetric( - vertical: Screenutil.length(26), + vertical: 26.w, ), - margin: EdgeInsets.only(top: Screenutil.length(40)), + margin: EdgeInsets.only(top: 40.w), decoration: BoxDecoration( color: Color(0xffffc40c), borderRadius: - BorderRadius.all(Radius.circular(Screenutil.length(48)))), + BorderRadius.all(Radius.circular(48.w))), child: Text( '确认提交', style: TextStyle( fontWeight: FontWeight.w600, - fontSize: Screenutil.size(32), + fontSize: 32.sp, color: Color(0xff333333)), ), ), @@ -89,7 +89,7 @@ class _CommitteeMailboxPageState extends State { body: Container( color: Colors.white, child: ListView( - padding: EdgeInsets.symmetric(horizontal: Screenutil.length(32)), + padding: EdgeInsets.symmetric(horizontal: 32.w), children: [ SingleChildScrollView( child: GestureDetector( @@ -102,12 +102,12 @@ class _CommitteeMailboxPageState extends State { children: [ Container( margin: EdgeInsets.symmetric( - vertical: Screenutil.length(48), + vertical: 48.w, ), child: Text( '您对园区的规约、管理、环境、活动等各方面有何宝贵建议,请写在下方为园区建设贡献一份力量。', style: TextStyle( - fontSize: Screenutil.size(28), + fontSize: 28.sp, color: Color(0xff333333), ), ), diff --git a/lib/pages/industry_committee/industry_committee_page.dart b/lib/pages/industry_committee/industry_committee_page.dart index ba618885..5f0555fc 100644 --- a/lib/pages/industry_committee/industry_committee_page.dart +++ b/lib/pages/industry_committee/industry_committee_page.dart @@ -42,7 +42,7 @@ class _IndustryCommitteePageState extends State { title: Text( '0574-88478909', style: TextStyle( - fontSize: Screenutil.size(34), + fontSize: 34.sp, color: Color(0xff030303), ), ), @@ -51,7 +51,7 @@ class _IndustryCommitteePageState extends State { child: Text( '取消', style: TextStyle( - fontSize: Screenutil.size(34), + fontSize: 34.sp, color: Color(0xff333333), ), ), @@ -64,7 +64,7 @@ class _IndustryCommitteePageState extends State { '呼叫', style: TextStyle( fontWeight: FontWeight.w600, - fontSize: Screenutil.size(34), + fontSize: 34.sp, color: Color(0xffff8200), ), ), @@ -97,12 +97,12 @@ class _IndustryCommitteePageState extends State { color: color, alignment: Alignment.center, padding: EdgeInsets.symmetric( - vertical: Screenutil.length(26.5), + vertical: 26.5.w, ), child: Text( title, style: TextStyle( - fontSize: Screenutil.size(32), + fontSize: 32.sp, color: fontColor, ), ), @@ -115,7 +115,7 @@ class _IndustryCommitteePageState extends State { bottom: 0, child: Container( height: - Screenutil.length(98) + MediaQuery.of(context).viewPadding.bottom, + 98.w + MediaQuery.of(context).viewPadding.bottom, width: MediaQuery.of(context).size.width, child: Row( children: _listBottom diff --git a/lib/pages/industry_committee/widget/staff_list.dart b/lib/pages/industry_committee/widget/staff_list.dart index ef95f6bf..58ccf8ba 100644 --- a/lib/pages/industry_committee/widget/staff_list.dart +++ b/lib/pages/industry_committee/widget/staff_list.dart @@ -65,7 +65,7 @@ class _StaffListState extends State { TextStyle _subStyle() { return TextStyle( - fontSize: Screenutil.size(24), + fontSize: 24.sp, color: Color(0xff999999), ); } @@ -73,11 +73,11 @@ class _StaffListState extends State { Positioned _positionedTag(String tag) { return Positioned( top: 0, - right: Screenutil.length(20), + right: 20.w, child: Container( padding: EdgeInsets.symmetric( - horizontal: Screenutil.length(21.5), - vertical: Screenutil.length(5.5)), + horizontal: 21.5.w, + vertical: 5.5.w), decoration: BoxDecoration( color: Color(0xfffff3cd), border: Border.all(color: Color(0xffffc40c), width: 0.5), @@ -85,7 +85,7 @@ class _StaffListState extends State { child: Text( tag, style: TextStyle( - fontSize: Screenutil.size(24), + fontSize: 24.sp, color: Color(0xff333333), ), ), @@ -97,14 +97,14 @@ class _StaffListState extends State { String tenure, String post, String tag) { return Container( margin: EdgeInsets.only( - left: Screenutil.length(32), - right: Screenutil.length(32), - top: Screenutil.length(20), + left: 32.w, + right: 32.w, + top: 20.w, ), padding: EdgeInsets.only( - left: Screenutil.length(20), - top: Screenutil.length(20), - bottom: Screenutil.length(20), + left: 20.w, + top: 20.w, + bottom: 20.w, ), decoration: BoxDecoration( color: Color(0xffffffff), @@ -116,10 +116,10 @@ class _StaffListState extends State { children: [ CachedImageWrapper( url: imagePath, - height: Screenutil.length(150), - width: Screenutil.length(150), + height: 150.w, + width: 150.w, ), - SizedBox(width: Screenutil.length(24)), + SizedBox(width: 24.w), Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -127,21 +127,21 @@ class _StaffListState extends State { name, style: TextStyle( fontWeight: FontWeight.w600, - fontSize: Screenutil.size(28), + fontSize: 28.sp, color: Color(0xff333333), ), ), - SizedBox(width: Screenutil.length(10)), + SizedBox(width: 10.w), Text( '住址:${address}', style: _subStyle(), ), - SizedBox(width: Screenutil.length(10)), + SizedBox(width: 10.w), Text( '任职期限:${tenure}', style: _subStyle(), ), - SizedBox(width: Screenutil.length(10)), + SizedBox(width: 10.w), Text( '从事岗位:${post}', style: _subStyle(), diff --git a/lib/pages/invoice/invoice_page.dart b/lib/pages/invoice/invoice_page.dart index 7500ac51..5bf986fa 100644 --- a/lib/pages/invoice/invoice_page.dart +++ b/lib/pages/invoice/invoice_page.dart @@ -37,7 +37,7 @@ class _InvoicePageState extends State { elevation: 0, backgroundColor: Color(0xffffffff), leading: IconButton( - icon: Icon(AntDesign.left, size: Screenutil.size(40)), + icon: Icon(AntDesign.left, size: 40.sp), onPressed: () { Navigator.pop(context); }, @@ -47,7 +47,7 @@ class _InvoicePageState extends State { '开具发票', style: TextStyle( fontWeight: FontWeight.w600, - fontSize: Screenutil.size(32), + fontSize: 32.sp, color: Color(0xff333333), ), ), @@ -57,10 +57,10 @@ class _InvoicePageState extends State { Container _containerInvoiceDetailCheck() { return Container( color: Colors.white, - height: Screenutil.length(96), + height: 96.w, padding: EdgeInsets.symmetric( - vertical: Screenutil.length(28), - horizontal: Screenutil.length(32), + vertical: 28.w, + horizontal: 32.w, ), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, @@ -72,14 +72,14 @@ class _InvoicePageState extends State { Text( '发票内容', style: TextStyle( - fontSize: Screenutil.size(28), + fontSize: 28.sp, color: Color(0xff333333), ), ), - SizedBox(width: Screenutil.length(6)), + SizedBox(width: 6.w), Icon( AntDesign.exclamationcircleo, - size: Screenutil.size(20), + size: 20.sp, color: Color(0xff999999), ), ], @@ -100,18 +100,18 @@ class _InvoicePageState extends State { onTap: () {}, child: Container( color: Color(0xffffc40c), - height: Screenutil.length(85), + height: 85.w, margin: EdgeInsets.symmetric( - horizontal: Screenutil.length(43), + horizontal: 43.w, ), padding: EdgeInsets.symmetric( - vertical: Screenutil.length(20), + vertical: 20.w, ), alignment: Alignment.center, child: Text( '确认', style: TextStyle( - fontSize: Screenutil.size(32), + fontSize: 32.sp, color: Color(0xff333333), ), ), @@ -132,14 +132,14 @@ class _InvoicePageState extends State { Text( '增值税电子普票', style: TextStyle( - fontSize: Screenutil.size(28), + fontSize: 28.sp, color: Color(0xff333333), ), ), - SizedBox(width: Screenutil.length(12)), + SizedBox(width: 12.w), Icon( AntDesign.right, - size: Screenutil.size(20), + size: 20.sp, color: Color(0xff333333), ), ], @@ -165,7 +165,7 @@ class _InvoicePageState extends State { }, title: '个人/事业单位', ), - SizedBox(width: Screenutil.length(12)), + SizedBox(width: 12.w), RoundCheckBox( value: _checkRise[1], onChanged: () { @@ -200,10 +200,10 @@ class _InvoicePageState extends State { children: _listHeader .map((item) => Container( padding: EdgeInsets.only( - left: Screenutil.length(77), - right: Screenutil.length(32), - top: Screenutil.length(28), - // bottom: Screenutil.length(28), + left: 77.w, + right: 32.w, + top: 28.w, + // bottom: 28.w, ), child: Column( children: [ @@ -213,14 +213,14 @@ class _InvoicePageState extends State { Text( item['title'], style: TextStyle( - fontSize: Screenutil.size(28), + fontSize: 28.sp, color: Color(0xff333333), ), ), item['rightWidget'] ], ), - SizedBox(height: Screenutil.length(28)), + SizedBox(height: 28.w), Divider(height: 1), ], ), @@ -235,7 +235,7 @@ class _InvoicePageState extends State { appBar: _appBar(), body: SingleChildScrollView( child: Container( - height: Screenutil.length(1334), + height: 1334.w, child: GestureDetector( behavior: HitTestBehavior.opaque, onTap: () { @@ -251,9 +251,9 @@ class _InvoicePageState extends State { children: [InvoiceInput(isEnterprise: isEnterprise)], ), ), - SizedBox(height: Screenutil.length(66)), + SizedBox(height: 66.w), _containerInvoiceDetailCheck(), - SizedBox(height: Screenutil.length(92)), + SizedBox(height: 92.w), _containerSubmit(), ], ), diff --git a/lib/pages/invoice/widget/invoice_input.dart b/lib/pages/invoice/widget/invoice_input.dart index ea256463..1293835e 100644 --- a/lib/pages/invoice/widget/invoice_input.dart +++ b/lib/pages/invoice/widget/invoice_input.dart @@ -36,10 +36,10 @@ class _InvoiceInputState extends State { return listInput .map((item) => Container( padding: EdgeInsets.only( - left: Screenutil.length(77), - right: Screenutil.length(32), - top: Screenutil.length(28), - // bottom: Screenutil.length(28), + left: 77.w, + right: 32.w, + top: 28.w, + // bottom: 28.w, ), child: Column( children: [ @@ -49,7 +49,7 @@ class _InvoiceInputState extends State { Text( item['title'], style: TextStyle( - fontSize: Screenutil.size(28), + fontSize: 28.sp, color: Color(0xff333333), ), ), @@ -61,15 +61,15 @@ class _InvoiceInputState extends State { // ] // : [], cursorColor: Color(0xffffc40c), - style: TextStyle(fontSize: Screenutil.size(28)), + style: TextStyle(fontSize: 28.sp), controller: item['controller'], onChanged: (String value) {}, textAlign: TextAlign.end, decoration: InputDecoration( isDense: true, contentPadding: EdgeInsets.only( - top: Screenutil.length(0), - bottom: Screenutil.length(0), + top: 0.w, + bottom: 0.w, ), hintText: item['hintText'], border: InputBorder.none, //去掉输入框的下滑线 @@ -77,13 +77,13 @@ class _InvoiceInputState extends State { filled: true, hintStyle: TextStyle( color: Color(0xff999999), - fontSize: Screenutil.size(24)), + fontSize: 24.sp), ), ), ), ], ), - SizedBox(height: Screenutil.length(28)), + SizedBox(height: 28.w), Divider(height: 1), ], ), diff --git a/lib/pages/life_pay/life_pay_bill_page/life_pay_bill_page.dart b/lib/pages/life_pay/life_pay_bill_page/life_pay_bill_page.dart index 06368e54..3de1bcc3 100644 --- a/lib/pages/life_pay/life_pay_bill_page/life_pay_bill_page.dart +++ b/lib/pages/life_pay/life_pay_bill_page/life_pay_bill_page.dart @@ -19,7 +19,7 @@ class _LifePayBillPageState extends State { Text( title, style: TextStyle( - fontSize: Screenutil.size(28), + fontSize: 28.sp, color: Color(0xff666666), ), ), @@ -27,7 +27,7 @@ class _LifePayBillPageState extends State { subtitle, style: TextStyle( fontWeight: FontWeight.w600, - fontSize: Screenutil.size(28), + fontSize: 28.sp, color: Color(0xff333333), ), ), @@ -48,21 +48,21 @@ class _LifePayBillPageState extends State { children: [ Container( margin: EdgeInsets.only( - top: Screenutil.length(32), - left: Screenutil.length(32), - right: Screenutil.length(32)), + top: 32.w, + left: 32.w, + right: 32.w), decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.all(Radius.circular(6)), ), padding: EdgeInsets.symmetric( - horizontal: Screenutil.length(20), - vertical: Screenutil.length(32), + horizontal: 20.w, + vertical: 32.w, ), child: Column( children: [ _cardList('收费项目', '公共能耗费'), - SizedBox(height: Screenutil.length(30)), + SizedBox(height: 30.w), _cardList('收费地址', '深蓝公寓 1幢1单元306室'), ], ), diff --git a/lib/pages/life_pay/life_pay_bill_page/widget/bill_card.dart b/lib/pages/life_pay/life_pay_bill_page/widget/bill_card.dart index bac9cfe0..f4f8377d 100644 --- a/lib/pages/life_pay/life_pay_bill_page/widget/bill_card.dart +++ b/lib/pages/life_pay/life_pay_bill_page/widget/bill_card.dart @@ -19,7 +19,7 @@ class BillCard extends StatelessWidget { Container _billItem(String title, value) { return Container( - margin: EdgeInsets.only(top: Screenutil.length(30)), + margin: EdgeInsets.only(top: 30.w), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ @@ -47,15 +47,15 @@ class BillCard extends StatelessWidget { Widget build(BuildContext context) { return Container( margin: EdgeInsets.only( - top: Screenutil.length(32), - left: Screenutil.length(32), - right: Screenutil.length(32), + top: 32.w, + left: 32.w, + right: 32.w, ), padding: EdgeInsets.only( - left: Screenutil.length(20), - right: Screenutil.length(20), - bottom: Screenutil.length(32), - top: Screenutil.length(2), + left: 20.w, + right: 20.w, + bottom: 32.w, + top: 2.w, ), decoration: BoxDecoration( color: Colors.white, diff --git a/lib/pages/life_pay/life_pay_info_page/life_pay_info_page.dart b/lib/pages/life_pay/life_pay_info_page/life_pay_info_page.dart index e201786c..ddc47f99 100644 --- a/lib/pages/life_pay/life_pay_info_page/life_pay_info_page.dart +++ b/lib/pages/life_pay/life_pay_info_page/life_pay_info_page.dart @@ -31,7 +31,7 @@ class _LifePayInfoPageState extends State { body: Stack( children: [ ListView( - padding: EdgeInsets.only(bottom: Screenutil.length(130)), + padding: EdgeInsets.only(bottom: 130.w), children: [ DetailsCard(fun: billRouter), ], diff --git a/lib/pages/life_pay/life_pay_info_page/widget/details_card.dart b/lib/pages/life_pay/life_pay_info_page/widget/details_card.dart index 963977ab..3a8d3c1c 100644 --- a/lib/pages/life_pay/life_pay_info_page/widget/details_card.dart +++ b/lib/pages/life_pay/life_pay_info_page/widget/details_card.dart @@ -16,8 +16,8 @@ class _DetailsCardState extends State { Container _detailHeader() { return Container( margin: EdgeInsets.only( - top: Screenutil.length(20), - bottom: Screenutil.length(18), + top: 20.w, + bottom: 18.w, ), child: Row( crossAxisAlignment: CrossAxisAlignment.start, @@ -47,7 +47,7 @@ class _DetailsCardState extends State { return InkWell( onTap: fun, child:Container( - margin: EdgeInsets.only(top: Screenutil.length(32)), + margin: EdgeInsets.only(top: 32.w), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ @@ -56,9 +56,9 @@ class _DetailsCardState extends State { Icon( Icons.radio_button_unchecked, color: BaseStyle.color999999, - size: Screenutil.length(40), + size: 40.w, ), - SizedBox(width: Screenutil.length(24)), + SizedBox(width: 24.w), Text( '2019上半年', style: TextStyle( @@ -78,11 +78,11 @@ class _DetailsCardState extends State { color: Color(0xfffc361d), ), ), - SizedBox(width: Screenutil.length(28)), + SizedBox(width: 28.w), Icon( AntDesign.right, color: BaseStyle.color999999, - size: Screenutil.length(30), + size: 30.w, ), ], ), @@ -96,14 +96,14 @@ class _DetailsCardState extends State { Widget build(BuildContext context) { return Container( margin: EdgeInsets.only( - top: Screenutil.length(32), - left: Screenutil.length(32), - right: Screenutil.length(32), + top: 32.w, + left: 32.w, + right: 32.w, ), padding: EdgeInsets.only( - left: Screenutil.length(32), - right: Screenutil.length(32), - bottom: Screenutil.length(32), + left: 32.w, + right: 32.w, + bottom: 32.w, ), decoration: BoxDecoration( color: Colors.white, diff --git a/lib/pages/life_pay/life_pay_page.dart b/lib/pages/life_pay/life_pay_page.dart index e5c57dc1..69c4bf49 100644 --- a/lib/pages/life_pay/life_pay_page.dart +++ b/lib/pages/life_pay/life_pay_page.dart @@ -33,18 +33,18 @@ class _LifePayPageState extends State { body: Stack( children: [ ListView( - padding: EdgeInsets.only(bottom: Screenutil.length(130)), + padding: EdgeInsets.only(bottom: 130.w), children: [ Container( margin: EdgeInsets.only( - top: Screenutil.length(32), - left: Screenutil.length(32), - right: Screenutil.length(32), + top: 32.w, + left: 32.w, + right: 32.w, ), child: RichText( text: TextSpan( style: TextStyle( - fontSize: Screenutil.size(28), + fontSize: 28.sp, color: Color(0xff666666)), children: [ TextSpan( diff --git a/lib/pages/life_pay/life_pay_record_page/life_pay_record_page.dart b/lib/pages/life_pay/life_pay_record_page/life_pay_record_page.dart index 360b922e..59b95c9e 100644 --- a/lib/pages/life_pay/life_pay_record_page/life_pay_record_page.dart +++ b/lib/pages/life_pay/life_pay_record_page/life_pay_record_page.dart @@ -67,13 +67,13 @@ class _LifePayRecordPageState extends State { children: [ Container( margin: EdgeInsets.only( - top: Screenutil.length(34), - left: Screenutil.length(32), - right: Screenutil.length(32), + top: 34.w, + left: 32.w, + right: 32.w, ), child: RichText( text: TextSpan( - style: TextStyle(fontSize: Screenutil.size(24)), + style: TextStyle(fontSize: 24.sp), children: [ TextSpan( text: '如果有疑问,请联系物业客服', diff --git a/lib/pages/life_pay/life_pay_record_page/widget/record_card.dart b/lib/pages/life_pay/life_pay_record_page/widget/record_card.dart index cb62b6a3..8f8569d2 100644 --- a/lib/pages/life_pay/life_pay_record_page/widget/record_card.dart +++ b/lib/pages/life_pay/life_pay_record_page/widget/record_card.dart @@ -85,7 +85,7 @@ class RecordCard extends StatelessWidget { Container _billItem(String title, value, TextStyle titleStyle, valueStyle, double top, bool isShow, Function fun) { return Container( - margin: EdgeInsets.only(top: Screenutil.length(top)), + margin: EdgeInsets.only(top: top.w), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ @@ -103,11 +103,11 @@ class RecordCard extends StatelessWidget { style: valueStyle, ), Container( - margin: EdgeInsets.only(left: Screenutil.length(24)), + margin: EdgeInsets.only(left: 24.w), child: Icon( AntDesign.right, color: BaseStyle.color999999, - size: Screenutil.length(30), + size: 30.w, ), ), ], @@ -126,15 +126,15 @@ class RecordCard extends StatelessWidget { Widget build(BuildContext context) { return Container( margin: EdgeInsets.only( - top: Screenutil.length(32), - left: Screenutil.length(32), - right: Screenutil.length(32), + top: 32.w, + left: 32.w, + right: 32.w, ), padding: EdgeInsets.only( - left: Screenutil.length(20), - right: Screenutil.length(20), - bottom: Screenutil.length(32), - top: Screenutil.length(2), + left: 20.w, + right: 20.w, + bottom: 32.w, + top: 2.w, ), decoration: BoxDecoration( color: Colors.white, diff --git a/lib/pages/life_pay/widget/order_card.dart b/lib/pages/life_pay/widget/order_card.dart index d9f08c7f..b250e276 100644 --- a/lib/pages/life_pay/widget/order_card.dart +++ b/lib/pages/life_pay/widget/order_card.dart @@ -16,9 +16,9 @@ class _OrderCardState extends State { Container _orderInfo() { return Container( margin: EdgeInsets.only( - top: Screenutil.length(20), - bottom: Screenutil.length(20), - left: Screenutil.length(24), + top: 20.w, + bottom: 20.w, + left: 24.w, ), child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -31,7 +31,7 @@ class _OrderCardState extends State { ), ), Container( - margin: EdgeInsets.symmetric(vertical: Screenutil.length(24)), + margin: EdgeInsets.symmetric(vertical: 24.w), child: Row( children: [ Text( @@ -41,7 +41,7 @@ class _OrderCardState extends State { color: BaseStyle.color333333, ), ), - SizedBox(width: Screenutil.length(40)), + SizedBox(width: 40.w), Text( '已选:4项', style: TextStyle( @@ -81,11 +81,11 @@ class _OrderCardState extends State { ..putMap('detailMap', {'title': '去年(2019年)'})); }, child: Container( - margin: EdgeInsets.only(top: Screenutil.length(20)), + margin: EdgeInsets.only(top: 20.w), alignment: Alignment.center, - padding: EdgeInsets.symmetric(vertical: Screenutil.length(7)), - height: Screenutil.length(44), - width: Screenutil.length(128), + padding: EdgeInsets.symmetric(vertical: 7.w), + height: 44.w, + width: 128.w, decoration: BoxDecoration( color: Color(0xff2a2a2a), borderRadius: BorderRadius.all(Radius.circular(20)), @@ -105,11 +105,11 @@ class _OrderCardState extends State { Widget build(BuildContext context) { return Container( margin: EdgeInsets.only( - top: Screenutil.length(32), - left: Screenutil.length(32), - right: Screenutil.length(32), + top: 32.w, + left: 32.w, + right: 32.w, ), - padding: EdgeInsets.symmetric(horizontal: Screenutil.length(32)), + padding: EdgeInsets.symmetric(horizontal: 32.w), decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.all(Radius.circular(6)), @@ -122,7 +122,7 @@ class _OrderCardState extends State { Icon( Icons.radio_button_unchecked, color: BaseStyle.color999999, - size: Screenutil.length(40), + size: 40.w, ), Expanded( child: Row( diff --git a/lib/pages/life_pay/widget/submit_bar.dart b/lib/pages/life_pay/widget/submit_bar.dart index 15057103..d0e1888f 100644 --- a/lib/pages/life_pay/widget/submit_bar.dart +++ b/lib/pages/life_pay/widget/submit_bar.dart @@ -15,16 +15,16 @@ class _SubmitBarState extends State { InkWell _selectAll() { return InkWell( child: Container( - margin: EdgeInsets.symmetric(vertical: Screenutil.length(29)), + margin: EdgeInsets.symmetric(vertical: 29.w), child: Row( crossAxisAlignment: CrossAxisAlignment.center, children: [ Icon( Icons.radio_button_unchecked, color: BaseStyle.color999999, - size: Screenutil.length(40), + size: 40.w, ), - SizedBox(width: Screenutil.length(16)), + SizedBox(width: 16.w), Text( '全选', style: TextStyle( @@ -38,11 +38,11 @@ class _SubmitBarState extends State { Container _submitOrder(String title) { return Container( - margin: EdgeInsets.symmetric(vertical: Screenutil.length(12)), + margin: EdgeInsets.symmetric(vertical: 12.w), child: Row( children: [ Container( - margin: EdgeInsets.only(right: Screenutil.length(16)), + margin: EdgeInsets.only(right: 16.w), child: Column( crossAxisAlignment: CrossAxisAlignment.end, children: [ @@ -76,11 +76,11 @@ class _SubmitBarState extends State { child: Container( alignment: Alignment.center, padding: EdgeInsets.only( - top: Screenutil.length(15), - bottom: Screenutil.length(14), + top: 15.w, + bottom: 14.w, ), - height: Screenutil.length(74), - width: Screenutil.length(198), + height: 74.w, + width: 198.w, decoration: BoxDecoration( color: BaseStyle.colorffc40c, borderRadius: BorderRadius.all(Radius.circular(36)), @@ -104,9 +104,9 @@ class _SubmitBarState extends State { Widget build(BuildContext context) { return Container( color: Colors.white, - height: Screenutil.length(98), + height: 98.w, width: MediaQuery.of(context).size.width, - padding: EdgeInsets.symmetric(horizontal: Screenutil.length(32)), + padding: EdgeInsets.symmetric(horizontal: 32.w), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ diff --git a/lib/pages/market/market_cart_page/widget/market_cart_app_bar.dart b/lib/pages/market/market_cart_page/widget/market_cart_app_bar.dart index d528ae5d..5a3a3132 100644 --- a/lib/pages/market/market_cart_page/widget/market_cart_app_bar.dart +++ b/lib/pages/market/market_cart_page/widget/market_cart_app_bar.dart @@ -14,7 +14,7 @@ class MarketCartAppBar extends StatelessWidget { backgroundColor: Colors.white, leading: IconButton( padding: EdgeInsets.all(0), - icon: Icon(AntDesign.left, size: Screenutil.size(40)), + icon: Icon(AntDesign.left, size: 40.sp), onPressed: () { Navigator.pop(context); }, @@ -29,12 +29,12 @@ class MarketCartAppBar extends StatelessWidget { TextSpan( text: '购物车 ', style: TextStyle( - fontSize: Screenutil.size(38), + fontSize: 38.sp, ), ), TextSpan( text: '业主尊享,购物更省心', - style: TextStyle(fontSize: Screenutil.size(24)), + style: TextStyle(fontSize: 24.sp), ), ], ), diff --git a/lib/pages/market/market_cart_page/widget/market_cart_bottom_bar.dart b/lib/pages/market/market_cart_page/widget/market_cart_bottom_bar.dart index ec530d4b..edc589e0 100644 --- a/lib/pages/market/market_cart_page/widget/market_cart_bottom_bar.dart +++ b/lib/pages/market/market_cart_page/widget/market_cart_bottom_bar.dart @@ -17,7 +17,7 @@ class MarketCartBottomBar extends StatelessWidget { model.changeALlCheckState(!model.isAllCheck); }, child: Container( - margin: EdgeInsets.symmetric(vertical: Screenutil.length(29)), + margin: EdgeInsets.symmetric(vertical: 29.w), child: Row( crossAxisAlignment: CrossAxisAlignment.center, children: [ @@ -26,14 +26,14 @@ class MarketCartBottomBar extends StatelessWidget { ? Icons.radio_button_checked : Icons.radio_button_unchecked, color: model.isAllCheck ? Color(0xffdb0000) : Color(0xff999999), - size: Screenutil.length(40), + size: 40.w, ), Container( - margin: EdgeInsets.only(left: Screenutil.length(18)), + margin: EdgeInsets.only(left: 18.w), child: Text( '全选', style: TextStyle( - fontSize: Screenutil.size(28), + fontSize: 28.sp, color: Color(0xff333333), ), ), @@ -49,11 +49,11 @@ class MarketCartBottomBar extends StatelessWidget { children: [ model.allPrice != 0 ? Container( - margin: EdgeInsets.only(right: Screenutil.length(10)), + margin: EdgeInsets.only(right: 10.w), child: Text( '合计:¥${model.allPrice.toStringAsFixed(2)}', style: TextStyle( - fontSize: Screenutil.size(28), + fontSize: 28.sp, color: Color(0xffe60e0e), ), ), @@ -69,13 +69,13 @@ class MarketCartBottomBar extends StatelessWidget { : Color(0xffd8d8d8), borderRadius: BorderRadius.all(Radius.circular(30)), ), - width: Screenutil.length(198), - margin: EdgeInsets.symmetric(vertical: Screenutil.length(16)), - padding: EdgeInsets.symmetric(vertical: Screenutil.length(12)), + width: 198.w, + margin: EdgeInsets.symmetric(vertical: 16.w), + padding: EdgeInsets.symmetric(vertical: 12.w), child: Text( '结算(${model.allGoodsCount})', style: TextStyle( - fontSize: Screenutil.size(30), + fontSize: 30.sp, color: model.allGoodsCount != 0 ? Color(0xff333333) : Colors.white, ), @@ -91,9 +91,9 @@ class MarketCartBottomBar extends StatelessWidget { return Consumer(builder: (context, model, child) { return Container( color: Colors.white, - height: Screenutil.length(98), + height: 98.w, width: MediaQuery.of(context).size.width, - padding: EdgeInsets.symmetric(horizontal: Screenutil.length(32)), + padding: EdgeInsets.symmetric(horizontal: 32.w), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ diff --git a/lib/pages/market/market_cart_page/widget/market_cart_card.dart b/lib/pages/market/market_cart_page/widget/market_cart_card.dart index f0f1b831..63b79ff9 100644 --- a/lib/pages/market/market_cart_page/widget/market_cart_card.dart +++ b/lib/pages/market/market_cart_page/widget/market_cart_card.dart @@ -42,7 +42,7 @@ class MarketCartCard extends StatelessWidget { child: Icon( Icons.check_circle, color: cartItem.isCheck ? Color(0xffdb0000) : Color(0xff999999), - size: Screenutil.length(36), + size: 36.w, ), ), ); @@ -50,13 +50,13 @@ class MarketCartCard extends StatelessWidget { Widget _image(String imagePath) { return Container( - margin: EdgeInsets.symmetric(horizontal: Screenutil.length(20)), + margin: EdgeInsets.symmetric(horizontal: 20.w), child: ClipRRect( borderRadius: BorderRadius.all(Radius.circular(2)), child: CachedImageWrapper( url: imagePath, - width: Screenutil.length(180), - height: Screenutil.length(180), + width: 180.w, + height: 180.w, ), ), ); @@ -69,13 +69,13 @@ class MarketCartCard extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - width: Screenutil.length(394), + width: 394.w, child: Text( content, maxLines: 2, overflow: TextOverflow.ellipsis, style: TextStyle( - fontSize: Screenutil.size(24), + fontSize: 24.sp, color: Color(0xff333333), ), ), @@ -83,10 +83,10 @@ class MarketCartCard extends StatelessWidget { // InkWell( // onTap: _showGoodsSpecsSheet, // child: Container( - // margin: EdgeInsets.only(top: Screenutil.length(10)), + // margin: EdgeInsets.only(top: 10.w), // padding: EdgeInsets.symmetric( - // vertical: Screenutil.length(5), - // horizontal: Screenutil.length(19), + // vertical: 5.w, + // horizontal: 19.w, // ), // alignment: Alignment.center, // decoration: BoxDecoration( @@ -101,17 +101,17 @@ class MarketCartCard extends StatelessWidget { // Text( // specs, // style: TextStyle( - // fontSize: Screenutil.size(18), + // fontSize: 18.sp, // color: Color(0xff333333), // ), // ), // Container( // alignment: Alignment.center, - // margin: EdgeInsets.only(left: Screenutil.length(16)), + // margin: EdgeInsets.only(left: 16.w), // child: Icon( // AntDesign.down, // color: Color(0xff333333), - // size: Screenutil.size(22), + // size: 22.sp, // ), // ), // ], @@ -119,11 +119,11 @@ class MarketCartCard extends StatelessWidget { // ), // ), Container( - margin: EdgeInsets.only(top: Screenutil.length(40)), + margin: EdgeInsets.only(top: 40.w), child: Text( '¥${price}', style: TextStyle( - fontSize: Screenutil.size(28), + fontSize: 28.sp, color: Color(0xffe60e0e), ), ), @@ -138,9 +138,9 @@ class MarketCartCard extends StatelessWidget { return Consumer(builder: (context, model, child) { return Container( margin: EdgeInsets.only( - top: Screenutil.length(20), - left: Screenutil.length(32), - right: Screenutil.length(32), + top: 20.w, + left: 32.w, + right: 32.w, ), decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(6)), @@ -156,7 +156,7 @@ class MarketCartCard extends StatelessWidget { child: Text( '移至收藏夹', style: TextStyle( - fontSize: Screenutil.size(28), color: Colors.white), + fontSize: 28.sp, color: Colors.white), ), color: renderingMode == SlidableRenderingMode.slide ? Color(0xffffc40c).withOpacity(animation.value) @@ -181,7 +181,7 @@ class MarketCartCard extends StatelessWidget { child: Text( '删除', style: TextStyle( - fontSize: Screenutil.size(28), color: Colors.white), + fontSize: 28.sp, color: Colors.white), ), // onTap: () => _showSnackBar(context, 'Delete'), ); @@ -191,9 +191,9 @@ class MarketCartCard extends StatelessWidget { child: Container( color: Colors.white, padding: EdgeInsets.only( - top: Screenutil.length(30), - left: Screenutil.length(15), - bottom: Screenutil.length(37), + top: 30.w, + left: 15.w, + bottom: 37.w, ), child: Stack( children: [ @@ -206,7 +206,7 @@ class MarketCartCard extends StatelessWidget { ), Positioned( bottom: 0, - right: Screenutil.length(16), + right: 16.w, child: CartCount( cartItem: cartItem, // goodsNum: widget.goodsNum, diff --git a/lib/pages/market/market_detail_page/widget/market_details_app_bar.dart b/lib/pages/market/market_detail_page/widget/market_details_app_bar.dart index a4550f2a..489b33cb 100644 --- a/lib/pages/market/market_detail_page/widget/market_details_app_bar.dart +++ b/lib/pages/market/market_detail_page/widget/market_details_app_bar.dart @@ -38,20 +38,20 @@ class _MarketDetailsAppBarState extends State { Container( alignment: Alignment.lerp(Alignment.topCenter, Alignment.center, 0.25), - margin: EdgeInsets.symmetric(horizontal: Screenutil.length(32)), + margin: EdgeInsets.symmetric(horizontal: 32.w), child: Material( color: Color(0xffffffff), child: Container( alignment: Alignment.topCenter, - height: Screenutil.length(282), - width: Screenutil.length(686), + height: 282.w, + width: 686.w, color: Colors.black.withOpacity(animation.value), child: GridView.builder( padding: EdgeInsets.only( - top: Screenutil.length(36), - left: Screenutil.length(25), - right: Screenutil.length(25), - bottom: Screenutil.length(30), + top: 36.w, + left: 25.w, + right: 25.w, + bottom: 30.w, ), shrinkWrap: true, physics: NeverScrollableScrollPhysics(), @@ -68,7 +68,7 @@ class _MarketDetailsAppBarState extends State { color: _classList[index]['title'] == widget.title ? Color(0xffe60e0e) : Color(0xff979797), - width: Screenutil.length(1), + width: 1.w, ), ), child: Center( @@ -79,17 +79,17 @@ class _MarketDetailsAppBarState extends State { _classList[index]['title'] == widget.title ? Color(0xffe60e0e) : Color(0xff333333), - fontSize: Screenutil.size(24)), + fontSize: 24.sp), )), ), ); }, gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( crossAxisCount: 3, - mainAxisSpacing: Screenutil.length(20), - crossAxisSpacing: Screenutil.length(30), + mainAxisSpacing: 20.w, + crossAxisSpacing: 30.w, childAspectRatio: - Screenutil.length(192) / Screenutil.length(58)), + 192.w / 58.w), ), ), ), @@ -103,7 +103,7 @@ class _MarketDetailsAppBarState extends State { child: Icon( AntDesign.caretup, color: Color(0xffffffff), - size: Screenutil.size(36), + size: 36.sp, ), ), ), @@ -130,7 +130,7 @@ class _MarketDetailsAppBarState extends State { backgroundColor: Color(0xffffffff), leading: IconButton( padding: EdgeInsets.all(0), - icon: Icon(AntDesign.left, size: Screenutil.size(37)), + icon: Icon(AntDesign.left, size: 37.sp), onPressed: () { Navigator.pop(context); }), @@ -143,14 +143,14 @@ class _MarketDetailsAppBarState extends State { Text( widget.title, style: TextStyle( - fontSize: Screenutil.size(32), color: Color(0xff333333)), + fontSize: 32.sp, color: Color(0xff333333)), ), - SizedBox(width: Screenutil.length(10)), + SizedBox(width: 10.w), Container( padding: EdgeInsets.only(top: 1), child: Icon( AntDesign.caretdown, - size: Screenutil.size(18), + size: 18.sp, color: Color(0xff000000), ), ) @@ -162,7 +162,7 @@ class _MarketDetailsAppBarState extends State { IconButton( icon: Icon( AntDesign.search1, - size: Screenutil.size(38), + size: 38.sp, color: Color(0xff666666), ), onPressed: () {}, diff --git a/lib/pages/market/market_page.dart b/lib/pages/market/market_page.dart index f65703ea..35b6e778 100644 --- a/lib/pages/market/market_page.dart +++ b/lib/pages/market/market_page.dart @@ -114,7 +114,7 @@ class _MarketPageState extends State headerSliverBuilder: (BuildContext context, bool innerBoxIsScrolled) { return [ SliverAppBar( - expandedHeight: Screenutil.length(676), + expandedHeight: 676.w, backgroundColor: Colors.transparent, elevation: 0, flexibleSpace: Stack( diff --git a/lib/pages/market/widget/market_list.dart b/lib/pages/market/widget/market_list.dart index 12fc12b7..14e466ab 100644 --- a/lib/pages/market/widget/market_list.dart +++ b/lib/pages/market/widget/market_list.dart @@ -221,9 +221,9 @@ class _MarketListState extends State ? SliverGoodsGroupCard() : SliverPadding( padding: EdgeInsets.only( - top: Screenutil.length(30), - left: Screenutil.length(32), - right: Screenutil.length(32), + top: 30.w, + left: 32.w, + right: 32.w, ), sliver: _shopList.length == 0 ? SliverToBoxAdapter(child: GoodsCardSkeleton()) diff --git a/lib/pages/market/widget/sliver_goods_group_card.dart b/lib/pages/market/widget/sliver_goods_group_card.dart index 97d6cb2b..947c402c 100644 --- a/lib/pages/market/widget/sliver_goods_group_card.dart +++ b/lib/pages/market/widget/sliver_goods_group_card.dart @@ -53,8 +53,8 @@ class _SliverGoodsGroupCardState extends State { borderRadius: BorderRadius.circular(6), child: CachedImageWrapper( url: image, - height: Screenutil.length(120), - width: Screenutil.length(160), + height: 120.w, + width: 160.w, ), ); } @@ -63,16 +63,16 @@ class _SliverGoodsGroupCardState extends State { return InkWell( onTap: () {}, child: Container( - height: Screenutil.length(52), - width: Screenutil.length(170), + height: 52.w, + width: 170.w, alignment: Alignment.center, padding: EdgeInsets.only( - top: Screenutil.length(10), - bottom: Screenutil.length(9), + top: 10.w, + bottom: 9.w, ), decoration: BoxDecoration( color: isOverTime ? Color(0xffd9d9d9) : Color(0xffffc40c), - borderRadius: BorderRadius.all(Radius.circular(Screenutil.length(4))), + borderRadius: BorderRadius.all(Radius.circular(4.w)), ), child: Row( mainAxisAlignment: MainAxisAlignment.center, @@ -81,16 +81,16 @@ class _SliverGoodsGroupCardState extends State { '¥${price}', style: TextStyle( fontWeight: FontWeight.w600, - fontSize: Screenutil.size(24), + fontSize: 24.sp, color: isOverTime ? Color(0xff333333) : Color(0xffe60e0e), ), ), - SizedBox(width: Screenutil.length(10)), + SizedBox(width: 10.w), Text( isOverTime ? '已过期' : '去团购', style: TextStyle( fontWeight: FontWeight.w600, - fontSize: Screenutil.size(24), + fontSize: 24.sp, color: Color(0xff333333)), ), ], @@ -102,52 +102,52 @@ class _SliverGoodsGroupCardState extends State { Widget _content(String title, subtitle, remainingTime, address, arrivalTime, price, isOverTime) { return Container( - margin: EdgeInsets.only(left: Screenutil.length(20)), + margin: EdgeInsets.only(left: 20.w), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - margin: EdgeInsets.only(bottom: Screenutil.length(8)), - width: Screenutil.length(474), + margin: EdgeInsets.only(bottom: 8.w), + width: 474.w, child: Text( title, textAlign: TextAlign.left, maxLines: 1, overflow: TextOverflow.ellipsis, style: TextStyle( - fontSize: Screenutil.size(30), + fontSize: 30.sp, color: Color(0xff333333), ), ), ), Container( - margin: EdgeInsets.only(bottom: Screenutil.length(12)), + margin: EdgeInsets.only(bottom: 12.w), child: Text( subtitle, style: TextStyle( - fontSize: Screenutil.size(20), + fontSize: 20.sp, color: Color(0xff333333), ), ), ), Container( - margin: EdgeInsets.only(bottom: Screenutil.length(16)), + margin: EdgeInsets.only(bottom: 16.w), padding: EdgeInsets.only( - top: Screenutil.length(6), - left: Screenutil.length(11), - bottom: Screenutil.length(7), - right: Screenutil.length(20), + top: 6.w, + left: 11.w, + bottom: 7.w, + right: 20.w, ), decoration: BoxDecoration( color: isOverTime ? Color(0xffd9d9d9) : Color(0xffffeee3), borderRadius: - BorderRadius.all(Radius.circular(Screenutil.length(4))), + BorderRadius.all(Radius.circular(4.w)), ), child: Row( children: [ Icon( MaterialIcons.access_time, - size: Screenutil.size(18), + size: 18.sp, color: isOverTime ? Color(0xff333333) : Color(0xffff7f00), ), Text( @@ -156,15 +156,15 @@ class _SliverGoodsGroupCardState extends State { overflow: TextOverflow.ellipsis, style: TextStyle( color: isOverTime ? Color(0xff333333) : Color(0xffff7f00), - fontSize: Screenutil.size(18), + fontSize: 18.sp, ), ), ], ), ), Container( - margin: EdgeInsets.only(bottom: Screenutil.length(30)), - width: Screenutil.length(474), + margin: EdgeInsets.only(bottom: 30.w), + width: 474.w, child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ @@ -175,14 +175,14 @@ class _SliverGoodsGroupCardState extends State { '原产地:${address}', style: TextStyle( color: Color(0xff999999), - fontSize: Screenutil.size(20)), + fontSize: 20.sp), ), - SizedBox(height: Screenutil.length(10)), + SizedBox(height: 10.w), Text( '预计到货:${arrivalTime}', style: TextStyle( color: Color(0xff999999), - fontSize: Screenutil.size(20)), + fontSize: 20.sp), ) ], ), @@ -201,19 +201,19 @@ class _SliverGoodsGroupCardState extends State { delegate: SliverChildBuilderDelegate((BuildContext content, int index) { return Container( margin: EdgeInsets.only( - top: Screenutil.length(20), - left: Screenutil.length(32), - right: Screenutil.length(32), + top: 20.w, + left: 32.w, + right: 32.w, ), padding: EdgeInsets.only( - top: Screenutil.length(12), - left: Screenutil.length(12), - right: Screenutil.length(20), + top: 12.w, + left: 12.w, + right: 20.w, ), decoration: BoxDecoration( color: Colors.white, borderRadius: - BorderRadius.all(Radius.circular(Screenutil.length(8))), + BorderRadius.all(Radius.circular(8.w)), ), child: Row( crossAxisAlignment: CrossAxisAlignment.start, diff --git a/lib/pages/market_class/market_class_page.dart b/lib/pages/market_class/market_class_page.dart index 102e6407..bf135e08 100644 --- a/lib/pages/market_class/market_class_page.dart +++ b/lib/pages/market_class/market_class_page.dart @@ -73,10 +73,10 @@ class _MarketClassPageState extends State { child: Stack( children: [ Container( - height: Screenutil.length(120), + height: 120.w, alignment: Alignment.center, color: _currentIndex == index ? Colors.white : Colors.transparent, - padding: EdgeInsets.symmetric(vertical: Screenutil.length(24)), + padding: EdgeInsets.symmetric(vertical: 24.w), child: Text( _shopClassList[index].mainName, style: TextStyle( @@ -89,11 +89,11 @@ class _MarketClassPageState extends State { ), _currentIndex == index ? Positioned( - top: Screenutil.length(42), + top: 42.w, left: 1, child: SizedBox( - width: Screenutil.length(8), - height: Screenutil.length(40), + width: 8.w, + height: 40.w, child: DecoratedBox( decoration: BoxDecoration(color: BaseStyle.colorffc40c), ), @@ -127,11 +127,11 @@ class _MarketClassPageState extends State { children: [ CachedImageWrapper( url: infoList[index].imgurl, - width: Screenutil.length(152), - height: Screenutil.length(152), + width: 152.w, + height: 152.w, ), Container( - margin: EdgeInsets.only(top: Screenutil.length(14)), + margin: EdgeInsets.only(top: 14.w), child: Text( infoList[index].sonName, style: TextStyle( @@ -146,7 +146,7 @@ class _MarketClassPageState extends State { }, gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( crossAxisCount: 3, - childAspectRatio: Screenutil.length(152) / Screenutil.length(210), + childAspectRatio: 152.w / 210.w, ), ), ); @@ -154,14 +154,14 @@ class _MarketClassPageState extends State { Widget _classList(String nextName, List infoList) { return Container( - margin: EdgeInsets.symmetric(horizontal: Screenutil.length(32)), + margin: EdgeInsets.symmetric(horizontal: 32.w), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - margin: EdgeInsets.only(bottom: Screenutil.length(24)), - padding: EdgeInsets.symmetric(vertical: Screenutil.length(14)), - width: Screenutil.length(476), + margin: EdgeInsets.only(bottom: 24.w), + padding: EdgeInsets.symmetric(vertical: 14.w), + width: 476.w, decoration: BoxDecoration( border: Border( bottom: BorderSide(color: Color(0xffe8e8e8), width: 0.5), @@ -202,7 +202,7 @@ class _MarketClassPageState extends State { mainAxisAlignment: MainAxisAlignment.start, children: [ Container( - width: Screenutil.length(203), + width: 203.w, height: MediaQuery.of(context).size.height - kToolbarHeight - _statusHeight, @@ -219,7 +219,7 @@ class _MarketClassPageState extends State { }), ), Container( - width: Screenutil.length(547), + width: 547.w, height: MediaQuery.of(context).size.height - kToolbarHeight - _statusHeight, diff --git a/lib/pages/market_class/widget/market_class_bar.dart b/lib/pages/market_class/widget/market_class_bar.dart index 8a63379d..4f1c5f67 100644 --- a/lib/pages/market_class/widget/market_class_bar.dart +++ b/lib/pages/market_class/widget/market_class_bar.dart @@ -12,11 +12,11 @@ class MarketClassBar extends StatelessWidget { showSearch(context: context, delegate: searchBarDelegate()); }, child: Container( - margin: EdgeInsets.only(right: Screenutil.length(32)), + margin: EdgeInsets.only(right: 32.w), padding: EdgeInsets.only( - left: Screenutil.length(40), - top: Screenutil.length(15), - bottom: Screenutil.length(15)), + left: 40.w, + top: 15.w, + bottom: 15.w), decoration: BoxDecoration( color: Color(0xfff3f3f3), borderRadius: BorderRadius.all(Radius.circular(36)), @@ -24,14 +24,14 @@ class MarketClassBar extends StatelessWidget { child: Row(children: [ Icon( AntDesign.search1, - size: Screenutil.size(28), + size: 28.sp, color: Color(0xff999999), ), SizedBox(width: 5), Text( '搜索商品、活动、帖子、应用', style: TextStyle( - fontSize: Screenutil.size(28), + fontSize: 28.sp, color: Color(0xff999999), ), ) @@ -49,7 +49,7 @@ class MarketClassBar extends StatelessWidget { backgroundColor: Color(0xffffffff), leading: InkWell( onTap: () => Navigator.pop(context), - child: Icon(AntDesign.left, size: Screenutil.size(40)), + child: Icon(AntDesign.left, size: 40.sp), ), centerTitle: true, title: _inkWellSearch(context), diff --git a/lib/pages/message_center_page/comment_message_page/comment_message_page.dart b/lib/pages/message_center_page/comment_message_page/comment_message_page.dart index 0c32471a..ddc1bb87 100644 --- a/lib/pages/message_center_page/comment_message_page/comment_message_page.dart +++ b/lib/pages/message_center_page/comment_message_page/comment_message_page.dart @@ -78,10 +78,10 @@ class _CommentMessagePageState extends State { Container _containerCommentCard( String name, imageHeader, content, time, imagePath) { return Container( - margin: EdgeInsets.symmetric(horizontal: Screenutil.length(32)), + margin: EdgeInsets.symmetric(horizontal: 32.w), padding: EdgeInsets.only( - top: Screenutil.length(32), - bottom: Screenutil.length(16), + top: 32.w, + bottom: 16.w, ), decoration: BoxDecoration( border: Border( @@ -98,50 +98,50 @@ class _CommentMessagePageState extends State { ), child: Image.asset( imageHeader, - height: Screenutil.length(86), - width: Screenutil.length(86), + height: 86.w, + width: 86.w, fit: BoxFit.fill, ), ), - SizedBox(width: Screenutil.length(20)), + SizedBox(width: 20.w), Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( name, style: TextStyle( - fontSize: Screenutil.size(36), + fontSize: 36.sp, color: Color(0xff333333), ), ), - SizedBox(height: Screenutil.length(6)), + SizedBox(height: 6.w), Container( - width: Screenutil.length(392), + width: 392.w, child: Text( content, maxLines: 2, overflow: TextOverflow.ellipsis, style: TextStyle( - fontSize: Screenutil.size(28), + fontSize: 28.sp, color: Color(0xff333333), ), ), ), - SizedBox(height: Screenutil.length(16)), + SizedBox(height: 16.w), Text( time, style: TextStyle( - fontSize: Screenutil.size(28), + fontSize: 28.sp, color: Color(0xff999999), ), ), ], ), - SizedBox(width: Screenutil.length(12)), + SizedBox(width: 12.w), Image.asset( imagePath, - height: Screenutil.length(158), - width: Screenutil.length(158), + height: 158.w, + width: 158.w, fit: BoxFit.fill, ), ], diff --git a/lib/pages/message_center_page/message_center_page.dart b/lib/pages/message_center_page/message_center_page.dart index 20767b07..094de92c 100644 --- a/lib/pages/message_center_page/message_center_page.dart +++ b/lib/pages/message_center_page/message_center_page.dart @@ -34,14 +34,14 @@ class _MessageCenterPageState extends State { TextStyle _textStyleTitle() { return TextStyle( fontWeight: FontWeight.w600, - fontSize: Screenutil.size(32), + fontSize: 32.sp, color: Color(0xff333333), ); } TextStyle _textStyleSubtitle() { return TextStyle( - fontSize: Screenutil.size(28), + fontSize: 28.sp, color: Color(0xff333333), ); } @@ -78,11 +78,11 @@ class _MessageCenterPageState extends State { }, child: Container( padding: EdgeInsets.only( - top: Screenutil.length(36), - bottom: Screenutil.length(19), + top: 36.w, + bottom: 19.w, ), margin: EdgeInsets.symmetric( - horizontal: Screenutil.length(32)), + horizontal: 32.w), decoration: BoxDecoration( border: Border( bottom: Divider.createBorderSide(context, @@ -94,10 +94,10 @@ class _MessageCenterPageState extends State { children: [ Image.asset( _messageList[index]['imagePath'], - height: Screenutil.length(90), - width: Screenutil.length(90), + height: 90.w, + width: 90.w, ), - SizedBox(width: Screenutil.length(14)), + SizedBox(width: 14.w), Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -105,7 +105,7 @@ class _MessageCenterPageState extends State { _messageList[index]['title'], style: _textStyleTitle(), ), - SizedBox(height: Screenutil.length(5)), + SizedBox(height: 5.w), Text( _messageList[index]['subtitle'], maxLines: 1, diff --git a/lib/pages/message_center_page/refund_details.dart b/lib/pages/message_center_page/refund_details.dart index 3cf8ffed..e785d2bc 100644 --- a/lib/pages/message_center_page/refund_details.dart +++ b/lib/pages/message_center_page/refund_details.dart @@ -12,9 +12,9 @@ class RefundDetails extends StatelessWidget { width: double.infinity, color: Color(0xffffd000), padding: EdgeInsets.only( - top: Screenutil.length(44), - bottom: Screenutil.length(44), - left: Screenutil.length(33), + top: 44.w, + bottom: 44.w, + left: 33.w, ), child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -27,7 +27,7 @@ class RefundDetails extends StatelessWidget { color: BaseStyle.color333333, ), ), - SizedBox(height: Screenutil.length(10)), + SizedBox(height: 10.w), Text( '2020年7月8日 13:28', style: TextStyle( @@ -44,10 +44,10 @@ class RefundDetails extends StatelessWidget { return Container( color: Color(0xffffffff), padding: EdgeInsets.only( - top: Screenutil.length(24), - bottom: Screenutil.length(24), - left: Screenutil.length(33), - right: Screenutil.length(32), + top: 24.w, + bottom: 24.w, + left: 33.w, + right: 32.w, ), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, @@ -81,9 +81,9 @@ class RefundDetails extends StatelessWidget { color: Color(0xffffffff), width: double.infinity, padding: EdgeInsets.only( - top: Screenutil.length(25), - bottom: Screenutil.length(22), - left: Screenutil.length(33), + top: 25.w, + bottom: 22.w, + left: 33.w, ), child: Text( '退款信息', @@ -96,24 +96,24 @@ class RefundDetails extends StatelessWidget { Container( color: Color(0xfff2f2f2), padding: EdgeInsets.only( - top: Screenutil.length(30), - bottom: Screenutil.length(24), - left: Screenutil.length(33), + top: 30.w, + bottom: 24.w, + left: 33.w, ), child: Row( children: [ Image.asset( 'assets/example/tz1.png', - height: Screenutil.length(120), - width: Screenutil.length(120), + height: 120.w, + width: 120.w, fit: BoxFit.fill, ), - SizedBox(width: Screenutil.length(20)), + SizedBox(width: 20.w), Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - width: Screenutil.length(544), + width: 544.w, child: Text( '轻便自由 男士针织休闲西装 全身羊毛修身意大利进口精致裁剪', maxLines: 2, @@ -124,7 +124,7 @@ class RefundDetails extends StatelessWidget { ), ), ), - SizedBox(height: Screenutil.length(10)), + SizedBox(height: 10.w), Text( '规格分类:M 黑色', style: TextStyle( @@ -141,9 +141,9 @@ class RefundDetails extends StatelessWidget { color: Color(0xffffffff), width: double.infinity, padding: EdgeInsets.only( - top: Screenutil.length(22), - left: Screenutil.length(33), - bottom: Screenutil.length(22), + top: 22.w, + left: 33.w, + bottom: 22.w, ), child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -155,7 +155,7 @@ class RefundDetails extends StatelessWidget { color: BaseStyle.color999999, ), ), - SizedBox(height: Screenutil.length(22)), + SizedBox(height: 22.w), Text( '退款金额:${'¥1123.60'}', style: TextStyle( @@ -163,7 +163,7 @@ class RefundDetails extends StatelessWidget { color: BaseStyle.color999999, ), ), - SizedBox(height: Screenutil.length(22)), + SizedBox(height: 22.w), Text( '申请时间:${'2020-7-7 21:09'}', style: TextStyle( @@ -171,7 +171,7 @@ class RefundDetails extends StatelessWidget { color: BaseStyle.color999999, ), ), - SizedBox(height: Screenutil.length(22)), + SizedBox(height: 22.w), Text( '退款编号:${'8324982349230293'}', style: TextStyle( @@ -198,7 +198,7 @@ class RefundDetails extends StatelessWidget { children: [ _containerHeader(), _containerPrice(), - SizedBox(height: Screenutil.length(44)), + SizedBox(height: 44.w), _containerContent(), ], ), diff --git a/lib/pages/message_center_page/shop_message_page/shop_message_page.dart b/lib/pages/message_center_page/shop_message_page/shop_message_page.dart index a8c5b5e8..442abe15 100644 --- a/lib/pages/message_center_page/shop_message_page/shop_message_page.dart +++ b/lib/pages/message_center_page/shop_message_page/shop_message_page.dart @@ -96,9 +96,9 @@ class _ShopMessagePageState extends State { Text( lookType, style: TextStyle( - fontSize: Screenutil.size(28), color: Color(0xff333333)), + fontSize: 28.sp, color: Color(0xff333333)), ), - Icon(AntDesign.right, size: Screenutil.size(40)), + Icon(AntDesign.right, size: 40.sp), ], ), ); @@ -107,15 +107,15 @@ class _ShopMessagePageState extends State { Container _containerCard(String status, type, imagePath, content, lookType) { return Container( margin: EdgeInsets.only( - top: Screenutil.length(32), - left: Screenutil.length(32), - right: Screenutil.length(32), + top: 32.w, + left: 32.w, + right: 32.w, ), padding: EdgeInsets.only( - top: Screenutil.length(21), - bottom: Screenutil.length(14), - left: Screenutil.length(30), - right: Screenutil.length(20)), + top: 21.w, + bottom: 14.w, + left: 30.w, + right: 20.w), decoration: BoxDecoration( color: Color(0xffffffff), borderRadius: BorderRadius.all(Radius.circular(4)), @@ -130,7 +130,7 @@ class _ShopMessagePageState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - padding: EdgeInsets.only(left: Screenutil.length(2)), + padding: EdgeInsets.only(left: 2.w), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -141,39 +141,39 @@ class _ShopMessagePageState extends State { '商城通知', style: TextStyle( fontWeight: FontWeight.w600, - fontSize: Screenutil.size(32), + fontSize: 32.sp, color: Color(0xff333333)), ), Text( status, style: TextStyle( - fontSize: Screenutil.size(32), + fontSize: 32.sp, color: Color(0xff999999)), ), ], ), - SizedBox(height: Screenutil.length(5)), + SizedBox(height: 5.w), Text(type, style: TextStyle( - fontSize: Screenutil.size(28), + fontSize: 28.sp, color: Color(0xff333333))), - SizedBox(height: Screenutil.length(8)), + SizedBox(height: 8.w), Row( children: [ Image.asset( imagePath, - height: Screenutil.length(120), - width: Screenutil.length(120), + height: 120.w, + width: 120.w, ), - SizedBox(width: Screenutil.length(32)), + SizedBox(width: 32.w), Container( - width: Screenutil.length(439), + width: 439.w, child: Text( content, maxLines: 2, overflow: TextOverflow.ellipsis, style: TextStyle( - fontSize: Screenutil.size(28), + fontSize: 28.sp, color: Color(0xff999999)), ), ), @@ -182,7 +182,7 @@ class _ShopMessagePageState extends State { ], ), ), - SizedBox(height: Screenutil.length(30)), + SizedBox(height: 30.w), Divider(), _inkWellLook(type, content, lookType), ], diff --git a/lib/pages/message_center_page/system_message_page/system_details_page/system_details_page.dart b/lib/pages/message_center_page/system_message_page/system_details_page/system_details_page.dart index 4366ed7b..c459b856 100644 --- a/lib/pages/message_center_page/system_message_page/system_details_page/system_details_page.dart +++ b/lib/pages/message_center_page/system_message_page/system_details_page/system_details_page.dart @@ -23,9 +23,9 @@ class SystemDetailsPage extends StatelessWidget { children: [ Container( padding: EdgeInsets.only( - top: Screenutil.length(42), - left: Screenutil.length(34), - right: Screenutil.length(44), + top: 42.w, + left: 34.w, + right: 44.w, ), child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -34,23 +34,23 @@ class SystemDetailsPage extends StatelessWidget { '系统通知', style: TextStyle( fontWeight: FontWeight.w600, - fontSize: Screenutil.size(32), + fontSize: 32.sp, color: Color(0xff333333), ), ), - SizedBox(height: Screenutil.length(5)), + SizedBox(height: 5.w), Text( bundle.getMap('detailsMap')['type'], style: TextStyle( - fontSize: Screenutil.size(28), + fontSize: 28.sp, color: Color(0xff333333), ), ), - SizedBox(height: Screenutil.length(110)), + SizedBox(height: 110.w), Text( bundle.getMap('detailsMap')['content'], style: TextStyle( - fontSize: Screenutil.size(28), + fontSize: 28.sp, color: Color(0xff333333), ), ), diff --git a/lib/pages/message_center_page/system_message_page/system_message_page.dart b/lib/pages/message_center_page/system_message_page/system_message_page.dart index 4907baf3..b69923ce 100644 --- a/lib/pages/message_center_page/system_message_page/system_message_page.dart +++ b/lib/pages/message_center_page/system_message_page/system_message_page.dart @@ -77,9 +77,9 @@ class _SystemMessagePageState extends State { Text( '查看详情', style: TextStyle( - fontSize: Screenutil.size(28), color: Color(0xff333333)), + fontSize: 28.sp, color: Color(0xff333333)), ), - Icon(AntDesign.right, size: Screenutil.size(40)), + Icon(AntDesign.right, size: 40.sp), ], ), ); @@ -88,15 +88,15 @@ class _SystemMessagePageState extends State { Container _containerCard(String status, String type, String content) { return Container( margin: EdgeInsets.only( - top: Screenutil.length(32), - left: Screenutil.length(32), - right: Screenutil.length(32), + top: 32.w, + left: 32.w, + right: 32.w, ), padding: EdgeInsets.only( - top: Screenutil.length(21), - bottom: Screenutil.length(14), - left: Screenutil.length(30), - right: Screenutil.length(20)), + top: 21.w, + bottom: 14.w, + left: 30.w, + right: 20.w), decoration: BoxDecoration( color: Color(0xffffffff), borderRadius: BorderRadius.all(Radius.circular(4)), @@ -111,7 +111,7 @@ class _SystemMessagePageState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - padding: EdgeInsets.only(left: Screenutil.length(2)), + padding: EdgeInsets.only(left: 2.w), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -122,35 +122,35 @@ class _SystemMessagePageState extends State { '系统通知', style: TextStyle( fontWeight: FontWeight.w600, - fontSize: Screenutil.size(32), + fontSize: 32.sp, color: Color(0xff333333)), ), Text( status, style: TextStyle( - fontSize: Screenutil.size(32), + fontSize: 32.sp, color: Color(0xff999999)), ), ], ), - SizedBox(height: Screenutil.length(5)), + SizedBox(height: 5.w), Text( type, style: TextStyle( - fontSize: Screenutil.size(28), color: Color(0xff333333)), + fontSize: 28.sp, color: Color(0xff333333)), ), - SizedBox(height: Screenutil.length(8)), + SizedBox(height: 8.w), Text( '驳回理由:${content}', maxLines: 1, overflow: TextOverflow.ellipsis, style: TextStyle( - fontSize: Screenutil.size(28), color: Color(0xff333333)), + fontSize: 28.sp, color: Color(0xff333333)), ), ], ), ), - SizedBox(height: Screenutil.length(30)), + SizedBox(height: 30.w), Divider(), _inkWellLook(type, content), ], diff --git a/lib/pages/mine_car_page/car_add_page/car_add_page.dart b/lib/pages/mine_car_page/car_add_page/car_add_page.dart index c96fe68c..90a13216 100644 --- a/lib/pages/mine_car_page/car_add_page/car_add_page.dart +++ b/lib/pages/mine_car_page/car_add_page/car_add_page.dart @@ -18,11 +18,11 @@ class _CarAddPageState extends State { return InkWell( child: Container( padding: EdgeInsets.only( - top: Screenutil.length(19), - bottom: Screenutil.length(21), + top: 19.w, + bottom: 21.w, ), alignment: Alignment.center, - width: Screenutil.length(686), + width: 686.w, decoration: BoxDecoration( color: Color(0xffffd000), borderRadius: BorderRadius.all(Radius.circular(4)), @@ -37,7 +37,7 @@ class _CarAddPageState extends State { '保存', style: TextStyle( fontWeight: FontWeight.w600, - fontSize: Screenutil.size(32), + fontSize: 32.sp, color: Color(0xff333333), ), ), @@ -64,17 +64,17 @@ class _CarAddPageState extends State { }, child: Container( margin: EdgeInsets.only( - top: Screenutil.length(32), - left: Screenutil.length(32), - right: Screenutil.length(32), + top: 32.w, + left: 32.w, + right: 32.w, ), child: Column( crossAxisAlignment: CrossAxisAlignment.center, children: [ Container( padding: EdgeInsets.only( - top: Screenutil.length(23), - bottom: Screenutil.length(24), + top: 23.w, + bottom: 24.w, ), decoration: BoxDecoration( border: Border( @@ -87,10 +87,10 @@ class _CarAddPageState extends State { Text( '您的车牌号', style: TextStyle( - fontSize: Screenutil.size(28), + fontSize: 28.sp, color: Color(0xff333333)), ), - SizedBox(height: Screenutil.length(25)), + SizedBox(height: 25.w), CommonInput( hintText: '请输入您的车牌号', inputController: _carNum, @@ -98,7 +98,7 @@ class _CarAddPageState extends State { ], ), ), - SizedBox(height: Screenutil.length(89)), + SizedBox(height: 89.w), _inkWellSave(), ], ), diff --git a/lib/pages/mine_car_page/mine_car_page.dart b/lib/pages/mine_car_page/mine_car_page.dart index bb49ead1..4522f112 100644 --- a/lib/pages/mine_car_page/mine_car_page.dart +++ b/lib/pages/mine_car_page/mine_car_page.dart @@ -25,15 +25,15 @@ class _MineCarPageState extends State { Widget _containerHouseCard(String title, subtitle) { return Container( margin: EdgeInsets.only( - top: Screenutil.length(24), - left: Screenutil.length(32), - right: Screenutil.length(32), + top: 24.w, + left: 32.w, + right: 32.w, ), child: Container( padding: EdgeInsets.only( - top: Screenutil.length(41), - bottom: Screenutil.length(41), - left: Screenutil.length(27), + top: 41.w, + bottom: 41.w, + left: 27.w, ), decoration: BoxDecoration( border: @@ -45,25 +45,25 @@ class _MineCarPageState extends State { children: [ Image.asset( AssetsImage.HOUSEATTESTATION, - height: Screenutil.length(48), - width: Screenutil.length(48), + height: 48.w, + width: 48.w, ), - SizedBox(width: Screenutil.length(20)), + SizedBox(width: 20.w), Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( title, style: TextStyle( - fontSize: Screenutil.size(32), + fontSize: 32.sp, color: Color(0xff474747), ), ), - SizedBox(height: Screenutil.length(10)), + SizedBox(height: 10.w), Text( subtitle, style: TextStyle( - fontSize: Screenutil.size(32), + fontSize: 32.sp, color: Color(0xff474747), ), ) @@ -91,11 +91,11 @@ class _MineCarPageState extends State { }, child: Container( padding: EdgeInsets.only( - top: Screenutil.length(11), - bottom: Screenutil.length(10), + top: 11.w, + bottom: 10.w, ), alignment: Alignment.center, - width: Screenutil.length(167), + width: 167.w, decoration: BoxDecoration( color: Color(0xffffd000), borderRadius: BorderRadius.all(Radius.circular(4)), @@ -110,7 +110,7 @@ class _MineCarPageState extends State { '去添加', style: TextStyle( fontWeight: FontWeight.w600, - fontSize: Screenutil.size(32), + fontSize: 32.sp, color: Color(0xff333333), ), ), @@ -120,34 +120,34 @@ class _MineCarPageState extends State { Widget _containerAttestation(String tag) { return Container( - margin: EdgeInsets.only(top: Screenutil.length(156)), + margin: EdgeInsets.only(top: 156.w), child: Column( mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, children: [ Image.asset( AssetsImage.CARHEADER, - height: Screenutil.length(240), - width: Screenutil.length(130), + height: 240.w, + width: 130.w, ), - SizedBox(height: Screenutil.length(24)), + SizedBox(height: 24.w), Text( '马泽鹏', style: TextStyle( fontWeight: FontWeight.w600, - fontSize: Screenutil.size(32), + fontSize: 32.sp, color: Color(0xff474747), ), ), - SizedBox(height: Screenutil.length(8)), + SizedBox(height: 8.w), Text( '尊敬的业主/租客,您还没有添加您的${tag}', style: TextStyle( - fontSize: Screenutil.size(24), + fontSize: 24.sp, color: Color(0xff999999), ), ), - SizedBox(height: Screenutil.length(39)), + SizedBox(height: 39.w), _inkWellCheck(widget.bundle.getMap('carType')['type']), ], ), @@ -157,16 +157,16 @@ class _MineCarPageState extends State { Widget _containerInfoCard(String title, bool isDelete) { return Container( margin: EdgeInsets.only( - left: Screenutil.length(32), - top: Screenutil.length(26), - right: Screenutil.length(32), + left: 32.w, + top: 26.w, + right: 32.w, ), child: Container( padding: EdgeInsets.only( - left: Screenutil.length(40), - right: Screenutil.length(26), - top: Screenutil.length(26), - bottom: Screenutil.length(25), + left: 40.w, + right: 26.w, + top: 26.w, + bottom: 25.w, ), decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(4)), @@ -179,7 +179,7 @@ class _MineCarPageState extends State { title, style: TextStyle( fontWeight: FontWeight.w600, - fontSize: Screenutil.size(32), + fontSize: 32.sp, color: Color(0xff333333), ), ), @@ -188,7 +188,7 @@ class _MineCarPageState extends State { child: Text( '移除', style: TextStyle( - fontSize: Screenutil.size(28), + fontSize: 28.sp, color: Color(0xff999999), ), ), @@ -207,18 +207,18 @@ class _MineCarPageState extends State { onTap: () {}, child: Container( padding: EdgeInsets.only( - top: Screenutil.length(23), - bottom: Screenutil.length(22), + top: 23.w, + bottom: 22.w, ), color: Color(0xffffd000), alignment: Alignment.center, - height: Screenutil.length(85), + height: 85.w, width: MediaQuery.of(context).size.width, child: Text( buttonName, style: TextStyle( fontWeight: FontWeight.w600, - fontSize: Screenutil.size(28), + fontSize: 28.sp, color: Color(0xff333333), ), ), @@ -243,7 +243,7 @@ class _MineCarPageState extends State { ListView( children: [ Container( - margin: EdgeInsets.only(bottom: Screenutil.length(85)), + margin: EdgeInsets.only(bottom: 85.w), child: Column( children: [ Column( @@ -255,7 +255,7 @@ class _MineCarPageState extends State { .toList(), ), // Container( - // margin: EdgeInsets.only(top: Screenutil.length(64)), + // margin: EdgeInsets.only(top: 64.w), // child: Column( // children: _listCart // .map((item) => _containerInfoCard( diff --git a/lib/pages/mine_car_page/select_community_page/select_community_page.dart b/lib/pages/mine_car_page/select_community_page/select_community_page.dart index 71fcf2ae..b49aaa76 100644 --- a/lib/pages/mine_car_page/select_community_page/select_community_page.dart +++ b/lib/pages/mine_car_page/select_community_page/select_community_page.dart @@ -29,10 +29,10 @@ class _SelectCommunityPageState extends State { Container( width: MediaQuery.of(context).size.width, color: Colors.white, - margin: EdgeInsets.only(top: Screenutil.length(32)), + margin: EdgeInsets.only(top: 32.w), padding: EdgeInsets.symmetric( - vertical: Screenutil.length(28), - horizontal: Screenutil.length(32)), + vertical: 28.w, + horizontal: 32.w), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ @@ -41,13 +41,13 @@ class _SelectCommunityPageState extends State { Icon( EvilIcons.location, color: Color(0xff333333), - size: Screenutil.size(40), + size: 40.sp, ), - SizedBox(width: Screenutil.length(18)), + SizedBox(width: 18.w), Text( '深圳市', style: TextStyle( - fontSize: Screenutil.size(28), + fontSize: 28.sp, color: Color(0xff333333), ), ) @@ -57,18 +57,18 @@ class _SelectCommunityPageState extends State { child: Icon( MaterialIcons.refresh, color: Color(0xff333333), - size: Screenutil.size(40), + size: 40.sp, ), ), ], ), ), Container( - margin: EdgeInsets.all(Screenutil.length(32)), + margin: EdgeInsets.all(32.w), child: Text( '所有社区', style: TextStyle( - fontSize: Screenutil.size(28), + fontSize: 28.sp, color: Color(0xff333333), ), ), @@ -87,12 +87,12 @@ class _SelectCommunityPageState extends State { width: MediaQuery.of(context).size.width, color: Colors.white, padding: EdgeInsets.symmetric( - vertical: Screenutil.length(28), - horizontal: Screenutil.length(32)), + vertical: 28.w, + horizontal: 32.w), child: Text( _communityList[index], style: TextStyle( - fontSize: Screenutil.size(28), + fontSize: 28.sp, color: Color(0xff333333), ), ), diff --git a/lib/pages/mine_car_page/select_parking_page/select_parking_page.dart b/lib/pages/mine_car_page/select_parking_page/select_parking_page.dart index 60b1ffa8..50ee1db0 100644 --- a/lib/pages/mine_car_page/select_parking_page/select_parking_page.dart +++ b/lib/pages/mine_car_page/select_parking_page/select_parking_page.dart @@ -25,11 +25,11 @@ class _SelectParkingPageState extends State { body: ListView( children: [ Container( - margin: EdgeInsets.all(Screenutil.length(32)), + margin: EdgeInsets.all(32.w), child: Text( '所有社区', style: TextStyle( - fontSize: Screenutil.size(28), + fontSize: 28.sp, color: Color(0xff333333), ), ), @@ -42,12 +42,12 @@ class _SelectParkingPageState extends State { width: MediaQuery.of(context).size.width, color: Colors.white, padding: EdgeInsets.symmetric( - vertical: Screenutil.length(28), - horizontal: Screenutil.length(32)), + vertical: 28.w, + horizontal: 32.w), child: Text( '${widget.bundle.getString('title')}地下车库11号${index + 1}', style: TextStyle( - fontSize: Screenutil.size(28), + fontSize: 28.sp, color: Color(0xff333333), ), ), diff --git a/lib/pages/mine_house_page/house_authenticate_page/house_authenticate_page.dart b/lib/pages/mine_house_page/house_authenticate_page/house_authenticate_page.dart index a2f0f3b5..c4b10f6e 100644 --- a/lib/pages/mine_house_page/house_authenticate_page/house_authenticate_page.dart +++ b/lib/pages/mine_house_page/house_authenticate_page/house_authenticate_page.dart @@ -32,11 +32,11 @@ class _HouseAuthenticatePageState extends State { return InkWell( child: Container( padding: EdgeInsets.only( - top: Screenutil.length(19), - bottom: Screenutil.length(21), + top: 19.w, + bottom: 21.w, ), alignment: Alignment.center, - width: Screenutil.length(686), + width: 686.w, decoration: BoxDecoration( color: Color(0xffffd000), borderRadius: BorderRadius.all(Radius.circular(4)), @@ -51,7 +51,7 @@ class _HouseAuthenticatePageState extends State { '保存', style: TextStyle( fontWeight: FontWeight.w600, - fontSize: Screenutil.length(32), + fontSize: 32.w, color: Color(0xff333333), ), ), @@ -78,9 +78,9 @@ class _HouseAuthenticatePageState extends State { }, child: Container( margin: EdgeInsets.only( - top: Screenutil.length(32), - left: Screenutil.length(32), - right: Screenutil.length(32), + top: 32.w, + left: 32.w, + right: 32.w, ), child: Column( crossAxisAlignment: CrossAxisAlignment.center, @@ -90,8 +90,8 @@ class _HouseAuthenticatePageState extends State { _inputList.length, (index) => Container( padding: EdgeInsets.only( - top: Screenutil.length(23), - bottom: Screenutil.length(24), + top: 23.w, + bottom: 24.w, ), decoration: BoxDecoration( border: Border( @@ -104,10 +104,10 @@ class _HouseAuthenticatePageState extends State { Text( _inputList[index]['title'], style: TextStyle( - fontSize: Screenutil.size(28), + fontSize: 28.sp, color: Color(0xff333333)), ), - SizedBox(height: Screenutil.length(25)), + SizedBox(height: 25.w), CommonInput( hintText: _inputList[index]['hintText'], inputController: _inputList[index] @@ -119,7 +119,7 @@ class _HouseAuthenticatePageState extends State { ), ), ), - SizedBox(height: Screenutil.length(89)), + SizedBox(height: 89.w), _inkWellSave(), ], ), diff --git a/lib/pages/mine_house_page/mine_house_page.dart b/lib/pages/mine_house_page/mine_house_page.dart index 274be5c5..bab0e828 100644 --- a/lib/pages/mine_house_page/mine_house_page.dart +++ b/lib/pages/mine_house_page/mine_house_page.dart @@ -20,15 +20,15 @@ class _MineHousePageState extends State { Widget _containerHouseCard(String title, subtitle) { return Container( margin: EdgeInsets.only( - top: Screenutil.length(24), - left: Screenutil.length(32), - right: Screenutil.length(32), + top: 24.w, + left: 32.w, + right: 32.w, ), child: Container( padding: EdgeInsets.only( - top: Screenutil.length(41), - bottom: Screenutil.length(41), - left: Screenutil.length(27), + top: 41.w, + bottom: 41.w, + left: 27.w, ), decoration: BoxDecoration( border: @@ -40,25 +40,25 @@ class _MineHousePageState extends State { children: [ Image.asset( AssetsImage.HOUSEATTESTATION, - height: Screenutil.length(48), - width: Screenutil.length(48), + height: 48.w, + width: 48.w, ), - SizedBox(width: Screenutil.length(20)), + SizedBox(width: 20.w), Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( title, style: TextStyle( - fontSize: Screenutil.size(32), + fontSize: 32.sp, color: Color(0xff474747), ), ), - SizedBox(height: Screenutil.length(10)), + SizedBox(height: 10.w), Text( subtitle, style: TextStyle( - fontSize: Screenutil.size(32), + fontSize: 32.sp, color: Color(0xff474747), ), ) @@ -78,11 +78,11 @@ class _MineHousePageState extends State { }, child: Container( padding: EdgeInsets.only( - top: Screenutil.length(11), - bottom: Screenutil.length(10), + top: 11.w, + bottom: 10.w, ), alignment: Alignment.center, - width: Screenutil.length(167), + width: 167.w, decoration: BoxDecoration( color: Color(0xffffd000), borderRadius: BorderRadius.all(Radius.circular(4)), @@ -97,7 +97,7 @@ class _MineHousePageState extends State { '去认证', style: TextStyle( fontWeight: FontWeight.w600, - fontSize: Screenutil.size(32), + fontSize: 32.sp, color: Color(0xff333333), ), ), @@ -113,27 +113,27 @@ class _MineHousePageState extends State { children: [ Image.asset( AssetsImage.HOUSEHEADER, - height: Screenutil.length(124), - width: Screenutil.length(124), + height: 124.w, + width: 124.w, ), - SizedBox(height: Screenutil.length(24)), + SizedBox(height: 24.w), Text( '马泽鹏', style: TextStyle( fontWeight: FontWeight.w600, - fontSize: Screenutil.size(32), + fontSize: 32.sp, color: Color(0xff474747), ), ), - SizedBox(height: Screenutil.length(8)), + SizedBox(height: 8.w), Text( '经过产权人审核成为住户,开启更多功能', style: TextStyle( - fontSize: Screenutil.size(24), + fontSize: 24.sp, color: Color(0xff999999), ), ), - SizedBox(height: Screenutil.length(39)), + SizedBox(height: 39.w), _inkWellCheck(), ], ), @@ -161,7 +161,7 @@ class _MineHousePageState extends State { )) .toList(), ), - SizedBox(height: Screenutil.length(156)), + SizedBox(height: 156.w), _containerAttestation(), ], ), diff --git a/lib/pages/notice_page/notice_page.dart b/lib/pages/notice_page/notice_page.dart index 30de470f..7b9802a7 100644 --- a/lib/pages/notice_page/notice_page.dart +++ b/lib/pages/notice_page/notice_page.dart @@ -65,13 +65,13 @@ class NoticePage extends StatelessWidget { child: Row( children: [ Container( - margin: EdgeInsets.only(right: Screenutil.length(12)), + margin: EdgeInsets.only(right: 12.w), child: ClipOval( child: CachedImageWrapper( url: 'https://ss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=1380335538,732392216&fm=26&gp=0.jpg', - width: Screenutil.length(45), - height: Screenutil.length(45), + width: 45.w, + height: 45.w, ), ), ), @@ -81,21 +81,21 @@ class NoticePage extends StatelessWidget { TextSpan( text: '管理员 ', style: TextStyle( - fontSize: Screenutil.size(24), + fontSize: 24.sp, color: Color(0xff999999), ), ), TextSpan( text: ' 发布于 ', style: TextStyle( - fontSize: Screenutil.size(24), + fontSize: 24.sp, color: Color(0xff666666), ), ), TextSpan( text: '2020-08-12', style: TextStyle( - fontSize: Screenutil.size(24), + fontSize: 24.sp, color: Color(0xff999999), ), ), @@ -122,32 +122,32 @@ class NoticePage extends StatelessWidget { color: Colors.white, child: ListView( padding: EdgeInsets.only( - top: Screenutil.length(26), - left: Screenutil.length(32), - right: Screenutil.length(32), - bottom: Screenutil.length(60)), + top: 26.w, + left: 32.w, + right: 32.w, + bottom: 60.w), children: [ Text( bundle.getMap('details')['title'], style: TextStyle( - fontSize: Screenutil.size(32), + fontSize: 32.sp, color: Color(0xff333333), fontWeight: FontWeight.w600,), ), Container( - margin: EdgeInsets.only(top: Screenutil.length(45)), + margin: EdgeInsets.only(top: 45.w), child: ClipRRect( borderRadius: BorderRadius.all(Radius.circular(6)), child: CachedImageWrapper( url: bundle.getMap('details')['imagePath'], - width: Screenutil.length(686), - height: Screenutil.length(228), + width: 686.w, + height: 228.w, ), ), ), Container( - margin: EdgeInsets.only(top: Screenutil.length(44)), - width: Screenutil.length(647), + margin: EdgeInsets.only(top: 44.w), + width: 647.w, child: Html(data: htmlData), ), _creater(), diff --git a/lib/pages/one_alarm/widget/alarm_page.dart b/lib/pages/one_alarm/widget/alarm_page.dart index 5e952913..98ab2237 100644 --- a/lib/pages/one_alarm/widget/alarm_page.dart +++ b/lib/pages/one_alarm/widget/alarm_page.dart @@ -74,9 +74,9 @@ class _AlarmPageState extends State { crossAxisAlignment: CrossAxisAlignment.center, children: [ Container( - margin: EdgeInsets.only(top: Screenutil.length(32)), + margin: EdgeInsets.only(top: 32.w), width: 686.w, - height: Screenutil.length(148), + height: 148.w, decoration: BoxDecoration( color: Colors.white.withOpacity(0.9), borderRadius: BorderRadius.circular(16), @@ -88,41 +88,41 @@ class _AlarmPageState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - SizedBox(height: Screenutil.length(24)), + SizedBox(height: 24.w), Container( margin: EdgeInsets.only( - top: Screenutil.length(24), - left: Screenutil.length(32)), + top: 24.w, + left: 32.w), child: Text( '当前位置(仅供参考)', style: TextStyle( fontWeight: FontWeight.w600, color: Color(0xff333333), - fontSize: Screenutil.size(28)), + fontSize: 28.sp), ), ), Container( margin: EdgeInsets.only( - top: Screenutil.length(20), - left: Screenutil.length(32)), + top: 20.w, + left: 32.w), child: Row( mainAxisAlignment: MainAxisAlignment.start, children: [ Icon( Entypo.location_pin, color: Color(0xff666666), - size: Screenutil.size(29), + size: 29.sp, ), Container( margin: - EdgeInsets.only(left: Screenutil.length(5)), + EdgeInsets.only(left: 5.w), child: Text( (_location == null) ? '加载中……' : _location.aoiName, style: TextStyle( color: Color(0xff666666), - fontSize: Screenutil.size(28), + fontSize: 28.sp, ), ), ), @@ -137,11 +137,11 @@ class _AlarmPageState extends State { Spacer(), Container( alignment: Alignment.center, - width: Screenutil.length(66), - height: Screenutil.length(66), + width: 66.w, + height: 66.w, decoration: BoxDecoration( borderRadius: - BorderRadius.circular(Screenutil.length(66)), + BorderRadius.circular(66.w), boxShadow: [ BoxShadow( color: Color(0x1F000000), @@ -154,7 +154,7 @@ class _AlarmPageState extends State { padding: EdgeInsets.zero, shape: RoundedRectangleBorder( borderRadius: - BorderRadius.circular(Screenutil.length(66))), + BorderRadius.circular(66.w)), color: Color(0xFFFFFFFF), onPressed: () { _amapController?.setCenterCoordinate( @@ -165,19 +165,19 @@ class _AlarmPageState extends State { }, child: Icon( Icons.location_searching, - size: Screenutil.length(44), + size: 44.w, ), ), ), - SizedBox(width: Screenutil.length(34)), + SizedBox(width: 34.w), ], ), SizedBox( - height: Screenutil.length(29), + height: 29.w, ), Container( width: double.infinity, - height: Screenutil.length(271), + height: 271.w, alignment: Alignment.center, decoration: BoxDecoration(color: Color(0xFFFFFFFF).withOpacity(0.9)), @@ -186,19 +186,19 @@ class _AlarmPageState extends State { alignment: Alignment.topCenter, children: [ Positioned( - bottom: Screenutil.length(173), + bottom: 173.w, child: Container( - padding: EdgeInsets.all(Screenutil.length(12)), - height: Screenutil.length(196), - width: Screenutil.length(196), + padding: EdgeInsets.all(12.w), + height: 196.w, + width: 196.w, decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.all( - Radius.circular(Screenutil.length(196))), + Radius.circular(196.w)), ), child: Container( - height: Screenutil.length(172), - width: Screenutil.length(172), + height: 172.w, + width: 172.w, decoration: BoxDecoration( gradient: LinearGradient( begin: Alignment.bottomLeft, @@ -206,20 +206,20 @@ class _AlarmPageState extends State { colors: [Color(0xffef0909), Color(0xffff8880)], ), borderRadius: BorderRadius.all( - Radius.circular(Screenutil.length(172))), + Radius.circular(172.w)), boxShadow: [ BoxShadow( color: Color(0xfffd7770).withOpacity(0.33), - offset: Offset(0, Screenutil.length(10)), - blurRadius: Screenutil.length(20), - spreadRadius: Screenutil.length(4), + offset: Offset(0, 10.w), + blurRadius: 20.w, + spreadRadius: 4.w, ) ], ), child: FlatButton( shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular( - Screenutil.length(172))), + 172.w)), onPressed: () { setState(() { _makephonenum('tel:110'); @@ -228,7 +228,7 @@ class _AlarmPageState extends State { child: Icon( Feather.phone_call, color: Colors.white, - size: Screenutil.size(87), + size: 87.sp, ), ), ), @@ -236,12 +236,12 @@ class _AlarmPageState extends State { ), Column( children: [ - SizedBox(height: Screenutil.length(146)), + SizedBox(height: 146.w), Text( '谎报警情,依法追责', style: TextStyle( fontWeight: FontWeight.bold, - fontSize: Screenutil.size(32), + fontSize: 32.sp, color: Color(0xffe02020), ), ), @@ -249,7 +249,7 @@ class _AlarmPageState extends State { Text( '谎报警情将可能被处以五日以上十日以下拘留', style: TextStyle( - fontSize: Screenutil.size(24), + fontSize: 24.sp, color: Color(0xff999999), ), ), diff --git a/lib/pages/one_alarm/widget/explain_template.dart b/lib/pages/one_alarm/widget/explain_template.dart index 5857023f..2e19d1b2 100644 --- a/lib/pages/one_alarm/widget/explain_template.dart +++ b/lib/pages/one_alarm/widget/explain_template.dart @@ -17,7 +17,7 @@ class ExplainTemplate extends BeautifulPopupTemplate { @override final maxWidth = 400.w; @override - final maxHeight = Screenutil.length(617); + final maxHeight = 617.w; @override final bodyMargin = 0; @override @@ -55,9 +55,9 @@ class ExplainTemplate extends BeautifulPopupTemplate { // return Container( // color: Colors.white, // padding: EdgeInsets.only( -// top: Screenutil.length(32), -// left: Screenutil.length(32), -// right: Screenutil.length(32), +// top: 32.w, +// left: 32.w, +// right: 32.w, // ), // child: Column( // crossAxisAlignment: CrossAxisAlignment.start, @@ -71,7 +71,7 @@ class ExplainTemplate extends BeautifulPopupTemplate { // ), // ), // Container( -// margin: EdgeInsets.only(top: Screenutil.length(20)), +// margin: EdgeInsets.only(top: 20.w), // child: Text( // '点击“呼叫110”后,您可以直接拨打本地110。页面中提供了您当前所在位置,以便您与警方沟通。(GPS信号弱时,位置可能存在偏移)', // style: TextStyle( diff --git a/lib/pages/open_door_page/open_door_page.dart b/lib/pages/open_door_page/open_door_page.dart index 268d8193..3c487a4b 100644 --- a/lib/pages/open_door_page/open_door_page.dart +++ b/lib/pages/open_door_page/open_door_page.dart @@ -20,14 +20,14 @@ class _OpenDoorPageState extends State { title: Text( '实名认证', style: TextStyle( - fontSize: Screenutil.size(34), + fontSize: 34.sp, color: Color(0xff030303), ), ), content: Text( '\n为了小区的安全,需要先进行实名认证', style: TextStyle( - fontSize: Screenutil.size(28), + fontSize: 28.sp, color: Color(0xff030303), ), ), @@ -36,7 +36,7 @@ class _OpenDoorPageState extends State { child: Text( '考虑考虑', style: TextStyle( - fontSize: Screenutil.size(34), + fontSize: 34.sp, color: Color(0xff333333), ), ), @@ -49,7 +49,7 @@ class _OpenDoorPageState extends State { '前去认证', style: TextStyle( fontWeight: FontWeight.w600, - fontSize: Screenutil.size(34), + fontSize: 34.sp, color: Color(0xffff8200), ), ), @@ -80,7 +80,7 @@ class _OpenDoorPageState extends State { child: ListView( children: [ Container( - margin: EdgeInsets.only(top: Screenutil.length(220)), + margin: EdgeInsets.only(top: 220.w), child: Column( children: [ InkWell( @@ -89,22 +89,22 @@ class _OpenDoorPageState extends State { children: [ Container( alignment: Alignment.center, - width: Screenutil.length(400), - height: Screenutil.length(420), + width: 400.w, + height: 420.w, child: Image.asset( 'assets/images/open_door.png', - width: Screenutil.length(400), - height: Screenutil.length(420), + width: 400.w, + height: 420.w, fit: BoxFit.fill, ), ), Positioned( - top: Screenutil.length(120), - left: Screenutil.length(137.5), + top: 120.w, + left:137.5.w, child: Image.asset( 'assets/images/lock.png', - width: Screenutil.length(125), - height: Screenutil.length(150), + width: 125.w, + height: 150.w, fit: BoxFit.fill, ), ), @@ -112,11 +112,11 @@ class _OpenDoorPageState extends State { ), ), Container( - margin: EdgeInsets.only(top: Screenutil.length(40)), + margin: EdgeInsets.only(top: 40.w), child: Text( '未检测到相关设备', style: TextStyle( - fontSize: Screenutil.length(44), + fontSize: 44.w, color: Color(0xff999999), fontWeight: FontWeight.w600, ), diff --git a/lib/pages/opening_code_page/opening_code_page.dart b/lib/pages/opening_code_page/opening_code_page.dart index e275f189..2c707d44 100644 --- a/lib/pages/opening_code_page/opening_code_page.dart +++ b/lib/pages/opening_code_page/opening_code_page.dart @@ -28,54 +28,54 @@ class _OpeningCodePageState extends State { children: [ Container( margin: EdgeInsets.only( - top: Screenutil.length(70), - left: Screenutil.length(32), - right: Screenutil.length(32), - bottom: Screenutil.length(76), + top: 70.w, + left: 32.w, + right: 32.w, + bottom: 76.w, ), padding: EdgeInsets.symmetric( - horizontal: Screenutil.length(20), - vertical: Screenutil.length(32), + horizontal: 20.w, + vertical: 32.w, ), decoration: BoxDecoration( color: Color(0xffffffff), borderRadius: - BorderRadius.all(Radius.circular(Screenutil.length(8))), + BorderRadius.all(Radius.circular(8.w)), ), - height: Screenutil.length(746), - width: Screenutil.length(686), + height: 746.w, + width: 686.w, child: Column( children: [ Container( margin: EdgeInsets.only( - top: Screenutil.length(44), - bottom: Screenutil.length(32), + top: 44.w, + bottom: 32.w, ), - height: Screenutil.length(460), - width: Screenutil.length(460), + height: 460.w, + width: 460.w, child: QrImage( padding: EdgeInsets.zero, data: '智慧社区开门码', - size: Screenutil.length(460), + size: 460.w, ), ), Container( padding: EdgeInsets.symmetric( - horizontal: Screenutil.length(29), - vertical: Screenutil.length(33), + horizontal: 29.w, + vertical: 33.w, ), decoration: BoxDecoration( color: Color(0xfffffbf6), borderRadius: BorderRadius.all( - Radius.circular(Screenutil.length(8))), + Radius.circular(8.w)), ), - width: Screenutil.length(646), - height: Screenutil.length(146), + width: 646.w, + height: 146.w, child: Text( '扫一扫,你的专属二维码,人人文明出行,路路畅通安宁,智慧社区祝您一路顺风', maxLines: 2, style: TextStyle( - fontSize: Screenutil.size(28), + fontSize: 28.sp, color: Color(0xff666666), ), ), @@ -91,13 +91,13 @@ class _OpeningCodePageState extends State { Icon( AntDesign.checkcircleo, color: Color(0xffffc40c), - size: Screenutil.size(32), + size: 32.sp, ), - SizedBox(width: Screenutil.length(19)), + SizedBox(width: 19.w), Text( '已刷新', style: TextStyle( - fontSize: Screenutil.size(32), + fontSize: 32.sp, color: Color(0xff999999), ), ), diff --git a/lib/pages/personal/evaluate_good_page.dart b/lib/pages/personal/evaluate_good_page.dart index 005204c4..0cd1d05f 100644 --- a/lib/pages/personal/evaluate_good_page.dart +++ b/lib/pages/personal/evaluate_good_page.dart @@ -29,7 +29,7 @@ class _EvaluateGoodPageState extends State { elevation: 0, backgroundColor: Colors.white, leading: IconButton( - icon: Icon(AntDesign.left, size: Screenutil.size(40)), + icon: Icon(AntDesign.left, size: 40.sp), onPressed: () { Navigator.pop(context); }, @@ -63,10 +63,10 @@ class _EvaluateGoodPageState extends State { Container _containerRadio() { return Container( margin: EdgeInsets.only( - top: Screenutil.length(8), + top: 8.w, ), padding: EdgeInsets.only( - left: Screenutil.length(32), + left: 32.w, ), child: Row( children: [ @@ -75,11 +75,11 @@ class _EvaluateGoodPageState extends State { style: TextStyle( fontSize: BaseStyle.fontSize28, color: BaseStyle.color333333), ), - SizedBox(width: Screenutil.length(34)), + SizedBox(width: 34.w), Row( children: _listRadio .map((item) => Container( - margin: EdgeInsets.only(left: Screenutil.length(44)), + margin: EdgeInsets.only(left: 44.w), child: InkWell( onTap: () { setState(() { @@ -98,7 +98,7 @@ class _EvaluateGoodPageState extends State { ? BaseStyle.colorff8500 : BaseStyle.colord8d8d8, ), - SizedBox(width: Screenutil.length(16)), + SizedBox(width: 16.w), Text( item['radioName'], style: TextStyle( @@ -122,12 +122,12 @@ class _EvaluateGoodPageState extends State { Container _containerEvaluateTextField() { return Container( margin: EdgeInsets.only( - top: Screenutil.length(70), + top: 70.w, ), padding: EdgeInsets.only( - top: Screenutil.length(22), - left: Screenutil.length(32), - right: Screenutil.length(32), + top: 22.w, + left: 32.w, + right: 32.w, ), color: Colors.white, child: Container( @@ -145,8 +145,8 @@ class _EvaluateGoodPageState extends State { decoration: InputDecoration( isDense: true, contentPadding: EdgeInsets.only( - top: Screenutil.length(0), - bottom: Screenutil.length(0), + top: 0.w, + bottom: 0.w, ), hintText: hintText, border: InputBorder.none, //去掉输入框的下滑线 @@ -168,10 +168,10 @@ class _EvaluateGoodPageState extends State { Container _containerAddImage() { return Container( padding: EdgeInsets.only( - left: Screenutil.length(36), - right: Screenutil.length(36), - top: Screenutil.length(32), - bottom: Screenutil.length(24)), + left: 36.w, + right: 36.w, + top: 32.w, + bottom: 24.w), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -180,12 +180,12 @@ class _EvaluateGoodPageState extends State { style: TextStyle( fontSize: BaseStyle.fontSize28, color: BaseStyle.color333333), ), - SizedBox(height: Screenutil.length(24)), + SizedBox(height: 24.w), InkWell( onTap: () {}, child: Container( - width: Screenutil.length(218), - height: Screenutil.length(218), + width: 218.w, + height: 218.w, decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.all(Radius.circular(8)), @@ -205,10 +205,10 @@ class _EvaluateGoodPageState extends State { return InkWell( child: Container( alignment: Alignment.center, - height: Screenutil.length(85), - width: Screenutil.length(686), + height: 85.w, + width: 686.w, padding: EdgeInsets.symmetric( - vertical: Screenutil.length(20), + vertical: 20.w, ), decoration: BoxDecoration( color: Color(0xffffc40c), @@ -243,9 +243,9 @@ class _EvaluateGoodPageState extends State { children: [ Container( margin: EdgeInsets.only( - top: Screenutil.length(21), - left: Screenutil.length(24), - right: Screenutil.length(24), + top: 21.w, + left: 24.w, + right: 24.w, ), decoration: BoxDecoration( color: Colors.white, @@ -268,7 +268,7 @@ class _EvaluateGoodPageState extends State { ], ), ), - SizedBox(height: Screenutil.length(26)), + SizedBox(height: 26.w), _inkWellRelease(), ], ), diff --git a/lib/pages/personal/look_logistics_page.dart b/lib/pages/personal/look_logistics_page.dart index bda28ecb..74faa36c 100644 --- a/lib/pages/personal/look_logistics_page.dart +++ b/lib/pages/personal/look_logistics_page.dart @@ -32,7 +32,7 @@ class _LookLogisticsPageState extends State { children: [ _body(), SlidingUpPanel( - margin: EdgeInsets.symmetric(horizontal: Screenutil.length(32)), + margin: EdgeInsets.symmetric(horizontal: 32.w), maxHeight: _panelHeightOpen, minHeight: _panelHeightClosed, parallaxEnabled: true, @@ -45,10 +45,10 @@ class _LookLogisticsPageState extends State { ), ), Positioned( - top: Screenutil.length(32) + _statusHeight, + top: 32.w + _statusHeight, child: Container( - width: Screenutil.length(686), - padding: EdgeInsets.symmetric(horizontal: Screenutil.length(32)), + width: 686.w, + padding: EdgeInsets.symmetric(horizontal: 32.w), decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.circular(6), @@ -64,7 +64,7 @@ class _LookLogisticsPageState extends State { child: IconButton( padding: EdgeInsets.all(0), alignment: Alignment.centerLeft, - icon: Icon(AntDesign.left, size: Screenutil.size(40)), + icon: Icon(AntDesign.left, size: 40.sp), onPressed: () { Navigator.pop(context); }, @@ -76,13 +76,13 @@ class _LookLogisticsPageState extends State { child: CachedImageWrapper( url: 'https://ns-strategy.cdn.bcebos.com/ns-strategy/upload/fc_big_pic/part-00412-2241.jpg', - width: Screenutil.length(72), - height: Screenutil.length(72), + width: 72.w, + height: 72.w, ), ), ), Container( - margin: EdgeInsets.only(left: Screenutil.length(20)), + margin: EdgeInsets.only(left: 20.w), child: Text( '已签收', style: TextStyle( @@ -96,8 +96,8 @@ class _LookLogisticsPageState extends State { crossAxisAlignment: CrossAxisAlignment.center, children: [ SizedBox( - width: Screenutil.length(1), - height: Screenutil.length(50), + width: 1.w, + height: 50.w, child: DecoratedBox( decoration: BoxDecoration(color: BaseStyle.color999999), @@ -106,7 +106,7 @@ class _LookLogisticsPageState extends State { InkWell( onTap: () {}, child: Container( - margin: EdgeInsets.only(left: Screenutil.length(20)), + margin: EdgeInsets.only(left: 20.w), child: Column( children: [ Icon( @@ -116,7 +116,7 @@ class _LookLogisticsPageState extends State { ), Container( margin: - EdgeInsets.only(top: Screenutil.length(8)), + EdgeInsets.only(top: 8.w), child: Text( '物流投诉', style: TextStyle( @@ -147,7 +147,7 @@ class _LookLogisticsPageState extends State { controller: sc, children: [ Container( - height: Screenutil.length(40), + height: 40.w, alignment: Alignment.centerLeft, decoration: BoxDecoration( color: Color(0xfff0f0f0), diff --git a/lib/pages/personal/order_details_page.dart b/lib/pages/personal/order_details_page.dart index 20c28f01..44a41946 100644 --- a/lib/pages/personal/order_details_page.dart +++ b/lib/pages/personal/order_details_page.dart @@ -21,7 +21,7 @@ class _OrderDetailsPageState extends State { elevation: 0, backgroundColor: BaseStyle.colorffd000, leading: IconButton( - icon: Icon(AntDesign.left, size: Screenutil.size(40)), + icon: Icon(AntDesign.left, size: 40.sp), onPressed: () { Navigator.pop(context); }, @@ -43,9 +43,9 @@ class _OrderDetailsPageState extends State { width: double.infinity, color: Color(0xffffd000), padding: EdgeInsets.only( - top: Screenutil.length(44), - bottom: Screenutil.length(44), - left: Screenutil.length(33), + top: 44.w, + bottom: 44.w, + left: 33.w, ), child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -58,7 +58,7 @@ class _OrderDetailsPageState extends State { color: BaseStyle.color333333, ), ), - SizedBox(height: Screenutil.length(10)), + SizedBox(height: 10.w), Text( '还剩9小时33分自动确认', style: TextStyle( @@ -75,19 +75,19 @@ class _OrderDetailsPageState extends State { return Container( color: Color(0xffffffff), padding: EdgeInsets.only( - left: Screenutil.length(32), - top: Screenutil.length(24), - bottom: Screenutil.length(24), + left: 32.w, + top: 24.w, + bottom: 24.w, ), child: Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ Image.asset( AssetsImage.LOCATION, - height: Screenutil.length(78), - width: Screenutil.length(78), + height: 78.w, + width: 78.w, ), - SizedBox(width: Screenutil.length(24)), + SizedBox(width: 24.w), Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -101,7 +101,7 @@ class _OrderDetailsPageState extends State { color: BaseStyle.color333333, ), ), - SizedBox(width: Screenutil.length(16)), + SizedBox(width: 16.w), Text( '18809801254', style: TextStyle( @@ -111,9 +111,9 @@ class _OrderDetailsPageState extends State { ), ], ), - SizedBox(height: Screenutil.length(16)), + SizedBox(height: 16.w), Container( - width: Screenutil.length(584), + width: 584.w, child: ExtendedText.rich( TextSpan( children: [ @@ -150,8 +150,8 @@ class _OrderDetailsPageState extends State { }, child: Container( alignment: Alignment.center, - padding: EdgeInsets.symmetric(vertical: Screenutil.length(6)), - width: Screenutil.length(134), + padding: EdgeInsets.symmetric(vertical: 6.w), + width: 134.w, decoration: BoxDecoration( border: Border.all(color: BaseStyle.color999999, width: 0.5), borderRadius: BorderRadius.all(Radius.circular(36)), @@ -185,16 +185,16 @@ class _OrderDetailsPageState extends State { children: [ Image.asset( imagePath, - height: Screenutil.length(179), - width: Screenutil.length(173), + height: 179.w, + width: 173.w, fit: BoxFit.fill, ), - SizedBox(width: Screenutil.length(24)), + SizedBox(width: 24.w), Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - width: Screenutil.length(252), + width: 252.w, child: Text( content, overflow: TextOverflow.ellipsis, @@ -205,7 +205,7 @@ class _OrderDetailsPageState extends State { ), ), ), - SizedBox(height: Screenutil.length(16)), + SizedBox(height: 16.w), Text( specs, style: TextStyle( @@ -217,12 +217,12 @@ class _OrderDetailsPageState extends State { ), ], ), - SizedBox(height: Screenutil.length(73)), + SizedBox(height: 73.w), Row( mainAxisAlignment: MainAxisAlignment.end, children: [ Container( - margin: EdgeInsets.only(right: Screenutil.length(25)), + margin: EdgeInsets.only(right: 25.w), child: Text( '实付款¥${payPrice}', style: TextStyle( @@ -238,7 +238,7 @@ class _OrderDetailsPageState extends State { ), Positioned( top: 0, - right: Screenutil.length(23), + right: 23.w, child: Column( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.end, @@ -262,7 +262,7 @@ class _OrderDetailsPageState extends State { ), ), Positioned( - top: Screenutil.length(103), + top: 103.w, right: 0, child: _inkWellRefund(listContent,payPrice), ), @@ -275,12 +275,12 @@ class _OrderDetailsPageState extends State { List> listContent, double payPrice) { return Container( color: Color(0xffffffff), - margin: EdgeInsets.only(top: Screenutil.length(32)), + margin: EdgeInsets.only(top: 32.w), padding: EdgeInsets.only( - top: Screenutil.length(32), - left: Screenutil.length(32), - right: Screenutil.length(32), - bottom: Screenutil.length(24), + top: 32.w, + left: 32.w, + right: 32.w, + bottom: 24.w, ), child: Column( children: listContent @@ -302,11 +302,11 @@ class _OrderDetailsPageState extends State { return Container( color: Color(0xffffffff), width: double.infinity, - margin: EdgeInsets.only(top: Screenutil.length(24)), + margin: EdgeInsets.only(top: 24.w), padding: EdgeInsets.only( - top: Screenutil.length(32), - left: Screenutil.length(31), - bottom: Screenutil.length(39), + top: 32.w, + left: 31.w, + bottom: 39.w, ), child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -321,7 +321,7 @@ class _OrderDetailsPageState extends State { Column( children: listOrderDetail .map((item) => Container( - margin: EdgeInsets.only(top: Screenutil.length(22)), + margin: EdgeInsets.only(top: 22.w), child: Row( children: [ Text( @@ -330,7 +330,7 @@ class _OrderDetailsPageState extends State { fontSize: BaseStyle.fontSize24, color: BaseStyle.color999999), ), - SizedBox(width: Screenutil.length(75)), + SizedBox(width: 75.w), Text( item['subtitle'], style: TextStyle( @@ -354,7 +354,7 @@ class _OrderDetailsPageState extends State { alignment: Alignment.center, color: color, padding: EdgeInsets.symmetric( - vertical: Screenutil.length(26.5), + vertical: 26.5.w, ), child: Text( title, @@ -438,7 +438,7 @@ class _OrderDetailsPageState extends State { bottom: 0, child: Container( alignment: Alignment.center, - height: Screenutil.length(98), + height: 98.w, width: MediaQuery.of(context).size.width, child: Row( children: _listBottom diff --git a/lib/pages/personal/order_page.dart b/lib/pages/personal/order_page.dart index 8658720e..c5323d5b 100644 --- a/lib/pages/personal/order_page.dart +++ b/lib/pages/personal/order_page.dart @@ -46,11 +46,11 @@ class _OrderPageState extends State labelColor: BaseStyle.colorff8500, unselectedLabelColor: BaseStyle.color333333, labelStyle: TextStyle( - fontSize: Screenutil.size(28), + fontSize: 28.sp, fontWeight: FontWeight.w600, ), unselectedLabelStyle: TextStyle( - fontSize: Screenutil.size(28), + fontSize: 28.sp, fontWeight: FontWeight.w500, ), tabs: List.generate( @@ -68,11 +68,11 @@ class _OrderPageState extends State return InkWell( onTap: () {}, child: Container( - margin: EdgeInsets.only(right: Screenutil.length(32)), + margin: EdgeInsets.only(right: 32.w), padding: EdgeInsets.only( - left: Screenutil.length(40), - top: Screenutil.length(20), - bottom: Screenutil.length(20)), + left: 40.w, + top: 20.w, + bottom: 20.w), decoration: BoxDecoration( color: BaseStyle.colorf3f3f3, borderRadius: BorderRadius.all(Radius.circular(36)), @@ -109,7 +109,7 @@ class _OrderPageState extends State backgroundColor: Color(0xffffffff), leading: InkWell( onTap: () => Navigator.pop(context), - child: Icon(AntDesign.left, size: Screenutil.size(40)), + child: Icon(AntDesign.left, size: 40.sp), ), centerTitle: false, title: _inkWellSearch(), diff --git a/lib/pages/personal/personal_page.dart b/lib/pages/personal/personal_page.dart index bb81148e..d6bf4dd0 100644 --- a/lib/pages/personal/personal_page.dart +++ b/lib/pages/personal/personal_page.dart @@ -38,7 +38,7 @@ class _PersonalIndexState extends State elevation: 0, stretch: true, floating: true, - expandedHeight: Screenutil.length(450) - height, + expandedHeight: 450.w - height, backgroundColor: Colors.white, flexibleSpace: FlexibleSpaceBar( background: Stack( @@ -60,8 +60,8 @@ class _PersonalIndexState extends State Spacer(), Container( margin: EdgeInsets.only( - top: Screenutil.length(175), - left: Screenutil.length(32)), + top: 175.w, + left: 32.w), child: Row( children: [ Container( @@ -69,8 +69,8 @@ class _PersonalIndexState extends State child: CachedImageWrapper( url: 'https://dss0.bdstatic.com/70cFuHSh_Q1YnxGkpoWK1HF6hhy/it/u=1851283359,3457678391&fm=26&gp=0.jpg', - width: Screenutil.length(106), - height: Screenutil.length(106), + width: 106.w, + height: 106.w, isSigned: _isSigned, ), ), @@ -81,7 +81,7 @@ class _PersonalIndexState extends State }, child: Container( margin: EdgeInsets.only( - left: Screenutil.length(16)), + left: 16.w), child: _isSigned ? Text( 'Cheailune', @@ -103,14 +103,14 @@ class _PersonalIndexState extends State ), Container( margin: EdgeInsets.only( - top: Screenutil.length(38), - left: Screenutil.length(36), - right: Screenutil.length(36), + top: 38.w, + left: 36.w, + right: 36.w, ), child: Image.asset( 'assets/images/member_bg.png', - width: Screenutil.length(678), - height: Screenutil.length(129), + width: 678.w, + height: 129.w, ), ), ], @@ -126,7 +126,7 @@ class _PersonalIndexState extends State Container _containerBar(String title) { return Container( color: title == '我的物业' ? Colors.white : BaseStyle.colorf9f9f9, - padding: EdgeInsets.all(title == '我的物业' ? 0 : Screenutil.length(32)), + padding: EdgeInsets.all(title == '我的物业' ? 0 : 32.w), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ @@ -156,7 +156,7 @@ class _PersonalIndexState extends State color: BaseStyle.color333333, ), ), - SizedBox(width: Screenutil.length(8)), + SizedBox(width: 8.w), Icon( AntDesign.right, size: BaseStyle.fontSize28, @@ -183,7 +183,7 @@ class _PersonalIndexState extends State ), SliverToBoxAdapter( child: Container( - margin: EdgeInsets.only(top: Screenutil.length(10)), + margin: EdgeInsets.only(top: 10.w), color: BaseStyle.colorf9f9f9, child: GridButton( gridList: AssetsImage.orderGridList, @@ -194,9 +194,9 @@ class _PersonalIndexState extends State SliverToBoxAdapter( child: Container( margin: EdgeInsets.only( - top: Screenutil.length(32), - left: Screenutil.length(32), - right: Screenutil.length(32)), + top: 32.w, + left: 32.w, + right: 32.w), child: Divider( color: Color(0xffd8d8d8), ), @@ -208,7 +208,7 @@ class _PersonalIndexState extends State SliverToBoxAdapter( child: Container( color: BaseStyle.colorf9f9f9, - margin: EdgeInsets.only(top: Screenutil.length(10)), + margin: EdgeInsets.only(top: 10.w), alignment: Alignment.center, child: GridButton( gridList: AssetsImage.orderGridList.take(3).skip(1).toList(), @@ -233,8 +233,8 @@ class _PersonalIndexState extends State ), ], ), - margin: EdgeInsets.all(Screenutil.length(20)), - padding: EdgeInsets.all(Screenutil.length(12)), + margin: EdgeInsets.all(20.w), + padding: EdgeInsets.all(12.w), child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ diff --git a/lib/pages/personal/refund_apply_page.dart b/lib/pages/personal/refund_apply_page.dart index 9a151998..5c19597d 100644 --- a/lib/pages/personal/refund_apply_page.dart +++ b/lib/pages/personal/refund_apply_page.dart @@ -25,7 +25,7 @@ class _RefundApplyPageState extends State { elevation: 0, backgroundColor: BaseStyle.colorffd000, leading: IconButton( - icon: Icon(AntDesign.left, size: Screenutil.size(40)), + icon: Icon(AntDesign.left, size: 40.sp), onPressed: () { Navigator.pop(context); }, @@ -59,13 +59,13 @@ class _RefundApplyPageState extends State { Container _containerRefundPrice(double payPrice) { return Container( padding: EdgeInsets.only( - top: Screenutil.length(22), - left: Screenutil.length(32), - right: Screenutil.length(32), + top: 22.w, + left: 32.w, + right: 32.w, ), color: Colors.white, child: Container( - padding: EdgeInsets.only(bottom: Screenutil.length(26)), + padding: EdgeInsets.only(bottom: 26.w), decoration: BoxDecoration( border: Border( bottom: BorderSide(color: BaseStyle.coloreeeeee, width: 0.5)), @@ -97,13 +97,13 @@ class _RefundApplyPageState extends State { Container _containerRefundTextField() { return Container( padding: EdgeInsets.only( - top: Screenutil.length(22), - left: Screenutil.length(32), - right: Screenutil.length(32), + top: 22.w, + left: 32.w, + right: 32.w, ), color: Colors.white, child: Container( - padding: EdgeInsets.only(bottom: Screenutil.length(26)), + padding: EdgeInsets.only(bottom: 26.w), decoration: BoxDecoration( border: Border( bottom: BorderSide(color: BaseStyle.coloreeeeee, width: 0.5)), @@ -118,7 +118,7 @@ class _RefundApplyPageState extends State { color: BaseStyle.color333333, ), ), - SizedBox(height: Screenutil.length(23)), + SizedBox(height: 23.w), TextFormField( cursorColor: Color(0xffffc40c), style: TextStyle( @@ -130,8 +130,8 @@ class _RefundApplyPageState extends State { decoration: InputDecoration( isDense: true, contentPadding: EdgeInsets.only( - top: Screenutil.length(0), - bottom: Screenutil.length(0), + top: 0.w, + bottom: 0.w, ), hintText: hintText, border: InputBorder.none, //去掉输入框的下滑线 @@ -157,7 +157,7 @@ class _RefundApplyPageState extends State { alignment: Alignment.center, color: BaseStyle.colorffc40c, padding: EdgeInsets.symmetric( - vertical: Screenutil.length(26.5), + vertical: 26.5.w, ), child: Text( '提交', @@ -193,11 +193,11 @@ class _RefundApplyPageState extends State { children: [ Column( children: [ - SizedBox(height: Screenutil.length(24)), + SizedBox(height: 24.w), _containerContentList( widget.bundle.getMap('details')['listContent'], ), - SizedBox(height: Screenutil.length(24)), + SizedBox(height: 24.w), RefundTileCard( listTile: widget.bundle.getMap('details')['isRefundGood'] @@ -205,7 +205,7 @@ class _RefundApplyPageState extends State { : _listTile.take(1).toList()), _containerRefundPrice( widget.bundle.getMap('details')['payPrice']), - SizedBox(height: Screenutil.length(24)), + SizedBox(height: 24.w), _containerRefundTextField(), ], ), @@ -213,7 +213,7 @@ class _RefundApplyPageState extends State { bottom: 0, child: Container( alignment: Alignment.center, - height: Screenutil.length(98), + height: 98.w, width: MediaQuery.of(context).size.width, child: Row(children: [Expanded(child: _inkWellBottom())]), ), diff --git a/lib/pages/personal/refund_select_page.dart b/lib/pages/personal/refund_select_page.dart index 3863e3bb..4be8ffe0 100644 --- a/lib/pages/personal/refund_select_page.dart +++ b/lib/pages/personal/refund_select_page.dart @@ -22,7 +22,7 @@ class _RefundSelectPageState extends State { elevation: 0, backgroundColor: BaseStyle.colorffd000, leading: IconButton( - icon: Icon(AntDesign.left, size: Screenutil.size(40)), + icon: Icon(AntDesign.left, size: 40.sp), onPressed: () { Navigator.pop(context); }, @@ -89,11 +89,11 @@ class _RefundSelectPageState extends State { appBar: _appBar(), body: ListView( children: [ - SizedBox(height: Screenutil.length(24)), + SizedBox(height: 24.w), _containerContentList( widget.bundle.getMap('details')['listContent'], ), - SizedBox(height: Screenutil.length(24)), + SizedBox(height: 24.w), RefundTileCard(listTile: _listTile) ], ), diff --git a/lib/pages/personal/widget/order_card.dart b/lib/pages/personal/widget/order_card.dart index e588fa77..cc2d6755 100644 --- a/lib/pages/personal/widget/order_card.dart +++ b/lib/pages/personal/widget/order_card.dart @@ -26,7 +26,7 @@ class _OrderCardState extends State { Container _containerStatus(String status) { return Container( width: double.infinity, - padding: EdgeInsets.only(bottom: Screenutil.length(13)), + padding: EdgeInsets.only(bottom: 13.w), decoration: BoxDecoration( border: Border(bottom: BorderSide(color: Color(0xffd8d8d8), width: 0.5)), @@ -45,7 +45,7 @@ class _OrderCardState extends State { Container _containerContent( String imagePath, content, specs, double price, int shopNum) { return Container( - margin: EdgeInsets.only(top: Screenutil.length(24)), + margin: EdgeInsets.only(top: 24.w), child: Stack( children: [ Row( @@ -54,16 +54,16 @@ class _OrderCardState extends State { children: [ Image.asset( imagePath, - height: Screenutil.length(179), - width: Screenutil.length(173), + height: 179.w, + width: 173.w, fit: BoxFit.fill, ), - SizedBox(width: Screenutil.length(24)), + SizedBox(width: 24.w), Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - width: Screenutil.length(262), + width: 262.w, child: Text( content, overflow: TextOverflow.ellipsis, @@ -74,7 +74,7 @@ class _OrderCardState extends State { ), ), ), - SizedBox(height: Screenutil.length(16)), + SizedBox(height: 16.w), Text( specs, style: TextStyle( @@ -88,7 +88,7 @@ class _OrderCardState extends State { ), Positioned( top: 0, - right: Screenutil.length(8), + right: 8.w, child: Column( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.end, @@ -134,7 +134,7 @@ class _OrderCardState extends State { Container _containerPayInfo(double totalPrice, payPrice) { return Container( - margin: EdgeInsets.only(right: Screenutil.length(8)), + margin: EdgeInsets.only(right: 8.w), child: Row( mainAxisAlignment: MainAxisAlignment.end, children: [ @@ -145,7 +145,7 @@ class _OrderCardState extends State { color: BaseStyle.color999999, ), ), - SizedBox(width: Screenutil.length(16)), + SizedBox(width: 16.w), Text( '实付款¥${payPrice}', style: TextStyle( @@ -188,10 +188,10 @@ class _OrderCardState extends State { } }, child: Container( - margin: EdgeInsets.only(left: Screenutil.length(16)), + margin: EdgeInsets.only(left: 16.w), alignment: Alignment.center, - width: Screenutil.length(171), - height: Screenutil.length(60), + width: 171.w, + height: 60.w, decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(30)), border: Border.all(color: buttonColor, width: 1), @@ -210,8 +210,8 @@ class _OrderCardState extends State { Container _containerButtonList(List> listButton) { return Container( margin: EdgeInsets.only( - top: Screenutil.length(42), - right: Screenutil.length(8), + top: 42.w, + right: 8.w, ), child: Row( mainAxisAlignment: MainAxisAlignment.end, @@ -249,15 +249,15 @@ class _OrderCardState extends State { ], ), padding: EdgeInsets.only( - top: Screenutil.length(18), - left: Screenutil.length(20), - right: Screenutil.length(16), - bottom: Screenutil.length(42), + top: 18.w, + left: 20.w, + right: 16.w, + bottom: 42.w, ), margin: EdgeInsets.only( - top: Screenutil.length(24), - left: Screenutil.length(32), - right: Screenutil.length(32), + top: 24.w, + left: 32.w, + right: 32.w, ), child: Column( crossAxisAlignment: CrossAxisAlignment.start, diff --git a/lib/pages/personal/widget/refund_shop_card.dart b/lib/pages/personal/widget/refund_shop_card.dart index 4ed9b532..edb308b2 100644 --- a/lib/pages/personal/widget/refund_shop_card.dart +++ b/lib/pages/personal/widget/refund_shop_card.dart @@ -13,9 +13,9 @@ class RefundShopCard extends StatelessWidget { return Container( color: Colors.white, padding: EdgeInsets.only( - top: Screenutil.length(32), - left: Screenutil.length(32), - bottom: Screenutil.length(32), + top: 32.w, + left: 32.w, + bottom: 32.w, ), child: Row( crossAxisAlignment: CrossAxisAlignment.start, @@ -23,16 +23,16 @@ class RefundShopCard extends StatelessWidget { children: [ Image.asset( imagePath, - height: Screenutil.length(179), - width: Screenutil.length(173), + height: 179.w, + width: 173.w, fit: BoxFit.fill, ), - SizedBox(width: Screenutil.length(24)), + SizedBox(width: 24.w), Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - width: Screenutil.length(458), + width: 458.w, child: Text( content, overflow: TextOverflow.ellipsis, @@ -43,9 +43,9 @@ class RefundShopCard extends StatelessWidget { ), ), ), - SizedBox(height: Screenutil.length(8)), + SizedBox(height: 8.w), Container( - width: Screenutil.length(456), + width: 456.w, child: Text( specs, overflow: TextOverflow.ellipsis, diff --git a/lib/pages/personal/widget/refund_tile_card.dart b/lib/pages/personal/widget/refund_tile_card.dart index f800c7d1..100ada1a 100644 --- a/lib/pages/personal/widget/refund_tile_card.dart +++ b/lib/pages/personal/widget/refund_tile_card.dart @@ -16,7 +16,7 @@ class _RefundTileCardState extends State { Container _refundTile(String title, subtitle) { return Container( width: double.infinity, - padding: EdgeInsets.only(bottom: Screenutil.length(26)), + padding: EdgeInsets.only(bottom: 26.w), decoration: BoxDecoration( border: Border( bottom: BorderSide(color: BaseStyle.coloreeeeee, width: 0.5)), @@ -31,7 +31,7 @@ class _RefundTileCardState extends State { color: BaseStyle.color333333, ), ), - SizedBox(height: Screenutil.length(24)), + SizedBox(height: 24.w), Text( subtitle, style: TextStyle( @@ -56,9 +56,9 @@ class _RefundTileCardState extends State { child: Container( width: double.infinity, padding: EdgeInsets.only( - top: Screenutil.length(22), - left: Screenutil.length(32), - right: Screenutil.length(32), + top: 22.w, + left: 32.w, + right: 32.w, ), color: Colors.white, child: Stack( @@ -69,11 +69,11 @@ class _RefundTileCardState extends State { ), item['isRight'] ? Positioned( - top: Screenutil.length(45), + top: 45.w, right: 0, child: Icon( AntDesign.right, - size: Screenutil.size(40), + size: 40.sp, color: BaseStyle.colord8d8d8, ), ) diff --git a/lib/pages/property/property_index.dart b/lib/pages/property/property_index.dart index b2741799..9acfbc3e 100644 --- a/lib/pages/property/property_index.dart +++ b/lib/pages/property/property_index.dart @@ -124,7 +124,7 @@ class _PropertyIndexState extends State title: Text( '物业', style: TextStyle( - fontSize: Screenutil.size(36), + fontSize: 36.sp, color: Color(0xff333333), ), ), diff --git a/lib/pages/property/widget/property_activity_card.dart b/lib/pages/property/widget/property_activity_card.dart index ae5a953b..f8692e61 100644 --- a/lib/pages/property/widget/property_activity_card.dart +++ b/lib/pages/property/widget/property_activity_card.dart @@ -40,15 +40,15 @@ class PropertyActivityCard extends StatelessWidget { ]; TextStyle _textStyleTitle() { - return TextStyle(fontSize: Screenutil.size(28), color: Color(0xff4a4b51)); + return TextStyle(fontSize: 28.sp, color: Color(0xff4a4b51)); } TextStyle _textStyleTag() { - return TextStyle(fontSize: Screenutil.size(24), color: Color(0xff999999)); + return TextStyle(fontSize: 24.sp, color: Color(0xff999999)); } TextStyle _textStyleSubtitle() { - return TextStyle(fontSize: Screenutil.size(24), color: Color(0xff4a4b51)); + return TextStyle(fontSize: 24.sp, color: Color(0xff4a4b51)); } Container _activityCard(String imagePath, title, subtitleFirst, @@ -59,28 +59,28 @@ class PropertyActivityCard extends StatelessWidget { borderRadius: BorderRadius.all(Radius.circular(8)), ), margin: EdgeInsets.only( - top: index == 0 ? 0 : Screenutil.length(32), - left: Screenutil.length(32), - right: Screenutil.length(32), + top: index == 0 ? 0 : 32.w, + left: 32.w, + right: 32.w, ), padding: EdgeInsets.only( - top: Screenutil.length(12), - left: Screenutil.length(10), - right: Screenutil.length(22), - bottom: Screenutil.length(20)), + top: 12.w, + left: 10.w, + right: 22.w, + bottom: 20.w), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Row( children: [ Container( - margin: EdgeInsets.only(right: Screenutil.length(20)), + margin: EdgeInsets.only(right: 20.w), child: ClipRRect( borderRadius: BorderRadius.all(Radius.circular(6)), child: CachedImageWrapper( url: imagePath, - width: Screenutil.length(160), - height: Screenutil.length(120), + width: 160.w, + height: 120.w, ), ), ), @@ -88,14 +88,14 @@ class PropertyActivityCard extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - margin: EdgeInsets.only(bottom: Screenutil.length(6)), + margin: EdgeInsets.only(bottom: 6.w), child: Text( title, style: _textStyleTitle(), ), ), Container( - margin: EdgeInsets.only(bottom: Screenutil.length(8)), + margin: EdgeInsets.only(bottom: 8.w), child: RichText( text: TextSpan( text: '地点:', @@ -121,7 +121,7 @@ class PropertyActivityCard extends StatelessWidget { ), ], ), - SizedBox(height: Screenutil.length(40)), + SizedBox(height: 40.w), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ @@ -129,16 +129,16 @@ class PropertyActivityCard extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.start, children: [ Container( - margin: EdgeInsets.only(left: Screenutil.length(80)), + margin: EdgeInsets.only(left: 80.w), child: ImageStack( imageList: images, - imageRadius: Screenutil.size(44), + imageRadius: 44.sp, imageCount: 3, imageBorderWidth: 1, totalCount: 3, ), ), - SizedBox(width: Screenutil.length(26)), + SizedBox(width: 26.w), Text( '${peopleNum}人已参加', style: _textStyleSubtitle(), @@ -151,10 +151,10 @@ class PropertyActivityCard extends StatelessWidget { }, child: Container( alignment: Alignment.center, - height: Screenutil.length(44), - width: Screenutil.length(120), + height: 44.w, + width: 120.w, padding: EdgeInsets.symmetric( - vertical: Screenutil.length(7), + vertical: 7.w, ), decoration: BoxDecoration( color: Color(0xffffc40c), diff --git a/lib/pages/property/widget/property_bar.dart b/lib/pages/property/widget/property_bar.dart index cc236883..41ce7310 100644 --- a/lib/pages/property/widget/property_bar.dart +++ b/lib/pages/property/widget/property_bar.dart @@ -14,14 +14,14 @@ class PropertyBar extends StatelessWidget { TextStyle _textStyleTitle() { return TextStyle( - fontSize: Screenutil.size(36), + fontSize: 36.sp, color: Color(0xff333333), ); } TextStyle _textStyleSubtitle() { return TextStyle( - fontSize: Screenutil.size(24), + fontSize: 24.sp, color: Color(0xff999999), ); } @@ -36,16 +36,16 @@ class PropertyBar extends StatelessWidget { maxHeight: 93, child: Container( margin: EdgeInsets.only( - top: Screenutil.length(40), - bottom: Screenutil.length(32), - left: Screenutil.length(32), - right: Screenutil.length(32), + top: 40.w, + bottom: 32.w, + left: 32.w, + right: 32.w, ), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text(title, style: _textStyleTitle()), - SizedBox(height: Screenutil.length(10)), + SizedBox(height: 10.w), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ @@ -58,11 +58,11 @@ class PropertyBar extends StatelessWidget { child: Row( children: [ Text(more, style: _textStyleSubtitle()), - SizedBox(width: Screenutil.length(12)), + SizedBox(width: 12.w), Icon( AntDesign.right, color: Color(0xff999999), - size: Screenutil.size(20), + size: 20.sp, ), ], ), diff --git a/lib/pages/property/widget/property_card.dart b/lib/pages/property/widget/property_card.dart index 52e546d5..aa3da56a 100644 --- a/lib/pages/property/widget/property_card.dart +++ b/lib/pages/property/widget/property_card.dart @@ -40,7 +40,7 @@ class PropertyCard extends StatelessWidget { title: Text( url, style: TextStyle( - fontSize: Screenutil.size(34), + fontSize: 34.sp, color: Color(0xff030303), ), ), @@ -49,7 +49,7 @@ class PropertyCard extends StatelessWidget { child: Text( '取消', style: TextStyle( - fontSize: Screenutil.size(34), + fontSize: 34.sp, color: Color(0xff333333), ), ), @@ -62,7 +62,7 @@ class PropertyCard extends StatelessWidget { '呼叫', style: TextStyle( fontWeight: FontWeight.w600, - fontSize: Screenutil.size(34), + fontSize: 34.sp, color: Color(0xffff8200), ), ), @@ -81,8 +81,8 @@ class PropertyCard extends StatelessWidget { Widget build(BuildContext context) { return Container( margin: EdgeInsets.symmetric( - horizontal: Screenutil.length(32), - vertical: Screenutil.length(20), + horizontal: 32.w, + vertical: 20.w, ), child: GridView.builder( shrinkWrap: true, @@ -102,8 +102,8 @@ class PropertyCard extends StatelessWidget { }, child: Container( padding: EdgeInsets.symmetric( - horizontal: Screenutil.length(19), - vertical: Screenutil.length(36), + horizontal: 19.w, + vertical: 36.w, ), decoration: BoxDecoration( gradient: LinearGradient( @@ -124,8 +124,8 @@ class PropertyCard extends StatelessWidget { children: [ Container( alignment: Alignment.center, - height: Screenutil.length(88), - width: Screenutil.length(88), + height: 88.w, + width: 88.w, decoration: BoxDecoration( shape: BoxShape.circle, gradient: LinearGradient( @@ -143,28 +143,28 @@ class PropertyCard extends StatelessWidget { child: Image.asset( _listCard[index]['image'], fit: BoxFit.fill, - height: Screenutil.length(64), - width: Screenutil.length(77), + height: 64.w, + width: 77.w, ), ), - SizedBox(width: Screenutil.length(24)), + SizedBox(width: 24.w), Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - SizedBox(height: Screenutil.length(5)), + SizedBox(height: 5.w), Text( _listCard[index]['title'], style: TextStyle( fontWeight: FontWeight.w600, - fontSize: Screenutil.size(32), + fontSize: 32.sp, color: Color(0xffffffff), ), ), - SizedBox(height: Screenutil.length(4)), + SizedBox(height: 4.w), Text( _listCard[index]['subtitle'], style: TextStyle( - fontSize: Screenutil.size(20), + fontSize: 20.sp, color: Color(0xffffffff), ), ), @@ -177,8 +177,8 @@ class PropertyCard extends StatelessWidget { }, gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( crossAxisCount: 2, - crossAxisSpacing: Screenutil.length(40), - childAspectRatio: Screenutil.length(323) / Screenutil.length(160)), + crossAxisSpacing: 40.w, + childAspectRatio: 323.w / 160.w), ), ); } diff --git a/lib/pages/questionnaire_page/questionnaire_details_page/questionnaire_details_page.dart b/lib/pages/questionnaire_page/questionnaire_details_page/questionnaire_details_page.dart index 07197e05..5cb9ebdb 100644 --- a/lib/pages/questionnaire_page/questionnaire_details_page/questionnaire_details_page.dart +++ b/lib/pages/questionnaire_page/questionnaire_details_page/questionnaire_details_page.dart @@ -71,7 +71,7 @@ class _QuestionnaireDetailsPageState extends State { Widget _questionCard(String title, List> optionList) { return Container( - margin: EdgeInsets.only(top: Screenutil.length(64)), + margin: EdgeInsets.only(top:64.w), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -84,9 +84,9 @@ class _QuestionnaireDetailsPageState extends State { ), ), Container( - margin: EdgeInsets.only(top: Screenutil.length(64)), + margin: EdgeInsets.only(top: 64.w), child: Wrap( - runSpacing: Screenutil.length(48), + runSpacing: 48.w, children: optionList .map((item) => InkWell( onTap: () { @@ -95,7 +95,7 @@ class _QuestionnaireDetailsPageState extends State { }); }, child: Container( - margin: EdgeInsets.only(left: Screenutil.length(15)), + margin: EdgeInsets.only(left:15.w), width: MediaQuery.of(context).size.width / 2.35, child: Row( children: [ @@ -106,11 +106,11 @@ class _QuestionnaireDetailsPageState extends State { color: item['isCheck'] ? BaseStyle.colorffc40c : BaseStyle.color979797, - size: Screenutil.length(32), + size: 32.w, ), Container( margin: EdgeInsets.only( - left: Screenutil.length(16)), + left: 16.w), width: MediaQuery.of(context).size.width / 3.2, child: Text( item['title'], @@ -139,9 +139,9 @@ class _QuestionnaireDetailsPageState extends State { Widget _containerTextField() { return Container( padding: EdgeInsets.only( - top: Screenutil.length(24), - left: Screenutil.length(24), - right: Screenutil.length(32)), + top: 24.w, + left: 24.w, + right: 32.w), decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(6)), border: Border.all(color: Color(0xffd4cfbe), width: 1.0), @@ -158,8 +158,8 @@ class _QuestionnaireDetailsPageState extends State { decoration: InputDecoration( isDense: true, contentPadding: EdgeInsets.only( - top: Screenutil.length(0), - bottom: Screenutil.length(0), + top: 0, + bottom: 0, ), hintText: hintText, border: InputBorder.none, //去掉输入框的下滑线 @@ -180,7 +180,7 @@ class _QuestionnaireDetailsPageState extends State { bottom: 0, child: Container( alignment: Alignment.center, - height: Screenutil.length(98), + height: 98.w, width: MediaQuery.of(context).size.width, child: InkWell( onTap: () {}, @@ -188,7 +188,7 @@ class _QuestionnaireDetailsPageState extends State { alignment: Alignment.center, color: BaseStyle.colorffc40c, padding: EdgeInsets.symmetric( - vertical: Screenutil.length(26.5), + vertical: 26.5.w, ), child: Text( '确认提交', @@ -219,7 +219,7 @@ class _QuestionnaireDetailsPageState extends State { children: [ Container( padding: EdgeInsets.only( - left: Screenutil.length(32), + left: 32.w, right: Screenutil.length(32), bottom: Screenutil.length(155), ), diff --git a/lib/pages/setting_page/about_page/about_page.dart b/lib/pages/setting_page/about_page/about_page.dart index a6229065..516228a4 100644 --- a/lib/pages/setting_page/about_page/about_page.dart +++ b/lib/pages/setting_page/about_page/about_page.dart @@ -12,7 +12,7 @@ class AboutPage extends StatelessWidget { '“小蜜蜂社区”APP是由凯达来科技有限公司研究开发,为全国社区业主量身定做,本产品融合了基础物业服务,园区生活服务,周边商圈服务和邻里社交服务的一站式园区生活服务平台。该平台可提供超过30种的线上服务其中包括维修、意见建议、投诉表扬物业缴费、访客通行、粮油宅配、团购商城等,并可通过支付宝、微信支付来未完成线上支付,真正打造了智慧园区O2O平台为广大业主打造更安全、更便捷、更和睦的幸福园区。'; TextStyle _style = TextStyle( - fontSize: Screenutil.size(32), + fontSize: 32.sp, color: Color(0xff575757), ); @@ -26,16 +26,16 @@ class AboutPage extends StatelessWidget { body: Container( color: Colors.white, padding: EdgeInsets.only( - top: Screenutil.length(72), - left: Screenutil.length(36), - right: Screenutil.length(35)), + top: 72.w, + left: 36.w, + right: 35.w), child: ListView( children: [ Text( aboutText, style: _style, ), - SizedBox(height: Screenutil.length(100)), + SizedBox(height: 100.w), Text( '“小蜜蜂智慧社区”APP——幸福生活,简单到达', style: _style, diff --git a/lib/pages/setting_page/agreement_page/agreement_page.dart b/lib/pages/setting_page/agreement_page/agreement_page.dart index 3fcfe0f1..16c54052 100644 --- a/lib/pages/setting_page/agreement_page/agreement_page.dart +++ b/lib/pages/setting_page/agreement_page/agreement_page.dart @@ -14,13 +14,13 @@ class _AgreementPageState extends State { title: Text('用户协议'), ), body: SingleChildScrollView( - padding: EdgeInsets.all(Screenutil.length(16)), + padding: EdgeInsets.all(16.w), child: Column( children: [ Text( '《用户协议》', style: TextStyle( - fontWeight: FontWeight.w600, fontSize: Screenutil.length(35)), + fontWeight: FontWeight.w600, fontSize: 35.w), ), Text( ''' @@ -223,7 +223,7 @@ class _AgreementPageState extends State { ''', style: TextStyle( - fontSize: Screenutil.length(30), + fontSize: 30.w, ), ), ], diff --git a/lib/pages/setting_page/agreement_page/privacy_page.dart b/lib/pages/setting_page/agreement_page/privacy_page.dart index 6cc7fbf1..a7816060 100644 --- a/lib/pages/setting_page/agreement_page/privacy_page.dart +++ b/lib/pages/setting_page/agreement_page/privacy_page.dart @@ -15,12 +15,12 @@ class _PrivacyPageState extends State { title: Text('隐私政策'), ), body: SingleChildScrollView( - padding: EdgeInsets.all(Screenutil.size(16)), + padding: EdgeInsets.all(16.sp), child: Column( children: [Text( '小蜜蜂智慧社区隐私政策', style: TextStyle( - fontWeight: FontWeight.w600, fontSize: Screenutil.length(35)), + fontWeight: FontWeight.w600, fontSize: 35.w), ), Text( ''' @@ -125,7 +125,7 @@ class _PrivacyPageState extends State { 2020年10月20日 ''', style: TextStyle( - fontSize: Screenutil.length(30), + fontSize: 30.w, ), ), ], diff --git a/lib/pages/setting_page/feedback_page/feedback_page.dart b/lib/pages/setting_page/feedback_page/feedback_page.dart index a9996dda..d22e746e 100644 --- a/lib/pages/setting_page/feedback_page/feedback_page.dart +++ b/lib/pages/setting_page/feedback_page/feedback_page.dart @@ -22,9 +22,9 @@ class _FeedBackPageState extends State { Widget _containerTextField() { return Container( padding: EdgeInsets.only( - top: Screenutil.length(24), - left: Screenutil.length(24), - right: Screenutil.length(32)), + top: 24.w, + left: 24.w, + right: 32.w), decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(6)), border: Border.all(color: Color(0xffd4cfbe), width: 1.0), @@ -32,7 +32,7 @@ class _FeedBackPageState extends State { child: TextFormField( cursorColor: Color(0xffffc40c), style: TextStyle( - fontSize: Screenutil.size(28), + fontSize: 28.sp, fontWeight: FontWeight.w600, ), controller: _ideaContent, @@ -41,8 +41,8 @@ class _FeedBackPageState extends State { decoration: InputDecoration( isDense: true, contentPadding: EdgeInsets.only( - top: Screenutil.length(0), - bottom: Screenutil.length(0), + top: 0.w, + bottom: 0.w, ), hintText: '请输入', border: InputBorder.none, //去掉输入框的下滑线 @@ -50,7 +50,7 @@ class _FeedBackPageState extends State { filled: true, hintStyle: TextStyle( color: Color(0xff999999), - fontSize: Screenutil.size(28), + fontSize: 28.sp, fontWeight: FontWeight.normal, ), ), @@ -60,8 +60,8 @@ class _FeedBackPageState extends State { Widget _containerAddImage() { return Container( - width: Screenutil.length(218), - height: Screenutil.length(218), + width: 218.w, + height: 218.w, decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.all(Radius.circular(8)), @@ -95,9 +95,9 @@ class _FeedBackPageState extends State { }, child: Container( alignment: Alignment.center, - height: Screenutil.length(85), - width: Screenutil.length(686), - padding: EdgeInsets.symmetric(vertical: Screenutil.length(20)), + height: 85.w, + width: 686.w, + padding: EdgeInsets.symmetric(vertical: 20.w), decoration: BoxDecoration( color: Color(0xffffc40c), borderRadius: BorderRadius.all(Radius.circular(2)), @@ -106,7 +106,7 @@ class _FeedBackPageState extends State { '确认提交', style: TextStyle( fontWeight: FontWeight.w600, - fontSize: Screenutil.size(32), + fontSize: 32.sp, color: Color(0xff333333), ), ), @@ -133,31 +133,31 @@ class _FeedBackPageState extends State { }, child: Container( padding: EdgeInsets.symmetric( - horizontal: Screenutil.length(32), - vertical: Screenutil.length(36), + horizontal: 32.w, + vertical: 36.w, ), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - SizedBox(height: Screenutil.length(76)), + SizedBox(height: 76.w), Text( '意见反馈', style: TextStyle( - fontSize: Screenutil.size(28), + fontSize: 28.sp, color: Color(0xff333333)), ), - SizedBox(height: Screenutil.length(24)), + SizedBox(height: 24.w), _containerTextField(), - SizedBox(height: Screenutil.length(24)), + SizedBox(height: 24.w), Text( '添加图片信息(0/9)', style: TextStyle( - fontSize: Screenutil.size(28), + fontSize: 28.sp, color: Color(0xff333333)), ), - SizedBox(height: Screenutil.length(24)), + SizedBox(height: 24.w), CommonImagePicker(), - SizedBox(height: Screenutil.length(76)), + SizedBox(height: 76.w), _inkWellSubmit(), ], ), diff --git a/lib/pages/setting_page/invite_page/invite_page.dart b/lib/pages/setting_page/invite_page/invite_page.dart index 5cb22092..2e84282f 100644 --- a/lib/pages/setting_page/invite_page/invite_page.dart +++ b/lib/pages/setting_page/invite_page/invite_page.dart @@ -15,7 +15,7 @@ class InvitePage extends StatelessWidget { child: QrImage( padding: EdgeInsets.zero, data: '智慧社区开门码', - size: Screenutil.length(460), + size: 460.w, ), ); } @@ -29,31 +29,31 @@ class InvitePage extends StatelessWidget { ), body: Container( color: Colors.white, - padding: EdgeInsets.only(top: Screenutil.length(146)), + padding: EdgeInsets.only(top: 146.w), child: ListView( children: [ _containerImage('assets/example/QR_code.png'), - SizedBox(height: Screenutil.length(29)), + SizedBox(height: 29.w), Container( alignment: Alignment.center, child: Text( '扫一扫,二维码直接下载小蜜蜂智慧社区', style: TextStyle( - fontSize: Screenutil.size(28), + fontSize: 28.sp, color: Color(0xff666666), ), ), ), - SizedBox(height: Screenutil.length(89)), + SizedBox(height: 89.w), Container( color: Color(0xfffffbf6), - height: Screenutil.length(105), - padding: EdgeInsets.symmetric(vertical: Screenutil.length(30)), + height: 105.w, + padding: EdgeInsets.symmetric(vertical: 30.w), alignment: Alignment.center, child: Text( '分享小蜜蜂智慧社区APP', style: TextStyle( - fontSize: Screenutil.size(32), + fontSize: 32.sp, color: Color(0xff333333), ), ), diff --git a/lib/pages/setting_page/setting_page.dart b/lib/pages/setting_page/setting_page.dart index 8673b521..5396145f 100644 --- a/lib/pages/setting_page/setting_page.dart +++ b/lib/pages/setting_page/setting_page.dart @@ -63,7 +63,7 @@ class _SettingPageState extends State { title: Text( url, style: TextStyle( - fontSize: Screenutil.size(34), + fontSize: 34.sp, color: Color(0xff030303), ), ), @@ -72,7 +72,7 @@ class _SettingPageState extends State { child: Text( '取消', style: TextStyle( - fontSize: Screenutil.size(34), + fontSize: 34.sp, color: Color(0xff333333), ), ), @@ -85,7 +85,7 @@ class _SettingPageState extends State { '确认', style: TextStyle( fontWeight: FontWeight.w600, - fontSize: Screenutil.size(34), + fontSize: 34.sp, color: Color(0xffff8200), ), ), @@ -186,9 +186,9 @@ class _SettingPageState extends State { }, child: Container( color: Colors.white, - padding: EdgeInsets.symmetric(horizontal: Screenutil.length(32)), + padding: EdgeInsets.symmetric(horizontal: 32.w), child: Container( - padding: EdgeInsets.symmetric(vertical: Screenutil.length(28)), + padding: EdgeInsets.symmetric(vertical: 28.w), decoration: BoxDecoration( border: Border( bottom: BorderSide(color: BaseStyle.coloreeeeee, width: 0.5)), @@ -222,7 +222,7 @@ class _SettingPageState extends State { ) : Icon( AntDesign.right, - size: Screenutil.size(36), + size: 36.sp, color: BaseStyle.color999999, ), ], @@ -272,10 +272,10 @@ class _SettingPageState extends State { }, child: Container( color: Colors.white, - height: Screenutil.length(96), + height: 96.w, padding: EdgeInsets.only( - top: Screenutil.length(26), - bottom: Screenutil.length(25), + top: 26.w, + bottom: 25.w, ), alignment: Alignment.center, child: Text( @@ -311,7 +311,7 @@ class _SettingPageState extends State { )) .toList(), ), - SizedBox(height: Screenutil.length(24)), + SizedBox(height: 24.w), Column( children: _listView .take(8) @@ -323,7 +323,7 @@ class _SettingPageState extends State { )) .toList(), ), - SizedBox(height: Screenutil.length(52)), + SizedBox(height: 52.w), _containerQuit(), ], ), diff --git a/lib/pages/sign/sign_in_page.dart b/lib/pages/sign/sign_in_page.dart index 8d739256..e8f46bfd 100644 --- a/lib/pages/sign/sign_in_page.dart +++ b/lib/pages/sign/sign_in_page.dart @@ -31,7 +31,7 @@ class _SignInPageState extends State { elevation: 0, backgroundColor: Colors.white, // leading: IconButton( - // icon: Icon(AntDesign.left, size: Screenutil.size(40)), + // icon: Icon(AntDesign.left, size: 40.sp), // onPressed: () { // Navigator.pop(context); // }, @@ -42,8 +42,8 @@ class _SignInPageState extends State { Container _containerTextField(String imagePath, TextEditingController controller, String hintText, bool isCode) { return Container( - padding: EdgeInsets.symmetric(horizontal: Screenutil.length(29)), - margin: EdgeInsets.symmetric(horizontal: Screenutil.length(82)), + padding: EdgeInsets.symmetric(horizontal: 29.w), + margin: EdgeInsets.symmetric(horizontal: 82.w), decoration: BoxDecoration( color: Color(0xfffff4d7), borderRadius: BorderRadius.all(Radius.circular(36)), @@ -53,10 +53,10 @@ class _SignInPageState extends State { children: [ Image.asset( imagePath, - height: Screenutil.length(50), - width: Screenutil.length(50), + height: 50.w, + width: 50.w, ), - SizedBox(width: Screenutil.length(24)), + SizedBox(width: 24.w), Expanded( child: TextFormField( obscureText: false, @@ -72,7 +72,7 @@ class _SignInPageState extends State { decoration: InputDecoration( isDense: true, contentPadding: EdgeInsets.symmetric( - vertical: Screenutil.length(25), + vertical: 25.w, ), hintText: hintText, border: InputBorder.none, //去掉输入框的下滑线 @@ -92,12 +92,12 @@ class _SignInPageState extends State { children: [ SizedBox( width: 2, - height: Screenutil.length(29), + height: 29.w, child: DecoratedBox( decoration: BoxDecoration(color: Color(0xffd8d8d8)), ), ), - SizedBox(width: Screenutil.length(16)), + SizedBox(width: 16.w), InkWell( child: Text( _verifyStr, @@ -122,8 +122,8 @@ class _SignInPageState extends State { alignment: Alignment.center, child: Image.asset( AssetsImage.LOGO, - height: Screenutil.length(184), - width: Screenutil.length(266), + height: 184.w, + width: 266.w, ), ); } @@ -173,11 +173,11 @@ class _SignInPageState extends State { }, child: Container( alignment: Alignment.center, - height: Screenutil.length(89), - width: Screenutil.length(586), + height: 89.w, + width: 586.w, padding: EdgeInsets.only( - top: Screenutil.length(25), bottom: Screenutil.length(24)), - margin: EdgeInsets.symmetric(horizontal: Screenutil.length(82)), + top: 25.w, bottom: 24.w), + margin: EdgeInsets.symmetric(horizontal: 82.w), decoration: BoxDecoration( color: Color(0xffffc40c), borderRadius: BorderRadius.all(Radius.circular(36)), @@ -213,10 +213,10 @@ class _SignInPageState extends State { shrinkWrap: true, children: [ SizedBox( - height: Screenutil.length(153), + height: 153.w, ), _containerImage(), - SizedBox(height: Screenutil.length(16)), + SizedBox(height: 16.w), Container( alignment: Alignment.center, child: Text( @@ -227,13 +227,13 @@ class _SignInPageState extends State { color: BaseStyle.color333333), ), ), - SizedBox(height: Screenutil.length(89)), + SizedBox(height: 89.w), _containerTextField( AssetsImage.PHONELOGO, _phone, '请输入手机号码', false), - SizedBox(height: Screenutil.length(27)), + SizedBox(height: 27.w), _containerTextField( AssetsImage.CODELOGO, _code, '请输入验证码', true), - SizedBox(height: Screenutil.length(59)), + SizedBox(height: 59.w), _inkWellLogin(), Row( mainAxisAlignment: MainAxisAlignment.center, diff --git a/lib/pages/sign/user_authentication_page.dart b/lib/pages/sign/user_authentication_page.dart index 1ee5f43f..cc212bbc 100644 --- a/lib/pages/sign/user_authentication_page.dart +++ b/lib/pages/sign/user_authentication_page.dart @@ -30,7 +30,7 @@ class _UserAuthenticationPageState extends State { elevation: 0, backgroundColor: Colors.white, leading: IconButton( - icon: Icon(AntDesign.left, size: Screenutil.size(40)), + icon: Icon(AntDesign.left, size: 40.sp), onPressed: () { Navigator.pop(context); }, @@ -60,8 +60,8 @@ class _UserAuthenticationPageState extends State { children: _listRadio .map((item) => Container( padding: EdgeInsets.only( - bottom: Screenutil.length(16), - top: Screenutil.length(40), + bottom: 16.w, + top: 40.w, ), decoration: BoxDecoration( border: Border( @@ -87,7 +87,7 @@ class _UserAuthenticationPageState extends State { Icons.radio_button_unchecked, color: BaseStyle.color999999, ), - SizedBox(width: Screenutil.length(17)), + SizedBox(width: 17.w), Text( item['title'], style: TextStyle( @@ -122,8 +122,8 @@ class _UserAuthenticationPageState extends State { decoration: InputDecoration( isDense: true, contentPadding: EdgeInsets.only( - top: Screenutil.length(0), - bottom: Screenutil.length(0), + top: 0.w, + bottom: 0.w, ), hintText: hintText, border: InputBorder.none, //去掉输入框的下滑线 @@ -155,8 +155,8 @@ class _UserAuthenticationPageState extends State { return _listWidget .map((item) => Container( padding: EdgeInsets.only( - top: Screenutil.length(23), - bottom: Screenutil.length(24), + top: 23.w, + bottom: 24.w, ), decoration: BoxDecoration( border: Border( @@ -172,7 +172,7 @@ class _UserAuthenticationPageState extends State { fontSize: BaseStyle.fontSize28, color: BaseStyle.color333333), ), - SizedBox(height: Screenutil.length(25)), + SizedBox(height: 25.w), item['widget'], ], ), @@ -192,9 +192,9 @@ class _UserAuthenticationPageState extends State { }, child: Container( padding: EdgeInsets.only( - left: Screenutil.length(32), - right: Screenutil.length(32), - top: Screenutil.length(32), + left: 32.w, + right: 32.w, + top: 32.w, ), color: Colors.white, child: Column( @@ -207,12 +207,12 @@ class _UserAuthenticationPageState extends State { fontSize: BaseStyle.fontSize38, color: BaseStyle.color333333), ), - SizedBox(height: Screenutil.length(8)), + SizedBox(height: 8.w), Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ _textTag('身份选择'), - SizedBox(height: Screenutil.length(167)), + SizedBox(height: 167.w), _columnRadio(), Column( children: _listView(), diff --git a/lib/pages/things_page/things_create_page/things_create_page.dart b/lib/pages/things_page/things_create_page/things_create_page.dart index 6ff85a2d..747d63cd 100644 --- a/lib/pages/things_page/things_create_page/things_create_page.dart +++ b/lib/pages/things_page/things_create_page/things_create_page.dart @@ -57,10 +57,10 @@ class _ThingsCreatePageState extends State { children: [ Image.asset( AssetsImage.HOUSE, - height: Screenutil.length(60), - width: Screenutil.length(60), + height: 60.w, + width: 60.w, ), - SizedBox(width: Screenutil.length(40)), + SizedBox(width: 40.w), Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -68,15 +68,15 @@ class _ThingsCreatePageState extends State { '深证华茂悦峰', style: TextStyle( fontWeight: FontWeight.w600, - fontSize: Screenutil.size(34), + fontSize: 34.sp, color: Color(0xff333333)), ), - SizedBox(width: Screenutil.length(10)), + SizedBox(width: 10.w), Text( '1幢-1单元-702室', style: TextStyle( fontWeight: FontWeight.w600, - fontSize: Screenutil.size(34), + fontSize: 34.sp, color: Color(0xff333333)), ) ], @@ -96,10 +96,10 @@ class _ThingsCreatePageState extends State { setState(() {}); }, child: Container( - height: Screenutil.length(72), - width: Screenutil.length(176), + height: 72.w, + width: 176.w, padding: EdgeInsets.symmetric( - vertical: Screenutil.length(10), + vertical: 10.w, ), decoration: BoxDecoration( color: isCheck ? Color(0xfffff4d3) : Color(0xffffffff), @@ -113,16 +113,16 @@ class _ThingsCreatePageState extends State { image != null ? Image.asset( image, - height: Screenutil.length(30), - width: Screenutil.length(30), + height: 30.w, + width: 30.w, color: isCheck ? Color(0xff333333) : Color(0xff979797), ) : SizedBox(), - SizedBox(width: Screenutil.length(9)), + SizedBox(width: 9.w), Text( title, style: TextStyle( - fontSize: Screenutil.size(28), + fontSize: 28.sp, color: isCheck ? Color(0xff333333) : Color(0xff979797)), ), ], @@ -134,9 +134,9 @@ class _ThingsCreatePageState extends State { Widget _containerTextField() { return Container( padding: EdgeInsets.only( - top: Screenutil.length(32), - left: Screenutil.length(22), - right: Screenutil.length(35)), + top: 32.w, + left: 22.w, + right: 35.w), decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(8)), border: Border.all(color: Color(0xffd4cfbe), width: 1.0), @@ -144,7 +144,7 @@ class _ThingsCreatePageState extends State { child: TextFormField( cursorColor: Color(0xffffc40c), style: TextStyle( - fontSize: Screenutil.size(28), + fontSize: 28.sp, fontWeight: FontWeight.w600, ), controller: _thingsContent, @@ -153,8 +153,8 @@ class _ThingsCreatePageState extends State { decoration: InputDecoration( isDense: true, contentPadding: EdgeInsets.only( - top: Screenutil.length(0), - bottom: Screenutil.length(0), + top: 0.w, + bottom: 0.w, ), hintText: hintText, border: InputBorder.none, //去掉输入框的下滑线 @@ -162,7 +162,7 @@ class _ThingsCreatePageState extends State { filled: true, hintStyle: TextStyle( color: Color(0xff999999), - fontSize: Screenutil.size(28), + fontSize: 28.sp, fontWeight: FontWeight.normal, ), ), @@ -176,15 +176,15 @@ class _ThingsCreatePageState extends State { child: InkWell( child: Container( alignment: Alignment.center, - height: Screenutil.length(98), - width: Screenutil.length(750), + height: 98.w, + width: 750.w, padding: EdgeInsets.symmetric(vertical: Screenutil.length(26.5)), color: Color(0xffffc40c), child: Text( '确认提交', style: TextStyle( fontWeight: FontWeight.w600, - fontSize: Screenutil.size(32), + fontSize: 32.sp, color: Color(0xff333333), ), ), @@ -196,9 +196,9 @@ class _ThingsCreatePageState extends State { Widget _cardList(String title, Widget widget) { return Container( padding: EdgeInsets.only( - left: Screenutil.length(36), - right: Screenutil.length(36), - top: Screenutil.length(32), + left: 36.w, + right: 36.w, + top: 32.w, ), child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -206,11 +206,11 @@ class _ThingsCreatePageState extends State { Text( title, style: TextStyle( - fontSize: Screenutil.size(28), color: Color(0xff333333)), + fontSize: 28.sp, color: Color(0xff333333)), ), - SizedBox(height: Screenutil.length(32)), + SizedBox(height: 32.w), widget, - SizedBox(height: Screenutil.length(26)), + SizedBox(height: 26.w), // index == 0 ? Divider() : SizedBox(), ], ), @@ -223,7 +223,7 @@ class _ThingsCreatePageState extends State { children: [ _inkWellType(_typeList[0]['title'], _typeList[0]['image'], _typeList[0]['isCheck'], 0), - SizedBox(width: Screenutil.length(80)), + SizedBox(width: 80.w), _inkWellType(_typeList[1]['title'], _typeList[1]['image'], _typeList[1]['isCheck'], 1), ], @@ -246,9 +246,9 @@ class _ThingsCreatePageState extends State { // .keys // .map((index) => Container( // padding: EdgeInsets.only( - // left: Screenutil.length(36), - // right: Screenutil.length(36), - // top: Screenutil.length(32), + // left: 36.w, + // right: 36.w, + // top: 32.w, // ), // child: Column( // crossAxisAlignment: CrossAxisAlignment.start, @@ -256,12 +256,12 @@ class _ThingsCreatePageState extends State { // Text( // _listWidget[index]['title'], // style: TextStyle( - // fontSize: Screenutil.size(28), + // fontSize: 28.sp, // color: Color(0xff333333)), // ), - // SizedBox(height: Screenutil.length(32)), + // SizedBox(height: 32.w), // _listWidget[index]['widget'], - // SizedBox(height: Screenutil.length(26)), + // SizedBox(height: 26.w), // index == 0 ? Divider() : SizedBox(), // ], // ), diff --git a/lib/pages/things_page/things_detail_page/things_detail_page.dart b/lib/pages/things_page/things_detail_page/things_detail_page.dart index 7d0d60ba..b41c46d6 100644 --- a/lib/pages/things_page/things_detail_page/things_detail_page.dart +++ b/lib/pages/things_page/things_detail_page/things_detail_page.dart @@ -26,9 +26,9 @@ class _ThingsDetailPageState extends State { String tag, String content, String time, List imageList) { return Container( padding: EdgeInsets.only( - top: Screenutil.length(46), - left: Screenutil.length(33), - right: Screenutil.length(44), + top: 46.w, + left: 33.w, + right: 44.w, ), child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -36,27 +36,27 @@ class _ThingsDetailPageState extends State { Text( tag, style: TextStyle( - fontSize: Screenutil.size(38), + fontSize: 38.sp, color: Color(0xff333333), ), ), - SizedBox(height: Screenutil.length(30)), + SizedBox(height: 30.w), ExpandableText( text: content, maxLines: 2, style: TextStyle( - fontSize: Screenutil.size(28), + fontSize: 28.sp, color: Color(0xff666666), ), expand: false, ), - SizedBox(height: Screenutil.length(29)), + SizedBox(height: 29.w), imageList.length != 0 ? ImageGrid(imageList) : SizedBox(), - SizedBox(height: Screenutil.length(24)), + SizedBox(height: 24.w), Text( time, style: TextStyle( - fontSize: Screenutil.size(24), + fontSize: 24.sp, color: Color(0xff999999), ), ), @@ -82,15 +82,15 @@ class _ThingsDetailPageState extends State { }, child: Container( alignment: Alignment.center, - height: Screenutil.length(98), - width: Screenutil.length(750), + height: 98.w, + width: 750.w, padding: EdgeInsets.symmetric(vertical: Screenutil.length(26.5)), color: Color(0xffffc40c), child: Text( widget.bundle.getMap('things')['isRepair'] ? '确认完成' : '继续提问', style: TextStyle( fontWeight: FontWeight.w600, - fontSize: Screenutil.size(32), + fontSize: 32.sp, color: Color(0xff333333), ), ), @@ -115,7 +115,7 @@ class _ThingsDetailPageState extends State { children: [ widget.bundle.getMap('things')['isRepair'] ? ListView( - padding: EdgeInsets.only(bottom: Screenutil.length(108)), + padding: EdgeInsets.only(bottom: 108.w), children: [ GoodsInfoCard( status: widget.bundle.getMap('things')['time'], @@ -147,7 +147,7 @@ class _ThingsDetailPageState extends State { ], ) : ListView( - padding: EdgeInsets.only(bottom: Screenutil.length(108)), + padding: EdgeInsets.only(bottom: 108.w), children: [ _containerCard( '您的建议', @@ -155,7 +155,7 @@ class _ThingsDetailPageState extends State { widget.bundle.getMap('things')['time'], widget.bundle.getMap('things')['imageList'], ), - SizedBox(height: Screenutil.length(3)), + SizedBox(height: 3.w), _containerCard( '物业回复', widget.bundle.getMap('things')['content'], diff --git a/lib/pages/things_page/things_detail_page/widget/goods_info_card.dart b/lib/pages/things_page/things_detail_page/widget/goods_info_card.dart index e0998b15..0143dfee 100644 --- a/lib/pages/things_page/things_detail_page/widget/goods_info_card.dart +++ b/lib/pages/things_page/things_detail_page/widget/goods_info_card.dart @@ -22,9 +22,9 @@ class GoodsInfoCard extends StatelessWidget { Widget build(BuildContext context) { return Container( margin: EdgeInsets.only( - top: Screenutil.length(32), - left: Screenutil.length(32), - right: Screenutil.length(32), + top: 32.w, + left: 32.w, + right: 32.w, ), decoration: BoxDecoration( color: Colors.white, @@ -47,14 +47,14 @@ class GoodsInfoCard extends StatelessWidget { ], ), padding: EdgeInsets.only( - top: Screenutil.length(25), - left: Screenutil.length(24), - right: Screenutil.length(24)), + top: 25.w, + left: 24.w, + right: 24.w), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - padding: EdgeInsets.only(bottom: Screenutil.length(24)), + padding: EdgeInsets.only(bottom: 24.w), decoration: BoxDecoration( border: Border( bottom: @@ -67,21 +67,21 @@ class GoodsInfoCard extends StatelessWidget { '出户信息', style: TextStyle( fontWeight: FontWeight.w600, - fontSize: Screenutil.size(32), + fontSize: 32.sp, color: Color(0xff333333)), ), Text(status, style: TextStyle( fontWeight: FontWeight.w600, - fontSize: Screenutil.size(28), + fontSize: 28.sp, color: Color(0xff333333))), ], ), ), Container( padding: EdgeInsets.only( - bottom: Screenutil.length(33), - top: Screenutil.length(16), + bottom: 33.w, + top: 16.w, ), decoration: BoxDecoration( border: Border( @@ -90,11 +90,11 @@ class GoodsInfoCard extends StatelessWidget { ), child: infodetails != null ? Container( - width: Screenutil.length(630), + width: 630.w, child: Text( infodetails, style: TextStyle( - fontSize: Screenutil.size(28), + fontSize: 28.sp, color: Color(0xff333333)), ), ) @@ -104,7 +104,7 @@ class GoodsInfoCard extends StatelessWidget { .map( (item) => Container( padding: EdgeInsets.only( - top: Screenutil.length(8)), + top: 8.w), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, @@ -112,13 +112,13 @@ class GoodsInfoCard extends StatelessWidget { Text( item['title'], style: TextStyle( - fontSize: Screenutil.size(28), + fontSize: 28.sp, color: Color(0xff999999)), ), Text( item['content'], style: TextStyle( - fontSize: Screenutil.size(28), + fontSize: 28.sp, color: Color(0xff333333)), ), ], @@ -131,19 +131,19 @@ class GoodsInfoCard extends StatelessWidget { listImage != null ? Container( margin: EdgeInsets.only( - top: Screenutil.length(19), - bottom: Screenutil.length(30), + top: 19.w, + bottom: 30.w, ), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( margin: EdgeInsets.only( - bottom: Screenutil.length(25)), + bottom: 25.w), child: Text( '图片信息', style: TextStyle( - fontSize: Screenutil.size(28), + fontSize: 28.sp, color: Color(0xff333333)), ), ), diff --git a/lib/pages/things_page/things_detail_page/widget/goods_info_card_button.dart b/lib/pages/things_page/things_detail_page/widget/goods_info_card_button.dart index 1e85b510..ae956e27 100644 --- a/lib/pages/things_page/things_detail_page/widget/goods_info_card_button.dart +++ b/lib/pages/things_page/things_detail_page/widget/goods_info_card_button.dart @@ -28,7 +28,7 @@ class GoodsInfoCardButton extends StatelessWidget { title: Text( url, style: TextStyle( - fontSize: Screenutil.size(34), + fontSize: 34.sp, color: Color(0xff030303), ), ), @@ -37,7 +37,7 @@ class GoodsInfoCardButton extends StatelessWidget { child: Text( '取消', style: TextStyle( - fontSize: Screenutil.size(34), + fontSize: 34.sp, color: Color(0xff333333), ), ), @@ -50,7 +50,7 @@ class GoodsInfoCardButton extends StatelessWidget { '呼叫', style: TextStyle( fontWeight: FontWeight.w600, - fontSize: Screenutil.size(34), + fontSize: 34.sp, color: Color(0xffff8200), ), ), @@ -75,7 +75,7 @@ class GoodsInfoCardButton extends StatelessWidget { bottomRight: Radius.circular(6), ), ), - height: Screenutil.length(96), + height: 96.w, child: Row( children: _listButton .asMap() @@ -112,17 +112,17 @@ class GoodsInfoCardButton extends StatelessWidget { children: [ Icon( _listButton[index]['icon'], - size: Screenutil.size(36), + size: 36.sp, color: Color(0xff333333), ), Container( margin: - EdgeInsets.only(left: Screenutil.length(14)), + EdgeInsets.only(left: 14.w), child: Text( _listButton[index]['title'], style: TextStyle( fontWeight: FontWeight.w600, - fontSize: Screenutil.size(32), + fontSize: 32.sp, color: Color(0xff333333), ), ), diff --git a/lib/pages/things_page/things_detail_page/widget/image_horizontal_list.dart b/lib/pages/things_page/things_detail_page/widget/image_horizontal_list.dart index b34a76c1..6e0b1e19 100644 --- a/lib/pages/things_page/things_detail_page/widget/image_horizontal_list.dart +++ b/lib/pages/things_page/things_detail_page/widget/image_horizontal_list.dart @@ -26,7 +26,7 @@ class ImageHorizontalList extends StatelessWidget { @override Widget build(BuildContext context) { return Container( - height: Screenutil.length(184), + height: 184.w, child: ListView.builder( shrinkWrap: true, scrollDirection: Axis.horizontal, @@ -34,7 +34,7 @@ class ImageHorizontalList extends StatelessWidget { return AspectRatio( aspectRatio: 1, child: Container( - margin: EdgeInsets.only(right: Screenutil.length(16)), + margin: EdgeInsets.only(right: 16.w), child: ClipRRect( borderRadius: BorderRadius.all(Radius.circular(4)), child: GalleryExampleItemThumbnail( diff --git a/lib/pages/things_page/things_evaluate_page/things_evaluate_page.dart b/lib/pages/things_page/things_evaluate_page/things_evaluate_page.dart index 307a9c3b..6797de39 100644 --- a/lib/pages/things_page/things_evaluate_page/things_evaluate_page.dart +++ b/lib/pages/things_page/things_evaluate_page/things_evaluate_page.dart @@ -28,8 +28,8 @@ class _ThingsEvaluatePageState extends State { borderRadius: BorderRadius.all(Radius.circular(8)), ), padding: EdgeInsets.only( - top: Screenutil.length(27), - bottom: Screenutil.length(52), + top: 27.w, + bottom: 52.w, ), child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -37,22 +37,22 @@ class _ThingsEvaluatePageState extends State { Text( '请您对本次服务进行评价', style: TextStyle( - fontSize: Screenutil.size(28), color: Color(0xff999999)), + fontSize: 28.sp, color: Color(0xff999999)), ), - SizedBox(height: Screenutil.length(50)), + SizedBox(height: 50.w), Row( mainAxisAlignment: MainAxisAlignment.start, children: [ Text( '综合评价', style: TextStyle( - fontSize: Screenutil.size(28), color: Color(0xff999999)), + fontSize: 28.sp, color: Color(0xff999999)), ), - SizedBox(width: Screenutil.length(47)), + SizedBox(width: 47.w), SmoothStarRating( rating: rating, isReadOnly: false, - size: Screenutil.size(46), + size: 46.sp, filledIconData: AntDesign.star, // halfFilledIconData: Icons.star_half, defaultIconData: AntDesign.staro, @@ -60,7 +60,7 @@ class _ThingsEvaluatePageState extends State { borderColor: Color(0xffffc40c), starCount: 5, allowHalfRating: false, - spacing: Screenutil.length(20), + spacing: 20.w, onRated: (value) { print("rating value -> $value"); // print("rating value dd -> ${value.truncate()}"); @@ -76,9 +76,9 @@ class _ThingsEvaluatePageState extends State { Container _containerTextField(String hintText) { return Container( padding: EdgeInsets.only( - top: Screenutil.length(32), - left: Screenutil.length(22), - right: Screenutil.length(35)), + top: 32.w, + left: 22.w, + right: 35.w), decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(8)), border: Border.all(color: Color(0xffd4cfbe), width: 1.0), @@ -86,7 +86,7 @@ class _ThingsEvaluatePageState extends State { child: TextFormField( cursorColor: Color(0xffffc40c), style: TextStyle( - fontSize: Screenutil.size(28), + fontSize: 28.sp, fontWeight: FontWeight.w600, ), controller: _proposeContent, @@ -95,8 +95,8 @@ class _ThingsEvaluatePageState extends State { decoration: InputDecoration( isDense: true, contentPadding: EdgeInsets.only( - top: Screenutil.length(0), - bottom: Screenutil.length(0), + top: 0.w, + bottom: 0.w, ), hintText: hintText, border: InputBorder.none, //去掉输入框的下滑线 @@ -104,7 +104,7 @@ class _ThingsEvaluatePageState extends State { filled: true, hintStyle: TextStyle( color: Color(0xff999999), - fontSize: Screenutil.size(28), + fontSize: 28.sp, fontWeight: FontWeight.normal, ), ), @@ -116,8 +116,8 @@ class _ThingsEvaluatePageState extends State { return InkWell( child: Container( alignment: Alignment.center, - height: Screenutil.length(96), - margin: EdgeInsets.symmetric(horizontal: Screenutil.length(32)), + height: 96.w, + margin: EdgeInsets.symmetric(horizontal: 32.w), padding: EdgeInsets.symmetric(vertical: Screenutil.length(25.5)), decoration: BoxDecoration( color: Color(0xffffc40c), @@ -127,7 +127,7 @@ class _ThingsEvaluatePageState extends State { title, style: TextStyle( fontWeight: FontWeight.w600, - fontSize: Screenutil.size(32), + fontSize: 32.sp, color: Color(0xff333333), ), ), @@ -154,8 +154,8 @@ class _ThingsEvaluatePageState extends State { }, child: Container( padding: EdgeInsets.symmetric( - horizontal: Screenutil.length(32), - vertical: Screenutil.length(36), + horizontal: 32.w, + vertical: 36.w, ), child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -171,12 +171,12 @@ class _ThingsEvaluatePageState extends State { Text( '请输入内容', style: TextStyle( - fontSize: Screenutil.size(28), + fontSize: 28.sp, color: Color(0xff333333)), ), - SizedBox(height: Screenutil.length(24)), + SizedBox(height: 24.w), _containerTextField(hintText), - SizedBox(height: Screenutil.length(42)), + SizedBox(height: 42.w), ], ), _inkWellButton('确认提交'), @@ -192,7 +192,7 @@ class _ThingsEvaluatePageState extends State { // child: Column( // children: [ // _containerEvaluateCard(), - // SizedBox(height: Screenutil.length(42)), + // SizedBox(height: 42.w), // _inkWellButton('确认'), // ], // ), @@ -210,8 +210,8 @@ class _ThingsEvaluatePageState extends State { // }, // child: Container( // padding: EdgeInsets.symmetric( - // horizontal: Screenutil.length(32), - // vertical: Screenutil.length(36), + // horizontal: 32.w, + // vertical: 36.w, // ), // child: Column( // crossAxisAlignment: CrossAxisAlignment.start, @@ -220,12 +220,12 @@ class _ThingsEvaluatePageState extends State { // Text( // '请输入内容', // style: TextStyle( - // fontSize: Screenutil.size(28), + // fontSize: 28.sp, // color: Color(0xff333333)), // ), - // SizedBox(height: Screenutil.length(24)), + // SizedBox(height: 24.w), // _containerTextField(hintText), - // SizedBox(height: Screenutil.length(42)), + // SizedBox(height: 42.w), // _inkWellButton(widget.isPropose ? '确认提交' : '发布'), // ], // ), diff --git a/lib/pages/things_page/things_page.dart b/lib/pages/things_page/things_page.dart index 558c8926..a2b0da61 100644 --- a/lib/pages/things_page/things_page.dart +++ b/lib/pages/things_page/things_page.dart @@ -139,15 +139,15 @@ class _ThingsPageState extends State with TickerProviderStateMixin { }, child: Container( alignment: Alignment.center, - height: Screenutil.length(98), - width: Screenutil.length(750), + height: 98.w, + width: 750.w, padding: EdgeInsets.symmetric(vertical: Screenutil.length(26.5)), color: Color(0xffffc40c), child: Text( '新增', style: TextStyle( fontWeight: FontWeight.w600, - fontSize: Screenutil.size(32), + fontSize: 32.sp, color: Color(0xff333333), ), ), diff --git a/lib/pages/things_page/widget/things_app_bar.dart b/lib/pages/things_page/widget/things_app_bar.dart index 84d49165..0a199416 100644 --- a/lib/pages/things_page/widget/things_app_bar.dart +++ b/lib/pages/things_page/widget/things_app_bar.dart @@ -26,7 +26,7 @@ class ThingsAppBar extends StatelessWidget { onTap: () => Navigator.pop(context), child: Icon( AntDesign.left, - size: Screenutil.size(45), + size: 45.sp, color: Color(0xff333333), ), ), @@ -35,24 +35,24 @@ class ThingsAppBar extends StatelessWidget { title, style: TextStyle( color: Color(0xff333333), - fontSize: Screenutil.size(32), + fontSize: 32.sp, fontWeight: FontWeight.w600, ), ), bottom: TabBar( unselectedLabelStyle: TextStyle( - fontSize: Screenutil.size(28), + fontSize: 28.sp, ), labelStyle: TextStyle( fontWeight: FontWeight.w600, - fontSize: Screenutil.size(28), + fontSize: 28.sp, ), labelPadding: EdgeInsets.symmetric(horizontal: Screenutil.length(131.5)), indicatorColor: Color(0xffffc40c), indicatorSize: TabBarIndicatorSize.label, indicatorPadding: - EdgeInsets.symmetric(horizontal: Screenutil.length(21)), + EdgeInsets.symmetric(horizontal: 21.w), isScrollable: true, controller: tabController, tabs: List.generate( diff --git a/lib/pages/things_page/widget/things_card.dart b/lib/pages/things_page/widget/things_card.dart index a935d060..7e50729d 100644 --- a/lib/pages/things_page/widget/things_card.dart +++ b/lib/pages/things_page/widget/things_card.dart @@ -48,32 +48,32 @@ class _ThingsCardState extends State { Text( time, style: TextStyle( - fontSize: Screenutil.size(32), + fontSize: 32.sp, color: Color(0xff333333), ), ), Text( tag, style: TextStyle( - fontSize: Screenutil.size(24), + fontSize: 24.sp, color: Color(0xffff8200), ), ), ], ), - SizedBox(height: Screenutil.length(24)), + SizedBox(height: 24.w), Divider(height: 0.5), - SizedBox(height: Screenutil.length(24)), + SizedBox(height: 24.w), ExpandableText( text: content, maxLines: 2, style: TextStyle( - fontSize: Screenutil.size(28), + fontSize: 28.sp, color: Color(0xff333333), ), expand: false, ), - SizedBox(height: Screenutil.length(29)), + SizedBox(height: 29.w), imageList.length != 0 ? ImageGrid(imageList):SizedBox() ], ), @@ -88,15 +88,15 @@ class _ThingsCardState extends State { color: Color(0xffffffff), borderRadius: BorderRadius.all(Radius.circular(8))), margin: EdgeInsets.only( - left: Screenutil.length(32), - right: Screenutil.length(32), - top: Screenutil.length(20), + left: 32.w, + right: 32.w, + top: 20.w, ), padding: EdgeInsets.only( - left: Screenutil.length(28), - right: Screenutil.length(28), - top: Screenutil.length(21), - bottom: Screenutil.length(24), + left: 28.w, + right: 28.w, + top: 21.w, + bottom: 24.w, ), child: _inkWellPropose( widget.time, diff --git a/lib/pages/things_page/widget/things_list.dart b/lib/pages/things_page/widget/things_list.dart index 43244734..a94493cc 100644 --- a/lib/pages/things_page/widget/things_list.dart +++ b/lib/pages/things_page/widget/things_list.dart @@ -42,7 +42,7 @@ class _ThingsListState extends State onLoading: _onLoading, enablePullUp: true, child: ListView.builder( - padding: EdgeInsets.only(bottom: Screenutil.length(98)), + padding: EdgeInsets.only(bottom: 98.w), itemBuilder: (context, index) => ThingsCard( time: widget.listCard[index]['time'], tag: widget.listCard[index]['tag'], diff --git a/lib/pages/total_application_page/total_applications_page.dart b/lib/pages/total_application_page/total_applications_page.dart index b912210b..b5441d7b 100644 --- a/lib/pages/total_application_page/total_applications_page.dart +++ b/lib/pages/total_application_page/total_applications_page.dart @@ -22,11 +22,11 @@ class _TotalApplicationsPageState extends State { Widget _myApp() { return Container( margin: EdgeInsets.only( - top: Screenutil.length(32), - left: Screenutil.length(32), - right: Screenutil.length(32), + top: 32.w, + left: 32.w, + right: 32.w, ), - padding: EdgeInsets.only(bottom: Screenutil.length(16)), + padding: EdgeInsets.only(bottom: 16.w), decoration: BoxDecoration( border: Border(bottom: BorderSide(color: Color(0xffd8d8d8), width: 0.5)), @@ -37,7 +37,7 @@ class _TotalApplicationsPageState extends State { Text( '我的应用', style: TextStyle( - fontSize: Screenutil.size(28), + fontSize: 28.sp, color: Color(0xff333333), ), ), @@ -49,8 +49,8 @@ class _TotalApplicationsPageState extends State { }, child: Container( alignment: Alignment.center, - width: Screenutil.length(90), - padding: EdgeInsets.symmetric(vertical: Screenutil.length(6)), + width: 90.w, + padding: EdgeInsets.symmetric(vertical: 6.w), decoration: BoxDecoration( color: Color(0xffffd000), borderRadius: BorderRadius.all(Radius.circular(2)), @@ -59,7 +59,7 @@ class _TotalApplicationsPageState extends State { isEdit ? '完成' : '编辑', style: TextStyle( fontWeight: FontWeight.w600, - fontSize: Screenutil.size(28), + fontSize: 28.sp, color: Color(0xff333333), ), ), @@ -213,15 +213,15 @@ class _TotalApplicationsPageState extends State { children: [ Image.asset( gridList[index]['imagePath'], - height: Screenutil.length(75), - width: Screenutil.length(75), + height: 75.w, + width: 75.w, fit: BoxFit.cover, ), - SizedBox(height: Screenutil.length(8)), + SizedBox(height: 8.w), Text( gridList[index]['title'], style: TextStyle( - fontSize: Screenutil.size(24), + fontSize: 24.sp, color: Color(0xff4a4b51), ), ) @@ -230,13 +230,13 @@ class _TotalApplicationsPageState extends State { isEdit ? Positioned( right: 0, - top: Screenutil.length(24), + top: 24.w, child: Image.asset( count == 3 ? AssetsImage.APPADD : AssetsImage.APPREDUCE, - height: Screenutil.length(24), - width: Screenutil.length(24), + height: 24.w, + width: 24.w, ), ) : SizedBox(), @@ -258,25 +258,25 @@ class _TotalApplicationsPageState extends State { child: Stack( children: [ Container( - height: Screenutil.length(88), + height: 88.w, alignment: Alignment.center, color: _currentIndex == index ? Colors.white : Colors.transparent, - padding: EdgeInsets.symmetric(vertical: Screenutil.length(24)), + padding: EdgeInsets.symmetric(vertical: 24.w), child: Text( _leftNav[index], style: TextStyle( - fontSize: Screenutil.size(28), + fontSize: 28.sp, color: Color(0xff333333), ), ), ), _currentIndex == index ? Positioned( - top: Screenutil.length(24), + top: 24.w, left: 1, child: SizedBox( - width: Screenutil.length(4), - height: Screenutil.length(40), + width: 4.w, + height: 40.w, child: DecoratedBox( decoration: BoxDecoration(color: Color(0xffffd000)), ), @@ -311,13 +311,13 @@ class _TotalApplicationsPageState extends State { child: _myAppGrid(AssetsImage.mineAppList, 4), ), Container( - margin: EdgeInsets.only(top: Screenutil.length(32)), + margin: EdgeInsets.only(top: 32.w), child: Row( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - width: Screenutil.length(172), + width: 172.w, child: ListView.builder( shrinkWrap: true, itemCount: 3, @@ -326,7 +326,7 @@ class _TotalApplicationsPageState extends State { }), ), Container( - width: Screenutil.length(578), + width: 578.w, color: Colors.white, child: ListView( shrinkWrap: true, diff --git a/lib/pages/total_application_page/widget/applications_bar.dart b/lib/pages/total_application_page/widget/applications_bar.dart index 38b1a4c5..f14eb299 100644 --- a/lib/pages/total_application_page/widget/applications_bar.dart +++ b/lib/pages/total_application_page/widget/applications_bar.dart @@ -18,7 +18,7 @@ class ApplicationsBar extends StatelessWidget { onTap: () => Navigator.pop(context), child: Icon( AntDesign.left, - size: Screenutil.size(45), + size: 45.sp, color: Color(0xff333333), ), ), @@ -28,11 +28,11 @@ class ApplicationsBar extends StatelessWidget { showSearch(context: context, delegate: searchBarDelegate()); }, child: Container( - margin: EdgeInsets.only(right: Screenutil.length(32)), + margin: EdgeInsets.only(right: 32.w), padding: EdgeInsets.only( - left: Screenutil.length(40), - top: Screenutil.length(15), - bottom: Screenutil.length(15)), + left: 40.w, + top: 15.w, + bottom: 15.w), decoration: BoxDecoration( color: Color(0xfff3f3f3), borderRadius: BorderRadius.all(Radius.circular(36)), @@ -40,14 +40,14 @@ class ApplicationsBar extends StatelessWidget { child: Row(children: [ Icon( AntDesign.search1, - size: Screenutil.size(28), + size: 28.sp, color: Color(0xff999999), ), SizedBox(width: 5), Text( '搜索商品、活动、帖子、应用', style: TextStyle( - fontSize: Screenutil.size(28), + fontSize: 28.sp, color: Color(0xff999999), ), ) diff --git a/lib/pages/visitor_access_page/visitor_access_page.dart b/lib/pages/visitor_access_page/visitor_access_page.dart index c9121f8e..2a38ac85 100644 --- a/lib/pages/visitor_access_page/visitor_access_page.dart +++ b/lib/pages/visitor_access_page/visitor_access_page.dart @@ -27,9 +27,9 @@ class _VisitorAccessPageState extends State { Widget _house() { return Container( padding: EdgeInsets.only( - left: Screenutil.length(36), - right: Screenutil.length(36), - top: Screenutil.length(32), + left: 36.w, + right: 36.w, + top: 32.w, ), child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -37,9 +37,9 @@ class _VisitorAccessPageState extends State { Text( '来访房屋', style: TextStyle( - fontSize: Screenutil.size(28), color: Color(0xff333333)), + fontSize: 28.sp, color: Color(0xff333333)), ), - SizedBox(height: Screenutil.length(32)), + SizedBox(height: 32.w), Container( child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, @@ -49,10 +49,10 @@ class _VisitorAccessPageState extends State { children: [ Image.asset( AssetsImage.HOUSE, - height: Screenutil.length(60), - width: Screenutil.length(60), + height: 60.w, + width: 60.w, ), - SizedBox(width: Screenutil.length(40)), + SizedBox(width: 40.w), Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -60,15 +60,15 @@ class _VisitorAccessPageState extends State { '宁波华茂悦峰', style: TextStyle( fontWeight: FontWeight.w600, - fontSize: Screenutil.size(34), + fontSize: 34.sp, color: Color(0xff333333)), ), - SizedBox(height: Screenutil.length(10)), + SizedBox(height: 10.w), Text( '1幢-1单元-702室', style: TextStyle( fontWeight: FontWeight.w600, - fontSize: Screenutil.size(34), + fontSize: 34.sp, color: Color(0xff333333)), ) ], @@ -78,8 +78,8 @@ class _VisitorAccessPageState extends State { Container( alignment: Alignment.center, padding: EdgeInsets.symmetric( - vertical: Screenutil.length(14), - horizontal: Screenutil.length(21), + vertical: 14.w, + horizontal: 21.w, ), decoration: BoxDecoration( color: Color(0xffFEC200), @@ -89,14 +89,14 @@ class _VisitorAccessPageState extends State { '邀请客户填写', style: TextStyle( fontWeight: FontWeight.w600, - fontSize: Screenutil.size(28), + fontSize: 28.sp, color: Color(0xff333333)), ), ), ], ), ), - SizedBox(height: Screenutil.length(26)), + SizedBox(height: 26.w), Divider(), ], ), @@ -106,12 +106,12 @@ class _VisitorAccessPageState extends State { Widget _input(String title, hintText, TextEditingController controller) { return Container( padding: EdgeInsets.only( - left: Screenutil.length(36), - right: Screenutil.length(36), - top: Screenutil.length(32), - bottom: Screenutil.length(24), + left: 36.w, + right: 36.w, + top: 32.w, + bottom: 24.w, ), - margin: EdgeInsets.only(bottom: Screenutil.length(60)), + margin: EdgeInsets.only(bottom: 60.w), decoration: BoxDecoration( border: Border(bottom: BorderSide(color: Color(0xffeeeeee), width: 0.5)), @@ -122,9 +122,9 @@ class _VisitorAccessPageState extends State { Text( title, style: TextStyle( - fontSize: Screenutil.size(28), color: Color(0xff333333)), + fontSize: 28.sp, color: Color(0xff333333)), ), - SizedBox(height: Screenutil.length(25)), + SizedBox(height: 25.w), CommonInput(inputController: controller, hintText: hintText) ], ), @@ -141,10 +141,10 @@ class _VisitorAccessPageState extends State { setState(() {}); }, child: Container( - height: Screenutil.length(72), - width: Screenutil.length(176), + height: 72.w, + width: 176.w, padding: EdgeInsets.symmetric( - vertical: Screenutil.length(13), + vertical: 13.w, ), decoration: BoxDecoration( color: Color(0xffffffff), @@ -157,15 +157,15 @@ class _VisitorAccessPageState extends State { children: [ Icon( sexIcon, - size: Screenutil.size(32), + size: 32.sp, color: isCheck ? Color(0xff333333) : Color(0xff979797), ), - SizedBox(width: Screenutil.length(9)), + SizedBox(width: 9.w), Text( sex, style: TextStyle( fontWeight: FontWeight.w600, - fontSize: Screenutil.size(30), + fontSize: 30.sp, color: isCheck ? Color(0xff333333) : Color(0xff979797)), ), ], @@ -177,8 +177,8 @@ class _VisitorAccessPageState extends State { Widget _sexSelect() { return Container( padding: EdgeInsets.only( - left: Screenutil.length(36), - right: Screenutil.length(36), + left: 36.w, + right: 36.w, ), child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -186,21 +186,21 @@ class _VisitorAccessPageState extends State { Text( '访客性别', style: TextStyle( - fontSize: Screenutil.size(28), color: Color(0xff333333)), + fontSize: 28.sp, color: Color(0xff333333)), ), - SizedBox(height: Screenutil.length(32)), + SizedBox(height: 32.w), Container( child: Row( children: [ _sexButton(_sexList[0]['sex'], _sexList[0]['sexIcon'], _sexList[0]['isCheck'], 0), - SizedBox(width: Screenutil.length(80)), + SizedBox(width: 80.w), _sexButton(_sexList[1]['sex'], _sexList[1]['sexIcon'], _sexList[1]['isCheck'], 1), ], ), ), - SizedBox(height: Screenutil.length(26)), + SizedBox(height: 26.w), ], ), ); @@ -222,8 +222,8 @@ class _VisitorAccessPageState extends State { }, child: Container( padding: EdgeInsets.only( - left: Screenutil.length(36), - right: Screenutil.length(36), + left: 36.w, + right: 36.w, ), child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -231,9 +231,9 @@ class _VisitorAccessPageState extends State { Text( '到访时间', style: TextStyle( - fontSize: Screenutil.size(28), color: Color(0xff333333)), + fontSize: 28.sp, color: Color(0xff333333)), ), - SizedBox(height: Screenutil.length(32)), + SizedBox(height: 32.w), Container( child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, @@ -242,18 +242,18 @@ class _VisitorAccessPageState extends State { '${dateTime}', style: TextStyle( fontWeight: FontWeight.w600, - fontSize: Screenutil.size(34), + fontSize: 34.sp, color: Color(0xff333333)), ), Icon( AntDesign.right, - size: Screenutil.size(36), + size: 36.sp, color: Color(0xffd8d8d8), ), ], ), ), - SizedBox(height: Screenutil.length(26)), + SizedBox(height: 26.w), Divider(), ], ), @@ -265,10 +265,10 @@ class _VisitorAccessPageState extends State { return InkWell( child: Container( alignment: Alignment.center, - height: Screenutil.length(96), - width: Screenutil.length(686), + height: 96.w, + width: 686.w, padding: EdgeInsets.symmetric( - vertical: Screenutil.length(26), + vertical: 26.w, ), decoration: BoxDecoration( color: Color(0xffffc40c), @@ -277,7 +277,7 @@ class _VisitorAccessPageState extends State { '生成通行证', style: TextStyle( fontWeight: FontWeight.w600, - fontSize: Screenutil.size(32), + fontSize: 32.sp, color: Color(0xff333333)), ), ), @@ -288,12 +288,12 @@ class _VisitorAccessPageState extends State { return Container( child: Container( padding: EdgeInsets.symmetric( - vertical: Screenutil.length(8), + vertical: 8.w, ), child: Text( '通行证只在到访当天单次有效,逾期或超次需要重新生成', style: TextStyle( - fontSize: Screenutil.size(20), color: Color(0xff999999)), + fontSize: 20.sp, color: Color(0xff999999)), ), ), ); @@ -325,7 +325,7 @@ class _VisitorAccessPageState extends State { _sexSelect(), _input('是否驾车', '请输入,例如浙A88888(没有驾车可不填)', _userCarNum), _selectTime(), - SizedBox(height: Screenutil.length(64)), + SizedBox(height: 64.w), _create(), _tips(), ], diff --git a/lib/pages/visitor_access_page/visitor_pass_page.dart b/lib/pages/visitor_access_page/visitor_pass_page.dart index 9c69ab02..88886b72 100644 --- a/lib/pages/visitor_access_page/visitor_pass_page.dart +++ b/lib/pages/visitor_access_page/visitor_pass_page.dart @@ -22,13 +22,13 @@ class _VisitorPassPageState extends State { Text( '宁波华茂悦峰', style: TextStyle( - fontSize: Screenutil.size(40), color: Color(0xffffffff)), + fontSize: 40.sp, color: Color(0xffffffff)), ), - SizedBox(height: Screenutil.length(10)), + SizedBox(height: 10.w), Text( '1幢-1单元-702室', style: TextStyle( - fontSize: Screenutil.size(26), color: Color(0xffffffff)), + fontSize: 26.sp, color: Color(0xffffffff)), ), ], ), @@ -39,7 +39,7 @@ class _VisitorPassPageState extends State { return Container( decoration: BoxDecoration( color: Color(0xffffffff), - borderRadius: BorderRadius.all(Radius.circular(Screenutil.length(16))), + borderRadius: BorderRadius.all(Radius.circular(16.w)), boxShadow: [ BoxShadow( color: Colors.grey.withOpacity(0.2), @@ -48,14 +48,14 @@ class _VisitorPassPageState extends State { ], ), margin: EdgeInsets.symmetric( - horizontal: Screenutil.length(75), - vertical: Screenutil.length(32), + horizontal: 75.w, + vertical: 32.w, ), padding: EdgeInsets.only( - bottom: Screenutil.length(16), - left: Screenutil.length(32), - right: Screenutil.length(21), - top: Screenutil.length(25), + bottom: 16.w, + left: 32.w, + right: 21.w, + top: 25.w, ), child: Column( mainAxisAlignment: MainAxisAlignment.center, @@ -68,17 +68,17 @@ class _VisitorPassPageState extends State { children: [ Icon( AntDesign.contacts, - size: Screenutil.size(40), + size: 40.sp, color: Color(0xff999999), ), - SizedBox(width: Screenutil.length(10)), + SizedBox(width: 10.w), Text( '马成泽先生', maxLines: 1, overflow: TextOverflow.ellipsis, style: TextStyle( fontWeight: FontWeight.w600, - fontSize: Screenutil.size(36), + fontSize: 36.sp, color: Color(0xff333333)), ), ], @@ -87,17 +87,17 @@ class _VisitorPassPageState extends State { children: [ Icon( AntDesign.car, - size: Screenutil.size(40), + size: 40.sp, color: Color(0xff999999), ), - SizedBox(width: Screenutil.length(10)), + SizedBox(width: 10.w), Text( '无车辆信息', maxLines: 1, overflow: TextOverflow.ellipsis, style: TextStyle( fontWeight: FontWeight.w600, - fontSize: Screenutil.size(36), + fontSize: 36.sp, color: Color(0xff333333), ), ), @@ -105,22 +105,22 @@ class _VisitorPassPageState extends State { ), ], ), - SizedBox(height: Screenutil.length(13)), + SizedBox(height: 13.w), Text( '有限时间:2020年6月30日', style: TextStyle( - fontSize: Screenutil.size(26), + fontSize: 26.sp, color: Color(0xff999999), ), ), - SizedBox(height: Screenutil.length(23)), + SizedBox(height: 23.w), DottedLine(color: Color(0xfff5f5f5)), Container( padding: EdgeInsets.only( - top: Screenutil.length(30), - bottom: Screenutil.length(38), + top: 30.w, + bottom: 38.w, ), - height: Screenutil.length(389), + height: 389.w, alignment: Alignment.center, child: Column( children: [ @@ -128,15 +128,15 @@ class _VisitorPassPageState extends State { '020-598-230', style: TextStyle( fontWeight: FontWeight.w600, - fontSize: Screenutil.size(36), + fontSize: 36.sp, color: Color(0xff333333), ), ), - SizedBox(height: Screenutil.length(11)), + SizedBox(height: 11.w), Image.asset( 'assets/example/QR_code.png', - height: Screenutil.length(260), - width: Screenutil.length(260), + height: 260.w, + width: 260.w, color: Color(0xff333333), fit: BoxFit.fill, ), @@ -144,13 +144,13 @@ class _VisitorPassPageState extends State { ), ), DottedLine(color: Color(0xfff5f5f5)), - SizedBox(height: Screenutil.length(16)), + SizedBox(height: 16.w), Container( alignment: Alignment.center, child: Text( '进入小区时,请出示此通行证给门岗', style: TextStyle( - fontSize: Screenutil.size(24), + fontSize: 24.sp, color: Color(0xff999999), ), ), @@ -165,15 +165,15 @@ class _VisitorPassPageState extends State { onTap: () {}, child: Container( alignment: Alignment.center, - height: Screenutil.length(98), - width: Screenutil.length(750), + height: 98.w, + width: 750.w, padding: EdgeInsets.symmetric(vertical: Screenutil.length(26.5)), color: Color(0xffffc40c), child: Text( '发送给访客', style: TextStyle( fontWeight: FontWeight.w600, - fontSize: Screenutil.size(32), + fontSize: 32.sp, color: Color(0xff333333), ), ), @@ -196,9 +196,9 @@ class _VisitorPassPageState extends State { children: [ Column( children: [ - SizedBox(height: Screenutil.length(192) - kToolbarHeight), + SizedBox(height: 192.w - kToolbarHeight), _header(), - SizedBox(height: Screenutil.length(32)), + SizedBox(height: 32.w), _card(), ], ), diff --git a/lib/pages/visitor_access_page/widget/record_item.dart b/lib/pages/visitor_access_page/widget/record_item.dart index 9a689273..263336fb 100644 --- a/lib/pages/visitor_access_page/widget/record_item.dart +++ b/lib/pages/visitor_access_page/widget/record_item.dart @@ -23,7 +23,7 @@ class _RecordItemState extends State Positioned _positionedAgain() { return Positioned( right: 0, - top: Screenutil.length(16), + top: 16.w, child: InkWell( onTap: () {}, child: Container( @@ -31,18 +31,18 @@ class _RecordItemState extends State decoration: BoxDecoration( color: Color(0xffffffff), borderRadius: - BorderRadius.all(Radius.circular(Screenutil.length(36))), + BorderRadius.all(Radius.circular(36.w)), border: Border.all( - color: Color(0xffffc500), width: Screenutil.length(3))), + color: Color(0xffffc500), width: 3.w)), padding: EdgeInsets.symmetric( - vertical: Screenutil.length(11), - horizontal: Screenutil.length(32), + vertical: 11.w, + horizontal: 32.w, ), child: Text( '再次邀请', style: TextStyle( fontWeight: FontWeight.w600, - fontSize: Screenutil.size(24), + fontSize: 24.sp, color: Color(0xff333333), ), ), @@ -54,18 +54,18 @@ class _RecordItemState extends State Positioned _positionedQRcode() { return Positioned( right: 0, - top: Screenutil.length(16), + top: 16.w, child: Row( children: [ Icon( AntDesign.qrcode, - size: Screenutil.size(40), + size: 40.sp, color: Color(0xff999999), ), - SizedBox(height: Screenutil.length(18)), + SizedBox(height: 18.w), Icon( AntDesign.right, - size: Screenutil.size(40), + size: 40.sp, color: Color(0xff999999), ), ], @@ -79,9 +79,9 @@ class _RecordItemState extends State onTap: recordPass, child: Container( padding: EdgeInsets.only( - top: Screenutil.length(32), - left: Screenutil.length(32), - right: Screenutil.length(32), + top: 32.w, + left: 32.w, + right: 32.w, ), color: Colors.white, child: Stack( @@ -92,19 +92,19 @@ class _RecordItemState extends State Text( '马成泽(浙A88888)', style: TextStyle( - fontSize: Screenutil.size(32), + fontSize: 32.sp, color: Color(0xff333333), ), ), - SizedBox(height: Screenutil.length(8)), + SizedBox(height: 8.w), Text( '2020年6月30日', style: TextStyle( - fontSize: Screenutil.size(24), + fontSize: 24.sp, color: Color(0xff999999), ), ), - SizedBox(height: Screenutil.length(33)), + SizedBox(height: 33.w), Divider() ], ), diff --git a/lib/utils/screenutil.dart b/lib/utils/screenutil.dart index f50ce5b5..385dbd34 100644 --- a/lib/utils/screenutil.dart +++ b/lib/utils/screenutil.dart @@ -1,7 +1,9 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; -class Screenutil { - static double length(double lengthNum) => ScreenUtil().setWidth(lengthNum); +export 'package:flutter_screenutil/flutter_screenutil.dart'; - static double size(double sizeNum) => ScreenUtil().setSp(sizeNum); -} +// class Screenutil { +// static double length(double lengthNum) => ScreenUtil().setWidth(lengthNum); + +// static double size(double sizeNum) => ScreenUtil().setSp(sizeNum); +// } diff --git a/lib/widget/activity_card.dart b/lib/widget/activity_card.dart index 20a98370..e7862555 100644 --- a/lib/widget/activity_card.dart +++ b/lib/widget/activity_card.dart @@ -27,9 +27,9 @@ class ActivityCard extends StatelessWidget { Widget build(BuildContext context) { return Container( margin: EdgeInsets.only( - top: Screenutil.length(20), - left: Screenutil.length(32), - right: Screenutil.length(32), + top: 20.w, + left: 32.w, + right: 32.w, ), decoration: BoxDecoration( color: Color(0xffffffff), @@ -49,7 +49,7 @@ class ActivityCard extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - margin: EdgeInsets.only(bottom: Screenutil.length(16)), + margin: EdgeInsets.only(bottom: 16.w), child: ClipRRect( borderRadius: BorderRadius.only( topLeft: Radius.circular(6), @@ -57,14 +57,14 @@ class ActivityCard extends StatelessWidget { ), child: CachedImageWrapper( url: imagePath, - width: Screenutil.length(686), - height: Screenutil.length(210), + width: 686.w, + height: 210.w, ), ), ), Container( - padding: EdgeInsets.symmetric(horizontal: Screenutil.length(24)), - margin: EdgeInsets.only(bottom: Screenutil.length(16)), + padding: EdgeInsets.symmetric(horizontal: 24.w), + margin: EdgeInsets.only(bottom: 16.w), child: Text( title, maxLines: 1, @@ -75,8 +75,8 @@ class ActivityCard extends StatelessWidget { ), ), Container( - padding: EdgeInsets.symmetric(horizontal: Screenutil.length(22)), - margin: EdgeInsets.only(bottom: Screenutil.length(8)), + padding: EdgeInsets.symmetric(horizontal: 22.w), + margin: EdgeInsets.only(bottom: 8.w), child: isVote ? Text( subtitleFirst, @@ -104,8 +104,8 @@ class ActivityCard extends StatelessWidget { ), ), Container( - padding: EdgeInsets.symmetric(horizontal: Screenutil.length(22)), - margin: EdgeInsets.only(bottom: Screenutil.length(16)), + padding: EdgeInsets.symmetric(horizontal: 22.w), + margin: EdgeInsets.only(bottom: 16.w), child: RichText( text: TextSpan(children: [ TextSpan( @@ -125,18 +125,18 @@ class ActivityCard extends StatelessWidget { ), Container( margin: EdgeInsets.only( - left: Screenutil.length(24), - right: Screenutil.length(20), - bottom: Screenutil.length(24), + left: 24.w, + right: 20.w, + bottom: 24.w, ), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Container( - margin: EdgeInsets.only(left: Screenutil.length(80)), + margin: EdgeInsets.only(left: 80.w), child: ImageStack( imageList: memberList, - imageRadius: Screenutil.size(44), + imageRadius: 44.sp, imageCount: 3, imageBorderWidth: 1, totalCount: 3, @@ -149,10 +149,10 @@ class ActivityCard extends StatelessWidget { }, child: Container( alignment: Alignment.center, - height: Screenutil.length(44), - width: Screenutil.length(120), + height: 44.w, + width: 120.w, padding: EdgeInsets.symmetric( - vertical: Screenutil.length(8), + vertical: 8.w, ), decoration: BoxDecoration( color: isOver diff --git a/lib/widget/app_bar_action.dart b/lib/widget/app_bar_action.dart index e63f46e6..cdbc700a 100644 --- a/lib/widget/app_bar_action.dart +++ b/lib/widget/app_bar_action.dart @@ -85,7 +85,7 @@ class _AppBarActionState extends State { @override Widget build(BuildContext context) { return Container( - margin: EdgeInsets.only(right: Screenutil.length(32)), + margin: EdgeInsets.only(right: 32.w), child: InkWell( child: Column( mainAxisAlignment: MainAxisAlignment.center, @@ -94,11 +94,11 @@ class _AppBarActionState extends State { widget.icon, color: Color(0xff333333), ), - SizedBox(height: Screenutil.length(4)), + SizedBox(height: 4.w), Text( widget.title, style: TextStyle( - fontSize: Screenutil.size(20), + fontSize: 20.sp, color: Color(0xff333333), ), ) diff --git a/lib/widget/bottom_button.dart b/lib/widget/bottom_button.dart index 14efeae7..3cd8449f 100644 --- a/lib/widget/bottom_button.dart +++ b/lib/widget/bottom_button.dart @@ -17,7 +17,7 @@ class _BottomButtonState extends State { Widget build(BuildContext context) { return Container( alignment: Alignment.center, - height: Screenutil.length(98), + height: 98.w, width: MediaQuery.of(context).size.width, child: InkWell( onTap: widget.fun, diff --git a/lib/widget/cart_count.dart b/lib/widget/cart_count.dart index 6160d39c..0715a21a 100644 --- a/lib/widget/cart_count.dart +++ b/lib/widget/cart_count.dart @@ -17,8 +17,8 @@ class CartCount extends StatelessWidget { } : null, child: Container( - width: Screenutil.length(52), - height: Screenutil.length(52), + width: 52.w, + height: 52.w, alignment: Alignment.center, decoration: BoxDecoration( color: cartItem.count > 1 ? Color(0xffffffff) : Colors.black12, @@ -27,7 +27,7 @@ class CartCount extends StatelessWidget { child: Icon( Icons.remove, color: Color(0xff979797), - size: Screenutil.size(38), + size: 38.sp, ), ), ); @@ -40,8 +40,8 @@ class CartCount extends StatelessWidget { model.addOrReduceAction(cartItem, 'add'); }, child: Container( - width: Screenutil.length(52), - height: Screenutil.length(52), + width: 52.w, + height: 52.w, alignment: Alignment.center, decoration: BoxDecoration( color: Color(0xffffffff), @@ -50,7 +50,7 @@ class CartCount extends StatelessWidget { child: Icon( Icons.add, color: Color(0xff979797), - size: Screenutil.size(38), + size: 38.sp, ), ), ); @@ -59,14 +59,14 @@ class CartCount extends StatelessWidget { //中间数量显示区域 Widget _countArea() { return Container( - width: Screenutil.length(52), - height: Screenutil.length(52), + width: 52.w, + height: 52.w, alignment: Alignment.center, color: Colors.white, child: Text( '${cartItem.count}', style: TextStyle( - fontSize: Screenutil.size(24), + fontSize: 24.sp, color: Color(0xff333333), ), ), @@ -76,7 +76,7 @@ class CartCount extends StatelessWidget { @override Widget build(BuildContext context) { return Container( - width: Screenutil.length(160), + width: 160.w, decoration: BoxDecoration( border: Border.all(width: 0.5, color: Colors.black12) //设置所有的边框宽度为1 颜色为浅灰 diff --git a/lib/widget/circle_trend.dart b/lib/widget/circle_trend.dart index cfa37551..c0eb5f38 100644 --- a/lib/widget/circle_trend.dart +++ b/lib/widget/circle_trend.dart @@ -18,16 +18,16 @@ class _CircleTrendState extends State { TextStyle _textStyleTitle() { return TextStyle( fontWeight: FontWeight.w600, - fontSize: Screenutil.size(52), + fontSize: 52.sp, color: Color(0xff333333)); } TextStyle _textStyleSubtitle() { - return TextStyle(fontSize: Screenutil.size(32), color: Color(0xff333333)); + return TextStyle(fontSize: 32.sp, color: Color(0xff333333)); } TextStyle _textStyleTag() { - return TextStyle(fontSize: Screenutil.size(30), color: Color(0xff444444)); + return TextStyle(fontSize: 30.sp, color: Color(0xff444444)); } InkWell _contentDetails(String subtitle, imagePath, Function fun) { @@ -36,19 +36,19 @@ class _CircleTrendState extends State { fun(subtitle, imagePath); }, child: Container( - margin: EdgeInsets.only(bottom: Screenutil.length(8)), + margin: EdgeInsets.only(bottom: 8.w), child: Row( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ CachedImageWrapper( url: imagePath, - width: Screenutil.length(152), - height: Screenutil.length(152), + width: 152.w, + height: 152.w, ), - SizedBox(width: Screenutil.length(10)), + SizedBox(width: 10.w), Container( - width: Screenutil.length(384), + width: 384.w, child: Text( subtitle, maxLines: 2, @@ -66,9 +66,9 @@ class _CircleTrendState extends State { String title, List> contentList, Function fun) { return Container( margin: EdgeInsets.only( - left: Screenutil.length(32), - right: Screenutil.length(32), - bottom: Screenutil.length(40), + left: 32.w, + right: 32.w, + bottom: 40.w, ), child: Row( crossAxisAlignment: CrossAxisAlignment.start, @@ -84,7 +84,7 @@ class _CircleTrendState extends State { ) : SizedBox(), Container( - margin: EdgeInsets.only(left: Screenutil.length(30)), + margin: EdgeInsets.only(left: 30.w), child: Column( children: contentList .map((item) => _contentDetails( diff --git a/lib/widget/common_app_bar.dart b/lib/widget/common_app_bar.dart index 866b9c24..2259fc8c 100644 --- a/lib/widget/common_app_bar.dart +++ b/lib/widget/common_app_bar.dart @@ -28,14 +28,14 @@ class CommonAppBar extends StatelessWidget { '功能说明', style: TextStyle( fontWeight: FontWeight.bold, - fontSize: Screenutil.size(32), + fontSize: 32.sp, color: Color(0xff15c0ec), ), ), content: Text( '点击“呼叫110”后,您可以直接拨打本地110。页面中提供了您当前所在位置,以便您与警方沟通。(GPS信号弱时,位置可能存在偏移)', style: TextStyle( - fontSize: Screenutil.size(28), + fontSize: 28.sp, color: Color(0xff666666), ), ), @@ -65,7 +65,7 @@ class CommonAppBar extends StatelessWidget { onTap: () => Navigator.pop(context), child: Icon( AntDesign.left, - size: Screenutil.size(45), + size: 45.sp, color: (title == '访客通行证' || title == '出户二维码') ? Colors.white : Color(0xff333333), @@ -78,7 +78,7 @@ class CommonAppBar extends StatelessWidget { color: (title == '访客通行证' || title == '出户二维码') ? Colors.white : Color(0xff333333), - fontSize: Screenutil.size(32), + fontSize: 32.sp, fontWeight: FontWeight.w600, ), ), @@ -121,11 +121,11 @@ class CommonAppBar extends StatelessWidget { child: Container( height: kToolbarHeight, alignment: Alignment.center, - margin: EdgeInsets.only(right: Screenutil.length(32)), + margin: EdgeInsets.only(right: 32.w), child: Text( subtitle, style: TextStyle( - fontSize: Screenutil.size(28), + fontSize: 28.sp, color: Color(0xff333333), ), ), @@ -136,18 +136,18 @@ class CommonAppBar extends StatelessWidget { bottom: treeList != null ? TabBar( unselectedLabelStyle: TextStyle( - fontSize: Screenutil.size(28), + fontSize: 28.sp, ), labelStyle: TextStyle( fontWeight: FontWeight.w600, - fontSize: Screenutil.size(28), + fontSize: 28.sp, ), labelPadding: EdgeInsets.symmetric(horizontal: Screenutil.length(131.5)), indicatorColor: Color(0xffffc40c), indicatorSize: TabBarIndicatorSize.label, indicatorPadding: - EdgeInsets.symmetric(horizontal: Screenutil.length(21)), + EdgeInsets.symmetric(horizontal: 21.w), isScrollable: true, controller: tabController, tabs: List.generate( diff --git a/lib/widget/common_image_picker.dart b/lib/widget/common_image_picker.dart index 953bfcd9..f175c7a5 100644 --- a/lib/widget/common_image_picker.dart +++ b/lib/widget/common_image_picker.dart @@ -99,8 +99,8 @@ class _CommonImagePickerState extends State { borderRadius: BorderRadius.all(Radius.circular(6)), child: Image.asset( AssetsImage.IMAGEADD, - width: Screenutil.length(218), - height: Screenutil.length(218), + width: 218.w, + height: 218.w, ), ), ) @@ -126,7 +126,7 @@ class _CommonImagePickerState extends State { child: Icon( AntDesign.closecircle, color: BaseStyle.colorffc40c, - size: Screenutil.size(36), + size: 36.sp, ), ), ), diff --git a/lib/widget/common_input.dart b/lib/widget/common_input.dart index 836a9204..4c812571 100644 --- a/lib/widget/common_input.dart +++ b/lib/widget/common_input.dart @@ -29,8 +29,8 @@ class _CommonInputState extends State { decoration: InputDecoration( isDense: true, contentPadding: EdgeInsets.only( - top: Screenutil.length(0), - bottom: Screenutil.length(0), + top: 0.w, + bottom: 0.w, ), hintText: widget.hintText, border: InputBorder.none, //去掉输入框的下滑线 diff --git a/lib/widget/common_upload_image.dart b/lib/widget/common_upload_image.dart index 23407886..59347b04 100644 --- a/lib/widget/common_upload_image.dart +++ b/lib/widget/common_upload_image.dart @@ -25,11 +25,11 @@ class _CommonUploadImageState extends State { borderRadius: BorderRadius.all(Radius.circular(6)), child: Image.asset( widget.imagePath, - width: Screenutil.length(328), - height: Screenutil.length(180), + width: 328.w, + height: 180.w, ), ), - SizedBox(height: Screenutil.length(16)), + SizedBox(height: 16.w), Text( widget.title, style: TextStyle( diff --git a/lib/widget/community_card.dart b/lib/widget/community_card.dart index deb29808..f18731c6 100644 --- a/lib/widget/community_card.dart +++ b/lib/widget/community_card.dart @@ -33,24 +33,24 @@ class _CommunityCardState extends State { child: Row( children: [ Container( - margin: EdgeInsets.only(bottom: Screenutil.length(16)), + margin: EdgeInsets.only(bottom: 16.w), child: ClipRRect( borderRadius: BorderRadius.all(Radius.circular(6)), child: CachedImageWrapper( url: imagePath, - width: Screenutil.length(160), - height: Screenutil.length(120), + width: 160.w, + height: 120.w, ), ), ), - SizedBox(width: Screenutil.length(20)), + SizedBox(width: 20.w), Column( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - width: Screenutil.length(480), - margin: EdgeInsets.only(bottom: Screenutil.length(6)), + width: 480.w, + margin: EdgeInsets.only(bottom: 6.w), child: Text( title, overflow: TextOverflow.ellipsis, @@ -61,8 +61,8 @@ class _CommunityCardState extends State { ), ), Container( - width: Screenutil.length(480), - margin: EdgeInsets.only(bottom: Screenutil.length(8)), + width: 480.w, + margin: EdgeInsets.only(bottom: 8.w), child: Text( subtitle, overflow: TextOverflow.ellipsis, @@ -73,7 +73,7 @@ class _CommunityCardState extends State { ), ), Container( - width: Screenutil.length(480), + width: 480.w, child: RichText( overflow: TextOverflow.ellipsis, maxLines: 1, @@ -103,20 +103,20 @@ class _CommunityCardState extends State { Container _cardFooter(String imagePath,title, List headList, bool isOver, int peopleNum, Function fun) { return Container( - margin: EdgeInsets.only(top: Screenutil.length(40)), + margin: EdgeInsets.only(top: 40.w), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Container( - margin: EdgeInsets.only(left: Screenutil.length(80)), + margin: EdgeInsets.only(left: 80.w), child: Row( mainAxisAlignment: MainAxisAlignment.start, children: [ Container( - margin: EdgeInsets.only(right: Screenutil.length(26)), + margin: EdgeInsets.only(right: 26.w), child: ImageStack( imageList: headList, - imageRadius: Screenutil.size(44), + imageRadius: 44.sp, imageCount: 3, imageBorderWidth: 1, totalCount: 3, @@ -137,10 +137,10 @@ class _CommunityCardState extends State { }, child: Container( alignment: Alignment.center, - height: Screenutil.length(44), - width: Screenutil.length(120), + height: 44.w, + width: 120.w, padding: EdgeInsets.symmetric( - vertical: Screenutil.length(7), + vertical: 7.w, ), decoration: BoxDecoration( color: isOver ? BaseStyle.colorababab : BaseStyle.colorffc40c, @@ -165,15 +165,15 @@ class _CommunityCardState extends State { return Container( color: Colors.white, margin: EdgeInsets.only( - top: Screenutil.length(24), - left: Screenutil.length(32), - right: Screenutil.length(32), + top: 24.w, + left: 32.w, + right: 32.w, ), padding: EdgeInsets.only( - top: Screenutil.length(12), - left: Screenutil.length(10), - right: Screenutil.length(16), - bottom: Screenutil.length(20), + top: 12.w, + left: 10.w, + right: 16.w, + bottom: 20.w, ), child: Column( children: [ diff --git a/lib/widget/goods_card_skeleton.dart b/lib/widget/goods_card_skeleton.dart index fc5cdb57..5dffc0bd 100644 --- a/lib/widget/goods_card_skeleton.dart +++ b/lib/widget/goods_card_skeleton.dart @@ -37,14 +37,14 @@ class GoodsCardSkeleton extends StatelessWidget { children: [ Container( color: Colors.white, - width: Screenutil.length(333), - height: Screenutil.length(344), + width: 333.w, + height: 344.w, ), Padding( padding: EdgeInsets.only( - left: Screenutil.length(12), - right: Screenutil.length(12), - top: Screenutil.length(22), + left: 12.w, + right: 12.w, + top: 22.w, ), child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -55,8 +55,8 @@ class GoodsCardSkeleton extends StatelessWidget { borderRadius: BorderRadius.circular(4), ), margin: - EdgeInsets.only(bottom: Screenutil.length(6)), - height: Screenutil.length(30), + EdgeInsets.only(bottom: 6.w), + height: 30.w, width: double.infinity, ), Container( @@ -65,8 +65,8 @@ class GoodsCardSkeleton extends StatelessWidget { borderRadius: BorderRadius.circular(4), ), margin: - EdgeInsets.only(bottom: Screenutil.length(20)), - height: Screenutil.length(30), + EdgeInsets.only(bottom: 20.w), + height: 30.w, width: double.infinity, ), Container( @@ -74,8 +74,8 @@ class GoodsCardSkeleton extends StatelessWidget { color: Colors.white, borderRadius: BorderRadius.circular(4), ), - height: Screenutil.length(32), - width: Screenutil.length(61), + height: 32.w, + width: 61.w, ), ], ), @@ -88,9 +88,9 @@ class GoodsCardSkeleton extends StatelessWidget { }, gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( crossAxisCount: 2, - mainAxisSpacing: Screenutil.length(20), - crossAxisSpacing: Screenutil.length(20), - childAspectRatio: Screenutil.length(333) / Screenutil.length(509)), + mainAxisSpacing: 20.w, + crossAxisSpacing: 20.w, + childAspectRatio: 333.w / 509.w), ), ); } diff --git a/lib/widget/goods_specs_sheet.dart b/lib/widget/goods_specs_sheet.dart index 6c2f1b3f..27a3ec0c 100644 --- a/lib/widget/goods_specs_sheet.dart +++ b/lib/widget/goods_specs_sheet.dart @@ -51,8 +51,8 @@ class _GoodsSpecsSheetState extends State { } : null, child: Container( - width: Screenutil.length(52), - height: Screenutil.length(52), + width: 52.w, + height: 52.w, alignment: Alignment.center, decoration: BoxDecoration( color: count > 1 ? Color(0xffffffff) : Colors.black12, @@ -61,7 +61,7 @@ class _GoodsSpecsSheetState extends State { child: Icon( Icons.remove, color: Color(0xff979797), - size: Screenutil.size(38), + size: 38.sp, ), ), ); @@ -76,8 +76,8 @@ class _GoodsSpecsSheetState extends State { }); }, child: Container( - width: Screenutil.length(52), - height: Screenutil.length(52), + width: 52.w, + height: 52.w, alignment: Alignment.center, decoration: BoxDecoration( color: Color(0xffffffff), @@ -86,7 +86,7 @@ class _GoodsSpecsSheetState extends State { child: Icon( Icons.add, color: Color(0xff979797), - size: Screenutil.size(38), + size: 38.sp, ), ), ); @@ -95,14 +95,14 @@ class _GoodsSpecsSheetState extends State { //中间数量显示区域 Widget _countArea() { return Container( - width: Screenutil.length(52), - height: Screenutil.length(52), + width: 52.w, + height: 52.w, alignment: Alignment.center, color: Colors.white, child: Text( '${count}', style: TextStyle( - fontSize: Screenutil.size(24), + fontSize: 24.sp, color: Color(0xff333333), ), ), @@ -113,19 +113,19 @@ class _GoodsSpecsSheetState extends State { return Stack( children: [ Padding( - padding: EdgeInsets.all(Screenutil.length(32)), + padding: EdgeInsets.all(32.w), child: Row( crossAxisAlignment: CrossAxisAlignment.end, children: [ Container( - margin: EdgeInsets.only(right: Screenutil.length(20)), + margin: EdgeInsets.only(right: 20.w), child: ClipRRect( borderRadius: - BorderRadius.all(Radius.circular(Screenutil.length(4))), + BorderRadius.all(Radius.circular(4.w)), child: CachedImageWrapper( url: image, - height: Screenutil.length(180), - width: Screenutil.length(180), + height: 180.w, + width: 180.w, ), ), ), @@ -137,25 +137,25 @@ class _GoodsSpecsSheetState extends State { '价格:¥${price}', style: TextStyle( color: Color(0xffe60e0e), - fontSize: Screenutil.size(28), + fontSize: 28.sp, ), ), - SizedBox(height: Screenutil.length(5)), + SizedBox(height: 5.w), // Row( // children: [ // Text( // '已选中:', // style: TextStyle( // color: Color(0xff333333), - // fontSize: Screenutil.size(28), + // fontSize: 28.sp, // ), // ), - // SizedBox(width: Screenutil.length(10)), + // SizedBox(width: 10.w), // Text( // '中蓝XS(170/80A)', // style: TextStyle( // color: Color(0xff333333), - // fontSize: Screenutil.size(28), + // fontSize: 28.sp, // ), // ), // ], @@ -171,7 +171,7 @@ class _GoodsSpecsSheetState extends State { child: IconButton( icon: Icon( AntDesign.close, - size: Screenutil.size(38), + size: 38.sp, color: Color(0xff999999), ), onPressed: () => Navigator.of(context).pop(), @@ -183,7 +183,7 @@ class _GoodsSpecsSheetState extends State { Widget _paddingSelect(String title, List> selectList) { return Padding( - padding: EdgeInsets.symmetric(horizontal: Screenutil.length(52)), + padding: EdgeInsets.symmetric(horizontal: 52.w), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -191,13 +191,13 @@ class _GoodsSpecsSheetState extends State { title, style: TextStyle( color: Color(0xff333333), - fontSize: Screenutil.size(28), + fontSize: 28.sp, ), ), - SizedBox(height: Screenutil.length(20)), + SizedBox(height: 20.w), Wrap( - spacing: Screenutil.length(30), - runSpacing: Screenutil.length(20), + spacing: 30.w, + runSpacing: 20.w, children: selectList .map((item) => InkWell( onTap: () { @@ -220,13 +220,13 @@ class _GoodsSpecsSheetState extends State { width: 0.5), borderRadius: BorderRadius.all(Radius.circular(4))), padding: EdgeInsets.symmetric( - horizontal: Screenutil.length(32), - vertical: Screenutil.length(15), + horizontal: 32.w, + vertical: 15.w, ), child: Text( item['title'], style: TextStyle( - fontSize: Screenutil.size(28), + fontSize: 28.sp, color: Color(0xff333333), ), ), @@ -241,7 +241,7 @@ class _GoodsSpecsSheetState extends State { Widget _paddingNum() { return Padding( - padding: EdgeInsets.symmetric(horizontal: Screenutil.length(52)), + padding: EdgeInsets.symmetric(horizontal: 52.w), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -249,13 +249,13 @@ class _GoodsSpecsSheetState extends State { '数量', style: TextStyle( color: Color(0xff333333), - fontSize: Screenutil.length(28), + fontSize: 28.w, ), ), - SizedBox(height: Screenutil.length(20)), + SizedBox(height: 20.w), // CartCount(), Container( - width: Screenutil.length(160), + width: 160.w, decoration: BoxDecoration( border: Border.all( width: 0.5, color: Colors.black12) //设置所有的边框宽度为1 颜色为浅灰 @@ -316,12 +316,12 @@ class _GoodsSpecsSheetState extends State { ], ), alignment: Alignment.center, - margin: EdgeInsets.symmetric(horizontal: Screenutil.length(52)), - padding: EdgeInsets.symmetric(vertical: Screenutil.length(20)), + margin: EdgeInsets.symmetric(horizontal: 52.w), + padding: EdgeInsets.symmetric(vertical: 20.w), child: Text( '确认', style: TextStyle( - fontSize: Screenutil.length(32), + fontSize: 32.w, color: Color(0xff333333), ), ), @@ -332,24 +332,24 @@ class _GoodsSpecsSheetState extends State { @override Widget build(BuildContext context) { return SizedBox( - // height: Screenutil.length(1334), + // height: 1334.w, child: Container( child: Column( mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.start, children: [ _stackHeader(widget.itempic, widget.itemprice), - SizedBox(height: Screenutil.length(91)), + SizedBox(height: 91.w), // _paddingSelect('颜色', colorsList), - // SizedBox(height: Screenutil.length(70)), + // SizedBox(height: 70.w), // _paddingSelect('尺寸', sizesList), - // SizedBox(height: Screenutil.length(50)), + // SizedBox(height: 50.w), _paddingNum(), - SizedBox(height: Screenutil.length(79)), + SizedBox(height: 79.w), Consumer(builder: (context, model, child) { return _inkwellSubmit(widget.type, model); }), - SizedBox(height: Screenutil.length(79)), + SizedBox(height: 79.w), ], ), ), diff --git a/lib/widget/grid_button.dart b/lib/widget/grid_button.dart index 3467b289..bfaad2b3 100644 --- a/lib/widget/grid_button.dart +++ b/lib/widget/grid_button.dart @@ -184,14 +184,14 @@ class GridButton extends StatelessWidget { children: [ Image.asset( gridList[index]['imagePath'], - height: Screenutil.length(53), - width: Screenutil.length(53), + height: 53.w, + width: 53.w, fit: BoxFit.cover, ), SizedBox(height: 5), Text( gridList[index]['title'], - style: TextStyle(fontSize: Screenutil.size(24)), + style: TextStyle(fontSize: 24.sp), ) ], ), diff --git a/lib/widget/round_check_box.dart b/lib/widget/round_check_box.dart index c8d3ab19..7941e234 100644 --- a/lib/widget/round_check_box.dart +++ b/lib/widget/round_check_box.dart @@ -27,19 +27,19 @@ class _RoundCheckBoxState extends State { widget.value ? Icon( Icons.check_circle, - size: Screenutil.size(30), + size: 30.sp, color: Color(0xffffc40c), ) : Icon( Icons.panorama_fish_eye, - size: Screenutil.size(30), + size: 30.sp, color: Color(0xff979797), ), - SizedBox(width: Screenutil.length(10)), + SizedBox(width: 10.w), Text( widget.title, style: TextStyle( - fontSize: Screenutil.size(26), + fontSize: 26.sp, color: Color(0xff333333), ), ), diff --git a/lib/widget/single_image_up.dart b/lib/widget/single_image_up.dart index e3438858..ba7bbad9 100644 --- a/lib/widget/single_image_up.dart +++ b/lib/widget/single_image_up.dart @@ -95,23 +95,23 @@ class _SingleImageUpState extends State { Stack( children: [ Container( - width: Screenutil.length(328), - height: Screenutil.length(180), + width: 328.w, + height: 180.w, decoration: BoxDecoration( border: Border.all( color: Color(0xffe8e8e8), - width: images.length == 0 ? 0 : Screenutil.length(4)), + width: images.length == 0 ? 0 : 4.w), borderRadius: - BorderRadius.all(Radius.circular(Screenutil.length(6))), + BorderRadius.all(Radius.circular(6.w)), ), child: ClipRRect( borderRadius: - BorderRadius.all(Radius.circular(Screenutil.length(6))), + BorderRadius.all(Radius.circular(6.w)), child: images.length == 0 ? Image.asset( widget.imagePath, - width: Screenutil.length(328), - height: Screenutil.length(180), + width: 328.w, + height: 180.w, ) : AssetThumb(asset: images[0], width: 328, height: 180), ), @@ -130,13 +130,13 @@ class _SingleImageUpState extends State { child: Icon( AntDesign.closecircle, color: BaseStyle.colorffc40c, - size: Screenutil.size(36), + size: 36.sp, ), ), ), ], ), - SizedBox(height: Screenutil.length(16)), + SizedBox(height: 16.w), Text( widget.title, style: TextStyle( @@ -151,9 +151,9 @@ class _SingleImageUpState extends State { // physics: NeverScrollableScrollPhysics(), // gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( // crossAxisCount: 2, - // mainAxisSpacing: Screenutil.length(30), - // crossAxisSpacing: Screenutil.length(32), - // childAspectRatio: Screenutil.length(328) / Screenutil.length(230), + // mainAxisSpacing: 30.w, + // crossAxisSpacing: 32.w, + // childAspectRatio: 328.w / 230.w, // ), // itemBuilder: (BuildContext context, int index) { // return index == images.length @@ -167,14 +167,14 @@ class _SingleImageUpState extends State { // children: [ // ClipRRect( // borderRadius: BorderRadius.all( - // Radius.circular(Screenutil.length(6))), + // Radius.circular(6.w)), // child: Image.asset( // widget.imagePath, - // width: Screenutil.length(328), - // height: Screenutil.length(180), + // width: 328.w, + // height: 180.w, // ), // ), - // SizedBox(height: Screenutil.length(16)), + // SizedBox(height: 16.w), // Text( // widget.title, // style: TextStyle( @@ -192,7 +192,7 @@ class _SingleImageUpState extends State { // children: [ // ClipRRect( // borderRadius: BorderRadius.all( - // Radius.circular(Screenutil.length(6))), + // Radius.circular(6.w)), // child: AssetThumb( // asset: images[index], // width: 328, @@ -201,11 +201,11 @@ class _SingleImageUpState extends State { // // Image.asset( // // widget.imagePath, - // // width: Screenutil.length(328), - // // height: Screenutil.length(180), + // // width: 328.w, + // // height: 180.w, // // ), // ), - // SizedBox(height: Screenutil.length(16)), + // SizedBox(height: 16.w), // Text( // widget.title, // style: TextStyle( @@ -226,7 +226,7 @@ class _SingleImageUpState extends State { // child: Icon( // AntDesign.closecircle, // color: BaseStyle.colorffc40c, - // size: Screenutil.size(36), + // size: 36.sp, // ), // ), // ), diff --git a/lib/widget/sliver_goods_card.dart b/lib/widget/sliver_goods_card.dart index ad9a9cb8..021c3ec7 100644 --- a/lib/widget/sliver_goods_card.dart +++ b/lib/widget/sliver_goods_card.dart @@ -22,8 +22,8 @@ class SliverGoodsCard extends StatelessWidget { Expanded( child: Container( padding: EdgeInsets.symmetric( - horizontal: Screenutil.length(16), - vertical: Screenutil.length(8), + horizontal: 16.w, + vertical: 8.w, ), color: Color(0xff000000).withOpacity(0.6), child: Text( @@ -31,7 +31,7 @@ class SliverGoodsCard extends StatelessWidget { maxLines: 1, overflow: TextOverflow.ellipsis, style: TextStyle( - color: Color(0xffffffff), fontSize: Screenutil.size(20)), + color: Color(0xffffffff), fontSize: 20.sp), ), ), ), @@ -61,26 +61,26 @@ class SliverGoodsCard extends StatelessWidget { Container( child: CachedImageWrapper( url: shoplist[index].itempic, - width: Screenutil.length(333), - height: Screenutil.length(344), + width: 333.w, + height: 344.w, ), ), ], ), Padding( padding: EdgeInsets.only( - left: Screenutil.length(12), - right: Screenutil.length(25), - top: Screenutil.length(20), + left: 12.w, + right: 25.w, + top: 20.w, ), child: Container( - width: Screenutil.length(296), + width: 296.w, child: Text( shoplist[index].itemtitle, maxLines: 2, overflow: TextOverflow.ellipsis, style: TextStyle( - fontSize: Screenutil.size(24), + fontSize: 24.sp, color: Color(0xff4a4b51), ), ), @@ -88,10 +88,10 @@ class SliverGoodsCard extends StatelessWidget { ), Container( margin: EdgeInsets.only( - top: Screenutil.length(20), - left: Screenutil.length(12), - right: Screenutil.length(8), - bottom: Screenutil.length(17), + top: 20.w, + left: 12.w, + right: 8.w, + bottom: 17.w, ), child: Row( mainAxisAlignment: isShow @@ -99,12 +99,12 @@ class SliverGoodsCard extends StatelessWidget { : MainAxisAlignment.spaceBetween, children: [ Container( - margin: EdgeInsets.only(right: Screenutil.length(8)), + margin: EdgeInsets.only(right: 8.w), child: Text( '¥${shoplist[index].itemprice}', style: TextStyle( color: Color(0xffe60e0e), - fontSize: Screenutil.size(28), + fontSize: 28.sp, fontWeight: FontWeight.w500, ), ), @@ -114,7 +114,7 @@ class SliverGoodsCard extends StatelessWidget { '${shoplist[index].itemsale}人已付款', style: TextStyle( color: Color(0xff999999), - fontSize: Screenutil.length(20), + fontSize: 20.w, ), ) : InkWell( @@ -129,21 +129,21 @@ class SliverGoodsCard extends StatelessWidget { .toString())); }, child: Container( - width: Screenutil.length(134), + width: 134.w, alignment: Alignment.center, padding: EdgeInsets.only( - top: Screenutil.length(6), - bottom: Screenutil.length(5), + top: 6.w, + bottom: 5.w, ), decoration: BoxDecoration( color: Color(0xffffc40c), borderRadius: BorderRadius.all( - Radius.circular(Screenutil.length(20))), + Radius.circular(20.w)), ), child: Text( '立即购买', style: TextStyle( - fontSize: Screenutil.size(24), + fontSize: 24.sp, color: Color(0xff333333), ), ), @@ -161,9 +161,9 @@ class SliverGoodsCard extends StatelessWidget { ), gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( crossAxisCount: 2, - mainAxisSpacing: Screenutil.length(30), - crossAxisSpacing: Screenutil.length(20), - childAspectRatio: Screenutil.length(343) / Screenutil.length(539)), + mainAxisSpacing: 30.w, + crossAxisSpacing: 20.w, + childAspectRatio: 343.w / 539.w), ); } }