代码优化

This commit is contained in:
YangYuhao 2023-07-19 09:09:47 +08:00
parent af2701f7f8
commit 5d6f953858
15 changed files with 170 additions and 157 deletions

View File

@ -4,9 +4,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import '../../components/my_app_bar.dart'; import '../../components/my_app_bar.dart';
import '../../router/app_routers.dart';
import 'logic.dart'; import 'logic.dart';
import 'package:url_launcher/url_launcher.dart';
class AboutappPage extends StatelessWidget { class AboutappPage extends StatelessWidget {
@ -55,7 +53,7 @@ class AboutappPage extends StatelessWidget {
Text( Text(
'圈子', '圈子',
style: TextStyle( style: TextStyle(
color: Color(0xFFF7FAFA), color: const Color(0xFFF7FAFA),
fontSize: 16.sp, fontSize: 16.sp,
), ),
), ),
@ -63,7 +61,7 @@ class AboutappPage extends StatelessWidget {
Container( Container(
width: double.infinity, width: double.infinity,
height: 0.4.sp, height: 0.4.sp,
color: Color(0xFF2E2E3B), color: const Color(0xFF2E2E3B),
), ),
// SizedBox(height: 20), // SizedBox(height: 20),
// GestureDetector( // GestureDetector(
@ -194,14 +192,14 @@ class AboutappPage extends StatelessWidget {
} }
String url = 'https://www.baidu.com'; // Replace with your desired URL // String url = 'https://www.baidu.com'; // Replace with your desired URL
//
void _openBrowser() async { // void _openBrowser() async {
if (await canLaunch(url)) { // if (await canLaunch(url)) {
await launch(url); // await launch(url);
} else { // } else {
throw 'Could not launch $url'; // throw 'Could not launch $url';
} // }
} // }
} }

View File

@ -1,4 +1,4 @@
import 'package:circle_app/main.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';

View File

@ -2,11 +2,9 @@ import 'dart:async';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import '../../components/my_app_bar.dart'; import '../../components/my_app_bar.dart';
import '../../util/util.dart'; import '../../util/util.dart';
import 'logic.dart';
class BindmailPage extends StatefulWidget { class BindmailPage extends StatefulWidget {
BindmailPage({Key? key}) : super(key: key); BindmailPage({Key? key}) : super(key: key);
@ -32,7 +30,7 @@ class _BindmailPageState extends State<BindmailPage> {
_countdownSeconds = 60; _countdownSeconds = 60;
}); });
_timer = Timer.periodic(Duration(seconds: 1), (timer) { _timer = Timer.periodic(const Duration(seconds: 1), (timer) {
setState(() { setState(() {
if (_countdownSeconds > 0) { if (_countdownSeconds > 0) {
_countdownSeconds--; _countdownSeconds--;
@ -55,7 +53,7 @@ class _BindmailPageState extends State<BindmailPage> {
), ),
child: Scaffold( child: Scaffold(
backgroundColor: Colors.transparent, backgroundColor: Colors.transparent,
appBar: MyAppBar( appBar: const MyAppBar(
centerTitle: '绑定邮箱', centerTitle: '绑定邮箱',
), ),
body: SingleChildScrollView( body: SingleChildScrollView(
@ -71,7 +69,7 @@ class _BindmailPageState extends State<BindmailPage> {
), ),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(4.0.sp), borderRadius: BorderRadius.circular(4.0.sp),
color: Color(0xff282733), color: const Color(0xff282733),
), ),
height: 40.0.sp, height: 40.0.sp,
child: Row( child: Row(
@ -103,8 +101,8 @@ class _BindmailPageState extends State<BindmailPage> {
), ),
style: TextStyle( style: TextStyle(
color: Colors.white, color: Colors.white,
fontSize: 14.0, fontSize: 14.0.sp,
height: 1.0, height: 1.0.sp,
), ),
), ),
), ),
@ -121,7 +119,7 @@ class _BindmailPageState extends State<BindmailPage> {
16.0.sp, 20.0.sp, 8.0.sp, 0.0.sp), 16.0.sp, 20.0.sp, 8.0.sp, 0.0.sp),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(4.0.sp), borderRadius: BorderRadius.circular(4.0.sp),
color: Color(0xff282733), color: const Color(0xff282733),
), ),
height: 40.0.sp, height: 40.0.sp,
child: Row( child: Row(
@ -130,7 +128,7 @@ class _BindmailPageState extends State<BindmailPage> {
alignment: Alignment.centerLeft, alignment: Alignment.centerLeft,
padding: EdgeInsets.only( padding: EdgeInsets.only(
left: 10.0.sp, right: 10.sp), left: 10.0.sp, right: 10.sp),
child: Text( child: const Text(
"验证码", "验证码",
style: TextStyle(color: Colors.white), style: TextStyle(color: Colors.white),
), ),
@ -152,7 +150,7 @@ class _BindmailPageState extends State<BindmailPage> {
), ),
style: TextStyle( style: TextStyle(
color: Colors.white, color: Colors.white,
fontSize: 14.0, fontSize: 14.0.sp,
height: 1.0, height: 1.0,
), ),
), ),
@ -176,7 +174,7 @@ class _BindmailPageState extends State<BindmailPage> {
8.0.sp, 20.0.sp, 16.0.sp, 0.0.sp), 8.0.sp, 20.0.sp, 16.0.sp, 0.0.sp),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(4.0.sp), borderRadius: BorderRadius.circular(4.0.sp),
color: Color(0xff282733), color: const Color(0xff282733),
), ),
height: 40.0.sp, height: 40.0.sp,
child: Center( child: Center(

View File

@ -186,31 +186,32 @@ class Call_outPage extends StatelessWidget {
} }
}, },
child: Container( child: Row(
child: Row( mainAxisAlignment: MainAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center, children: [
children: [ Image.asset(
Image.asset( getCircleImage(controller.isCheck
getCircleImage(controller.isCheck ? 'check'
? 'check' : 'uncheck'),
: 'uncheck'), width: 17.5.sp,
width: 17.5.sp, ),
), SizedBox(
SizedBox( width: 4.sp,
width: 4.sp, ),
), Text(
Text( '使用至尊喊话',
'使用至尊喊话', style: TextStyle(
style: TextStyle( color: Colors.white,
color: Colors.white, fontSize: 16.sp),
fontSize: 16.sp), )
) ],
],
),
), ),
), ),
), ),
GestureDetector( GestureDetector(
onTap: (){
navigateToContentGuidelines();
},
child: Text( child: Text(
'内容规范', '内容规范',
style: TextStyle( style: TextStyle(

View File

@ -30,7 +30,7 @@ class FeedbackPage extends StatelessWidget {
), ),
child: Scaffold( child: Scaffold(
backgroundColor: Colors.transparent, backgroundColor: Colors.transparent,
appBar: MyAppBar( appBar: const MyAppBar(
centerTitle: '意见反馈', centerTitle: '意见反馈',
), ),
body: SingleChildScrollView( body: SingleChildScrollView(
@ -42,19 +42,19 @@ class FeedbackPage extends StatelessWidget {
children: [ children: [
Container( Container(
height: 200, height: 200,
margin: EdgeInsets.symmetric( margin: const EdgeInsets.symmetric(
horizontal: 16, vertical: 20), horizontal: 16, vertical: 20),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(13), borderRadius: BorderRadius.circular(13),
color: Color( color: const Color(
0xFF4C3E5F), // Use your desired background color 0xFF4C3E5F), // Use your desired background color
), ),
padding: EdgeInsets.all(13), padding: EdgeInsets.all(13.sp),
child: TextField( child: TextField(
maxLength: 200, maxLength: 200,
controller: controller.textEditingController, controller: controller.textEditingController,
onChanged: (msg){ onChanged: (msg){
print(msg);
controller.state.maxMsg = '${msg.length}/200'; controller.state.maxMsg = '${msg.length}/200';
controller.update(); controller.update();
@ -65,14 +65,14 @@ class FeedbackPage extends StatelessWidget {
counterText: '', counterText: '',
hintStyle: TextStyle( hintStyle: TextStyle(
color: Color(0xFFB7BECC), fontSize: 14.sp), color: const Color(0xFFB7BECC), fontSize: 14.sp),
border: InputBorder.none, border: InputBorder.none,
), ),
maxLines: null, maxLines: null,
inputFormatters: [ inputFormatters: [
LengthLimitingTextInputFormatter(200), LengthLimitingTextInputFormatter(200),
], ],
style: TextStyle(color: Colors.white), style: const TextStyle(color: Colors.white),
), ),
), ),
Positioned( Positioned(
@ -80,7 +80,7 @@ class FeedbackPage extends StatelessWidget {
bottom: 30.sp, bottom: 30.sp,
child: Text( child: Text(
controller.state.maxMsg, controller.state.maxMsg,
style: TextStyle(color: Colors.white), style: const TextStyle(color: Colors.white),
)) ))
], ],
), ),
@ -88,7 +88,7 @@ class FeedbackPage extends StatelessWidget {
height: 120.sp, height: 120.sp,
margin: EdgeInsets.only(left: 16.sp, right: 16.sp), margin: EdgeInsets.only(left: 16.sp, right: 16.sp),
child: GridView.builder( child: GridView.builder(
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 3, // crossAxisCount: 3, //
), ),
itemCount:controller.state.imaglist.length<3 ? controller.state.imaglist.length+1: controller.state.imaglist.length, // Replace with your item count itemCount:controller.state.imaglist.length<3 ? controller.state.imaglist.length+1: controller.state.imaglist.length, // Replace with your item count
@ -125,14 +125,14 @@ class FeedbackPage extends StatelessWidget {
), ),
), ),
Padding( Padding(
padding: EdgeInsets.only(left: 16, top: 10), padding: EdgeInsets.only(left: 16.sp, top: 10.sp),
child: Text( child: Text(
'最多选择3张图片', '最多选择3张图片',
style: style:
TextStyle(color: Color(0xFFB7BECC), fontSize: 12), TextStyle(color: const Color(0xFFB7BECC), fontSize: 12.sp),
), ),
), ),
SizedBox(height: 50), SizedBox(height: 50.sp),
GestureDetector( GestureDetector(
onTap: () { onTap: () {
// showToast("完善资料"); // showToast("完善资料");
@ -143,8 +143,8 @@ class FeedbackPage extends StatelessWidget {
child: Center( child: Center(
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(21), borderRadius: BorderRadius.circular(21.sp),
gradient: LinearGradient( gradient: const LinearGradient(
colors: [ colors: [
Color(0xFF06F9FA), Color(0xFF06F9FA),
Color(0xFFDC5BFD), Color(0xFFDC5BFD),
@ -159,7 +159,7 @@ class FeedbackPage extends StatelessWidget {
"提交", "提交",
style: TextStyle( style: TextStyle(
color: Colors.white, color: Colors.white,
fontSize: 12, fontSize: 12.sp,
), ),
), ),
), ),
@ -179,7 +179,7 @@ class FeedbackPage extends StatelessWidget {
children: [ children: [
ClipRRect( ClipRRect(
borderRadius: BorderRadius.circular(0.0), borderRadius: BorderRadius.circular(0.0),
child: Container( child: SizedBox(
width: double.infinity, // width: double.infinity, //
height: double.infinity, // height: double.infinity, //
child: ClipRRect( child: ClipRRect(

View File

@ -27,7 +27,7 @@ class FriendslistPage extends StatelessWidget {
), ),
child: Scaffold( child: Scaffold(
backgroundColor: Colors.transparent, backgroundColor: Colors.transparent,
appBar: MyAppBar( appBar: const MyAppBar(
centerTitle: "我喜欢的", centerTitle: "我喜欢的",
), ),
body: SafeArea( body: SafeArea(
@ -84,7 +84,7 @@ class FriendslistPage extends StatelessWidget {
left: 0, left: 0,
bottom: 0, bottom: 0,
child: item.vip!=null&&item.vip>0 ? child: item.vip>0 ?
Image( Image(
image: AssetImage(getBaseImage("vip")), image: AssetImage(getBaseImage("vip")),
width: 44.sp, width: 44.sp,
@ -113,7 +113,7 @@ class FriendslistPage extends StatelessWidget {
width: 150.sp, width: 150.sp,
child: Text( child: Text(
item.signature, item.signature,
style: TextStyle(fontSize: 12.sp, color: Color(0xFFB7BECC)), style: TextStyle(fontSize: 12.sp, color: const Color(0xFFB7BECC)),
), ),
), ),
], ],
@ -128,12 +128,12 @@ class FriendslistPage extends StatelessWidget {
width: 75, width: 75,
height: 28, height: 28,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Color(0xFFFF4D7C), color: const Color(0xFFFF4D7C),
borderRadius: BorderRadius.circular(14), borderRadius: BorderRadius.circular(14),
), ),
child: child:
Center( Center(
child: Text(item.isLike?"取消喜欢":"喜欢", style: TextStyle(fontSize: 14, color: Colors.white)), child: Text(item.isLike?"取消喜欢":"喜欢", style: TextStyle(fontSize: 14.sp, color: Colors.white)),
), ),
), ),
), ),
@ -145,14 +145,14 @@ class FriendslistPage extends StatelessWidget {
Widget _buildInfoRow(UserInfo userInfoBean) { Widget _buildInfoRow(UserInfo userInfoBean) {
String ageMsg = getAgeCOntent(userInfoBean!.gender, userInfoBean!.age, String ageMsg = getAgeCOntent(userInfoBean.gender, userInfoBean.age,
userInfoBean!.role, userInfoBean!.orientation); userInfoBean.role, userInfoBean.orientation);
return Row( return Row(
children: [ children: [
Container( Container(
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(17), borderRadius: BorderRadius.circular(17),
gradient: LinearGradient( gradient: const LinearGradient(
colors: [ colors: [
Color.fromRGBO(141, 255, 248, 1.0), Color.fromRGBO(141, 255, 248, 1.0),
Color.fromRGBO(181, 211, 255, 1.0), Color.fromRGBO(181, 211, 255, 1.0),
@ -167,7 +167,7 @@ class FriendslistPage extends StatelessWidget {
ageMsg , ageMsg ,
style: TextStyle( style: TextStyle(
color: Colors.black, color: Colors.black,
fontSize: 10, fontSize: 10.sp,
), ),
), ),
), ),

View File

@ -1,16 +1,10 @@
import 'dart:io';
import 'package:circle_app/app/minefragment/view.dart';
import 'package:circle_app/app/circle/view.dart';
import 'package:circle_app/app/msg/view.dart';
import 'package:circle_app/router/app_routers.dart';
import 'package:circle_app/util/util.dart'; import 'package:circle_app/util/util.dart';
import 'package:circle_app/view/ExitAppConfirmation.dart'; import 'package:circle_app/view/ExitAppConfirmation.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import '../../router/app_routers.dart';
import 'logic.dart'; import 'logic.dart';
class HomePage extends StatefulWidget { class HomePage extends StatefulWidget {
@ -43,7 +37,7 @@ class _HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin
// color: Colors.red, // color: Colors.red,
padding: EdgeInsets.only(left: 50.sp, right: 50.sp, top: 8.sp), padding: EdgeInsets.only(left: 50.sp, right: 50.sp, top: 8.sp),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Color(0xFF423055), color: const Color(0xFF423055),
image: DecorationImage( image: DecorationImage(
fit: BoxFit.fill, fit: BoxFit.fill,
image: AssetImage( image: AssetImage(
@ -82,14 +76,12 @@ class _HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin
controller.updateIndex(index); controller.updateIndex(index);
} }
}, },
child: Container( child: Image.asset(
child: Image.asset( isSelected
isSelected ? getTabbarImage('${image}_selected')
? getTabbarImage(image + '_selected') : getTabbarImage('${image}_normal'),
: getTabbarImage(image + '_normal'), width: 34.sp,
width: 34.sp, height: 34.sp,
height: 34.sp,
),
), ),
); );
} }

View File

@ -25,7 +25,7 @@ class Complete_materialPage extends StatelessWidget {
return GetBuilder(builder: (Complete_materialLogic controller) { return GetBuilder(builder: (Complete_materialLogic controller) {
return Stack( return Stack(
children: [ children: [
Container( SizedBox(
width: MediaQuery.of(context).size.width, width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.height, height: MediaQuery.of(context).size.height,
child: Image.asset( child: Image.asset(
@ -227,7 +227,7 @@ class Complete_materialPage extends StatelessWidget {
child: Text( child: Text(
controller.type == "user" ? "完成" : '开启小圈之旅', controller.type == "user" ? "完成" : '开启小圈之旅',
style: TextStyle( style: TextStyle(
color: Color(0xff00FFF4), color: const Color(0xff00FFF4),
fontSize: 16.sp, fontSize: 16.sp,
fontWeight: FontWeight.w600), fontWeight: FontWeight.w600),
), ),
@ -267,7 +267,7 @@ class Complete_materialPage extends StatelessWidget {
fontSize: 16.sp, fontSize: 16.sp,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
shadows: [ shadows: [
Shadow(color: Color(0xffF657FF), blurRadius: 4.0.sp) Shadow(color: const Color(0xffF657FF), blurRadius: 4.0.sp)
])), ])),
Expanded( Expanded(
child: Padding( child: Padding(
@ -299,7 +299,7 @@ class Complete_materialPage extends StatelessWidget {
} }
interestWdiget(String interest, Complete_materialLogic controller) { interestWdiget(String interest, Complete_materialLogic controller) {
return Container( return SizedBox(
height: 59.sp, height: 59.sp,
width: 240.sp, width: 240.sp,
child: ListView.builder( child: ListView.builder(
@ -312,20 +312,20 @@ class Complete_materialPage extends StatelessWidget {
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(17.0), // borderRadius: BorderRadius.circular(17.0), //
gradient: LinearGradient( gradient: const LinearGradient(
colors: [ colors: [
Color(0xFF06F9FA), Color(0xFF06F9FA),
Color(0xFFDC5BFD), Color(0xFFDC5BFD),
], ],
), ),
color: Color(0xFF392D53), color: const Color(0xFF392D53),
), ),
child: Container( child: Container(
margin: EdgeInsets.all(0.5.sp), margin: EdgeInsets.all(0.5.sp),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(17.0), borderRadius: BorderRadius.circular(17.0),
// shape: BoxShape.circle, // shape: BoxShape.circle,
color: Color(0xFF392D53), color: const Color(0xFF392D53),
), ),
child: Padding( child: Padding(
padding: EdgeInsets.only( padding: EdgeInsets.only(
@ -334,7 +334,7 @@ class Complete_materialPage extends StatelessWidget {
child: Text( child: Text(
controller.numbers[index].name, controller.numbers[index].name,
style: TextStyle( style: TextStyle(
fontSize: 11.0, fontSize: 11.sp,
color: Colors.white, color: Colors.white,
), ),
), ),
@ -386,7 +386,7 @@ class Complete_materialPage extends StatelessWidget {
onConfirm: (p) { onConfirm: (p) {
String month = p.month! < 10 ? '0${p.month!}' : p.month!.toString(); String month = p.month! < 10 ? '0${p.month!}' : p.month!.toString();
String day = p.day! < 10 ? '0${p.day!}' : p.day!.toString(); String day = p.day! < 10 ? '0${p.day!}' : p.day!.toString();
var time = '${p.year}-${month}-${day}'; var time = '${p.year}-$month-$day';
controller.state.age = controller.getAge(p); controller.state.age = controller.getAge(p);
controller.state.brithday = time; controller.state.brithday = time;
controller.update(); controller.update();

View File

@ -1,13 +1,10 @@
import 'dart:math';
import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart';
import '../../components/my_app_bar.dart'; import '../../components/my_app_bar.dart';
import '../../router/app_routers.dart';
import '../../util/util.dart'; import '../../util/util.dart';
import 'logic.dart'; import 'logic.dart';
@ -33,6 +30,8 @@ class MyfeedbacklistPage extends StatelessWidget {
body: SafeArea( body: SafeArea(
child: logic.isLoad ? loaddingWidget(true) : logic.lists.isEmpty ? noResultWidget() : SmartRefresher( child: logic.isLoad ? loaddingWidget(true) : logic.lists.isEmpty ? noResultWidget() : SmartRefresher(
controller: logic.refreshController, controller: logic.refreshController,
onRefresh: _onRefresh,
onLoading: _onLoading,
child: ListView.builder( child: ListView.builder(
itemCount: logic.lists.length, itemCount: logic.lists.length,
@ -42,8 +41,6 @@ class MyfeedbacklistPage extends StatelessWidget {
); );
}, },
), ),
onRefresh: _onRefresh,
onLoading: _onLoading,
), ),
),), ),),
); );
@ -59,7 +56,7 @@ class MyfeedbacklistPage extends StatelessWidget {
margin: EdgeInsets.only(bottom: 12.0.sp,top: 12.sp), margin: EdgeInsets.only(bottom: 12.0.sp,top: 12.sp),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8.0.sp), borderRadius: BorderRadius.circular(8.0.sp),
color: Color(0xff282733), color: const Color(0xff282733),
), ),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -69,7 +66,7 @@ class MyfeedbacklistPage extends StatelessWidget {
padding: padding:
EdgeInsets.symmetric(vertical: 16.0.sp, horizontal: 16.0.sp), EdgeInsets.symmetric(vertical: 16.0.sp, horizontal: 16.0.sp),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Color(0xff282733), color: const Color(0xff282733),
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
topLeft: Radius.circular(8.0.sp), topLeft: Radius.circular(8.0.sp),
topRight: Radius.circular(8.0.sp), topRight: Radius.circular(8.0.sp),
@ -83,10 +80,10 @@ class MyfeedbacklistPage extends StatelessWidget {
), ),
), ),
), ),
Container( SizedBox(
height: 120.sp, height: 120.sp,
child: GridView.builder( child: GridView.builder(
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 3, // crossAxisCount: 3, //
), ),
itemCount:item.album.length, // Replace with your item count itemCount:item.album.length, // Replace with your item count
@ -127,7 +124,7 @@ class MyfeedbacklistPage extends StatelessWidget {
Widget _buildImageItem(String url, MyfeedbacklistLogic controller, int index) { Widget _buildImageItem(String url, MyfeedbacklistLogic controller, int index) {
return ClipRRect( return ClipRRect(
borderRadius: BorderRadius.circular(0.0), borderRadius: BorderRadius.circular(0.0),
child: Container( child: SizedBox(
width: double.infinity, // width: double.infinity, //
height: double.infinity, // height: double.infinity, //
child: ClipRRect( child: ClipRRect(

View File

@ -34,7 +34,7 @@ class _OffaccountState extends State<OffaccountPage> {
} }
void startCountdown() { void startCountdown() {
timer = Timer.periodic(Duration(seconds: 1), (Timer t) { timer = Timer.periodic(const Duration(seconds: 1), (Timer t) {
setState(() { setState(() {
if (countdown > 0) { if (countdown > 0) {
countdown--; countdown--;
@ -69,7 +69,7 @@ class _OffaccountState extends State<OffaccountPage> {
), ),
child: Scaffold( child: Scaffold(
backgroundColor: Colors.transparent, backgroundColor: Colors.transparent,
appBar: MyAppBar(centerTitle: '注销账号'), appBar: const MyAppBar(centerTitle: '注销账号'),
body: Scaffold( body: Scaffold(
backgroundColor: Colors.transparent, backgroundColor: Colors.transparent,
body: SingleChildScrollView( body: SingleChildScrollView(
@ -90,28 +90,28 @@ class _OffaccountState extends State<OffaccountPage> {
Text( Text(
"1、无法登录app", "1、无法登录app",
style: TextStyle( style: TextStyle(
color: Color(0xFFB7BECC), color: const Color(0xFFB7BECC),
fontSize: 12.sp, fontSize: 12.sp,
), ),
), ),
Text( Text(
"2、所有信息将被永远删除身份信息、账户信息、会员、喊话、相册等内容", "2、所有信息将被永远删除身份信息、账户信息、会员、喊话、相册等内容",
style: TextStyle( style: TextStyle(
color: Color(0xFFB7BECC), color: const Color(0xFFB7BECC),
fontSize: 12.sp, fontSize: 12.sp,
), ),
), ),
Text( Text(
"3、您的好友无法与你取得联系(包括关注、粉丝等);", "3、您的好友无法与你取得联系(包括关注、粉丝等);",
style: TextStyle( style: TextStyle(
color: Color(0xFFB7BECC), color: const Color(0xFFB7BECC),
fontSize: 12.sp, fontSize: 12.sp,
), ),
), ),
Text( Text(
"4、注销后一个月内该手机号将无法注册新的账号。", "4、注销后一个月内该手机号将无法注册新的账号。",
style: TextStyle( style: TextStyle(
color: Color(0xFFB7BECC), color: const Color(0xFFB7BECC),
fontSize: 12.sp, fontSize: 12.sp,
), ),
), ),
@ -121,7 +121,7 @@ class _OffaccountState extends State<OffaccountPage> {
Text( Text(
"请输入绑定的手机号", "请输入绑定的手机号",
style: TextStyle( style: TextStyle(
color: Color(0xFF898F99), color: const Color(0xFF898F99),
fontSize: 10.sp, fontSize: 10.sp,
), ),
), ),
@ -140,7 +140,7 @@ class _OffaccountState extends State<OffaccountPage> {
fontSize: 14.sp, fontSize: 14.sp,
), ),
filled: true, filled: true,
fillColor: Color(0xFF000000), fillColor: const Color(0xFF000000),
border: OutlineInputBorder( border: OutlineInputBorder(
borderRadius: BorderRadius.circular(4), borderRadius: BorderRadius.circular(4),
borderSide: BorderSide.none, borderSide: BorderSide.none,
@ -159,7 +159,7 @@ class _OffaccountState extends State<OffaccountPage> {
Text( Text(
"请选择你的注销原因", "请选择你的注销原因",
style: TextStyle( style: TextStyle(
color: Color(0xFF898F99), color: const Color(0xFF898F99),
fontSize: 10.sp, fontSize: 10.sp,
), ),
), ),
@ -173,7 +173,7 @@ class _OffaccountState extends State<OffaccountPage> {
margin: EdgeInsets.only(top: 10.sp), margin: EdgeInsets.only(top: 10.sp),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(4.sp), borderRadius: BorderRadius.circular(4.sp),
color: Color(0xFF000000), color: const Color(0xFF000000),
), ),
child: Row( child: Row(
children: [ children: [
@ -183,14 +183,14 @@ class _OffaccountState extends State<OffaccountPage> {
decoration: InputDecoration( decoration: InputDecoration(
hintText: logic.state.offReasonMsg, hintText: logic.state.offReasonMsg,
hintStyle: TextStyle( hintStyle: TextStyle(
color: Color(0xFFF7FAFA), color: const Color(0xFFF7FAFA),
fontSize: 14.sp, fontSize: 14.sp,
), ),
border: InputBorder.none, border: InputBorder.none,
contentPadding: EdgeInsets.only(left: 16.sp), contentPadding: EdgeInsets.only(left: 16.sp),
), ),
style: TextStyle( style: TextStyle(
color: Color(0xFFF7FAFA), color: const Color(0xFFF7FAFA),
fontSize: 14.sp, fontSize: 14.sp,
), ),
), ),
@ -213,18 +213,15 @@ class _OffaccountState extends State<OffaccountPage> {
}, child: Align( }, child: Align(
alignment: Alignment.bottomCenter, alignment: Alignment.bottomCenter,
child: Container( child: SizedBox(
width: 160.sp, width: 160.sp,
child: ElevatedButton( child: ElevatedButton(
onPressed: (){ onPressed: (){
handleLogout(logic); handleLogout(logic);
}, },
child: Text(
countdown > 0 ? "注销($countdown s" : "注销",
),
style: ButtonStyle( style: ButtonStyle(
backgroundColor: MaterialStateProperty.all<Color>( backgroundColor: MaterialStateProperty.all<Color>(
countdown > 0 ? Colors.grey : Color(0xFF21BEAB), countdown > 0 ? Colors.grey : const Color(0xFF21BEAB),
), ),
shape: MaterialStateProperty.all<OutlinedBorder>( shape: MaterialStateProperty.all<OutlinedBorder>(
RoundedRectangleBorder( RoundedRectangleBorder(
@ -232,6 +229,9 @@ class _OffaccountState extends State<OffaccountPage> {
), ),
), ),
), ),
child: Text(
countdown > 0 ? "注销($countdown s" : "注销",
),
), ),
), ),
),) ),)
@ -304,7 +304,7 @@ class _OffaccountState extends State<OffaccountPage> {
child: Text( child: Text(
title, title,
style: TextStyle( style: TextStyle(
fontSize: 16, fontSize: 16.sp,
color: Colors.white, color: Colors.white,
), ),
), ),

View File

@ -1,5 +1,4 @@
import 'dart:async';
import 'dart:math';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
@ -53,7 +52,7 @@ class PhotoinfoPage extends StatelessWidget {
), ),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(4.0.sp), borderRadius: BorderRadius.circular(4.0.sp),
color: Color(0xff282733), color: const Color(0xff282733),
), ),
height: 40.0.sp, height: 40.0.sp,
child: Row( child: Row(
@ -156,7 +155,7 @@ class PhotoinfoPage extends StatelessWidget {
EdgeInsets.fromLTRB(16.0.sp, 20.0.sp, 16.0.sp, 0.0.sp), EdgeInsets.fromLTRB(16.0.sp, 20.0.sp, 16.0.sp, 0.0.sp),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(4.0.sp), borderRadius: BorderRadius.circular(4.0.sp),
color: Color(0xff282733), color: const Color(0xff282733),
), ),
height: 40.0.sp, height: 40.0.sp,
child: Row( child: Row(
@ -218,7 +217,7 @@ class PhotoinfoPage extends StatelessWidget {
16.0.sp, 20.0.sp, 8.0.sp, 0.0.sp), 16.0.sp, 20.0.sp, 8.0.sp, 0.0.sp),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(4.0.sp), borderRadius: BorderRadius.circular(4.0.sp),
color: Color(0xff282733), color: const Color(0xff282733),
), ),
height: 40.0.sp, height: 40.0.sp,
child: Row( child: Row(
@ -274,7 +273,7 @@ class PhotoinfoPage extends StatelessWidget {
8.0.sp, 20.0.sp, 16.0.sp, 0.0.sp), 8.0.sp, 20.0.sp, 16.0.sp, 0.0.sp),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(4.0.sp), borderRadius: BorderRadius.circular(4.0.sp),
color: Color(0xff282733), color: const Color(0xff282733),
), ),
height: 40.0.sp, height: 40.0.sp,
child: Center( child: Center(

View File

@ -27,13 +27,13 @@ class SetupPage extends StatelessWidget {
), ),
child: Scaffold( child: Scaffold(
backgroundColor: Colors.transparent, backgroundColor: Colors.transparent,
appBar: MyAppBar(centerTitle: '设置',), appBar: const MyAppBar(centerTitle: '设置',),
body: SafeArea( body: SafeArea(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Row( Row(
children: [ children: const [
// GestureDetector( // GestureDetector(
// onTap: () { // onTap: () {
// //
@ -71,14 +71,19 @@ class SetupPage extends StatelessWidget {
// SizedBox(height: 16.sp), // SizedBox(height: 16.sp),
// _buildItemRow('聊天设置', getHomeImage("icon_in")), // _buildItemRow('聊天设置', getHomeImage("icon_in")),
// SizedBox(height: 16.sp), // SizedBox(height: 16.sp),
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () { // GestureDetector(
Get.toNamed(AppRoutes.PrivacyActivity); // behavior: HitTestBehavior.opaque,
}, // onTap: () {
child: _buildItemRow('隐私设置', getHomeImage("icon_in")), // Get.toNamed(AppRoutes.PrivacyActivity);
), // },
SizedBox(height: 16.sp), // child: _buildItemRow('隐私设置', getHomeImage("icon_in")),
// ),
// SizedBox(height: 16.sp),
GestureDetector( GestureDetector(
behavior: HitTestBehavior.opaque, behavior: HitTestBehavior.opaque,
onTap: () { onTap: () {
@ -122,11 +127,11 @@ class SetupPage extends StatelessWidget {
Text( Text(
text, text,
style: TextStyle( style: TextStyle(
color: Color(0xFFF7FAFA), // #fff7fafa color: const Color(0xFFF7FAFA), // #fff7fafa
fontSize: 16.sp, // 16sp fontSize: 16.sp, // 16sp
), ),
), ),
Spacer(), const Spacer(),
Image.asset( Image.asset(
imagePath, imagePath,
width: 20.sp, // width: 20.sp, //
@ -147,16 +152,16 @@ class SetupPage extends StatelessWidget {
Text( Text(
text, text,
style: TextStyle( style: TextStyle(
color: Color(0xFFF7FAFA), // #fff7fafa color: const Color(0xFFF7FAFA), // #fff7fafa
fontSize: 16.sp, // 16sp fontSize: 16.sp, // 16sp
), ),
), ),
Spacer(), const Spacer(),
// _getFormat(context), // _getFormat(context),
Text( Text(
logic.cache, // 'XXX' logic.cache, // 'XXX'
style: TextStyle( style: TextStyle(
color: Color(0xFFB7BECC), // #ffb7becc color: const Color(0xFFB7BECC), // #ffb7becc
fontSize: 14.sp, // 14sp fontSize: 14.sp, // 14sp
), ),
), ),

View File

@ -21,7 +21,7 @@ class _WebViewContainerState extends State<WebviewPage> {
final url = Get.arguments['url']; final url = Get.arguments['url'];
var controller = WebViewController() var controller = WebViewController()
..setJavaScriptMode(JavaScriptMode.unrestricted) ..setJavaScriptMode(JavaScriptMode.unrestricted)
..setBackgroundColor( Colors.transparent) ..setBackgroundColor(Colors.white)
..setNavigationDelegate( ..setNavigationDelegate(
NavigationDelegate( NavigationDelegate(
onProgress: (int progress) { onProgress: (int progress) {
@ -57,6 +57,7 @@ class _WebViewContainerState extends State<WebviewPage> {
Expanded( Expanded(
child: WebViewWidget( child: WebViewWidget(
controller: controller, controller: controller,
), ),
), ),
], ],
@ -66,5 +67,7 @@ class _WebViewContainerState extends State<WebviewPage> {
); );
}); });
} }
} }

View File

@ -247,12 +247,17 @@ class Open_vip_tipPage extends StatelessWidget {
SizedBox( SizedBox(
width: 2.sp, width: 2.sp,
), ),
Text( GestureDetector(
'《合伙人协议》', onTap: (){
style: TextStyle( navigateToPartnerAgreement();
color: const Color(0xff00FFF4), },
fontSize: 11.sp, child: Text(
fontWeight: FontWeight.w400, '《合伙人协议》',
style: TextStyle(
color: const Color(0xff00FFF4),
fontSize: 11.sp,
fontWeight: FontWeight.w400,
),
), ),
), ),
], ],

View File

@ -107,7 +107,7 @@ double calculateTextHeight(String value, fontSize, FontWeight fontWeight,
TextPainter painter = TextPainter( TextPainter painter = TextPainter(
///AUTOlocale的时候 ///AUTOlocale的时候
locale: WidgetsBinding.instance!.window.locale, locale: WidgetsBinding.instance.window.locale,
maxLines: maxLines, maxLines: maxLines,
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
textScaleFactor: 1, textScaleFactor: 1,
@ -267,20 +267,35 @@ Future<String> getLibraryDirectoryPath() async {
} }
// //
navigateToUserAgreement() { void navigateToUserAgreement() {
Get.toNamed(AppRoutes.WebViewActivity, arguments: { Get.toNamed(AppRoutes.WebViewActivity, arguments: {
'title': "用户协议", 'title': "用户协议",
"url": "https://docs.qq.com/doc/DZVV1SkttZGlPUW1H" "url": Platform.isIOS?"https://docs.qq.com/doc/DZVV1SkttZGlPUW1H":"https://iquanpai.com/app-h5/4_163.html"
}); });
} }
// //
navigateToPrivacyPolicy() { void navigateToPrivacyPolicy() {
Get.toNamed(AppRoutes.WebViewActivity, arguments: { Get.toNamed(AppRoutes.WebViewActivity, arguments: {
'title': "隐私协议", 'title': "隐私协议",
"url": "https://docs.qq.com/doc/DZXhvcXV6b1RNTUx1" "url": Platform.isIOS?"https://docs.qq.com/doc/DZXhvcXV6b1RNTUx1":"https://iquanpai.com/app-h5/4_164.html"
});
}
//
void navigateToContentGuidelines() {
Get.toNamed(AppRoutes.WebViewActivity, arguments: {
'title': "发布内容规范",
"url": Platform.isIOS?"https://docs.qq.com/doc/DZVhLamZDQnJ0eHds":"https://iquanpai.com/app-h5/4_165.html"
}); });
} }
//
// //
void navigateToPartnerAgreement() {
Get.toNamed(AppRoutes.WebViewActivity, arguments: {
'title': "合伙人协议",
"url": Platform.isIOS?"https://docs.qq.com/doc/DZUpwWFdNcGlsYld4":"https://iquanpai.com/app-h5/4_166.html"
});
}