Browse Source

社群刷新更改;

remove_uniapp
w-R 3 years ago
parent
commit
5a43223f65
  1. 16
      lib/community/community_child_page.dart
  2. 13
      lib/community/community_page.dart
  3. 19
      lib/community/community_view/community_dynamic.dart
  4. 4
      lib/retrofit/retrofit_api.dart
  5. 2
      lib/retrofit/retrofit_api.g.dart
  6. 2
      pubspec.lock
  7. 2
      pubspec.yaml

16
lib/community/community_child_page.dart

@ -18,15 +18,15 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
class CommunityChildPage extends StatefulWidget {
final String typeStr;
CommunityChildPage(this.typeStr);
CommunityChildPage(Key key, this.typeStr): super(key: key);
@override
State<StatefulWidget> createState() {
return _CommunityChildPage();
return CommunityChildPageState();
}
}
class _CommunityChildPage extends State<CommunityChildPage> with AutomaticKeepAliveClientMixin {
class CommunityChildPageState extends State<CommunityChildPage> with AutomaticKeepAliveClientMixin {
RefreshController refreshController = RefreshController();
ApiService apiService;
int pageNum = 1;
@ -38,10 +38,10 @@ class _CommunityChildPage extends State<CommunityChildPage> with AutomaticKeepAl
@override
void initState() {
super.initState();
_onRefresh();
onRefresh();
}
_onRefresh() async {
onRefresh() async {
setState(() {});
}
@ -120,7 +120,7 @@ class _CommunityChildPage extends State<CommunityChildPage> with AutomaticKeepAl
return MyFooter(mode);
},
),
onRefresh: _onRefresh,
onRefresh: onRefresh,
onLoading: () {
isLoadMore = true;
setState(() {});
@ -142,7 +142,7 @@ class _CommunityChildPage extends State<CommunityChildPage> with AutomaticKeepAl
isList: true,
exitFull: () {
setState(() {
_onRefresh();
onRefresh();
});
},
),
@ -154,7 +154,7 @@ class _CommunityChildPage extends State<CommunityChildPage> with AutomaticKeepAl
"userId": userId,
},
).then((value) {
_onRefresh();
onRefresh();
setState(() {});
});
setState(() {});

13
lib/community/community_page.dart

@ -21,6 +21,8 @@ class _CommunityPage extends State<CommunityPage>
TabController tabcontroller;
CommunityChildPage guanzhu,tuijian ;
final GlobalKey tuijianKey = GlobalKey();
final GlobalKey guanzhuKey = GlobalKey();
List<String> lables = [
"关注",
@ -41,6 +43,13 @@ class _CommunityPage extends State<CommunityPage>
_toRelease() async {
await Navigator.of(context).pushNamed('/router/release_dynamic');
if(tabcontroller.index == 0){
CommunityChildPageState page = guanzhuKey.currentState;
page.onRefresh();
}else if(tabcontroller.index == 1){
CommunityChildPageState page = tuijianKey.currentState;
page.onRefresh();
}
}
@override
@ -103,12 +112,12 @@ class _CommunityPage extends State<CommunityPage>
}
else if(e == "分享健康"){
if (tuijian == null){
tuijian = CommunityChildPage("分享健康");
tuijian = CommunityChildPage(tuijianKey,"分享健康");
}
return tuijian;
}else if(e == "关注"){
if (guanzhu == null){
guanzhu = CommunityChildPage("关注");
guanzhu = CommunityChildPage(guanzhuKey,"关注");
}
return guanzhu;
}

19
lib/community/community_view/community_dynamic.dart

@ -143,6 +143,17 @@ class _CommunityDynamic extends State<CommunityDynamic> {
}
}
goPersonalPage()async{
await Navigator.of(context)
.pushNamed('/router/personal_page', arguments: {
"memberId":
(widget.article.author == widget.userId)
? "0"
: widget.article.author,
});
widget.exitFull();
}
@override
Widget build(BuildContext context) {
return Column(
@ -188,13 +199,7 @@ class _CommunityDynamic extends State<CommunityDynamic> {
// index: 0, //index
// ),
// ));
Navigator.of(context)
.pushNamed('/router/personal_page', arguments: {
"memberId":
(widget.article.author == widget.userId)
? "0"
: widget.article.author,
});
goPersonalPage();
},
child: MImage(
(widget?.article?.authorHeadImg ??

4
lib/retrofit/retrofit_api.dart

@ -71,8 +71,8 @@ part 'retrofit_api.g.dart';
// const baseUrl = "http://192.168.10.37:8766/app/";
const base_url = "http://192.168.10.96:8766/app/";///
const baseUrl = "http://192.168.10.96:8766/app/";///
const base_url = "http://192.168.10.139:8766/app/";///
const baseUrl = "http://192.168.10.139:8766/app/";///
@RestApi(baseUrl: baseUrl)
abstract class ApiService {

2
lib/retrofit/retrofit_api.g.dart

@ -9,7 +9,7 @@ part of 'retrofit_api.dart';
class _ApiService implements ApiService {
_ApiService(this._dio, {this.baseUrl}) {
ArgumentError.checkNotNull(_dio, '_dio');
baseUrl ??= 'http://192.168.10.96:8766/app/';
baseUrl ??= 'http://192.168.10.139:8766/app/';
}
final Dio _dio;

2
pubspec.lock

@ -307,7 +307,7 @@ packages:
name: fluwx
url: "https://pub.flutter-io.cn"
source: hosted
version: "3.8.1+1"
version: "3.8.2"
font_awesome_flutter:
dependency: "direct main"
description:

2
pubspec.yaml

@ -13,7 +13,7 @@ dependencies:
sdk: flutter
flutter_localizations:
sdk: flutter
fluwx: ^3.5.0
fluwx: ^3.8.2
gradient_widgets: ^0.6.0

Loading…
Cancel
Save