You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

245 lines
6.9 KiB

import 'dart:ui';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter/services.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:flutter/cupertino.dart';
import '../../generated/l10n.dart';
import '../../retrofit/data/base_data.dart';
import '../../utils/font_weight.dart';
class ContactsShare extends StatefulWidget {
final Map<String, dynamic> arguments;
ContactsShare({this.arguments});
@override
State<StatefulWidget> createState() {
return _ContactsShare();
}
}
class _ContactsShare extends State<ContactsShare> {
ApiService apiService;
final TextEditingController searchController = TextEditingController();
int searchIndex = 0;
@override
void initState() {
super.initState();
}
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Color(0xFFF9FAF7),
appBar: MyAppBar(
background: Color(0xFFFFFFFFF),
leadingColor: Colors.white,
title: "私信给",
titleSize: 18,
titleColor: Colors.black,
),
body: Container(
margin: EdgeInsets.only(top:14.h),
color: Colors.white,
child:SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: GestureDetector(
behavior: HitTestBehavior.translucent,
onTap: () {
FocusScope.of(context).requestFocus(FocusNode());
},
child:Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
contactSearch(),
Padding(
padding: EdgeInsets.only(left: 17.w,bottom:24.h),
child: Text("最近联系(0)",
style: TextStyle(
fontSize: 17.sp,
color: Color(0xFF0D0D0D),
fontWeight: MyFontWeight.regular,
)),
),
recentList(),
Padding(
padding: EdgeInsets.only(left: 17.w,bottom:24.h),
child: Text("我的关注(0)",
style: TextStyle(
fontSize: 17.sp,
color: Color(0xFF0D0D0D),
fontWeight: MyFontWeight.regular,
)),
),
mineFollowList(),
],
)),)
),
);
}
Widget contactSearch() {
return Container(
width: double.infinity,
margin: EdgeInsets.only(left: 16.w, right: 16.w, top: 4.h, bottom: 16.h),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(6.w),
color: Color(0xFFF9FAF7),
),
child: Stack(
alignment: Alignment.center,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Image.asset(
"assets/image/icon_search.webp",
fit: BoxFit.fill,
),
SizedBox(
width: 4.w,
),
Text("搜索",
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFFB3B3B3),
fontWeight: MyFontWeight.regular,
)),
],
),
TextField(
textInputAction: TextInputAction.search,
enableInteractiveSelection: true,
onEditingComplete: () {
},
controller: searchController,
cursorHeight: 25.h,
decoration: InputDecoration(
contentPadding: EdgeInsets.only(top: 7.h, bottom: 9.h,left:5.w),
border: InputBorder.none,
),
)
],
)
);
}
Widget recentList() {
return ListView.builder(
itemCount: 6,
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
itemBuilder: (context, position) {
return GestureDetector(
onTap: () {},
child: recentItem(),
);
});
}
Widget recentItem() {
return Container(
margin: EdgeInsets.only(bottom: 14.h),
padding: EdgeInsets.only(left: 16.w,right: 14.w),
child:Column(
children: [
Row(
children: [
// MImage(
// "",
// isCircle: true,
// width: 44,
// height: 44,
// fit: BoxFit.cover,
// errorSrc: "assets/image/default_1.webp",
// fadeSrc: "assets/image/default_1.webp",
// ),
Image.asset(
"assets/image/fuka_zj.webp",
height:44,
width:44,
),
SizedBox(width: 10.w,),
Text("张五",
style: TextStyle(
fontSize: 14.sp,
color: Color(0xFF1A1A1A),
fontWeight: MyFontWeight.bold,
)),
],
),
Container(
height: 1.h,
width: double.infinity,
color: Color(0xFFF7F7F7),
margin: EdgeInsets.only(left:54.w,top: 10.h),
)
],
)
);
}
Widget mineFollowList() {
return ListView.builder(
itemCount: 3,
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
itemBuilder: (context, position) {
return GestureDetector(
onTap: () {},
child: recentItem(),
);
});
}
Widget mineFollowItem() {
return Container(
margin: EdgeInsets.only(bottom: 14.h),
padding: EdgeInsets.only(left: 16.w,right: 14.w),
child:Column(
children: [
Row(
children: [
// MImage(
// "",
// isCircle: true,
// width: 44,
// height: 44,
// fit: BoxFit.cover,
// errorSrc: "assets/image/default_1.webp",
// fadeSrc: "assets/image/default_1.webp",
// ),
Image.asset(
"assets/image/fuka_zj.webp",
height:44,
width:44,
),
SizedBox(width: 10.w,),
Text("小王",
style: TextStyle(
fontSize: 14.sp,
color: Color(0xFF1A1A1A),
fontWeight: MyFontWeight.bold,
)),
],
),
Container(
height: 1.h,
width: double.infinity,
color: Color(0xFFF7F7F7),
margin: EdgeInsets.only(left:54.w,top: 10.h),
)
],
)
);
}
}