Browse Source

修改UI, bug

null_safety
fmk 4 years ago
parent
commit
e9b407bbd1
  1. 325
      lib/home/huixiang_brand_page.dart

325
lib/home/huixiang_brand_page.dart

@ -73,20 +73,18 @@ class _BrandPage extends State<BrandPage>
super.initState();
SharedPreferences.getInstance().then((value) => {
apiService = ApiService(Dio(),
context: context, token: value.getString('token')),
queryHome(),
// if (value.getBool("isFristLogin"))
// {
// showAlertDialog(),
// }
});
apiService = ApiService(Dio(),
context: context, token: value.getString('token')),
queryHome(),
if(value.getBool("isFristLogin")){
showAlertDialog(),
}});
eventBus.on<EventType>().listen((event) {
print("object: BrandPage");
if (event.type < 3) {
setState(() {});
}
print("object: BrandPage");
if (event.type < 3) {
setState(() {});
}
});
}
@ -97,7 +95,10 @@ class _BrandPage extends State<BrandPage>
super.build(context);
return Scaffold(
appBar: AppBar(
toolbarHeight: 40.h - MediaQuery.of(context).padding.top,
toolbarHeight: 40.h - MediaQuery
.of(context)
.padding
.top,
backgroundColor: Colors.white,
elevation: 0,
),
@ -234,7 +235,7 @@ class _BrandPage extends State<BrandPage>
TextSpan(children: [
TextSpan(
text:
brandData == null ? "" : brandData.originator,
brandData == null ? "" : brandData.originator,
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 14.sp,
@ -242,7 +243,9 @@ class _BrandPage extends State<BrandPage>
),
),
TextSpan(
text: " ${S.of(context).jituanchuangbanren}",
text: " ${S
.of(context)
.jituanchuangbanren}",
style: TextStyle(
fontSize: 10.sp,
color: Colors.black,
@ -275,7 +278,9 @@ class _BrandPage extends State<BrandPage>
mainAxisSize: MainAxisSize.max,
children: [
Text(
S.of(context).gengduo,
S
.of(context)
.gengduo,
style: TextStyle(
fontSize: 12.sp,
color: Colors.black,
@ -335,7 +340,9 @@ class _BrandPage extends State<BrandPage>
height: 40.h,
),
Text(
S.of(context).linian,
S
.of(context)
.linian,
style: TextStyle(
fontSize: 16.sp,
fontWeight: FontWeight.bold,
@ -481,148 +488,148 @@ class _BrandPage extends State<BrandPage>
);
}
// showAlertDialog() {
// //
// showDialog(
// context: context,
// builder: (BuildContext context) {
// return SimpleDialog(
// titlePadding: EdgeInsets.all(10),
// backgroundColor: Colors.transparent,
// elevation: 0,
// shape: RoundedRectangleBorder(
// borderRadius: BorderRadius.all(Radius.circular(6))),
// children: <Widget>[
// Stack(
// alignment: Alignment.bottomCenter,
// children: [
// Container(
// alignment: Alignment.center,
// width: double.infinity,
// height: 305.h,
// // margin: EdgeInsets.only(left: 40.w, right: 40.w),
// padding: EdgeInsets.only(left: 16.w, right: 16.w),
// decoration: new BoxDecoration(
// color: Colors.white,
// borderRadius: BorderRadius.all(Radius.circular(8))),
// child: Column(
// children: [
// Padding(
// padding: EdgeInsets.only(top: 24.h, bottom: 10.h),
// child: Text(
// S
// .of(context)
// .xieyitanchuang,
// style: TextStyle(
// color: Color(0xff4D4D4D),
// fontSize: 18.sp,
// fontWeight: FontWeight.bold),
// ),
// ),
// Text.rich(
// TextSpan(children: [
// TextSpan(
// text:
// "     感谢您使用一心回乡APP。我们非常重视您的个人信息和隐私保护。为了更好地保证您的个人权益,在您使用我们的产品前,请务必仔细阅读一心回乡",
// style: TextStyle(
// fontWeight: FontWeight.w500,
// fontSize: 14.sp,
// height: 1.3.h,
// color: Color(0xff727272)),
// ),
// TextSpan(
// text: S
// .of(context)
// .yinsixieyi,
// style: TextStyle(
// fontWeight: FontWeight.w500,
// fontSize: 14.sp,
// color: Color(0xff32A060)),
// recognizer: TapGestureRecognizer()
// ..onTap = () {
// debugPrint(
// "${Navigator.of(context).popAndPushNamed(
// '/router/treaty_page')}");
// },
// ),
// ]),
// ),
// SizedBox(
// height: 10.h,
// ),
// Text(
// "     在您同意后,我们才会根据您的使用需求,收集部分可能涉及的数据(地理位置、相机、存储等信息)。",
// style: TextStyle(
// color: Color(0xff727272),
// fontSize: 14.sp,
// height: 1.3.h,
// fontWeight: FontWeight.w500,
// ),
// ),
// SizedBox(
// height: 16.h,
// ),
// ],
// ),
// ),
// Row(
// mainAxisAlignment: MainAxisAlignment.center,
// children: [
// GestureDetector(
// onTap: () {
// Navigator.of(context).pop();
// },
// child: Container(
// height: 40.h,
// alignment: Alignment.bottomCenter,
// margin: EdgeInsets.only(bottom: 20.h),
// child: BorderText(
// padding: EdgeInsets.only(
// top: 10.h, bottom: 10.h, left: 36.w, right: 36.w),
// text: "拒绝",
// fontSize: 12.sp,
// textColor: Color(0xFF32A060),
// borderColor: Color(0xFF32A060),
// borderWidth: 1.w,
// radius: 23,
// ),
// ),
// ),
// SizedBox(
// width: 21.w,
// ),
// Container(
// height: 40.h,
// margin: EdgeInsets.only(bottom: 20.h),
// alignment: Alignment.bottomCenter,
// child: RoundButton(
// text: "同意并继续",
// textColor: Colors.white,
// fontSize: 12,
// callback: () {
// Navigator.of(context).pop();
// },
// padding: EdgeInsets.only(
// top: 10.h,
// bottom: 10.h,
// left: 21.5.w,
// right: 21.5.w),
// backgroup: Color(0xff32A060),
// radius: 23,
// ),
// ),
// SizedBox(
// height: 20.h,
// ),
// ],
// ),
// ],
// )
// ],
// );
// },
// );
// }
showAlertDialog() {
//
showDialog(
context: context,
builder: (BuildContext context) {
return SimpleDialog(
titlePadding: EdgeInsets.all(10),
backgroundColor: Colors.transparent,
elevation: 0,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(6))),
children: <Widget>[
Stack(
alignment: Alignment.bottomCenter,
children: [
Container(
alignment: Alignment.center,
width: double.infinity,
height: 305.h,
// margin: EdgeInsets.only(left: 40.w, right: 40.w),
padding: EdgeInsets.only(left: 16.w, right: 16.w),
decoration: new BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(Radius.circular(8))),
child: Column(
children: [
Padding(
padding: EdgeInsets.only(top: 24.h, bottom: 10.h),
child: Text(
S
.of(context)
.xieyitanchuang,
style: TextStyle(
color: Color(0xff4D4D4D),
fontSize: 18.sp,
fontWeight: FontWeight.bold),
),
),
Text.rich(
TextSpan(children: [
TextSpan(
text:
"     感谢您使用一心回乡APP。我们非常重视您的个人信息和隐私保护。为了更好地保证您的个人权益,在您使用我们的产品前,请务必仔细阅读一心回乡",
style: TextStyle(
fontWeight: FontWeight.w500,
fontSize: 14.sp,
height: 1.3.h,
color: Color(0xff727272)),
),
TextSpan(
text: S
.of(context)
.yinsixieyi,
style: TextStyle(
fontWeight: FontWeight.w500,
fontSize: 14.sp,
color: Color(0xff32A060)),
recognizer: TapGestureRecognizer()
..onTap = () {
debugPrint(
"${Navigator.of(context).popAndPushNamed(
'/router/treaty_page')}");
},
),
]),
),
SizedBox(
height: 10.h,
),
Text(
"     在您同意后,我们才会根据您的使用需求,收集部分可能涉及的数据(地理位置、相机、存储等信息)。",
style: TextStyle(
color: Color(0xff727272),
fontSize: 14.sp,
height: 1.3.h,
fontWeight: FontWeight.w500,
),
),
SizedBox(
height: 16.h,
),
],
),
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
GestureDetector(
onTap: () {
Navigator.of(context).pop();
},
child: Container(
height: 40.h,
alignment: Alignment.bottomCenter,
margin: EdgeInsets.only(bottom: 20.h),
child: BorderText(
padding: EdgeInsets.only(
top: 10.h, bottom: 10.h, left: 36.w, right: 36.w),
text: "拒绝",
fontSize: 12.sp,
textColor: Color(0xFF32A060),
borderColor: Color(0xFF32A060),
borderWidth: 1.w,
radius: 23,
),
),
),
SizedBox(
width: 21.w,
),
Container(
height: 40.h,
margin: EdgeInsets.only(bottom: 20.h),
alignment: Alignment.bottomCenter,
child: RoundButton(
text: "同意并继续",
textColor: Colors.white,
fontSize: 12,
callback: () {
Navigator.of(context).pop();
},
padding: EdgeInsets.only(
top: 10.h,
bottom: 10.h,
left: 21.5.w,
right: 21.5.w),
backgroup: Color(0xff32A060),
radius: 23,
),
),
SizedBox(
height: 20.h,
),
],
),
],
)
],
);
},
);
}
/// contentType 0123
bannerClick(BannerData bannerData) async {

Loading…
Cancel
Save