Compare commits
3 Commits
a64a9a1ac8
...
668bf55348
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
668bf55348 | ||
|
|
8e1fd067f5 | ||
|
|
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,26 +1,45 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:circle_app/main.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:flutter/cupertino.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:pull_to_refresh/pull_to_refresh.dart';
|
||||
import '../../common/Widgets/open_vip_tip/view.dart';
|
||||
import '../../network/api.dart';
|
||||
import '../../network/dio_manager.dart';
|
||||
import '../../util/eventBus.dart';
|
||||
import '../select_circle/logic.dart';
|
||||
import '../userinfo/logic.dart';
|
||||
import 'state.dart';
|
||||
import 'package:scroll_to_index/scroll_to_index.dart';
|
||||
|
||||
class CircleLogic extends GetxController {
|
||||
|
||||
PageController pageController =
|
||||
PageController(initialPage: 1, viewportFraction: 0.8);
|
||||
SwiperController swiperController = SwiperController();
|
||||
final RefreshController refreshController = RefreshController();
|
||||
InterestsBean circle = InterestsBean(lists: []);
|
||||
final CircleState state = CircleState();
|
||||
var statistics = Rx<DataModel>(DataModel(visitCount: 0, lastVisitUsers: [], likeMeCount: 0));
|
||||
var statistics = Rx<DataModel>(
|
||||
DataModel(visitCount: 0, lastVisitUsers: [], likeMeCount: 0));
|
||||
|
||||
//Map? statistics;
|
||||
int page = 1;
|
||||
|
||||
int vicinityPage = 1;
|
||||
|
||||
bool isMore = true;
|
||||
int myVip = 0;
|
||||
bool isShowCircle = true;
|
||||
String cityName = "";
|
||||
|
||||
List<BannerItem> bannerList = [];
|
||||
|
||||
AutoScrollController scrollController = AutoScrollController();
|
||||
ScrollController listScrollController = ScrollController();
|
||||
@ -28,39 +47,98 @@ class CircleLogic extends GetxController {
|
||||
@override
|
||||
void onInit() async {
|
||||
super.onInit();
|
||||
var data = await DioManager.instance
|
||||
.get(url: Api.getCircleInterests, params: {"page": page,'page_size':20});
|
||||
var data = await DioManager.instance.get(
|
||||
url: Api.getCircleInterests, params: {"page": page, 'page_size': 20});
|
||||
var bean = BaseResponse<InterestsBean>.fromJson(
|
||||
data, (data) => InterestsBean.fromJson(data));
|
||||
if(bean.data is InterestsBean&&bean.isSuccess()){
|
||||
if (bean.data is InterestsBean && bean.isSuccess()) {
|
||||
circle = bean.data!;
|
||||
if (circle.lists.length < 20) {
|
||||
isMore = false;
|
||||
}
|
||||
update();
|
||||
}
|
||||
|
||||
myVip = await getVip();
|
||||
loadCirclePeopleData();
|
||||
initGerder();
|
||||
getCityList();
|
||||
|
||||
getBanner();
|
||||
getNearByList();
|
||||
|
||||
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;
|
||||
areaMap[cityName] = []; // 不再存储区域列表,直接设置为空列表
|
||||
}
|
||||
cityMap[provinceList[i].name] = areaMap;
|
||||
}
|
||||
|
||||
} catch (e) {
|
||||
print('Error loading JSON file: $e');
|
||||
}
|
||||
}
|
||||
|
||||
loadMore() async {
|
||||
if (!isMore) return;
|
||||
page = page + 1;
|
||||
var data = await DioManager.instance
|
||||
.get(url: Api.getCircleInterests, params: {"page": page,'page_size':20});
|
||||
var data = await DioManager.instance.get(
|
||||
url: Api.getCircleInterests, params: {"page": page, 'page_size': 20});
|
||||
var bean = BaseResponse<InterestsBean>.fromJson(
|
||||
data, (data) => InterestsBean.fromJson(data));
|
||||
|
||||
InterestsBean newcircle = bean.data!;
|
||||
if (newcircle.lists.isNotEmpty) {
|
||||
|
||||
if (newcircle.lists.length < 20) {
|
||||
isMore = false;
|
||||
}
|
||||
circle.lists.addAll(newcircle.lists);
|
||||
update();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
outCircle(String interest_id, bool isStatus) async {
|
||||
@ -79,7 +157,7 @@ class CircleLogic extends GetxController {
|
||||
}
|
||||
|
||||
updateCircleInfo(Circle circleInfo) {
|
||||
for(int i = 0; i < circle.lists.length; i++) {
|
||||
for (int i = 0; i < circle.lists.length; i++) {
|
||||
Circle temp = circle.lists[i];
|
||||
if (temp.id == circleInfo.id) {
|
||||
circle.lists[i] = circleInfo;
|
||||
@ -89,7 +167,7 @@ class CircleLogic extends GetxController {
|
||||
update();
|
||||
}
|
||||
|
||||
setCircle(String circleId){
|
||||
setCircle(String circleId) {
|
||||
circle.lists.forEach((element) {
|
||||
if (element.id.toString() == circleId.toString()) {
|
||||
element.isJoin = true;
|
||||
@ -99,13 +177,12 @@ class CircleLogic extends GetxController {
|
||||
|
||||
//访问我的圈子人数
|
||||
loadCirclePeopleData() async {
|
||||
var data = await DioManager.instance
|
||||
.get(url: Api.getInterestsCount);
|
||||
var data = await DioManager.instance.get(url: Api.getInterestsCount);
|
||||
var myAlbumBean = BaseResponse<DataModel>.fromJson(
|
||||
data, (data) => DataModel.fromJson(data));
|
||||
|
||||
if (data['code'] == 200) {
|
||||
statistics.value = myAlbumBean.data;
|
||||
statistics.value = myAlbumBean.data;
|
||||
// update();
|
||||
}
|
||||
}
|
||||
@ -115,27 +192,28 @@ class CircleLogic extends GetxController {
|
||||
}
|
||||
|
||||
void pushHome(String userId) {
|
||||
Get.toNamed(AppRoutes.UserInfoActivity, arguments: userId);
|
||||
Get.toNamed(AppRoutes.UserInfoActivity, arguments: userId);
|
||||
}
|
||||
|
||||
void getPipeiData() async {
|
||||
var data = await DioManager.instance
|
||||
.get(url: Api.getMatch);
|
||||
if(data['code'] == 200) {
|
||||
var data = await DioManager.instance.get(url: Api.getMatch);
|
||||
if (data['code'] == 200) {
|
||||
//发送消息
|
||||
bool isSuccess = await createCustomMsg(data['data']['account_id'].toString().split('_').last,data['data']['account_id']);
|
||||
bool isSuccess = await createCustomMsg(
|
||||
data['data']['account_id'].toString().split('_').last,
|
||||
data['data']['account_id']);
|
||||
if (!isSuccess) {
|
||||
await sendTextMsg(data['data']['account_id']);
|
||||
}
|
||||
} else if(data['code'] == 21201){
|
||||
} else if (data['code'] == 21201) {
|
||||
showOKToast(data['msg']);
|
||||
showRechargeDialog();
|
||||
}else{
|
||||
} else {
|
||||
showOKToast(data['msg']);
|
||||
}
|
||||
}
|
||||
|
||||
showRechargeDialog(){
|
||||
showRechargeDialog() {
|
||||
Get.bottomSheet(
|
||||
Scaffold(
|
||||
backgroundColor: Colors.transparent,
|
||||
@ -143,16 +221,231 @@ class CircleLogic extends GetxController {
|
||||
),
|
||||
isScrollControlled: true,
|
||||
enableDrag: false);
|
||||
|
||||
}
|
||||
|
||||
void getBanner() async {
|
||||
bannerList.clear();
|
||||
var data =
|
||||
await DioManager.instance.get(url: Api.getNearbyBeanner, params: {});
|
||||
var bean = BaseResponse<BannerList>.fromJson(
|
||||
data, (data) => BannerList.fromJson(data));
|
||||
bannerList.addAll(bean.data.banners);
|
||||
cityName = bean.data.city;
|
||||
}
|
||||
|
||||
int offset = 0;
|
||||
int deep = 0;
|
||||
List<VicinityItemBean> vicinityList = [];
|
||||
|
||||
void getNearByList() async {
|
||||
List<String> genders = [];
|
||||
genderList.forEach((element) {
|
||||
if (element.isSelect) {
|
||||
genders.add(element.id);
|
||||
}
|
||||
});
|
||||
List<String> roles = [];
|
||||
roleList.forEach((element) {
|
||||
if (element.isSelect) roles.add(element.id);
|
||||
});
|
||||
|
||||
List<String> orientations = [];
|
||||
orientationList.forEach((element) {
|
||||
if (element.isSelect) orientations.add(element.id);
|
||||
});
|
||||
|
||||
// getBanner();
|
||||
var data = await DioManager.instance.post(url: Api.postNearbyList, params: {
|
||||
"offset": offset,
|
||||
'deep': deep,
|
||||
'city': cityName,
|
||||
"genders": genders,
|
||||
"roles": roles,
|
||||
"orientations": orientations
|
||||
});
|
||||
var bean = BaseResponse<VicinityBean>.fromJson(
|
||||
data, (data) => VicinityBean.fromJson(data));
|
||||
try {
|
||||
offset = bean.data.offset;
|
||||
deep = bean.data.deep;
|
||||
} catch (Exception) {}
|
||||
|
||||
if (vicinityPage == 1) {
|
||||
vicinityList.clear();
|
||||
}
|
||||
try{
|
||||
vicinityList.addAll(bean.data.users);
|
||||
} catch(Exception){
|
||||
|
||||
}
|
||||
|
||||
if (vicinityPage == 1) {
|
||||
refreshController.refreshCompleted();
|
||||
} else {
|
||||
refreshController.loadComplete();
|
||||
}
|
||||
|
||||
update();
|
||||
}
|
||||
}
|
||||
|
||||
class VicinityBean {
|
||||
String city;
|
||||
int offset;
|
||||
int deep;
|
||||
List<VicinityItemBean> users;
|
||||
|
||||
VicinityBean(
|
||||
{required this.city,
|
||||
required this.users,
|
||||
required this.offset,
|
||||
required this.deep});
|
||||
|
||||
factory VicinityBean.fromJson(Map<String, dynamic> json) {
|
||||
List<dynamic> listsJson = json['users'];
|
||||
List<VicinityItemBean> lists =
|
||||
listsJson.map((e) => VicinityItemBean.fromJson(e)).toList();
|
||||
return VicinityBean(
|
||||
users: lists,
|
||||
city: json['city'],
|
||||
offset: json['offset'],
|
||||
deep: json['deep']);
|
||||
}
|
||||
}
|
||||
|
||||
class VicinityItemBean {
|
||||
final int id;
|
||||
final String nickname;
|
||||
final String avatar;
|
||||
final String signature;
|
||||
final String birthday;
|
||||
final int age;
|
||||
final int vip;
|
||||
final int gender;
|
||||
final int role;
|
||||
final int orientation;
|
||||
final double lng;
|
||||
final double lat;
|
||||
final String city;
|
||||
final List<Interest> interests;
|
||||
final List<String> images;
|
||||
final String avatarThumb;
|
||||
final String genderName;
|
||||
final String roleName;
|
||||
final String orientationName;
|
||||
final String bgPicUrl;
|
||||
final String onlineFlag;
|
||||
final bool isOnline;
|
||||
|
||||
VicinityItemBean({
|
||||
required this.id,
|
||||
required this.nickname,
|
||||
required this.avatar,
|
||||
required this.signature,
|
||||
required this.birthday,
|
||||
required this.age,
|
||||
required this.vip,
|
||||
required this.gender,
|
||||
required this.role,
|
||||
required this.orientation,
|
||||
required this.lng,
|
||||
required this.lat,
|
||||
required this.city,
|
||||
required this.interests,
|
||||
required this.images,
|
||||
required this.avatarThumb,
|
||||
required this.genderName,
|
||||
required this.roleName,
|
||||
required this.orientationName,
|
||||
required this.bgPicUrl,
|
||||
required this.onlineFlag,
|
||||
required this.isOnline,
|
||||
});
|
||||
|
||||
factory VicinityItemBean.fromJson(Map<String, dynamic> json) {
|
||||
var interestList = json['interests'] as List;
|
||||
List<Interest> interests =
|
||||
interestList.map((interest) => Interest.fromJson(interest)).toList();
|
||||
|
||||
return VicinityItemBean(
|
||||
id: json['id'],
|
||||
nickname: json['nickname'],
|
||||
avatar: json['avatar'],
|
||||
signature: json['signature'],
|
||||
birthday: json['birthday'],
|
||||
age: json['age'],
|
||||
vip: json['vip'],
|
||||
gender: json['gender'],
|
||||
role: json['role'],
|
||||
orientation: json['orientation'],
|
||||
lng: json['lng'],
|
||||
lat: json['lat'],
|
||||
city: json['city'],
|
||||
interests: interests,
|
||||
images: List<String>.from(json['images']),
|
||||
avatarThumb: json['avatar_thumb'],
|
||||
genderName: json['genderName'],
|
||||
roleName: json['roleName'],
|
||||
orientationName: json['orientationName'],
|
||||
bgPicUrl: json['bgPicUrl'],
|
||||
onlineFlag: json['onlineFlag'],
|
||||
isOnline: json['isOnline'],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// class Interest {
|
||||
// final int id;
|
||||
// final String title;
|
||||
// final String intro;
|
||||
// final String image;
|
||||
// final double amount;
|
||||
// final double oldAmount;
|
||||
// final String iosItem;
|
||||
// final DateTime lastCalloutTime;
|
||||
// final DateTime lastJoinTime;
|
||||
// final bool isJoin;
|
||||
// final bool isLike;
|
||||
// final bool isLimit;
|
||||
// final int viewTotal;
|
||||
// final int joinTotal;
|
||||
//
|
||||
// Interest({
|
||||
// required this.id,
|
||||
// required this.title,
|
||||
// required this.intro,
|
||||
// required this.image,
|
||||
// required this.amount,
|
||||
// required this.oldAmount,
|
||||
// required this.iosItem,
|
||||
// required this.lastCalloutTime,
|
||||
// required this.lastJoinTime,
|
||||
// required this.isJoin,
|
||||
// required this.isLike,
|
||||
// required this.isLimit,
|
||||
// required this.viewTotal,
|
||||
// required this.joinTotal,
|
||||
// });
|
||||
// factory Interest.fromJson(Map<String, dynamic> json) {
|
||||
// return Interest(
|
||||
// id: json['id'],
|
||||
// title: json['title'],
|
||||
// intro: json['intro'],
|
||||
// image: json['image'],
|
||||
// amount: json['amount'],
|
||||
// oldAmount: json['oldAmount'],
|
||||
// iosItem: json['iosItem'],
|
||||
// lastCalloutTime: DateTime.parse(json['lastCalloutTime']),
|
||||
// lastJoinTime: DateTime.parse(json['lastJoinTime']),
|
||||
// isJoin: json['isJoin'],
|
||||
// isLike: json['isLike'],
|
||||
// isLimit: json['isLimit'],
|
||||
// viewTotal: json['viewTotal'],
|
||||
// joinTotal: json['joinTotal'],
|
||||
// );
|
||||
// }
|
||||
// }
|
||||
|
||||
class InterestsBean {
|
||||
List<Circle> lists;
|
||||
|
||||
@ -263,13 +556,16 @@ class LastJoinUser {
|
||||
}
|
||||
|
||||
class DataModel {
|
||||
int visitCount = 0;
|
||||
int visitCount = 0;
|
||||
|
||||
List<dynamic> lastVisitUsers = [];
|
||||
|
||||
int likeMeCount = 0;
|
||||
|
||||
DataModel({required this.visitCount, required this.lastVisitUsers, required this.likeMeCount});
|
||||
DataModel(
|
||||
{required this.visitCount,
|
||||
required this.lastVisitUsers,
|
||||
required this.likeMeCount});
|
||||
|
||||
factory DataModel.fromJson(Map<String, dynamic> json) {
|
||||
return DataModel(
|
||||
@ -279,3 +575,85 @@ 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,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class BannerItem {
|
||||
final String name;
|
||||
final int type;
|
||||
final String? param;
|
||||
final String scene;
|
||||
final String picUrl;
|
||||
|
||||
BannerItem({
|
||||
required this.name,
|
||||
required this.type,
|
||||
this.param,
|
||||
required this.scene,
|
||||
required this.picUrl,
|
||||
});
|
||||
|
||||
factory BannerItem.fromJson(Map<String, dynamic> json) {
|
||||
return BannerItem(
|
||||
name: json['name'],
|
||||
type: json['type'],
|
||||
param: json['param'],
|
||||
scene: json['scene'],
|
||||
picUrl: json['pic_url'],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class BannerList {
|
||||
final String city;
|
||||
final List<BannerItem> banners;
|
||||
|
||||
BannerList({required this.banners, required this.city});
|
||||
|
||||
factory BannerList.fromJson(Map<String, dynamic> json) {
|
||||
final bannerList = json['banners'] as List<dynamic>;
|
||||
final banners =
|
||||
bannerList.map((item) => BannerItem.fromJson(item)).toList();
|
||||
|
||||
return BannerList(banners: banners, city: json['city']);
|
||||
}
|
||||
}
|
||||
|
||||
@ -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/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/util/util.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_swiper/flutter_swiper.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:pull_to_refresh/pull_to_refresh.dart';
|
||||
|
||||
import '../../util/eventBus.dart';
|
||||
import '../select_circle/logic.dart';
|
||||
import '../userinfo/logic.dart';
|
||||
import 'logic.dart';
|
||||
|
||||
class CirclePage extends StatefulWidget {
|
||||
@ -19,22 +26,42 @@ class CirclePage extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _CirclePageState extends State<CirclePage>
|
||||
with AutomaticKeepAliveClientMixin {
|
||||
with SingleTickerProviderStateMixin {
|
||||
late TabController _tabController;
|
||||
late PageController _pageController;
|
||||
|
||||
@override
|
||||
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 state = Get.find<CircleLogic>().state;
|
||||
|
||||
var getContext;
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
// TODO: implement dispose
|
||||
_tabController.removeListener(_handleTabChange); // 移除监听
|
||||
_tabController.dispose();
|
||||
_pageController.dispose();
|
||||
super.dispose();
|
||||
|
||||
}
|
||||
|
||||
@override
|
||||
@ -55,59 +82,47 @@ class _CirclePageState extends State<CirclePage>
|
||||
child: GetBuilder(builder: (CircleLogic controller) {
|
||||
return Stack(
|
||||
children: [
|
||||
Column(children: [
|
||||
Obx(() {
|
||||
return navigatorItem(controller.statistics.value);
|
||||
}),
|
||||
// Text(controller.state.msg),
|
||||
//组件使用
|
||||
]),
|
||||
Container(
|
||||
child: Column(children: [
|
||||
Container(
|
||||
child: Obx(() {
|
||||
return navigatorItem(controller.statistics.value);
|
||||
}),
|
||||
),
|
||||
// Text(controller.state.msg),
|
||||
//组件使用
|
||||
Expanded(
|
||||
child: Swiper(
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
var bean = logic.circle.lists[index];
|
||||
// final GlobalKey<InfoListViewState> infoListViewKey = GlobalKey<InfoListViewState>();
|
||||
return InfoListView(index, bean, logic);
|
||||
},
|
||||
onIndexChanged: (index) {
|
||||
controller.state.index = index;
|
||||
if (index == logic.circle.lists.length - 1) {
|
||||
logic.loadMore();
|
||||
|
||||
}
|
||||
print(index.toString());
|
||||
|
||||
},
|
||||
index: controller.state.index,
|
||||
itemCount: logic.circle.lists.length,
|
||||
viewportFraction: 0.93,
|
||||
// scale: 0.9,
|
||||
loop: false,
|
||||
key: UniqueKey(),
|
||||
// pagination: new SwiperPagination(),//如果不填则不显示指示点
|
||||
// control: new SwiperControl(),//如果不填则不显示左右按钮
|
||||
))
|
||||
]),
|
||||
margin: EdgeInsets.only(top: 45.sp),
|
||||
child: PageView(
|
||||
controller: _pageController,
|
||||
onPageChanged: (index) {
|
||||
_tabController.animateTo(index);
|
||||
print("index=" + index.toString());
|
||||
},
|
||||
children: [
|
||||
circleList(controller),
|
||||
vicinityList(controller),
|
||||
],
|
||||
),
|
||||
),
|
||||
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,
|
||||
)))
|
||||
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()
|
||||
],
|
||||
);
|
||||
}),
|
||||
@ -116,6 +131,422 @@ class _CirclePageState extends State<CirclePage>
|
||||
});
|
||||
}
|
||||
|
||||
Widget vicinityList(CircleLogic controller) {
|
||||
return SmartRefresher(
|
||||
controller: logic.refreshController,
|
||||
onRefresh: _onRefresh,
|
||||
onLoading: _onLoading,
|
||||
enablePullUp: logic.myVip>0,
|
||||
child: ListView.builder(
|
||||
padding: EdgeInsets.all(10.sp),
|
||||
itemCount: logic.myVip == 0 ? logic.vicinityList.length + 2 : logic.vicinityList.length + 1,
|
||||
itemBuilder: (context, index) {
|
||||
if (index == 0) {
|
||||
return bannerView(controller);
|
||||
} else {
|
||||
if (logic.myVip == 0 && index == logic.vicinityList.length+1) {
|
||||
return showVipView();
|
||||
} else {
|
||||
return ListItem(logic.vicinityList[index-1], index-1);
|
||||
}
|
||||
}
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget showVipView() {
|
||||
return Container(
|
||||
margin: EdgeInsets.only(top: 10.sp),
|
||||
color: const 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(VicinityItemBean item, int index) {
|
||||
return GestureDetector(
|
||||
onTap: (){
|
||||
Get.toNamed(AppRoutes.UserInfoActivity, arguments: item.id.toString());
|
||||
},
|
||||
child: 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: item.images.length==0? Image(
|
||||
image: AssetImage(getCircleImage("icon_list_null")),
|
||||
width: Get.width,
|
||||
fit: BoxFit.fill,
|
||||
height: 92.sp,
|
||||
):Container(),
|
||||
),
|
||||
),
|
||||
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(item.avatarThumb,
|
||||
width: 88.sp, height: 88.sp, fit: BoxFit.cover),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: SingleChildScrollView(
|
||||
scrollDirection: Axis.horizontal,
|
||||
child: Container(
|
||||
|
||||
margin: EdgeInsets.only(top: 6.sp),
|
||||
child: Row(
|
||||
children: [
|
||||
for (int i = 0; i < item.images.length; i++)
|
||||
GestureDetector(
|
||||
onTap: (){
|
||||
Get.toNamed(AppRoutes.Swiper,
|
||||
arguments: {'imaglist': item.images, 'index': i});
|
||||
},
|
||||
child: ListAlbumItem(item.images[i], i)),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 6.sp, left: 9.sp),
|
||||
child: Row(
|
||||
children: [
|
||||
Text(
|
||||
item.nickname,
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: const Color.fromRGBO(247, 250, 250, 1.0),
|
||||
fontSize: 16.sp,
|
||||
),
|
||||
),
|
||||
SizedBox(width: 8.sp),
|
||||
_buildInfoRow(item),
|
||||
const Spacer(),
|
||||
Container(
|
||||
margin: EdgeInsets.only(right: 8.sp),
|
||||
child:item.isOnline==1? Text(
|
||||
"当前在线",
|
||||
style: TextStyle(
|
||||
color: const Color.fromRGBO(247, 250, 250, 1.0),
|
||||
fontSize: 12.sp,
|
||||
),
|
||||
):Container(),
|
||||
),
|
||||
|
||||
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
height: 50.sp, // 设置固定高度
|
||||
width: Get.width,
|
||||
margin: EdgeInsets.symmetric( horizontal: 8.0),
|
||||
child: Align(
|
||||
alignment: Alignment.centerLeft, // 文本左对齐,垂直居中
|
||||
child: Text(
|
||||
item.signature,
|
||||
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(item.interests))
|
||||
]),
|
||||
],
|
||||
)),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildInterestsListView(List<Interest> interests) {
|
||||
return Align(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: 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(VicinityItemBean item) {
|
||||
String ageMsg = getAgeCOntent(item!.gender, item!.age,
|
||||
item!.role, item!.orientation);
|
||||
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(
|
||||
ageMsg,
|
||||
style: const TextStyle(
|
||||
color: Colors.black,
|
||||
fontSize: 10,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 6),
|
||||
if (item.vip > 0)
|
||||
Image(
|
||||
image: AssetImage(getBaseImage(item.vip == 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: CachedNetworkImage( width: 88.sp, height: 88.sp, fit: BoxFit.cover, imageUrl: item+"?imageView2/1/w/176/h/176/q/75",),
|
||||
);
|
||||
}
|
||||
|
||||
void _onRefresh() async {
|
||||
logic.vicinityPage = 1;
|
||||
logic.offset = 0;
|
||||
logic.getNearByList();
|
||||
// logic.refreshController.refreshCompleted();
|
||||
|
||||
}
|
||||
|
||||
void _onLoading() async {
|
||||
if(logic.myVip>0){
|
||||
logic.vicinityPage = logic.vicinityPage + 1;
|
||||
//
|
||||
logic.getNearByList();
|
||||
}else{
|
||||
logic.refreshController.loadComplete();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
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 {
|
||||
print(logic.bannerList[index].param);
|
||||
Get.toNamed(AppRoutes.WebViewActivity, arguments: {
|
||||
'title': "",
|
||||
"url": logic.bannerList[index].param.toString()
|
||||
});
|
||||
},
|
||||
child: SizedBox(
|
||||
width: Get.width,
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(15.sp),
|
||||
child: CachedNetworkImage(
|
||||
imageUrl: logic.bannerList[index].picUrl,
|
||||
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 Swiper(
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
var bean = logic.circle.lists[index];
|
||||
// final GlobalKey<InfoListViewState> infoListViewKey = GlobalKey<InfoListViewState>();
|
||||
return InfoListView(index, bean, logic);
|
||||
},
|
||||
onIndexChanged: (index) {
|
||||
controller.state.index = index;
|
||||
if (index == logic.circle.lists.length - 1) {
|
||||
logic.loadMore();
|
||||
}
|
||||
print(index.toString());
|
||||
},
|
||||
index: controller.state.index,
|
||||
itemCount: logic.circle.lists.length,
|
||||
viewportFraction: 0.93,
|
||||
// scale: 0.9,
|
||||
loop: false,
|
||||
key: UniqueKey(),
|
||||
// pagination: new SwiperPagination(),//如果不填则不显示指示点
|
||||
// control: new SwiperControl(),//如果不填则不显示左右按钮
|
||||
);
|
||||
}
|
||||
|
||||
Widget navigatorItem(DataModel statistics) {
|
||||
List<String> urlList = [];
|
||||
List infoList = [];
|
||||
@ -151,62 +582,192 @@ class _CirclePageState extends State<CirclePage>
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
Positioned(
|
||||
left: 0,
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
Get.toNamed(AppRoutes.VisitorListActivity);
|
||||
},
|
||||
child: SizedBox(
|
||||
width: 30.sp * widgets.length,
|
||||
height: 44.sp,
|
||||
child: Stack(
|
||||
alignment: Alignment.centerLeft,
|
||||
children: widgets,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
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);
|
||||
logic.isShowCircle
|
||||
? Positioned(
|
||||
left: 0,
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
Get.toNamed(AppRoutes.VisitorListActivity);
|
||||
},
|
||||
child: SizedBox(
|
||||
width: 30.sp * widgets.length,
|
||||
height: 44.sp,
|
||||
child: Stack(
|
||||
alignment: Alignment.centerLeft,
|
||||
children: widgets,
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
: GestureDetector(
|
||||
onTap: (){
|
||||
showCityPiker(context);
|
||||
},
|
||||
child: GestureDetector(
|
||||
onTap: (){
|
||||
EventBusManager.fire(ScrollToTop());
|
||||
},
|
||||
child: Text(
|
||||
'发现',
|
||||
style: TextStyle(
|
||||
fontSize: 18.sp,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: Colors.white,
|
||||
shadows: const [Shadow(color: Color(0xffF657FF), offset: Offset(0.0, -1))],
|
||||
),
|
||||
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(
|
||||
'发现',
|
||||
style: TextStyle(
|
||||
fontSize: 18.sp,
|
||||
|
||||
),
|
||||
),
|
||||
),
|
||||
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(
|
||||
right: 0,
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
Get.toNamed(AppRoutes.MyCircle, arguments: '');
|
||||
},
|
||||
child: Image.asset(
|
||||
getCircleImage('my_circle'),
|
||||
width: 64.sp,
|
||||
),
|
||||
),
|
||||
child: logic.isShowCircle
|
||||
? GestureDetector(
|
||||
onTap: () {
|
||||
Get.toNamed(AppRoutes.MyCircle, arguments: '');
|
||||
},
|
||||
child: Image.asset(
|
||||
getCircleImage('my_circle'),
|
||||
width: 64.sp,
|
||||
),
|
||||
)
|
||||
: GestureDetector(
|
||||
onTap: () {
|
||||
_showBottomSheet(context);
|
||||
},
|
||||
child: Image.asset(
|
||||
getCircleImage('icon_screen'),
|
||||
width: 24.sp,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
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) {
|
||||
logic.offset = 0;
|
||||
logic.getNearByList();
|
||||
},
|
||||
); // Use your custom widget here
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
circleWidget(String url, {double width = 30}) {
|
||||
return GestureDetector(
|
||||
child: Stack(
|
||||
@ -216,20 +777,23 @@ class _CirclePageState extends State<CirclePage>
|
||||
getCircleImage('avatar_bg'),
|
||||
width: width.sp,
|
||||
),
|
||||
url.contains("http") ? ClipOval(
|
||||
child: Image.network(
|
||||
url,
|
||||
width: (width - 1).sp,
|
||||
height: (width - 1).sp,
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
) : Text(url,style: TextStyle(color: Color(0xffF756FF),fontSize: 12.sp),)
|
||||
url.contains("http")
|
||||
? ClipOval(
|
||||
child: Image.network(
|
||||
url,
|
||||
width: (width - 1).sp,
|
||||
height: (width - 1).sp,
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
)
|
||||
: Text(
|
||||
url,
|
||||
style: TextStyle(color: Color(0xffF756FF), fontSize: 12.sp),
|
||||
)
|
||||
],
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
|
||||
void _showTextContentDialog(BuildContext context, String msg) {
|
||||
showDialog(
|
||||
context: context,
|
||||
@ -427,4 +991,33 @@ class _CirclePageState extends State<CirclePage>
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
showCityPiker(context) {
|
||||
Pickers.showMultiLinkPicker(context,
|
||||
pickerStyle: DefaultPickerStyle.dark(), data: logic.cityMap, columeNum: 2,
|
||||
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[1];
|
||||
|
||||
logic.offset = 0;
|
||||
logic.getNearByList();
|
||||
// logic.getSuccess();
|
||||
// logic.update();
|
||||
}
|
||||
|
||||
// onConfirm:(String province, String city, String? town){
|
||||
// controller.state.role = city;
|
||||
// controller.update();
|
||||
//
|
||||
// }
|
||||
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
406
circle_app/lib/app/dialog/ScreenBottomSheetDialog.dart
Normal file
406
circle_app/lib/app/dialog/ScreenBottomSheetDialog.dart
Normal file
@ -0,0 +1,406 @@
|
||||
import 'dart:async';
|
||||
|
||||
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/eventBus.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();
|
||||
}
|
||||
StreamSubscription? subscription = null;
|
||||
void initGerder() async {
|
||||
myVip = await getVip();
|
||||
subscription = EventBusManager.on<CommentVipEvent>().listen((event) {
|
||||
myVip = event.vip;
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
// TODO: implement dispose
|
||||
if (null != subscription) {
|
||||
EventBusManager.cancelSubscription(subscription!);
|
||||
}
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@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([],[],[]);
|
||||
Navigator.pop(context);
|
||||
},
|
||||
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: [
|
||||
Text(
|
||||
userInfoBean?.nickname ?? "",
|
||||
style: const TextStyle(
|
||||
style: TextStyle(
|
||||
color: Color.fromRGBO(247, 250, 250, 1.0),
|
||||
fontSize: 14,
|
||||
fontSize: 14.sp,
|
||||
),
|
||||
),
|
||||
SizedBox(width: 8.sp),
|
||||
|
||||
@ -7,6 +7,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:flutter_swiper/flutter_swiper.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import '../../../util/eventBus.dart';
|
||||
import 'logic.dart';
|
||||
|
||||
class Open_vip_tipPage extends StatelessWidget {
|
||||
@ -71,6 +72,7 @@ class Open_vip_tipPage extends StatelessWidget {
|
||||
right: 12.sp,
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
// EventBusManager.fire(CommentVipEvent(1));
|
||||
Get.back();
|
||||
},
|
||||
child: Image.asset(
|
||||
|
||||
@ -18,6 +18,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||
import 'package:get/get.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/data_services/core/core_services.dart';
|
||||
import 'package:tencent_cloud_chat_uikit/tencent_cloud_chat_uikit.dart';
|
||||
@ -433,27 +434,32 @@ class _MyAppState extends State<MyApp> with WidgetsBindingObserver {
|
||||
Widget build(BuildContext context) {
|
||||
//填入设计稿中设备的屏幕尺寸,单位dp
|
||||
// configureDio();
|
||||
return ScreenUtilInit(
|
||||
return
|
||||
ScreenUtilInit(
|
||||
designSize: const Size(375, 812),
|
||||
minTextAdapt: true,
|
||||
splitScreenMode: true,
|
||||
builder: (context, child) {
|
||||
return OKToast(
|
||||
// 2-A: wrap your app with OKToast
|
||||
textStyle: const TextStyle(fontSize: 19.0, color: Colors.white),
|
||||
backgroundColor: Colors.grey,
|
||||
animationCurve: Curves.easeIn,
|
||||
// animationBuilder: const Miui10AnimBuilder(),
|
||||
animationDuration: const Duration(milliseconds: 200),
|
||||
duration: const Duration(seconds: 2),
|
||||
child: GetMaterialApp(
|
||||
title: '微乐园',
|
||||
initialBinding: SplashBinding(),
|
||||
getPages: AppPages.routes,
|
||||
home: SplashPage(),
|
||||
builder: FlutterSmartDialog.init(),
|
||||
debugShowCheckedModeBanner: false,
|
||||
));
|
||||
return
|
||||
RefreshConfiguration(
|
||||
footerBuilder: () => CustomLoadFooter(),
|
||||
child: OKToast(
|
||||
// 2-A: wrap your app with OKToast
|
||||
textStyle: const TextStyle(fontSize: 19.0, color: Colors.white),
|
||||
backgroundColor: Colors.grey,
|
||||
animationCurve: Curves.easeIn,
|
||||
// animationBuilder: const Miui10AnimBuilder(),
|
||||
animationDuration: const Duration(milliseconds: 200),
|
||||
duration: const Duration(seconds: 2),
|
||||
child: GetMaterialApp(
|
||||
title: '微乐园',
|
||||
initialBinding: SplashBinding(),
|
||||
getPages: AppPages.routes,
|
||||
home: SplashPage(),
|
||||
builder: FlutterSmartDialog.init(),
|
||||
debugShowCheckedModeBanner: false,
|
||||
)))
|
||||
;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@ -192,12 +192,14 @@ class Api {
|
||||
|
||||
|
||||
|
||||
//附近banner
|
||||
static const getNearbyBeanner = 'user-service/nearby/banner';
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//附近列表
|
||||
static const postNearbyList = 'user-service/nearby/queryNearByUserList';
|
||||
|
||||
|
||||
|
||||
|
||||
@ -115,6 +115,14 @@ Future<String> getAuthorization() async {
|
||||
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 {
|
||||
if(Platform.isIOS){
|
||||
return true;
|
||||
|
||||
@ -10,6 +10,7 @@ import 'package:get/get.dart';
|
||||
import 'package:oktoast/oktoast.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 '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 {
|
||||
final directory = await getApplicationDocumentsDirectory();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user