附近还没接口
This commit is contained in:
parent
40a0eea463
commit
491900a054
BIN
circle_app/assets/images/base/icon_white_vip.png
Normal file
BIN
circle_app/assets/images/base/icon_white_vip.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.0 KiB |
BIN
circle_app/assets/images/base/icon_white_yearvip.png
Normal file
BIN
circle_app/assets/images/base/icon_white_yearvip.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.8 KiB |
BIN
circle_app/assets/images/circle/icon_city.png
Normal file
BIN
circle_app/assets/images/circle/icon_city.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.3 KiB |
BIN
circle_app/assets/images/circle/icon_list_null.png
Normal file
BIN
circle_app/assets/images/circle/icon_list_null.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 334 KiB |
BIN
circle_app/assets/images/circle/icon_screen.png
Normal file
BIN
circle_app/assets/images/circle/icon_screen.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.3 KiB |
5359
circle_app/assets/province.json
Normal file
5359
circle_app/assets/province.json
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,12 +1,20 @@
|
|||||||
|
import 'dart:convert';
|
||||||
|
|
||||||
import 'package:circle_app/main.dart';
|
import 'package:circle_app/main.dart';
|
||||||
import 'package:circle_app/router/app_routers.dart';
|
import 'package:circle_app/router/app_routers.dart';
|
||||||
|
import 'package:circle_app/util/device.dart';
|
||||||
import 'package:circle_app/util/util.dart';
|
import 'package:circle_app/util/util.dart';
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter/services.dart';
|
||||||
|
import 'package:flutter_swiper/flutter_swiper.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
import 'package:pull_to_refresh/pull_to_refresh.dart';
|
||||||
import '../../common/Widgets/open_vip_tip/view.dart';
|
import '../../common/Widgets/open_vip_tip/view.dart';
|
||||||
import '../../network/api.dart';
|
import '../../network/api.dart';
|
||||||
import '../../network/dio_manager.dart';
|
import '../../network/dio_manager.dart';
|
||||||
|
import '../../util/eventBus.dart';
|
||||||
|
import '../select_circle/logic.dart';
|
||||||
import 'state.dart';
|
import 'state.dart';
|
||||||
import 'package:scroll_to_index/scroll_to_index.dart';
|
import 'package:scroll_to_index/scroll_to_index.dart';
|
||||||
|
|
||||||
@ -14,6 +22,8 @@ class CircleLogic extends GetxController {
|
|||||||
|
|
||||||
PageController pageController =
|
PageController pageController =
|
||||||
PageController(initialPage: 1, viewportFraction: 0.8);
|
PageController(initialPage: 1, viewportFraction: 0.8);
|
||||||
|
SwiperController swiperController = SwiperController();
|
||||||
|
final RefreshController refreshController = RefreshController();
|
||||||
InterestsBean circle = InterestsBean(lists: []);
|
InterestsBean circle = InterestsBean(lists: []);
|
||||||
final CircleState state = CircleState();
|
final CircleState state = CircleState();
|
||||||
var statistics = Rx<DataModel>(DataModel(visitCount: 0, lastVisitUsers: [], likeMeCount: 0));
|
var statistics = Rx<DataModel>(DataModel(visitCount: 0, lastVisitUsers: [], likeMeCount: 0));
|
||||||
@ -21,6 +31,12 @@ class CircleLogic extends GetxController {
|
|||||||
int page = 1;
|
int page = 1;
|
||||||
|
|
||||||
bool isMore = true;
|
bool isMore = true;
|
||||||
|
int myVip = 0;
|
||||||
|
bool isShowCircle = true;
|
||||||
|
String cityName = "全国";
|
||||||
|
|
||||||
|
|
||||||
|
var bannerList = ["http://pics5.baidu.com/feed/622762d0f703918f751ba5e950ce8d915beec4c1.jpeg?token=ed435fd18c71cf7ca7a011acb70460f7"];
|
||||||
|
|
||||||
AutoScrollController scrollController = AutoScrollController();
|
AutoScrollController scrollController = AutoScrollController();
|
||||||
ScrollController listScrollController = ScrollController();
|
ScrollController listScrollController = ScrollController();
|
||||||
@ -39,8 +55,73 @@ class CircleLogic extends GetxController {
|
|||||||
}
|
}
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
myVip = await getVip();
|
||||||
loadCirclePeopleData();
|
loadCirclePeopleData();
|
||||||
|
initGerder();
|
||||||
|
getCityList();
|
||||||
|
EventBusManager.on<CommentVipEvent>().listen((event) {
|
||||||
|
myVip = event.vip;
|
||||||
|
// update();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
List<MyConfigData> genderList = [];
|
||||||
|
|
||||||
|
List<MyConfigData> orientationList = [];
|
||||||
|
|
||||||
|
List<MyConfigData> roleList = [];
|
||||||
|
|
||||||
|
void initGerder() async {
|
||||||
|
var data1 =
|
||||||
|
await DioManager.instance.get(url: Api.getCircleList, params: {});
|
||||||
|
var bean1 = BaseResponse<ConfigBean>.fromJson(
|
||||||
|
data1, (data1) => ConfigBean.fromJson(data1));
|
||||||
|
|
||||||
|
ConfigBean configBean = bean1.data!;
|
||||||
|
|
||||||
|
configBean.genderMap.forEach((key, value) {
|
||||||
|
genderList.add(MyConfigData(key, value, false));
|
||||||
|
});
|
||||||
|
|
||||||
|
configBean.orientationMap.forEach((key, value) {
|
||||||
|
orientationList.add(MyConfigData(key, value, false));
|
||||||
|
});
|
||||||
|
configBean.roleMap.forEach((key, value) {
|
||||||
|
roleList.add(MyConfigData(key, value, false));
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
List<Province> provinceList = [];
|
||||||
|
|
||||||
|
|
||||||
|
Map cityMap = {};
|
||||||
|
|
||||||
|
|
||||||
|
getCityList() async {
|
||||||
|
try {
|
||||||
|
String jsonString = await rootBundle.loadString('assets/province.json');
|
||||||
|
List<dynamic> jsonData = json.decode(jsonString);
|
||||||
|
provinceList =
|
||||||
|
jsonData.map((dynamic item) => Province.fromJson(item)).toList();
|
||||||
|
cityMap.clear();
|
||||||
|
for (int i = 0; i < provinceList.length; i++) {
|
||||||
|
Map areaMap = {};
|
||||||
|
for (int c = 0; c < provinceList[i].city.length; c++) {
|
||||||
|
String cityName = provinceList[i].city[c].name;
|
||||||
|
List<String> cityAreaList = [];
|
||||||
|
provinceList[i].city[c].area.forEach((element) {
|
||||||
|
cityAreaList.add(element);
|
||||||
|
});
|
||||||
|
areaMap[cityName] = cityAreaList;
|
||||||
|
}
|
||||||
|
cityMap[provinceList[i].name] = areaMap;
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
print('Error loading JSON file: $e');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
loadMore() async {
|
loadMore() async {
|
||||||
@ -151,6 +232,11 @@ class CircleLogic extends GetxController {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class InterestsBean {
|
class InterestsBean {
|
||||||
@ -279,3 +365,46 @@ class DataModel {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
class Province {
|
||||||
|
String name;
|
||||||
|
List<CityBean> city;
|
||||||
|
|
||||||
|
Province({required this.name, required this.city});
|
||||||
|
|
||||||
|
factory Province.fromJson(Map<String, dynamic> json) {
|
||||||
|
List<dynamic> cityData = json['city'];
|
||||||
|
List<CityBean> cityList =
|
||||||
|
cityData.map((dynamic item) => CityBean.fromJson(item)).toList();
|
||||||
|
|
||||||
|
return Province(
|
||||||
|
name: json['name'],
|
||||||
|
city: cityList,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
String getPickerViewText() {
|
||||||
|
return this.name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class CityBean {
|
||||||
|
String name;
|
||||||
|
List<String> area;
|
||||||
|
|
||||||
|
CityBean({required this.name, required this.area});
|
||||||
|
|
||||||
|
factory CityBean.fromJson(Map<String, dynamic> json) {
|
||||||
|
List<dynamic> areaData = json['area'];
|
||||||
|
List<String> areaList =
|
||||||
|
areaData.map((dynamic item) => item.toString()).toList();
|
||||||
|
|
||||||
|
return CityBean(
|
||||||
|
name: json['name'],
|
||||||
|
area: areaList,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,14 +1,21 @@
|
|||||||
|
import 'dart:math';
|
||||||
|
|
||||||
|
import 'package:cached_network_image/cached_network_image.dart';
|
||||||
import 'package:circle_app/app/circle/widgets/info_list_view.dart';
|
import 'package:circle_app/app/circle/widgets/info_list_view.dart';
|
||||||
import 'package:circle_app/common/Widgets/open_vip_tip/view.dart';
|
import 'package:circle_app/app/dialog/ScreenBottomSheetDialog.dart';
|
||||||
import 'package:circle_app/router/app_routers.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:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_pickers/pickers.dart';
|
||||||
|
import 'package:flutter_pickers/style/default_style.dart';
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
import 'package:flutter_swiper/flutter_swiper.dart';
|
import 'package:flutter_swiper/flutter_swiper.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
import 'package:pull_to_refresh/pull_to_refresh.dart';
|
||||||
|
|
||||||
import '../../util/eventBus.dart';
|
import '../../util/eventBus.dart';
|
||||||
import '../select_circle/logic.dart';
|
import '../select_circle/logic.dart';
|
||||||
|
import '../userinfo/logic.dart';
|
||||||
import 'logic.dart';
|
import 'logic.dart';
|
||||||
|
|
||||||
class CirclePage extends StatefulWidget {
|
class CirclePage extends StatefulWidget {
|
||||||
@ -19,22 +26,42 @@ class CirclePage extends StatefulWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _CirclePageState extends State<CirclePage>
|
class _CirclePageState extends State<CirclePage>
|
||||||
with AutomaticKeepAliveClientMixin {
|
with SingleTickerProviderStateMixin {
|
||||||
|
late TabController _tabController;
|
||||||
|
late PageController _pageController;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
bool get wantKeepAlive => true;
|
bool get wantKeepAlive => true;
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
_pageController = PageController();
|
||||||
|
_tabController = TabController(length: 2, vsync: this);
|
||||||
|
_tabController.addListener(_handleTabChange);
|
||||||
|
}
|
||||||
|
|
||||||
|
void _handleTabChange() {
|
||||||
|
// 在这里可以执行滑动监听后的逻辑操作
|
||||||
|
// 比如根据当前选中的标签执行其他操作
|
||||||
|
// int currentIndex = .toString());
|
||||||
|
logic.isShowCircle = _tabController.index == 0;
|
||||||
|
logic.update();
|
||||||
|
}
|
||||||
|
|
||||||
// 是否需要缓存
|
// 是否需要缓存
|
||||||
final logic = Get.put(CircleLogic());
|
final logic = Get.put(CircleLogic());
|
||||||
|
|
||||||
final state = Get.find<CircleLogic>().state;
|
final state = Get.find<CircleLogic>().state;
|
||||||
|
|
||||||
var getContext;
|
var getContext;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void dispose() {
|
void dispose() {
|
||||||
// TODO: implement dispose
|
_tabController.removeListener(_handleTabChange); // 移除监听
|
||||||
|
_tabController.dispose();
|
||||||
|
_pageController.dispose();
|
||||||
super.dispose();
|
super.dispose();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -55,16 +82,427 @@ class _CirclePageState extends State<CirclePage>
|
|||||||
child: GetBuilder(builder: (CircleLogic controller) {
|
child: GetBuilder(builder: (CircleLogic controller) {
|
||||||
return Stack(
|
return Stack(
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Column(children: [
|
||||||
child: Column(children: [
|
Obx(() {
|
||||||
Container(
|
|
||||||
child: Obx(() {
|
|
||||||
return navigatorItem(controller.statistics.value);
|
return navigatorItem(controller.statistics.value);
|
||||||
}),
|
}),
|
||||||
),
|
|
||||||
// Text(controller.state.msg),
|
// Text(controller.state.msg),
|
||||||
//组件使用
|
//组件使用
|
||||||
|
]),
|
||||||
|
Container(
|
||||||
|
margin: EdgeInsets.only(top: 45.sp),
|
||||||
|
child: Expanded(
|
||||||
|
child: PageView(
|
||||||
|
controller: _pageController,
|
||||||
|
onPageChanged: (index) {
|
||||||
|
_tabController.animateTo(index);
|
||||||
|
print("index=" + index.toString());
|
||||||
|
},
|
||||||
|
children: [
|
||||||
|
circleList(controller),
|
||||||
|
vicinityList(controller),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
logic.isShowCircle
|
||||||
|
? Positioned(
|
||||||
|
bottom: 36.sp,
|
||||||
|
right: 10.sp,
|
||||||
|
child: GestureDetector(
|
||||||
|
onTap: () async {
|
||||||
|
List<MyConfigData> numbers = [];
|
||||||
|
numbers.add(MyConfigData(
|
||||||
|
logic.getCircleIndex().id.toString(),
|
||||||
|
logic.getCircleIndex().title!,
|
||||||
|
false));
|
||||||
|
var data = await Get.toNamed(
|
||||||
|
AppRoutes.Call_out,
|
||||||
|
arguments: {'numbers': numbers});
|
||||||
|
},
|
||||||
|
child: Image.asset(
|
||||||
|
getCircleImage('send_msg'),
|
||||||
|
width: 60.sp,
|
||||||
|
)))
|
||||||
|
: Center()
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget vicinityList(CircleLogic controller) {
|
||||||
|
return SmartRefresher(
|
||||||
|
controller: logic.refreshController,
|
||||||
|
onRefresh: _onRefresh,
|
||||||
|
onLoading: _onLoading,
|
||||||
|
enablePullUp: true,
|
||||||
|
child: ListView.builder(
|
||||||
|
padding: EdgeInsets.all(10.sp),
|
||||||
|
itemCount: logic.myVip == 0 ? 5 + 2 : 10 + 1,
|
||||||
|
itemBuilder: (context, index) {
|
||||||
|
if (index == 0) {
|
||||||
|
return bannerView(controller);
|
||||||
|
} else {
|
||||||
|
if (logic.myVip == 0 && index == 6) {
|
||||||
|
return showVipView();
|
||||||
|
} else {
|
||||||
|
return ListItem("", index);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget showVipView() {
|
||||||
|
return Container(
|
||||||
|
margin: EdgeInsets.only(top: 10.sp),
|
||||||
|
color: Color(0xB30B011B),
|
||||||
|
padding: EdgeInsets.symmetric(vertical: 14.sp, horizontal: 20.sp),
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Center(
|
||||||
|
child: Text(
|
||||||
|
"VIP特权",
|
||||||
|
style: TextStyle(color: Colors.white, fontSize: 16.sp),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
padding: EdgeInsets.only(top: 18.sp),
|
||||||
|
child: Text(
|
||||||
|
"开通VIP后,才能查看更多附近的圈友,也可以根据您的喜好、属性、角色、取向等筛选出想要认识的人,还可以获得其他十几种会员特权,拥有更多不一样的体验",
|
||||||
|
style: TextStyle(color: Colors.white, fontSize: 12.sp),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
GestureDetector(
|
||||||
|
onTap: () async {
|
||||||
|
logic.showRechargeDialog();
|
||||||
|
},
|
||||||
|
child: Center(
|
||||||
|
child: Container(
|
||||||
|
margin: EdgeInsets.only(top: 14.sp),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(17),
|
||||||
|
gradient: const LinearGradient(
|
||||||
|
colors: [
|
||||||
|
Color(0xFF06F9FA),
|
||||||
|
Color(0xFFDC5BFD),
|
||||||
|
],
|
||||||
|
begin: Alignment.centerLeft,
|
||||||
|
end: Alignment.centerRight,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
padding: EdgeInsets.symmetric(
|
||||||
|
vertical: 10.sp,
|
||||||
|
horizontal: 55.sp,
|
||||||
|
),
|
||||||
|
child: const Text(
|
||||||
|
"前往开通VIP",
|
||||||
|
style: TextStyle(
|
||||||
|
color: Colors.white,
|
||||||
|
fontSize: 12,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
))
|
||||||
|
],
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget ListItem(String item, int index) {
|
||||||
|
return Container(
|
||||||
|
margin: EdgeInsets.only(top: 10.sp),
|
||||||
|
// padding: EdgeInsets.only( left: 8.sp, right: 8.sp),
|
||||||
|
width: Get.width,
|
||||||
|
height: 200.sp,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
image: DecorationImage(
|
||||||
|
fit: BoxFit.fill,
|
||||||
|
image: AssetImage(
|
||||||
|
getCircleImage('pic_bg'),
|
||||||
|
))),
|
||||||
|
child: Stack(
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
margin: EdgeInsets.only(top: 1.sp, left: 1.sp, right: 1.sp),
|
||||||
|
child: ClipRRect(
|
||||||
|
borderRadius: BorderRadius.only(
|
||||||
|
topLeft: Radius.circular(10.sp),
|
||||||
|
topRight: Radius.circular(10.sp),
|
||||||
|
),
|
||||||
|
child: Image(
|
||||||
|
image: AssetImage(getCircleImage("icon_list_null")),
|
||||||
|
width: Get.width,
|
||||||
|
fit: BoxFit.fill,
|
||||||
|
height: 92.sp,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Column(children: [
|
||||||
|
Container(
|
||||||
|
margin: EdgeInsets.only(right: 2.sp),
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
margin: EdgeInsets.only(top: 6.sp, left: 8.sp),
|
||||||
|
width: 88.sp,
|
||||||
|
height: 88.sp,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(8.0),
|
||||||
|
gradient: const LinearGradient(
|
||||||
|
begin: Alignment.topCenter,
|
||||||
|
end: Alignment.bottomCenter,
|
||||||
|
colors: [
|
||||||
|
Color(0xFF71F3F2),
|
||||||
|
Color(0xFFF558FF),
|
||||||
|
],
|
||||||
|
stops: [0.0365, 0.9427],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
padding: EdgeInsets.all(2.sp),
|
||||||
|
child: ClipRRect(
|
||||||
|
borderRadius: BorderRadius.circular(8.0),
|
||||||
|
child: Image.network(logic.bannerList[0],
|
||||||
|
width: 88.sp, height: 88.sp, fit: BoxFit.cover),
|
||||||
|
),
|
||||||
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
|
child: SingleChildScrollView(
|
||||||
|
scrollDirection: Axis.horizontal,
|
||||||
|
child: Container(
|
||||||
|
|
||||||
|
margin: EdgeInsets.only(top: 6.sp),
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
for (int i = 0; i < 5; i++)
|
||||||
|
ListAlbumItem(logic.bannerList[0], i),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
margin: EdgeInsets.only(top: 6.sp, left: 9.sp),
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
"nickname",
|
||||||
|
style: TextStyle(
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
color: const Color.fromRGBO(247, 250, 250, 1.0),
|
||||||
|
fontSize: 16.sp,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(width: 8.sp),
|
||||||
|
_buildInfoRow(),
|
||||||
|
const Spacer(),
|
||||||
|
Container(
|
||||||
|
margin: EdgeInsets.only(right: 8.sp),
|
||||||
|
child: Text(
|
||||||
|
"当前在线",
|
||||||
|
style: TextStyle(
|
||||||
|
color: const Color.fromRGBO(247, 250, 250, 1.0),
|
||||||
|
fontSize: 12.sp,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
|
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
height: 50.sp, // 设置固定高度
|
||||||
|
width: Get.width,
|
||||||
|
margin: EdgeInsets.symmetric( horizontal: 8.0),
|
||||||
|
child: Align(
|
||||||
|
alignment: Alignment.centerLeft, // 文本左对齐,垂直居中
|
||||||
|
child: Text(
|
||||||
|
"123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123",
|
||||||
|
maxLines: 2,
|
||||||
|
style: TextStyle(color: Colors.white,fontSize: 14.sp),
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
|
Container(
|
||||||
|
margin: EdgeInsets.only(left: 8.sp,right: 3.sp),
|
||||||
|
child: _buildInterestsListView([Interest(id: 0,title: "圈子名称"),Interest(id: 0,title: "圈子名称"),Interest(id: 0,title: "圈子名称"),Interest(id: 0,title: "圈子名称"),Interest(id: 0,title: "圈子名称"),Interest(id: 0,title: "圈子名称")]))
|
||||||
|
]),
|
||||||
|
],
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _buildInterestsListView(List<Interest> interests) {
|
||||||
|
return SingleChildScrollView(
|
||||||
|
scrollDirection: Axis.horizontal,
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
for (int index = 0; index < interests.length; index++)
|
||||||
|
GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
Get.toNamed(AppRoutes.Signal_circle_list,
|
||||||
|
arguments: interests[index].id);
|
||||||
|
},
|
||||||
|
child: Container(
|
||||||
|
margin: EdgeInsets.only(right: 11.sp),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(17.0),
|
||||||
|
gradient: const LinearGradient(
|
||||||
|
colors: [
|
||||||
|
Color(0xFF06F9FA),
|
||||||
|
Color(0xFFDC5BFD),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
color: const Color(0xFF392D53),
|
||||||
|
),
|
||||||
|
child: Container(
|
||||||
|
margin: EdgeInsets.all(0.2.sp),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(17.0),
|
||||||
|
color: const Color(0xFF392D53),
|
||||||
|
),
|
||||||
|
child: Padding(
|
||||||
|
padding: EdgeInsets.only(
|
||||||
|
top: 2.sp,
|
||||||
|
bottom: 2.sp,
|
||||||
|
left: 15.sp,
|
||||||
|
right: 15.sp,
|
||||||
|
),
|
||||||
|
child: Center(
|
||||||
|
child: Text(
|
||||||
|
interests[index].title,
|
||||||
|
style: const TextStyle(
|
||||||
|
fontSize: 13.0,
|
||||||
|
color: Colors.white,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Widget _buildInfoRow() {
|
||||||
|
return Row(
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(17),
|
||||||
|
gradient: const LinearGradient(
|
||||||
|
colors: [
|
||||||
|
Color.fromRGBO(141, 255, 248, 1.0),
|
||||||
|
Color.fromRGBO(181, 211, 255, 1.0),
|
||||||
|
],
|
||||||
|
begin: Alignment.centerLeft,
|
||||||
|
end: Alignment.centerRight,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
padding: EdgeInsets.only(
|
||||||
|
top: 2.sp,
|
||||||
|
bottom: 2.sp,
|
||||||
|
left: 10.sp,
|
||||||
|
right: 10.sp,
|
||||||
|
),
|
||||||
|
child: Text(
|
||||||
|
"agm",
|
||||||
|
style: const TextStyle(
|
||||||
|
color: Colors.black,
|
||||||
|
fontSize: 10,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(width: 6),
|
||||||
|
// if (controller.isVip > 0)
|
||||||
|
Image(
|
||||||
|
image: AssetImage(getBaseImage(1 == 1 ? "vip" : 'year_vip')),
|
||||||
|
width: 44.sp,
|
||||||
|
height: 18.sp,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget ListAlbumItem(String item, int index) {
|
||||||
|
return Container(
|
||||||
|
margin: EdgeInsets.symmetric(horizontal: 2.sp),
|
||||||
|
child: Image.network(item, width: 88.sp, height: 88.sp, fit: BoxFit.cover),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
void _onRefresh() async {
|
||||||
|
logic.page = 1;
|
||||||
|
// logic.initList();
|
||||||
|
logic.refreshController.refreshCompleted();
|
||||||
|
|
||||||
|
}
|
||||||
|
// if (page == 1) {
|
||||||
|
// refreshController.refreshCompleted();
|
||||||
|
// } else {
|
||||||
|
// refreshController.loadComplete();
|
||||||
|
// }
|
||||||
|
void _onLoading() async {
|
||||||
|
logic.page = logic.page + 1;
|
||||||
|
logic.refreshController.loadComplete();
|
||||||
|
// logic.initList();
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget bannerView(CircleLogic controller) {
|
||||||
|
return Container(
|
||||||
|
height: 160.sp,
|
||||||
|
// margin: EdgeInsets.symmetric(horizontal: 16.sp),
|
||||||
|
child: Swiper(
|
||||||
|
autoplay: logic.bannerList.length > 1,
|
||||||
|
controller: logic.swiperController,
|
||||||
|
loop: logic.bannerList.length>1?true:false,
|
||||||
|
// index:logic.index,
|
||||||
|
itemBuilder: (BuildContext context, int index) {
|
||||||
|
// print(index);
|
||||||
|
return GestureDetector(
|
||||||
|
onTap: () async {},
|
||||||
|
child: SizedBox(
|
||||||
|
width: Get.width,
|
||||||
|
child: ClipRRect(
|
||||||
|
borderRadius: BorderRadius.circular(15.sp),
|
||||||
|
child: CachedNetworkImage(
|
||||||
|
imageUrl: logic.bannerList[index],
|
||||||
|
fit: BoxFit.fill,
|
||||||
|
width: Get.width,
|
||||||
|
),
|
||||||
|
)),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
itemCount: logic.bannerList.length,
|
||||||
|
pagination: SwiperPagination(
|
||||||
|
margin: EdgeInsets.all(5.0.sp), // 设置外边距
|
||||||
|
alignment: Alignment.bottomCenter,
|
||||||
|
builder: DotSwiperPaginationBuilder(
|
||||||
|
color: Colors.white, // 小圆点的颜色
|
||||||
|
activeColor: logic.bannerList.length == 1
|
||||||
|
? Color(0x00FFFFFF)
|
||||||
|
: Color(0xFFFF4D7C), // 当前索引小圆点的颜色
|
||||||
|
),
|
||||||
|
),
|
||||||
|
// control: new SwiperControl(), //左右的那个箭头,在某模拟器中会出现蓝线
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget circleList(CircleLogic controller) {
|
||||||
|
return Expanded(
|
||||||
child: Swiper(
|
child: Swiper(
|
||||||
itemBuilder: (BuildContext context, int index) {
|
itemBuilder: (BuildContext context, int index) {
|
||||||
var bean = logic.circle.lists[index];
|
var bean = logic.circle.lists[index];
|
||||||
@ -75,10 +513,8 @@ class _CirclePageState extends State<CirclePage>
|
|||||||
controller.state.index = index;
|
controller.state.index = index;
|
||||||
if (index == logic.circle.lists.length - 1) {
|
if (index == logic.circle.lists.length - 1) {
|
||||||
logic.loadMore();
|
logic.loadMore();
|
||||||
|
|
||||||
}
|
}
|
||||||
print(index.toString());
|
print(index.toString());
|
||||||
|
|
||||||
},
|
},
|
||||||
index: controller.state.index,
|
index: controller.state.index,
|
||||||
itemCount: logic.circle.lists.length,
|
itemCount: logic.circle.lists.length,
|
||||||
@ -88,32 +524,7 @@ class _CirclePageState extends State<CirclePage>
|
|||||||
key: UniqueKey(),
|
key: UniqueKey(),
|
||||||
// pagination: new SwiperPagination(),//如果不填则不显示指示点
|
// pagination: new SwiperPagination(),//如果不填则不显示指示点
|
||||||
// control: new SwiperControl(),//如果不填则不显示左右按钮
|
// control: new SwiperControl(),//如果不填则不显示左右按钮
|
||||||
))
|
|
||||||
]),
|
|
||||||
),
|
|
||||||
Positioned(
|
|
||||||
bottom: 36.sp,
|
|
||||||
right: 10.sp,
|
|
||||||
child: GestureDetector(
|
|
||||||
onTap: () async {
|
|
||||||
List<MyConfigData> numbers = [];
|
|
||||||
numbers.add(MyConfigData(
|
|
||||||
logic.getCircleIndex().id.toString(),
|
|
||||||
logic.getCircleIndex().title!,
|
|
||||||
false));
|
|
||||||
var data = await Get.toNamed(AppRoutes.Call_out, arguments: {'numbers': numbers});
|
|
||||||
|
|
||||||
},
|
|
||||||
child: Image.asset(
|
|
||||||
getCircleImage('send_msg'),
|
|
||||||
width: 60.sp,
|
|
||||||
)))
|
|
||||||
],
|
|
||||||
);
|
|
||||||
}),
|
|
||||||
),
|
|
||||||
));
|
));
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget navigatorItem(DataModel statistics) {
|
Widget navigatorItem(DataModel statistics) {
|
||||||
@ -151,7 +562,8 @@ class _CirclePageState extends State<CirclePage>
|
|||||||
child: Stack(
|
child: Stack(
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
children: [
|
children: [
|
||||||
Positioned(
|
logic.isShowCircle
|
||||||
|
? Positioned(
|
||||||
left: 0,
|
left: 0,
|
||||||
child: GestureDetector(
|
child: GestureDetector(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
@ -166,33 +578,135 @@ class _CirclePageState extends State<CirclePage>
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
)
|
||||||
ShaderMask(
|
: GestureDetector(
|
||||||
shaderCallback: (Rect bounds) {
|
|
||||||
return const LinearGradient(
|
|
||||||
begin: Alignment(0.0, -1.0),
|
|
||||||
end: Alignment.bottomCenter,
|
|
||||||
colors: [Color(0xff71F3F2), Color(0xffF657FF)],
|
|
||||||
).createShader(Offset.zero & bounds.size);
|
|
||||||
},
|
|
||||||
child: GestureDetector(
|
|
||||||
onTap: (){
|
onTap: (){
|
||||||
EventBusManager.fire(ScrollToTop());
|
showCityPiker(context);
|
||||||
},
|
},
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Image.asset(
|
||||||
|
getCircleImage('icon_city'),
|
||||||
|
width: 24.sp,
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
margin: EdgeInsets.only(left: 4.sp, top: 4.sp),
|
||||||
|
child: Text(
|
||||||
|
logic.cityName,
|
||||||
|
style:
|
||||||
|
TextStyle(color: Colors.white, fontSize: 16.sp),
|
||||||
|
))
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
alignment: Alignment.center,
|
||||||
|
//padding: EdgeInsets.symmetric(horizontal: 10.sp),
|
||||||
|
|
||||||
|
height: 27.sp,
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
TabBar(
|
||||||
|
isScrollable: true,
|
||||||
|
controller: _tabController,
|
||||||
|
labelPadding: EdgeInsets.symmetric(horizontal: 13.0),
|
||||||
|
indicator: UnderlineTabIndicator(
|
||||||
|
borderSide: BorderSide(
|
||||||
|
color: const Color(0xFF00FFF4),
|
||||||
|
width: 2.sp,
|
||||||
|
),
|
||||||
|
insets: EdgeInsets.symmetric(horizontal: 6.0.sp),
|
||||||
|
borderRadius: BorderRadius.circular(18.0),
|
||||||
|
),
|
||||||
|
indicatorColor: const Color(0xFF00FFF4),
|
||||||
|
indicatorWeight: 2.sp,
|
||||||
|
labelColor: const Color(0xFF00FFF4),
|
||||||
|
unselectedLabelColor: const Color(0xB3FFFFFF),
|
||||||
|
indicatorSize: TabBarIndicatorSize.label,
|
||||||
|
tabs: [
|
||||||
|
Tab(
|
||||||
child: Text(
|
child: Text(
|
||||||
'发现',
|
'发现',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 18.sp,
|
fontSize: 18.sp,
|
||||||
fontWeight: FontWeight.w600,
|
|
||||||
color: Colors.white,
|
|
||||||
shadows: const [Shadow(color: Color(0xffF657FF), offset: Offset(0.0, -1))],
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
Tab(
|
||||||
|
child: Text(
|
||||||
|
'附近',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 18.sp,
|
||||||
|
|
||||||
),
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
labelStyle: TextStyle(
|
||||||
|
color: const Color(0xFF00FFF4),
|
||||||
|
fontSize: 18.sp,
|
||||||
|
shadows: [
|
||||||
|
Shadow(
|
||||||
|
color: const Color(0xFFF657FF).withOpacity(0.5),
|
||||||
|
offset: Offset(0, -2), // 阴影偏移
|
||||||
|
blurRadius: 3, // 阴影模糊半径
|
||||||
|
// spreadRadius: 0
|
||||||
|
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
unselectedLabelStyle: TextStyle(
|
||||||
|
// color: const Color(0xB3FFFFFF),
|
||||||
|
fontSize: 18.sp,
|
||||||
|
shadows: [
|
||||||
|
Shadow(
|
||||||
|
// color: const Color(0xFFF657FF),
|
||||||
|
offset: const Offset(0, -1),
|
||||||
|
blurRadius: 3.0.sp,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
onTap: (index) {
|
||||||
|
_pageController.animateToPage(
|
||||||
|
index, // 目标页面索引
|
||||||
|
duration: const Duration(milliseconds: 300), // 动画时长
|
||||||
|
curve: Curves.ease, // 动画曲线
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
|
// ShaderMask(
|
||||||
|
// shaderCallback: (Rect bounds) {
|
||||||
|
// return const LinearGradient(
|
||||||
|
// begin: Alignment(0.0, -1.0),
|
||||||
|
// end: Alignment.bottomCenter,
|
||||||
|
// colors: [Color(0xff71F3F2), Color(0xffF657FF)],
|
||||||
|
// ).createShader(Offset.zero & bounds.size);
|
||||||
|
// },
|
||||||
|
// child: GestureDetector(
|
||||||
|
// onTap: (){
|
||||||
|
//
|
||||||
|
// },
|
||||||
|
// child: Text(
|
||||||
|
// '发现',
|
||||||
|
// style: TextStyle(
|
||||||
|
// fontSize: 18.sp,
|
||||||
|
// fontWeight: FontWeight.w600,
|
||||||
|
// color: Colors.white,
|
||||||
|
// shadows: const [Shadow(color: Color(0xffF657FF), offset: Offset(0.0, -1))],
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
Positioned(
|
Positioned(
|
||||||
right: 0,
|
right: 0,
|
||||||
child: GestureDetector(
|
child: logic.isShowCircle
|
||||||
|
? GestureDetector(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Get.toNamed(AppRoutes.MyCircle, arguments: '');
|
Get.toNamed(AppRoutes.MyCircle, arguments: '');
|
||||||
},
|
},
|
||||||
@ -200,6 +714,15 @@ class _CirclePageState extends State<CirclePage>
|
|||||||
getCircleImage('my_circle'),
|
getCircleImage('my_circle'),
|
||||||
width: 64.sp,
|
width: 64.sp,
|
||||||
),
|
),
|
||||||
|
)
|
||||||
|
: GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
_showBottomSheet(context);
|
||||||
|
},
|
||||||
|
child: Image.asset(
|
||||||
|
getCircleImage('icon_screen'),
|
||||||
|
width: 24.sp,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@ -207,6 +730,21 @@ class _CirclePageState extends State<CirclePage>
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void _showBottomSheet(BuildContext context) {
|
||||||
|
showModalBottomSheet(
|
||||||
|
context: context,
|
||||||
|
backgroundColor: Colors.transparent,
|
||||||
|
builder: (BuildContext context) {
|
||||||
|
return ScreenBottomSheetDialog(
|
||||||
|
genderList: logic.genderList,
|
||||||
|
orientationList: logic.orientationList,
|
||||||
|
roleList: logic.roleList,
|
||||||
|
callback: (genderList, orientationList, roleList) {},
|
||||||
|
); // Use your custom widget here
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
circleWidget(String url, {double width = 30}) {
|
circleWidget(String url, {double width = 30}) {
|
||||||
return GestureDetector(
|
return GestureDetector(
|
||||||
child: Stack(
|
child: Stack(
|
||||||
@ -216,20 +754,23 @@ class _CirclePageState extends State<CirclePage>
|
|||||||
getCircleImage('avatar_bg'),
|
getCircleImage('avatar_bg'),
|
||||||
width: width.sp,
|
width: width.sp,
|
||||||
),
|
),
|
||||||
url.contains("http") ? ClipOval(
|
url.contains("http")
|
||||||
|
? ClipOval(
|
||||||
child: Image.network(
|
child: Image.network(
|
||||||
url,
|
url,
|
||||||
width: (width - 1).sp,
|
width: (width - 1).sp,
|
||||||
height: (width - 1).sp,
|
height: (width - 1).sp,
|
||||||
fit: BoxFit.cover,
|
fit: BoxFit.cover,
|
||||||
),
|
),
|
||||||
) : Text(url,style: TextStyle(color: Color(0xffF756FF),fontSize: 12.sp),)
|
)
|
||||||
|
: Text(
|
||||||
|
url,
|
||||||
|
style: TextStyle(color: Color(0xffF756FF), fontSize: 12.sp),
|
||||||
|
)
|
||||||
],
|
],
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void _showTextContentDialog(BuildContext context, String msg) {
|
void _showTextContentDialog(BuildContext context, String msg) {
|
||||||
showDialog(
|
showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
@ -427,4 +968,31 @@ class _CirclePageState extends State<CirclePage>
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
showCityPiker(context) {
|
||||||
|
Pickers.showMultiLinkPicker(context,
|
||||||
|
pickerStyle: DefaultPickerStyle.dark(), data: logic.cityMap, columeNum: 3,
|
||||||
|
onConfirm: (List res, List<int> position){
|
||||||
|
print(res);
|
||||||
|
print(logic.cityMap[res[0]][res[1]][0]);
|
||||||
|
// controller.state.city = controller.cityMap[res[0]][res[1]][0];
|
||||||
|
// logic.state.city = res[1];
|
||||||
|
logic.cityName = res[2];
|
||||||
|
logic.update();
|
||||||
|
// logic.getSuccess();
|
||||||
|
// logic.update();
|
||||||
|
}
|
||||||
|
|
||||||
|
// onConfirm:(String province, String city, String? town){
|
||||||
|
// controller.state.role = city;
|
||||||
|
// controller.update();
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
390
circle_app/lib/app/dialog/ScreenBottomSheetDialog.dart
Normal file
390
circle_app/lib/app/dialog/ScreenBottomSheetDialog.dart
Normal file
@ -0,0 +1,390 @@
|
|||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
|
import '../../common/Widgets/open_vip_tip/view.dart';
|
||||||
|
import '../../util/device.dart';
|
||||||
|
import '../../util/util.dart';
|
||||||
|
import '../select_circle/logic.dart';
|
||||||
|
|
||||||
|
typedef void ScreenCallback(List<int> genderList,List<int> orientationList,List<int> roleList);
|
||||||
|
|
||||||
|
|
||||||
|
class ScreenBottomSheetDialog extends StatefulWidget {
|
||||||
|
final List<MyConfigData> genderList ;
|
||||||
|
|
||||||
|
final List<MyConfigData> orientationList ;
|
||||||
|
|
||||||
|
final List<MyConfigData> roleList ;
|
||||||
|
final ScreenCallback callback;
|
||||||
|
|
||||||
|
ScreenBottomSheetDialog({required this.genderList, required this.orientationList,required this.roleList,
|
||||||
|
required this.callback
|
||||||
|
});
|
||||||
|
@override
|
||||||
|
_ScreenBottomSheetDialogState createState() =>
|
||||||
|
_ScreenBottomSheetDialogState();
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
class _ScreenBottomSheetDialogState extends State<ScreenBottomSheetDialog> {
|
||||||
|
late ConfigBean configBean;
|
||||||
|
|
||||||
|
|
||||||
|
int myVip = 0;
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
// TODO: implement initState
|
||||||
|
super.initState();
|
||||||
|
initGerder();
|
||||||
|
}
|
||||||
|
|
||||||
|
void initGerder() async {
|
||||||
|
myVip = await getVip();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Container(
|
||||||
|
decoration: const BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.only(
|
||||||
|
topLeft: Radius.circular(16.0),
|
||||||
|
topRight: Radius.circular(16.0),
|
||||||
|
),
|
||||||
|
gradient: LinearGradient(
|
||||||
|
colors: [
|
||||||
|
Color(0xFF4A3E5D),
|
||||||
|
Color(0xFF344143),
|
||||||
|
],
|
||||||
|
begin: Alignment.centerLeft,
|
||||||
|
end: Alignment.centerRight,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
height: 220.0,
|
||||||
|
width: double.infinity,
|
||||||
|
child: Container(
|
||||||
|
margin: EdgeInsets.symmetric( vertical: 20.sp),
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
Navigator.pop(context);
|
||||||
|
},
|
||||||
|
child: Container(
|
||||||
|
margin: EdgeInsets.only(left: 16.sp),
|
||||||
|
child: Text(
|
||||||
|
'取消',
|
||||||
|
textAlign: TextAlign.left,
|
||||||
|
style: TextStyle(color: Color(0xFFB7BECC), fontSize: 18.sp),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const Spacer(), // Adds space to separate the text widgets
|
||||||
|
Text(
|
||||||
|
'精准筛选',
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: TextStyle(color: Color(0xFFFFFFFF), fontSize: 18.sp),
|
||||||
|
),
|
||||||
|
const Spacer(), // Adds space to separate the text widgets
|
||||||
|
GestureDetector(
|
||||||
|
onTap: (){
|
||||||
|
|
||||||
|
widget.callback([],[],[]);
|
||||||
|
},
|
||||||
|
child: Container(
|
||||||
|
margin: EdgeInsets.only(right: 16.sp),
|
||||||
|
child: Text(
|
||||||
|
'确认',
|
||||||
|
textAlign: TextAlign.right,
|
||||||
|
style: TextStyle(color: Color(0xFFFFFFFF), fontSize: 18.sp),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 20.sp,
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
margin: EdgeInsets.only(left: 16.sp),
|
||||||
|
child: Text(
|
||||||
|
"属性",
|
||||||
|
style: TextStyle(color: Color(0xFFF7FAFA), fontSize: 16.sp),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: Container(
|
||||||
|
height: 23.sp,
|
||||||
|
margin: EdgeInsets.only(left: 18.sp),
|
||||||
|
child: ListView.builder(
|
||||||
|
itemCount: widget.genderList.length,
|
||||||
|
scrollDirection: Axis.horizontal,
|
||||||
|
itemBuilder: (context, index) {
|
||||||
|
final isSelected = widget.genderList[index]
|
||||||
|
.isSelect; // Replace with your condition
|
||||||
|
|
||||||
|
return GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
setState(() {
|
||||||
|
widget.genderList[index].isSelect =
|
||||||
|
!widget.genderList[index].isSelect;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
child: Container(
|
||||||
|
margin: EdgeInsets.only(right: 6.0),
|
||||||
|
width: 50.0,
|
||||||
|
height: 23.0,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(18.0),
|
||||||
|
gradient: isSelected
|
||||||
|
? const LinearGradient(
|
||||||
|
colors: [
|
||||||
|
Color(0xFFD95EFC),
|
||||||
|
Color(0xFF30FFD9)
|
||||||
|
],
|
||||||
|
tileMode: TileMode.repeated,
|
||||||
|
)
|
||||||
|
: const LinearGradient(
|
||||||
|
colors: [
|
||||||
|
Color(0xFFD95EFC),
|
||||||
|
Color(0xFF30FFD9)
|
||||||
|
],
|
||||||
|
tileMode: TileMode.repeated,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: Padding(
|
||||||
|
padding: EdgeInsets.all(0.5),
|
||||||
|
child: Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(17.0),
|
||||||
|
color:isSelected? Color(0x00000000): Color(0xFF392D53),
|
||||||
|
),
|
||||||
|
child: Center(
|
||||||
|
child: Text(
|
||||||
|
widget.genderList[index].name,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 13.0,
|
||||||
|
color: Colors.white,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
));
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 20.sp,
|
||||||
|
),
|
||||||
|
Stack(
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
margin: EdgeInsets.only(left: 16.sp,top: 6.sp),
|
||||||
|
child: Text(
|
||||||
|
"角色",
|
||||||
|
style: TextStyle(color: Color(0xFFF7FAFA), fontSize: 16.sp),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: Container(
|
||||||
|
height: 23.sp,
|
||||||
|
margin: EdgeInsets.only(left: 18.sp,top: 6.sp),
|
||||||
|
child: ListView.builder(
|
||||||
|
itemCount: widget.roleList.length,
|
||||||
|
scrollDirection: Axis.horizontal,
|
||||||
|
itemBuilder: (context, index) {
|
||||||
|
final isSelected = widget.roleList[index]
|
||||||
|
.isSelect; // Replace with your condition
|
||||||
|
|
||||||
|
return GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
if(myVip<1){
|
||||||
|
showRechargeDialog();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
setState(() {
|
||||||
|
widget.roleList[index].isSelect =
|
||||||
|
!widget.roleList[index].isSelect;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
child: Container(
|
||||||
|
margin: EdgeInsets.only(right: 6.0),
|
||||||
|
width: 50.0,
|
||||||
|
height: 23.0,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(18.0),
|
||||||
|
gradient: isSelected
|
||||||
|
? const LinearGradient(
|
||||||
|
colors: [
|
||||||
|
Color(0xFFD95EFC),
|
||||||
|
Color(0xFF30FFD9)
|
||||||
|
],
|
||||||
|
tileMode: TileMode.repeated,
|
||||||
|
)
|
||||||
|
: const LinearGradient(
|
||||||
|
colors: [
|
||||||
|
Color(0xFFD95EFC),
|
||||||
|
Color(0xFF30FFD9)
|
||||||
|
],
|
||||||
|
tileMode: TileMode.repeated,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: Padding(
|
||||||
|
padding: EdgeInsets.all(0.5),
|
||||||
|
child: Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(17.0),
|
||||||
|
color:isSelected? Color(0x00000000): Color(0xFF392D53),
|
||||||
|
),
|
||||||
|
child: Center(
|
||||||
|
child: Text(
|
||||||
|
widget.roleList[index].name,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 13.0,
|
||||||
|
color: Colors.white,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
));
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Positioned(
|
||||||
|
left: 36.sp,
|
||||||
|
|
||||||
|
child: Image(
|
||||||
|
image: AssetImage(getBaseImage("icon_white_vip")),
|
||||||
|
width: 34.sp,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 20.sp,
|
||||||
|
),
|
||||||
|
Stack(
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
margin: EdgeInsets.only(left: 16.sp,top: 6.sp),
|
||||||
|
child: Text(
|
||||||
|
"取向",
|
||||||
|
style: TextStyle(color: Color(0xFFF7FAFA), fontSize: 16.sp),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: Container(
|
||||||
|
height: 23.sp,
|
||||||
|
margin: EdgeInsets.only(left: 18.sp,top: 6.sp),
|
||||||
|
child: ListView.builder(
|
||||||
|
itemCount: widget.orientationList.length,
|
||||||
|
scrollDirection: Axis.horizontal,
|
||||||
|
itemBuilder: (context, index) {
|
||||||
|
final isSelected = widget.orientationList[index]
|
||||||
|
.isSelect; // Replace with your condition
|
||||||
|
|
||||||
|
return GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
if(myVip<2){
|
||||||
|
showRechargeDialog();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
setState(() {
|
||||||
|
widget.orientationList[index].isSelect =
|
||||||
|
!widget.orientationList[index].isSelect;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
child: Container(
|
||||||
|
margin: EdgeInsets.only(right: 6.0),
|
||||||
|
width: 50.0,
|
||||||
|
height: 23.0,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(18.0),
|
||||||
|
gradient: isSelected
|
||||||
|
? const LinearGradient(
|
||||||
|
colors: [
|
||||||
|
Color(0xFFD95EFC),
|
||||||
|
Color(0xFF30FFD9)
|
||||||
|
],
|
||||||
|
tileMode: TileMode.repeated,
|
||||||
|
)
|
||||||
|
: const LinearGradient(
|
||||||
|
colors: [
|
||||||
|
Color(0xFFD95EFC),
|
||||||
|
Color(0xFF30FFD9)
|
||||||
|
],
|
||||||
|
tileMode: TileMode.repeated,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: Padding(
|
||||||
|
padding: EdgeInsets.all(0.5),
|
||||||
|
child: Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(17.0),
|
||||||
|
color:isSelected? Color(0x00000000): Color(0xFF392D53),
|
||||||
|
),
|
||||||
|
child: Center(
|
||||||
|
child: Text(
|
||||||
|
widget.orientationList[index].name,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 13.0,
|
||||||
|
color: Colors.white,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
));
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Positioned(
|
||||||
|
left: 36.sp,
|
||||||
|
child: Image(
|
||||||
|
image: AssetImage(getBaseImage("icon_white_yearvip")),
|
||||||
|
width: 34.sp,
|
||||||
|
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
// Other content here...
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
showRechargeDialog(){
|
||||||
|
Get.bottomSheet(
|
||||||
|
Scaffold(
|
||||||
|
backgroundColor: Colors.transparent,
|
||||||
|
body: Open_vip_tipPage(true),
|
||||||
|
),
|
||||||
|
isScrollControlled: true,
|
||||||
|
enableDrag: false);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -261,9 +261,9 @@ class MyTabbedScreenState extends State<UserinfoPage>
|
|||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
userInfoBean?.nickname ?? "",
|
userInfoBean?.nickname ?? "",
|
||||||
style: const TextStyle(
|
style: TextStyle(
|
||||||
color: Color.fromRGBO(247, 250, 250, 1.0),
|
color: Color.fromRGBO(247, 250, 250, 1.0),
|
||||||
fontSize: 14,
|
fontSize: 14.sp,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SizedBox(width: 8.sp),
|
SizedBox(width: 8.sp),
|
||||||
|
|||||||
@ -18,6 +18,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|||||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:oktoast/oktoast.dart';
|
import 'package:oktoast/oktoast.dart';
|
||||||
|
import 'package:pull_to_refresh/pull_to_refresh.dart';
|
||||||
import 'package:tencent_cloud_chat_uikit/business_logic/separate_models/tui_chat_separate_view_model.dart';
|
import 'package:tencent_cloud_chat_uikit/business_logic/separate_models/tui_chat_separate_view_model.dart';
|
||||||
import 'package:tencent_cloud_chat_uikit/data_services/core/core_services.dart';
|
import 'package:tencent_cloud_chat_uikit/data_services/core/core_services.dart';
|
||||||
import 'package:tencent_cloud_chat_uikit/tencent_cloud_chat_uikit.dart';
|
import 'package:tencent_cloud_chat_uikit/tencent_cloud_chat_uikit.dart';
|
||||||
@ -433,12 +434,16 @@ class _MyAppState extends State<MyApp> with WidgetsBindingObserver {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
//填入设计稿中设备的屏幕尺寸,单位dp
|
//填入设计稿中设备的屏幕尺寸,单位dp
|
||||||
// configureDio();
|
// configureDio();
|
||||||
return ScreenUtilInit(
|
return
|
||||||
|
ScreenUtilInit(
|
||||||
designSize: const Size(375, 812),
|
designSize: const Size(375, 812),
|
||||||
minTextAdapt: true,
|
minTextAdapt: true,
|
||||||
splitScreenMode: true,
|
splitScreenMode: true,
|
||||||
builder: (context, child) {
|
builder: (context, child) {
|
||||||
return OKToast(
|
return
|
||||||
|
RefreshConfiguration(
|
||||||
|
footerBuilder: () => CustomLoadFooter(),
|
||||||
|
child: OKToast(
|
||||||
// 2-A: wrap your app with OKToast
|
// 2-A: wrap your app with OKToast
|
||||||
textStyle: const TextStyle(fontSize: 19.0, color: Colors.white),
|
textStyle: const TextStyle(fontSize: 19.0, color: Colors.white),
|
||||||
backgroundColor: Colors.grey,
|
backgroundColor: Colors.grey,
|
||||||
@ -453,7 +458,8 @@ class _MyAppState extends State<MyApp> with WidgetsBindingObserver {
|
|||||||
home: SplashPage(),
|
home: SplashPage(),
|
||||||
builder: FlutterSmartDialog.init(),
|
builder: FlutterSmartDialog.init(),
|
||||||
debugShowCheckedModeBanner: false,
|
debugShowCheckedModeBanner: false,
|
||||||
));
|
)))
|
||||||
|
;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -115,6 +115,14 @@ Future<String> getAuthorization() async {
|
|||||||
return token;
|
return token;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Future<int> getVip() async {
|
||||||
|
int vip =0;
|
||||||
|
SharedPreferences sharedPreferences =await SharedPreferences.getInstance();
|
||||||
|
vip = sharedPreferences.getInt(SharedPreferencesHelper.VIP)??0;
|
||||||
|
return vip;
|
||||||
|
}
|
||||||
|
|
||||||
Future<bool> getAgreemement() async {
|
Future<bool> getAgreemement() async {
|
||||||
if(Platform.isIOS){
|
if(Platform.isIOS){
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@ -10,6 +10,7 @@ import 'package:get/get.dart';
|
|||||||
import 'package:oktoast/oktoast.dart';
|
import 'package:oktoast/oktoast.dart';
|
||||||
|
|
||||||
import 'package:path_provider/path_provider.dart';
|
import 'package:path_provider/path_provider.dart';
|
||||||
|
import 'package:pull_to_refresh/pull_to_refresh.dart';
|
||||||
import 'package:video_compress/video_compress.dart';
|
import 'package:video_compress/video_compress.dart';
|
||||||
|
|
||||||
import 'SharedPreferencesHelper.dart';
|
import 'SharedPreferencesHelper.dart';
|
||||||
@ -252,6 +253,35 @@ Future<void> compressVideo(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class CustomRefreshHeader extends StatelessWidget {
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return ClassicHeader(
|
||||||
|
// 自定义刷新时的文字
|
||||||
|
refreshingText: "正在刷新...",
|
||||||
|
idleText: "下拉刷新",
|
||||||
|
completeText: "刷新完成",
|
||||||
|
failedText: "刷新失败",
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class CustomLoadFooter extends StatelessWidget {
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return ClassicFooter(
|
||||||
|
// 自定义加载更多时的文字
|
||||||
|
canLoadingText: "松手开始加载数据",
|
||||||
|
loadingText: "正在加载...",
|
||||||
|
idleText: "上拉加载更多",
|
||||||
|
noDataText: "没有更多数据了",
|
||||||
|
failedText: "加载失败",
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// 获取应用程序的文档目录路径
|
// 获取应用程序的文档目录路径
|
||||||
Future<String> getApplicationDocumentsDirectoryPath() async {
|
Future<String> getApplicationDocumentsDirectoryPath() async {
|
||||||
final directory = await getApplicationDocumentsDirectory();
|
final directory = await getApplicationDocumentsDirectory();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user