Browse Source

2.12.0

ff_new
fengmeikan@hotmail.com 3 years ago
parent
commit
25915a9500
  1. 4
      android/app/build.gradle
  2. 1
      android/app/src/main/AndroidManifest.xml
  3. 90
      lib/address/address_map_page.dart
  4. 63
      lib/address/edit_address_page.dart
  5. 10
      lib/article/hot_article_item.dart
  6. 10
      lib/article/video_playback_page.dart
  7. 12
      lib/community/community_child_list.dart
  8. 18
      lib/community/community_child_page.dart
  9. 26
      lib/community/community_course.dart
  10. 38
      lib/community/community_details.dart
  11. 132
      lib/community/community_list.dart
  12. 5
      lib/community/community_page.dart
  13. 62
      lib/community/community_view/class_details.dart
  14. 147
      lib/community/community_view/class_details_video.dart
  15. 4
      lib/community/community_view/class_list_view.dart
  16. 2
      lib/community/community_view/class_title_tab.dart
  17. 2
      lib/community/community_view/community_comment.dart
  18. 64
      lib/community/community_view/community_dynamic.dart
  19. 2
      lib/community/community_view/course_banner.dart
  20. 16
      lib/community/community_view/home_class.dart
  21. 4
      lib/community/headlines/activity_top_list.dart
  22. 10
      lib/community/headlines/article_list.dart
  23. 14
      lib/community/headlines/article_page.dart
  24. 2
      lib/community/headlines/headlines_banner.dart
  25. 4
      lib/community/headlines/headlines_collection.dart
  26. 16
      lib/community/headlines/headlines_column_details.dart
  27. 37
      lib/community/release_dynamic.dart
  28. 13
      lib/generated/intl/messages_all.dart
  29. 1289
      lib/generated/intl/messages_en.dart
  30. 1279
      lib/generated/intl/messages_zh_CN.dart
  31. 1279
      lib/generated/intl/messages_zh_Hans_CN.dart
  32. 1277
      lib/generated/intl/messages_zh_Hant_CN.dart
  33. 1279
      lib/generated/intl/messages_zh_TW.dart
  34. 43
      lib/generated/l10n.dart
  35. 12
      lib/main.dart
  36. 26
      lib/mine/mine_page.dart
  37. 27
      lib/mine/mine_view/mine_view.dart
  38. 12
      lib/retrofit/retrofit_api.dart
  39. 26
      lib/view_widget/keyboard/keyboard_widget.dart
  40. 22
      lib/view_widget/mine_vip_view.dart
  41. 31
      lib/web/web_view/comment_list.dart
  42. 129
      pubspec.lock
  43. 22
      pubspec.yaml

4
android/app/build.gradle

@ -90,7 +90,7 @@ def mfph = [
] ]
android { android {
compileSdkVersion 30 compileSdkVersion 32
sourceSets { sourceSets {
main.java.srcDirs += 'src/main/kotlin' main.java.srcDirs += 'src/main/kotlin'
@ -106,7 +106,7 @@ android {
defaultConfig { defaultConfig {
applicationId "com.zsw.huixiang" applicationId "com.zsw.huixiang"
minSdkVersion 21 minSdkVersion 21
targetSdkVersion 30 targetSdkVersion 32
versionCode flutterVersionCode.toInteger() versionCode flutterVersionCode.toInteger()
versionName flutterVersionName versionName flutterVersionName

1
android/app/src/main/AndroidManifest.xml

@ -134,6 +134,5 @@
<meta-data <meta-data
android:name="flutterEmbedding" android:name="flutterEmbedding"
android:value="2" /> android:value="2" />
</application> </application>
</manifest> </manifest>

90
lib/address/address_map_page.dart

@ -34,21 +34,21 @@ class _AddressMapPage extends State<AddressMapPage> {
// //
void _loadCustomData() async { void _loadCustomData() async {
setState(() { setState(() {
_mapController.setCustomMapStyle('assets/map_style/chatian.sty', 0); _mapController?.setCustomMapStyle('assets/map_style/chatian.sty', 0);
}); });
} }
LocationFlutterPlugin aMapFlutterLocation; LocationFlutterPlugin? aMapFlutterLocation;
String city = "武汉市"; String? city = "武汉市";
String keyWord = ""; String? keyWord = "";
@override @override
void dispose() { void dispose() {
super.dispose(); super.dispose();
aMapFlutterLocation.stopLocation(); aMapFlutterLocation?.stopLocation();
} }
ApiService apiService; ApiService? apiService;
@override @override
void initState() { void initState() {
@ -56,35 +56,38 @@ class _AddressMapPage extends State<AddressMapPage> {
SharedPreferences.getInstance().then((value) => { SharedPreferences.getInstance().then((value) => {
apiService = ApiService(Dio(), apiService = ApiService(Dio(),
context: context, token: value.getString('token')), context: context, token: value.getString('token')!),
}); });
if (aMapFlutterLocation == null) { if (aMapFlutterLocation == null) {
aMapFlutterLocation = LocationFlutterPlugin(); aMapFlutterLocation = LocationFlutterPlugin();
aMapFlutterLocation.requestPermission(); aMapFlutterLocation!.requestPermission();
aMapFlutterLocation.onResultCallback().listen((event) { aMapFlutterLocation!.onResultCallback().listen((event) {
print("event: ${jsonEncode(event)}"); print("event: ${jsonEncode(event)}");
event = event as Map<String, Object>;
if (event != null && if (event != null &&
event["latitude"] != null && event["latitude"] != null &&
event["longitude"] != null) { event["longitude"] != null) {
city = event["city"]; city = event["city"] as String;
BMFCoordinate latLng; BMFCoordinate latLng;
if (event["latitude"] is String && event["longitude"] is String) { if (event["latitude"] is String && event["longitude"] is String) {
latLng = BMFCoordinate(double.tryParse(event["latitude"]), latLng = BMFCoordinate(
double.tryParse(event["longitude"])); double.tryParse(event["latitude"] as String)!,
double.tryParse(event["longitude"] as String)!
);
} else { } else {
latLng = BMFCoordinate(event["latitude"], event["longitude"]); latLng = BMFCoordinate(event["latitude"] as double, event["longitude"] as double);
} }
BMFCalculateUtils.coordConvert( BMFCalculateUtils.coordConvert(
coordinate: latLng, coordinate: latLng,
fromType: BMF_COORD_TYPE.COMMON, fromType: BMF_COORD_TYPE.COMMON,
toType: BMF_COORD_TYPE.BD09LL) toType: BMF_COORD_TYPE.BD09LL)
.then((value) { .then((value) {
saveLatLng(value); saveLatLng(value);
if (_mapController != null) { if (_mapController != null) {
this.latLng = Platform.isIOS ? value : latLng; this.latLng = Platform.isIOS ? value! : latLng;
addMarker(); addMarker();
_mapController.updateMapOptions( _mapController?.updateMapOptions(
BMFMapOptions( BMFMapOptions(
center: latLng, center: latLng,
zoomLevel: 15, zoomLevel: 15,
@ -134,15 +137,15 @@ class _AddressMapPage extends State<AddressMapPage> {
Map iosMap = iosOption.getMap(); Map iosMap = iosOption.getMap();
aMapFlutterLocation.prepareLoc(androidMap, iosMap); aMapFlutterLocation?.prepareLoc(androidMap, iosMap);
} }
List<Address> poiList; List<Address>? poiList;
searchPoi(BMFCoordinate latLng) async { searchPoi(BMFCoordinate latLng) async {
keyWord = textEditingController.text; keyWord = textEditingController.text;
print("keyWord: ${keyWord}"); print("keyWord: ${keyWord}");
var addressPoi = await apiService.searchPoi( var addressPoi = await apiService!.searchPoi(
"${latLng.latitude}", "${latLng.longitude}", keyWord, 20, 1); "${latLng.latitude}", "${latLng.longitude}", keyWord, 20, 1);
List<dynamic> poi = addressPoi['pois']; List<dynamic> poi = addressPoi['pois'];
poiList = poi poiList = poi
@ -199,11 +202,11 @@ class _AddressMapPage extends State<AddressMapPage> {
requestDialog(); requestDialog();
} else if (await Permission.location.isGranted) { } else if (await Permission.location.isGranted) {
// EasyLoading.show(status: S.of(context).zhengzaijiazai); // EasyLoading.show(status: S.of(context).zhengzaijiazai);
aMapFlutterLocation.startLocation(); aMapFlutterLocation?.startLocation();
Future.delayed(Duration(seconds: 6), () { Future.delayed(Duration(seconds: 6), () {
EasyLoading.dismiss(); EasyLoading.dismiss();
}); });
} else if (await Permission.location.isUndetermined) { } else if (await Permission.location.isLimited) {
await Permission.location.request(); await Permission.location.request();
} else { } else {
if (Platform.isIOS) { if (Platform.isIOS) {
@ -261,18 +264,18 @@ class _AddressMapPage extends State<AddressMapPage> {
}); });
} }
BMFMapController _mapController; BMFMapController? _mapController;
BMFCoordinate bmfCoordinate; BMFCoordinate? bmfCoordinate;
void onMapCreated(BMFMapController controller) { void onMapCreated(BMFMapController controller) {
controller.setMapRegionDidChangeCallback(callback: (status) { controller.setMapRegionDidChangeCallback(callback: (status) {
BMFMapStatus bmfMapStatus = status; BMFMapStatus bmfMapStatus = status;
print("status: ${bmfMapStatus.toMap()}"); print("status: ${bmfMapStatus.toMap()}");
if (bmfCoordinate != null && if (bmfCoordinate != null &&
bmfCoordinate.longitude == status.targetGeoPt.longitude && bmfCoordinate!.longitude == status.targetGeoPt?.longitude &&
bmfCoordinate.latitude == status.targetGeoPt.latitude) { bmfCoordinate!.latitude == status.targetGeoPt?.latitude) {
if ((DateTime.now().millisecondsSinceEpoch - time) > 1000) { if ((DateTime.now().millisecondsSinceEpoch - time) > 1000) {
center = status.targetGeoPt; center = status.targetGeoPt!;
searchPoi(center); searchPoi(center);
time = DateTime.now().millisecondsSinceEpoch; time = DateTime.now().millisecondsSinceEpoch;
} }
@ -283,14 +286,14 @@ class _AddressMapPage extends State<AddressMapPage> {
setState(() { setState(() {
_mapController = controller; _mapController = controller;
_mapController.showUserLocation(true); _mapController?.showUserLocation(true);
_loadCustomData(); _loadCustomData();
addMarker(); addMarker();
}); });
} }
BMFCoordinate latLng; BMFCoordinate? latLng;
BMFMarker bmfMarker; BMFMarker? bmfMarker;
addMarker() { addMarker() {
if (latLng == null) return; if (latLng == null) return;
@ -299,7 +302,7 @@ class _AddressMapPage extends State<AddressMapPage> {
print("map_hei: ${MediaQuery.of(context).size.height}"); print("map_hei: ${MediaQuery.of(context).size.height}");
bmfMarker = BMFMarker( bmfMarker = BMFMarker(
position: latLng, position: latLng!,
screenPointToLock: BMFPoint( screenPointToLock: BMFPoint(
(Platform.isIOS (Platform.isIOS
? MediaQuery.of(context).size.width ? MediaQuery.of(context).size.width
@ -314,9 +317,9 @@ class _AddressMapPage extends State<AddressMapPage> {
icon: "assets/image/icon_address_location.png", icon: "assets/image/icon_address_location.png",
draggable: false, draggable: false,
); );
_mapController.addMarker(bmfMarker); _mapController!.addMarker(bmfMarker!);
} }
bmfMarker.updateIsLockedToScreen( bmfMarker?.updateIsLockedToScreen(
true, true,
BMFPoint( BMFPoint(
(Platform.isIOS (Platform.isIOS
@ -329,7 +332,8 @@ class _AddressMapPage extends State<AddressMapPage> {
4)); 4));
} }
saveLatLng(BMFCoordinate latLng) async { saveLatLng(BMFCoordinate? latLng) async {
if(latLng == null) return;
SharedPreferences prefs = await SharedPreferences.getInstance(); SharedPreferences prefs = await SharedPreferences.getInstance();
await prefs.setString("latitude", "${latLng.latitude}"); await prefs.setString("latitude", "${latLng.latitude}");
await prefs.setString("longitude", "${latLng.longitude}"); await prefs.setString("longitude", "${latLng.longitude}");
@ -339,11 +343,11 @@ class _AddressMapPage extends State<AddressMapPage> {
SharedPreferences.getInstance().then((value) => { SharedPreferences.getInstance().then((value) => {
setState(() { setState(() {
if (_mapController != null) { if (_mapController != null) {
_mapController.updateMapOptions( _mapController!.updateMapOptions(
BMFMapOptions( BMFMapOptions(
center: BMFCoordinate( center: BMFCoordinate(
double.tryParse(value.getString("latitude")), double.tryParse(value.getString("latitude")!)!,
double.tryParse(value.getString("longitude")), double.tryParse(value.getString("longitude")!)!,
), ),
zoomLevel: 15, zoomLevel: 15,
), ),
@ -353,7 +357,7 @@ class _AddressMapPage extends State<AddressMapPage> {
}); });
} }
BMFMapWidget map; BMFMapWidget? map;
BMFCoordinate center = BMFCoordinate(30.553111, 114.342366); BMFCoordinate center = BMFCoordinate(30.553111, 114.342366);
@override @override
@ -433,16 +437,16 @@ class _AddressMapPage extends State<AddressMapPage> {
child: Container( child: Container(
child: ListView.separated( child: ListView.separated(
padding: EdgeInsets.symmetric(vertical: 0), padding: EdgeInsets.symmetric(vertical: 0),
itemCount: poiList != null ? poiList.length : 0, itemCount: poiList != null ? poiList!.length : 0,
itemBuilder: (context, position) { itemBuilder: (context, position) {
return InkWell( return InkWell(
onTap: () { onTap: () {
Navigator.of(context).pop(poiList[position].toJson()); Navigator.of(context).pop(poiList![position].toJson());
}, },
child: addressItem(poiList[position]), child: addressItem(poiList![position]),
); );
}, },
separatorBuilder: (contetx, position) { separatorBuilder: (context, position) {
return Container( return Container(
height: 1, height: 1,
margin: EdgeInsets.symmetric(horizontal: 16.w), margin: EdgeInsets.symmetric(horizontal: 16.w),

63
lib/address/edit_address_page.dart

@ -10,9 +10,9 @@ import 'package:shared_preferences/shared_preferences.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
class EditAddressPage extends StatefulWidget { class EditAddressPage extends StatefulWidget {
final Map<String, dynamic> arguments; final Map<String, dynamic>? arguments;
EditAddressPage({this.arguments}); EditAddressPage({required this.arguments});
@override @override
State<StatefulWidget> createState() { State<StatefulWidget> createState() {
@ -26,7 +26,7 @@ class _EditAddressPage extends State<EditAddressPage> {
TextEditingController addressController = TextEditingController(); TextEditingController addressController = TextEditingController();
TextEditingController houseNumberController = TextEditingController(); TextEditingController houseNumberController = TextEditingController();
ApiService apiService; ApiService? apiService;
@override @override
void initState() { void initState() {
@ -34,21 +34,21 @@ class _EditAddressPage extends State<EditAddressPage> {
SharedPreferences.getInstance().then((value) => { SharedPreferences.getInstance().then((value) => {
apiService = ApiService(Dio(), apiService = ApiService(Dio(),
context: context, token: value.getString('token')), context: context, token: value.getString('token')!),
queryAddress(), queryAddress(),
}); });
} }
Address preAddress; Address? preAddress;
queryAddress() async { queryAddress() async {
if (widget.arguments == null) return; if (widget.arguments == null) return;
preAddress = Address.fromJson(widget.arguments); preAddress = Address.fromJson(widget.arguments!);
nameController.text = preAddress.username; nameController.text = preAddress!.username;
mobileController.text = preAddress.phone; mobileController.text = preAddress!.phone;
addressController.text = addressController.text =
"${preAddress.province}${preAddress.city}${preAddress.area}"; "${preAddress!.province}${preAddress!.city}${preAddress!.area}";
houseNumberController.text = preAddress.address; houseNumberController.text = preAddress!.address;
setState(() {}); setState(() {});
} }
@ -86,13 +86,13 @@ class _EditAddressPage extends State<EditAddressPage> {
children: [ children: [
editItem( editItem(
S.of(context).xingming, S.of(context).xingming,
preAddress != null ? preAddress.username : "", preAddress != null ? preAddress!.username : "",
S.of(context).qingtianxiexingming, S.of(context).qingtianxiexingming,
nameController, nameController,
false), false),
editItem( editItem(
S.of(context).dianhua, S.of(context).dianhua,
preAddress != null ? preAddress.phone : "", preAddress != null ? preAddress!.phone : "",
S.of(context).qingtianxieshoujihao, S.of(context).qingtianxieshoujihao,
mobileController, mobileController,
false), false),
@ -102,14 +102,14 @@ class _EditAddressPage extends State<EditAddressPage> {
}, },
child: editItem( child: editItem(
S.of(context).dizhi, S.of(context).dizhi,
preAddress != null ? preAddress.address : "", preAddress != null ? preAddress!.address : "",
S.of(context).shouhuodizhi, S.of(context).shouhuodizhi,
addressController, addressController,
true), true),
), ),
editItem( editItem(
S.of(context).xiangxidizhi, S.of(context).xiangxidizhi,
preAddress != null ? preAddress.address : "", preAddress != null ? preAddress!.address : "",
S.of(context).menpaihao, S.of(context).menpaihao,
houseNumberController, houseNumberController,
false), false),
@ -142,21 +142,22 @@ class _EditAddressPage extends State<EditAddressPage> {
); );
} }
Map addressMap; Map? addressMap;
toMap() async { toMap() async {
Navigator.of(context).pushNamed('/router/address_map_page').then( Navigator.of(context).pushNamed('/router/address_map_page').then(
(value) => { (value) => {
if (value != null) if (value != null)
{ {
value as Map,
addressMap = value, addressMap = value,
addressController.text = addressController.text =
"${(value as Map)['province']}${(value as Map)['city']}${(value as Map)['area']}", "${(value as Map)['province']}${(value as Map)['city']}${(value as Map)['area']}",
if (preAddress != null) if (preAddress != null)
{ {
preAddress.province = addressMap['province'], preAddress!.province = addressMap?['province'],
preAddress.city = addressMap['city'], preAddress!.city = addressMap?['city'],
preAddress.area = addressMap['area'], preAddress!.area = addressMap?['area'],
}, },
houseNumberController.text = "${(value as Map)['address']}", houseNumberController.text = "${(value as Map)['address']}",
} }
@ -188,32 +189,32 @@ class _EditAddressPage extends State<EditAddressPage> {
} }
BaseData baseData; BaseData baseData;
if (preAddress == null) { if (preAddress == null) {
baseData = await apiService.addAddress({ baseData = await apiService!.addAddress({
"address": address, "address": address,
"area": addressMap != null ? addressMap['area'] : "", "area": addressMap != null ? addressMap!['area'] : "",
"city": addressMap != null ? addressMap['city'] : "", "city": addressMap != null ? addressMap!['city'] : "",
"cityInfo": "", "cityInfo": "",
"isDefault": true, "isDefault": true,
"latitude": addressMap != null ? addressMap['latitude'] : 0, "latitude": addressMap != null ? addressMap!['latitude'] : 0,
"longitude": addressMap != null ? addressMap['longitude'] : 0, "longitude": addressMap != null ? addressMap!['longitude'] : 0,
"phone": mobile, "phone": mobile,
"province": addressMap != null ? addressMap['province'] : "", "province": addressMap != null ? addressMap!['province'] : "",
"tag": "", "tag": "",
"username": name "username": name
}); });
} else { } else {
baseData = await apiService.updateAddress({ baseData = await apiService!.updateAddress({
"address": address, "address": address,
"area": preAddress != null ? preAddress.area : "", "area": preAddress != null ? preAddress!.area : "",
"city": preAddress != null ? preAddress.city : "", "city": preAddress != null ? preAddress!.city : "",
"province": preAddress != null ? preAddress.province : "", "province": preAddress != null ? preAddress!.province : "",
"cityInfo": "", "cityInfo": "",
"isDefault": true, "isDefault": true,
"latitude": preAddress != null ? preAddress.latitude : 0, "latitude": preAddress != null ? preAddress!.latitude : 0,
"longitude": preAddress != null ? preAddress.longitude : 0, "longitude": preAddress != null ? preAddress!.longitude : 0,
"phone": mobile, "phone": mobile,
"tag": "", "tag": "",
"id": preAddress != null ? preAddress.id : 0, "id": preAddress != null ? preAddress!.id : 0,
"username": name "username": name
}); });
} }

10
lib/article/hot_article_item.dart

@ -24,7 +24,7 @@ class TouTiao extends StatefulWidget {
} }
class _TouTiao extends State<TouTiao> { class _TouTiao extends State<TouTiao> {
ApiService apiService; ApiService? apiService;
List<BannerData> bannerData = []; List<BannerData> bannerData = [];
@override @override
@ -38,7 +38,7 @@ class _TouTiao extends State<TouTiao> {
super.initState(); super.initState();
SharedPreferences.getInstance().then((value) => { SharedPreferences.getInstance().then((value) => {
apiService = ApiService(Dio(), context: context, token: value.getString("token")), apiService = ApiService(Dio(), context: context, token: value.getString("token")!),
queryArticle(), queryArticle(),
}); });
} }
@ -54,7 +54,7 @@ class _TouTiao extends State<TouTiao> {
List<Article> articles = []; List<Article> articles = [];
queryArticle() async { queryArticle() async {
BaseData<PageInfo<Article>> baseData = await apiService.queryArticle({ BaseData<PageInfo<Article>> baseData = await apiService!.queryArticle({
"pageNum": pageNum, "pageNum": pageNum,
"pageSize": 10, "pageSize": 10,
"searchKey": "", "searchKey": "",
@ -90,12 +90,12 @@ class _TouTiao extends State<TouTiao> {
apiService = ApiService( apiService = ApiService(
Dio(), Dio(),
context: context, context: context,
token: value.getString("token"), token: value.getString("token")!,
showLoading: true showLoading: true
); );
} }
BaseData<PageInfo<BannerData>> baseData = BaseData<PageInfo<BannerData>> baseData =
await apiService.queryBanner({ await apiService!.queryBanner({
"model": {"type": "COURSE_BANNER"}, "model": {"type": "COURSE_BANNER"},
}).catchError((onError) { }).catchError((onError) {
refreshController.refreshFailed(); refreshController.refreshFailed();

10
lib/article/video_playback_page.dart

@ -13,8 +13,8 @@ class VideoPlaybackPage extends StatefulWidget {
class _VideoPlaybackPage extends State<VideoPlaybackPage> { class _VideoPlaybackPage extends State<VideoPlaybackPage> {
var controller = new ScrollController(); var controller = new ScrollController();
VideoPlayerController videoPlayerController; VideoPlayerController? videoPlayerController;
ChewieController chewieController; ChewieController? chewieController;
@override @override
void initState() { void initState() {
@ -26,7 +26,7 @@ class _VideoPlaybackPage extends State<VideoPlaybackPage> {
videoPlayerController = VideoPlayerController.network( videoPlayerController = VideoPlayerController.network(
'https://www.runoob.com/try/demo_source/movie.mp4'); 'https://www.runoob.com/try/demo_source/movie.mp4');
chewieController = ChewieController( chewieController = ChewieController(
videoPlayerController: videoPlayerController, videoPlayerController: videoPlayerController!,
aspectRatio: 3 / 2, aspectRatio: 3 / 2,
// //
autoPlay: !true, autoPlay: !true,
@ -48,7 +48,7 @@ class _VideoPlaybackPage extends State<VideoPlaybackPage> {
/** /**
* *
*/ */
videoPlayerController.dispose(); videoPlayerController?.dispose();
super.dispose(); super.dispose();
} }
@ -65,7 +65,7 @@ class _VideoPlaybackPage extends State<VideoPlaybackPage> {
Container( Container(
height: 274.h, height: 274.h,
child: Chewie( child: Chewie(
controller: chewieController, controller: chewieController!,
), ),
), ),
Container( Container(

12
lib/community/community_child_list.dart

@ -25,9 +25,9 @@ class CommunityChildList extends StatefulWidget {
class _CommunityChildList extends State<CommunityChildList> { class _CommunityChildList extends State<CommunityChildList> {
RefreshController refreshController = RefreshController(); RefreshController refreshController = RefreshController();
final ScrollController scrollController = ScrollController(); final ScrollController scrollController = ScrollController();
ApiService apiService; ApiService? apiService;
int pageNum = 1; int pageNum = 1;
String userId; String? userId;
bool isLoadMore = false; bool isLoadMore = false;
List<ComunityComment> comments = []; List<ComunityComment> comments = [];
@ -50,14 +50,14 @@ class _CommunityChildList extends State<CommunityChildList> {
apiService = ApiService( apiService = ApiService(
Dio(), Dio(),
context: context, context: context,
token: value.getString("token"), token: value.getString("token")!,
); );
} }
if(isLoadMore){ if(isLoadMore){
pageNum += 1; pageNum += 1;
isLoadMore = false; isLoadMore = false;
}else pageNum = 1; }else pageNum = 1;
BaseData<PageInfo<ComunityComment>> baseData = await apiService.trendList({ BaseData<PageInfo<ComunityComment>> baseData = await apiService!.trendList({
"onlyFollow": widget.typeStr == "关注" ? true : false, "onlyFollow": widget.typeStr == "关注" ? true : false,
"onlyMe": false, "onlyMe": false,
"pageNum": pageNum, "pageNum": pageNum,
@ -78,7 +78,7 @@ class _CommunityChildList extends State<CommunityChildList> {
comments.addAll(baseData.data.list); comments.addAll(baseData.data.list);
// comments.sort((a,b)=>b.createTime.compareTo(a.createTime)); // comments.sort((a,b)=>b.createTime.compareTo(a.createTime));
// print("comments: ${comments.length}"); // print("comments: ${comments.length}");
if (int.tryParse(baseData.data.total) < (pageNum * 10)) { if ((int.tryParse(baseData.data.total) ?? 0) < (pageNum * 10)) {
refreshController.loadNoData(); refreshController.loadNoData();
} }
}); });
@ -117,7 +117,7 @@ class _CommunityChildList extends State<CommunityChildList> {
children: [ children: [
CommunityList( CommunityList(
comments, comments,
userId, userId!,
0, 0,
isList: true, isList: true,
exitFull: () { exitFull: () {

18
lib/community/community_child_page.dart

@ -28,9 +28,9 @@ class CommunityChildPage extends StatefulWidget {
class _CommunityChildPage extends State<CommunityChildPage> with AutomaticKeepAliveClientMixin { class _CommunityChildPage extends State<CommunityChildPage> with AutomaticKeepAliveClientMixin {
RefreshController refreshController = RefreshController(); RefreshController refreshController = RefreshController();
ApiService apiService; ApiService? apiService;
int pageNum = 1; int pageNum = 1;
String userId; String? userId;
bool isLoadMore = false; bool isLoadMore = false;
List<Article> articles = []; List<Article> articles = [];
@ -53,7 +53,7 @@ class _CommunityChildPage extends State<CommunityChildPage> with AutomaticKeepAl
apiService = ApiService( apiService = ApiService(
Dio(), Dio(),
context: context, context: context,
token: value.getString("token"), token: value.getString("token")!,
); );
} }
if(isLoadMore){ if(isLoadMore){
@ -61,7 +61,7 @@ class _CommunityChildPage extends State<CommunityChildPage> with AutomaticKeepAl
isLoadMore = false; isLoadMore = false;
} }
else pageNum = 1; else pageNum = 1;
BaseData<PageInfo<ComunityComment>> baseData = await apiService.trendList({ BaseData<PageInfo<ComunityComment>> baseData = await apiService!.trendList({
"onlyFollow": widget.typeStr == "关注" ? true : false, "onlyFollow": widget.typeStr == "关注" ? true : false,
"onlyMe": false, "onlyMe": false,
"pageNum": pageNum, "pageNum": pageNum,
@ -84,18 +84,18 @@ class _CommunityChildPage extends State<CommunityChildPage> with AutomaticKeepAl
article.content = jsonEncode(element.subjectInfo); article.content = jsonEncode(element.subjectInfo);
article.mainTitle =element.subject; article.mainTitle =element.subject;
article.isFollow = element.selfFollow; article.isFollow = element.selfFollow;
article.authorHeadImg = element.memberInfo?.avatar; article.authorHeadImg = element.memberInfo?.avatar ?? "";
article.authorName = element.memberInfo?.nickname; article.authorName = element.memberInfo?.nickname;
article.createTime = element.createTime; article.createTime = element.createTime;
article.updateUser = element.memberInfo?.mid; article.updateUser = element.memberInfo?.mid;
article.viewers = element?.viewers; article.viewers = element?.viewers ?? 0;
article.likes = element?.likes; article.likes = element?.likes ?? 0;
article.comments = element?.comments; article.comments = element?.comments ?? 0;
articles.add(article); articles.add(article);
}); });
// comments.sort((a,b)=>b.createTime.compareTo(a.createTime)); // comments.sort((a,b)=>b.createTime.compareTo(a.createTime));
// print("comments: ${comments.length}"); // print("comments: ${comments.length}");
if (int.tryParse(baseData.data.total) < (pageNum * 10)) { if ((int.tryParse(baseData.data.total) ?? 0) < (pageNum * 10)) {
refreshController.loadNoData(); refreshController.loadNoData();
} }
} }

26
lib/community/community_course.dart

@ -36,7 +36,7 @@ class _CommunityCourse extends State<CommunityCourse>
final ScrollController scrollController = ScrollController(); final ScrollController scrollController = ScrollController();
final RefreshController refreshController = RefreshController(); final RefreshController refreshController = RefreshController();
ApiService apiService; ApiService? apiService;
List<GlobalKey> globaKeys = []; List<GlobalKey> globaKeys = [];
List<Brand> brands = []; List<Brand> brands = [];
List<BannerData> bannerData = []; List<BannerData> bannerData = [];
@ -69,11 +69,11 @@ class _CommunityCourse extends State<CommunityCourse>
apiService = ApiService( apiService = ApiService(
Dio(), Dio(),
context: context, context: context,
token: value.getString("token"), token: value.getString("token")!,
); );
} }
BaseData<PageInfo<BannerData>> baseData = BaseData<PageInfo<BannerData>> baseData =
await apiService.queryBanner({ await apiService!.queryBanner({
"model": {"type": "COURSE_BANNER"}, "model": {"type": "COURSE_BANNER"},
}).catchError((onError) { }).catchError((onError) {
refreshController.refreshFailed(); refreshController.refreshFailed();
@ -96,10 +96,10 @@ class _CommunityCourse extends State<CommunityCourse>
apiService = ApiService( apiService = ApiService(
Dio(), Dio(),
context: context, context: context,
token: value.getString("token"), token: value.getString("token")!,
); );
} }
BaseData<List<CategorySelectList>> baseData = await apiService.categoryList().catchError((onError) {}); BaseData<List<CategorySelectList>> baseData = await apiService!.categoryList().catchError((onError) {});
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
setState(() { setState(() {
classSelectList = baseData.data; classSelectList = baseData.data;
@ -116,10 +116,10 @@ class _CommunityCourse extends State<CommunityCourse>
apiService = ApiService( apiService = ApiService(
Dio(), Dio(),
context: context, context: context,
token: value.getString("token"), token: value.getString("token")!,
); );
} }
BaseData<PageInfo<CourseList>> baseData = await apiService.courseList({ BaseData<PageInfo<CourseList>> baseData = await apiService!.courseList({
"categoryId":categoryId, "categoryId":categoryId,
"pageNum": 1, "pageNum": 1,
"pageSize":10, "pageSize":10,
@ -158,10 +158,10 @@ class _CommunityCourse extends State<CommunityCourse>
apiService = ApiService( apiService = ApiService(
Dio(), Dio(),
context: context, context: context,
token: value.getString("token"), token: value.getString("token")!,
); );
} }
BaseData<List<CollectClassList>> baseData = await apiService.collectList().catchError((onError) {}); BaseData<List<CollectClassList>> baseData = await apiService!.collectList().catchError((onError) {});
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
setState(() { setState(() {
collectList.clear(); collectList.clear();
@ -181,18 +181,18 @@ class _CommunityCourse extends State<CommunityCourse>
apiService = ApiService( apiService = ApiService(
Dio(), Dio(),
context: context, context: context,
token: value.getString("token"), token: value.getString("token")!,
); );
} }
BaseData<List<CourseList>> baseData = await apiService.collect(collectId).catchError((error) { BaseData<List<CourseList>> baseData = await apiService!.collect(collectId).catchError((error) {
}); });
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
setState(() { setState(() {
if(!collectMap.containsKey(collectId)){ if(!collectMap.containsKey(collectId)){
collectMap[collectId] = []; collectMap[collectId] = [];
} }
collectMap[collectId].clear(); collectMap[collectId]?.clear();
collectMap[collectId].addAll(baseData.data); collectMap[collectId]?.addAll(baseData.data);
}); });
} }
} }

38
lib/community/community_details.dart

@ -18,7 +18,7 @@ import 'package:shared_preferences/shared_preferences.dart';
class CommunityDetails extends StatefulWidget { class CommunityDetails extends StatefulWidget {
final Map<String, dynamic> arguments; final Map<String, dynamic> arguments;
CommunityDetails({this.arguments}); CommunityDetails({required this.arguments});
@override @override
State<StatefulWidget> createState() { State<StatefulWidget> createState() {
@ -35,19 +35,19 @@ class _CommunityDetails extends State<CommunityDetails> with WidgetsBindingObser
final ScrollController scrollController = ScrollController(); final ScrollController scrollController = ScrollController();
List<MemberCommentList> memberList = []; List<MemberCommentList> memberList = [];
ApiService apiService; ApiService? apiService;
var commentFocus = FocusNode(); var commentFocus = FocusNode();
String hintText = S.current.liuxianinjingcaidepinglunba; String hintText = S.current.liuxianinjingcaidepinglunba;
bool isKeyBoardShow = false; bool isKeyBoardShow = false;
int commentTotal = 0; int commentTotal = 0;
Article article; Article? article;
String businessId; String? businessId;
@override @override
void didChangeMetrics() { void didChangeMetrics() {
WidgetsBinding.instance.addPostFrameCallback((_) { WidgetsBinding.instance?.addPostFrameCallback((_) {
if (!mounted) return; if (!mounted) return;
if (MediaQuery if (MediaQuery
.of(context) .of(context)
@ -75,7 +75,7 @@ class _CommunityDetails extends State<CommunityDetails> with WidgetsBindingObser
super.initState(); super.initState();
// comunity = widget.arguments["comment"]; // comunity = widget.arguments["comment"];
businessId = widget.arguments["businessId"]; businessId = widget.arguments["businessId"];
WidgetsBinding.instance.addObserver(this); WidgetsBinding.instance?.addObserver(this);
_queryMemberCommentList(); _queryMemberCommentList();
queryDetails(businessId); queryDetails(businessId);
@ -88,9 +88,9 @@ class _CommunityDetails extends State<CommunityDetails> with WidgetsBindingObser
apiService = ApiService( apiService = ApiService(
Dio(), Dio(),
context: context, context: context,
token: value.getString("token"), token: value.getString("token")!,
); );
BaseData<Article> baseData = await apiService.informationInfo(id) BaseData<Article> baseData = await apiService!.informationInfo(id)
.catchError((onError) { .catchError((onError) {
debugPrint(onError.toString()); debugPrint(onError.toString());
}); });
@ -122,7 +122,7 @@ class _CommunityDetails extends State<CommunityDetails> with WidgetsBindingObser
children: [ children: [
if(article != null) if(article != null)
CommunityDynamic( CommunityDynamic(
article, article!,
0, 0,
exitFull: () { exitFull: () {
setState(() {}); setState(() {});
@ -196,15 +196,15 @@ class _CommunityDetails extends State<CommunityDetails> with WidgetsBindingObser
//// ////
_queryInformationLikes() async { _queryInformationLikes() async {
BaseData baseData = await apiService.informationLikes(businessId).catchError((onError) {}); BaseData baseData = await apiService!.informationLikes(businessId).catchError((onError) {});
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
commentKey.currentState.setState(() {}); commentKey.currentState?.setState(() {});
setState(() { setState(() {
if (article?.liked ?? false) if (article?.liked ?? false)
article?.likes -= 1; article?.likes -= 1;
else else
article?.likes += 1; article?.likes += 1;
article?.liked = !(article.liked ?? false); article?.liked = !(article?.liked ?? false);
}); });
} else { } else {
// SmartDialog.showToast(baseData.msg, alignment: Alignment.center); // SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
@ -213,14 +213,14 @@ class _CommunityDetails extends State<CommunityDetails> with WidgetsBindingObser
/// ///
_queryMemberComment(String content) async { _queryMemberComment(String content) async {
BaseData baseData = await apiService.memberComment({ BaseData baseData = await apiService!.memberComment({
"content": content, "content": content,
"parentId": parenId, "parentId": parenId,
"relationalId": businessId, "relationalId": businessId,
"relationalType":4 "relationalType":4
}).catchError((error) {}); }).catchError((error) {});
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
CommentListState state = commentKey.currentState; CommentListState state = commentKey.currentState as CommentListState;
state.queryMemberCommentList(); state.queryMemberCommentList();
commentTextController.text = ""; commentTextController.text = "";
FocusScope.of(context).unfocus(); FocusScope.of(context).unfocus();
@ -231,7 +231,7 @@ class _CommunityDetails extends State<CommunityDetails> with WidgetsBindingObser
/// ///
_toComment() { _toComment() {
if (commentKey.currentContext == null) return; if (commentKey.currentContext == null) return;
RenderBox firstRenderBox = commentKey.currentContext.findRenderObject(); RenderBox firstRenderBox = commentKey.currentContext!.findRenderObject() as RenderBox;
Offset first = firstRenderBox.localToGlobal(Offset.zero); Offset first = firstRenderBox.localToGlobal(Offset.zero);
scrollController.animateTo( scrollController.animateTo(
first.dy + first.dy +
@ -273,9 +273,9 @@ class _CommunityDetails extends State<CommunityDetails> with WidgetsBindingObser
/// ///
delComment(memberComment) async { delComment(memberComment) async {
BaseData baseData = await apiService.delComment(memberComment.id); BaseData baseData = await apiService!.delComment(memberComment.id);
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
CommentListState state = commentKey.currentState; CommentListState state = commentKey.currentState as CommentListState;
state.queryMemberCommentList(); state.queryMemberCommentList();
} }
} }
@ -294,11 +294,11 @@ class _CommunityDetails extends State<CommunityDetails> with WidgetsBindingObser
apiService = ApiService( apiService = ApiService(
Dio(), Dio(),
context: context, context: context,
token: sharedPreferences.getString("token"), token: sharedPreferences.getString("token") ?? "",
showLoading: false, showLoading: false,
); );
BaseData<PageInfo<MemberCommentList>> baseData = BaseData<PageInfo<MemberCommentList>> baseData =
await apiService.memberCommentList({ await apiService!.memberCommentList({
"pageNum": 1, "pageNum": 1,
"pageSize": 100, "pageSize": 100,
"relationalId": businessId, "relationalId": businessId,

132
lib/community/community_list.dart

@ -19,19 +19,11 @@ class CommunityList extends StatefulWidget {
final String userId; final String userId;
final int commentType; final int commentType;
final bool isList; final bool isList;
final Function exitFull; final Function? exitFull;
final Function removalDynamic; final Function? removalDynamic;
CommunityList( CommunityList(this.comments, this.userId, this.commentType,
this.comments, {this.isList = false, this.exitFull, this.removalDynamic});
this.userId,
this.commentType,{
this.isList = false,
this.exitFull,
this.removalDynamic
}
);
@override @override
State<StatefulWidget> createState() { State<StatefulWidget> createState() {
@ -40,7 +32,7 @@ class CommunityList extends StatefulWidget {
} }
class _CommunityList extends State<CommunityList> { class _CommunityList extends State<CommunityList> {
ApiService apiService; ApiService? apiService;
@override @override
void initState() { void initState() {
@ -48,15 +40,17 @@ class _CommunityList extends State<CommunityList> {
SharedPreferences.getInstance().then((value) => { SharedPreferences.getInstance().then((value) => {
apiService = ApiService(Dio(), apiService = ApiService(Dio(),
context: context, token: value.getString("token")), context: context, token: value.getString("token")??""),
}); });
} }
//// ////
_vipFollow(followId, isFollow) async { _vipFollow(followId, isFollow) async {
BaseData baseData = await apiService.follow(followId); BaseData baseData = await apiService!.follow(followId);
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
widget.exitFull(); if(widget.exitFull != null) {
widget.exitFull!();
}
SmartDialog.showToast(isFollow ? "关注成功" : "取关成功", SmartDialog.showToast(isFollow ? "关注成功" : "取关成功",
alignment: Alignment.center); alignment: Alignment.center);
setState(() {}); setState(() {});
@ -67,9 +61,11 @@ class _CommunityList extends State<CommunityList> {
/// ///
_deleteDynamic(id) async { _deleteDynamic(id) async {
BaseData baseData = await apiService.deleteTrend(id); BaseData baseData = await apiService!.deleteTrend(id);
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
widget.exitFull(); if(widget.exitFull != null) {
widget.exitFull!();
}
SmartDialog.showToast("删除成功", alignment: Alignment.center); SmartDialog.showToast("删除成功", alignment: Alignment.center);
setState(() {}); setState(() {});
} else { } else {
@ -96,14 +92,15 @@ class _CommunityList extends State<CommunityList> {
Navigator.of(context) Navigator.of(context)
.pushNamed('/router/new_community_details', arguments: { .pushNamed('/router/new_community_details', arguments: {
"commentsId": widget.comments[position].id, "commentsId": widget.comments[position].id,
"userId":widget.userId, "userId": widget.userId,
// exitFull: () { // exitFull: () {
// setState(() {}); // setState(() {});
// }, // },
}).then((value) { }).then((value) {
widget.exitFull(); if(widget.exitFull != null) {
setState(() { widget.exitFull!();
}); }
setState(() {});
}); });
setState(() {}); setState(() {});
}, },
@ -116,7 +113,7 @@ class _CommunityList extends State<CommunityList> {
} }
/// ///
Widget buildMedia(SubjectInfo subjectInfo, position) { Widget buildMedia(SubjectInfo? subjectInfo, position) {
if (subjectInfo == null) { if (subjectInfo == null) {
return Container(); return Container();
} }
@ -139,7 +136,7 @@ class _CommunityList extends State<CommunityList> {
fit: BoxFit.contain, fit: BoxFit.contain,
radius: BorderRadius.circular(2), radius: BorderRadius.circular(2),
width: MediaQuery.of(context).size.width / 1.5, width: MediaQuery.of(context).size.width / 1.5,
height: MediaQuery.of(context).size.width/1.5, height: MediaQuery.of(context).size.width / 1.5,
errorSrc: "assets/image/default_2_1.png", errorSrc: "assets/image/default_2_1.png",
fadeSrc: "assets/image/default_2_1.png", fadeSrc: "assets/image/default_2_1.png",
)), )),
@ -305,54 +302,55 @@ class _CommunityList extends State<CommunityList> {
), ),
), ),
if ((comments?.memberInfo?.mid ?? "") != (widget.userId)) if ((comments?.memberInfo?.mid ?? "") != (widget.userId))
GestureDetector( GestureDetector(
onTap: () { onTap: () {
setState(() { setState(() {
if (widget.commentType == 0) { if (widget.commentType == 0) {
comments.selfFollow = !(comments.selfFollow ?? false); comments.selfFollow =
_vipFollow(comments?.memberInfo?.mid,comments?.selfFollow ?? false); !(comments.selfFollow ?? false);
} else { _vipFollow(comments?.memberInfo?.mid,
showDeleteDialog(position); comments?.selfFollow ?? false);
} } else {
}); showDeleteDialog(position);
}, }
child: });
(widget.commentType == 0) ? },
Container( child: (widget.commentType == 0)
width: 56.w, ? Container(
height: 25.h, width: 56.w,
alignment: Alignment.center,
child: RoundButton(
height: 25.h, height: 25.h,
backgroup: (comments?.selfFollow ?? false) alignment: Alignment.center,
? Color(0xFFE6E6E6) child: RoundButton(
: Color(0xFF32A060), height: 25.h,
textColor: (comments?.selfFollow ?? false) backgroup: (comments?.selfFollow ?? false)
? Color(0xFF808080) ? Color(0xFFE6E6E6)
: Colors.white, : Color(0xFF32A060),
text: (comments?.selfFollow ?? false) textColor: (comments?.selfFollow ?? false)
? "已关注"
: "关注",
radius: 20,
icons: Icon(
(comments?.selfFollow ?? false)
? Icons.check
: Icons.add,
color: (comments?.selfFollow ?? false)
? Color(0xFF808080) ? Color(0xFF808080)
: Colors.white, : Colors.white,
size: 15, text: (comments?.selfFollow ?? false)
? "已关注"
: "关注",
radius: 20,
icons: Icon(
(comments?.selfFollow ?? false)
? Icons.check
: Icons.add,
color: (comments?.selfFollow ?? false)
? Color(0xFF808080)
: Colors.white,
size: 15,
),
))
: Padding(
padding: EdgeInsets.all(20),
child: Icon(
Icons.close,
color: Colors.black,
size: 16,
), ),
))
: Padding(
padding: EdgeInsets.all(20),
child: Icon(
Icons.close,
color: Colors.black,
size: 16,
), ),
), ),
),
], ],
), ),
SizedBox( SizedBox(

5
lib/community/community_page.dart

@ -19,9 +19,9 @@ class CommunityPage extends StatefulWidget {
class _CommunityPage extends State<CommunityPage> class _CommunityPage extends State<CommunityPage>
with SingleTickerProviderStateMixin { with SingleTickerProviderStateMixin {
TabController tabcontroller; TabController? tabcontroller;
CommunityChildPage guanzhu,tuijian ; CommunityChildPage? guanzhu,tuijian ;
List<String> lables = [ List<String> lables = [
"关注", "关注",
@ -95,6 +95,7 @@ class _CommunityPage extends State<CommunityPage>
child: TabBarView( child: TabBarView(
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
children: lables.map((e) { children: lables.map((e) {
e as String
if (e == "关于我们") { if (e == "关于我们") {
return BrandPage(); return BrandPage();
}else if(e == "头条"){ }else if(e == "头条"){

62
lib/community/community_view/class_details.dart

@ -20,7 +20,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
class ClassDetails extends StatefulWidget { class ClassDetails extends StatefulWidget {
final Map<String, dynamic> arguments; final Map<String, dynamic> arguments;
ClassDetails({this.arguments}); ClassDetails({required this.arguments});
@override @override
State<StatefulWidget> createState() { State<StatefulWidget> createState() {
@ -29,7 +29,7 @@ class ClassDetails extends StatefulWidget {
} }
class _ClassDetails extends State<ClassDetails> with WidgetsBindingObserver { class _ClassDetails extends State<ClassDetails> with WidgetsBindingObserver {
ApiService apiService; ApiService? apiService;
final GlobalKey commentKey = GlobalKey(); final GlobalKey commentKey = GlobalKey();
final GlobalKey videoKey = GlobalKey(); final GlobalKey videoKey = GlobalKey();
final ScrollController scrollController = ScrollController(); final ScrollController scrollController = ScrollController();
@ -40,7 +40,7 @@ class _ClassDetails extends State<ClassDetails> with WidgetsBindingObserver {
final GlobalKey inputKey = GlobalKey(); final GlobalKey inputKey = GlobalKey();
final TextEditingController commentTextController = TextEditingController(); final TextEditingController commentTextController = TextEditingController();
int commentTotal = 0; int commentTotal = 0;
CourseDetails course; CourseDetails? course;
List<Chapter> chapterList = []; List<Chapter> chapterList = [];
bool isShowImg = true; bool isShowImg = true;
int chapterIndex = 0; int chapterIndex = 0;
@ -50,7 +50,7 @@ class _ClassDetails extends State<ClassDetails> with WidgetsBindingObserver {
@override @override
void initState() { void initState() {
super.initState(); super.initState();
WidgetsBinding.instance.addObserver(this); WidgetsBinding.instance?.addObserver(this);
courseDetails(widget.arguments["id"]); courseDetails(widget.arguments["id"]);
queryChapterList(widget.arguments["id"]); queryChapterList(widget.arguments["id"]);
} }
@ -62,17 +62,17 @@ class _ClassDetails extends State<ClassDetails> with WidgetsBindingObserver {
apiService = ApiService( apiService = ApiService(
Dio(), Dio(),
context: context, context: context,
token: value.getString("token"), token: value.getString("token")!,
); );
} }
BaseData<List<Chapter>> baseData = BaseData<List<Chapter>> baseData =
await apiService.catalogList(courseId).catchError((onError) {}); await apiService!.catalogList(courseId).catchError((onError) {});
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
setState(() { setState(() {
chapterList.clear(); chapterList.clear();
chapterList.addAll(baseData.data); chapterList.addAll(baseData.data);
chapterIndex = 0; chapterIndex = 0;
ClassDetailsVideoState state = videoKey.currentState; ClassDetailsVideoState state = videoKey.currentState as ClassDetailsVideoState;
state.initVideo(chapterList[chapterIndex].content.fileUrl); state.initVideo(chapterList[chapterIndex].content.fileUrl);
// initVideo(chapterList[chapterIndex].content.fileUrl); // initVideo(chapterList[chapterIndex].content.fileUrl);
}); });
@ -87,11 +87,11 @@ class _ClassDetails extends State<ClassDetails> with WidgetsBindingObserver {
apiService = ApiService( apiService = ApiService(
Dio(), Dio(),
context: context, context: context,
token: value.getString("token"), token: value.getString("token")!,
); );
} }
BaseData<CourseDetails> baseData = BaseData<CourseDetails> baseData =
await apiService.course(id).catchError((error) {}); await apiService!.course(id).catchError((error) {});
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
setState(() { setState(() {
course = baseData.data; course = baseData.data;
@ -101,7 +101,7 @@ class _ClassDetails extends State<ClassDetails> with WidgetsBindingObserver {
@override @override
void didChangeMetrics() { void didChangeMetrics() {
WidgetsBinding.instance.addPostFrameCallback((_) { WidgetsBinding.instance?.addPostFrameCallback((_) {
if (!mounted) return; if (!mounted) return;
if (MediaQuery.of(context).viewInsets.bottom == 0) { if (MediaQuery.of(context).viewInsets.bottom == 0) {
if (isKeyBoardShow) { if (isKeyBoardShow) {
@ -171,7 +171,7 @@ class _ClassDetails extends State<ClassDetails> with WidgetsBindingObserver {
), ),
onTap: () { onTap: () {
Navigator.of(context).pop( Navigator.of(context).pop(
course != null ? course.viewers + 1 : 0); course != null ? course!.viewers + 1 : 0);
}, },
), ),
], ],
@ -212,9 +212,9 @@ class _ClassDetails extends State<ClassDetails> with WidgetsBindingObserver {
), ),
), ),
child: Text( child: Text(
(course?.tags != null && (course != null && course!.tags != null &&
course.tags.length > 0) course!.tags.length > 0)
? course.tags[0] ? course!.tags[0]
: "", : "",
overflow:TextOverflow.ellipsis, overflow:TextOverflow.ellipsis,
style: TextStyle( style: TextStyle(
@ -229,7 +229,7 @@ class _ClassDetails extends State<ClassDetails> with WidgetsBindingObserver {
), ),
Expanded( Expanded(
child: Text( child: Text(
course != null ? course.subject : "", course != null ? course!.subject : "",
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
maxLines: 2, maxLines: 2,
style: TextStyle( style: TextStyle(
@ -251,7 +251,7 @@ class _ClassDetails extends State<ClassDetails> with WidgetsBindingObserver {
children: [ children: [
Expanded( Expanded(
child: Text( child: Text(
"讲师:${course != null ? course.author.name : ""}", "讲师:${course != null ? course!.author.name : ""}",
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
maxLines: 2, maxLines: 2,
style: TextStyle( style: TextStyle(
@ -273,7 +273,7 @@ class _ClassDetails extends State<ClassDetails> with WidgetsBindingObserver {
), ),
Text( Text(
course != null course != null
? course.viewers.toString() ? course!.viewers.toString()
: "", : "",
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
maxLines: 2, maxLines: 2,
@ -290,7 +290,7 @@ class _ClassDetails extends State<ClassDetails> with WidgetsBindingObserver {
height: 10.h, height: 10.h,
), ),
Text( Text(
course != null ? course.introduce : "", course != null ? course!.introduce : "",
overflow: isShowMore overflow: isShowMore
? TextOverflow.visible ? TextOverflow.visible
: TextOverflow.ellipsis, : TextOverflow.ellipsis,
@ -381,7 +381,7 @@ class _ClassDetails extends State<ClassDetails> with WidgetsBindingObserver {
_toComment, _toComment,
_queryMemberComment, _queryMemberComment,
_queryCourseLikes, _queryCourseLikes,
isLike: course?.selfLiked, isLike: course!.selfLiked,
), ),
], ],
), ),
@ -432,7 +432,7 @@ class _ClassDetails extends State<ClassDetails> with WidgetsBindingObserver {
setState(() { setState(() {
chapterIndex = position; chapterIndex = position;
isShowImg = true; isShowImg = true;
ClassDetailsVideoState state = videoKey.currentState; ClassDetailsVideoState state = videoKey.currentState as ClassDetailsVideoState;
state.initVideo(chapterList[position].content.fileUrl); state.initVideo(chapterList[position].content.fileUrl);
// initVideo(chapterList[position].content.fileUrl); // initVideo(chapterList[position].content.fileUrl);
}); });
@ -475,18 +475,18 @@ class _ClassDetails extends State<ClassDetails> with WidgetsBindingObserver {
/// ///
_queryCourseLikes() async { _queryCourseLikes() async {
BaseData baseData = await apiService BaseData baseData = await apiService!
.courseLikes(widget.arguments["id"]) .courseLikes(widget.arguments["id"])
.catchError((onError) {}); .catchError((onError) {});
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
setState(() { setState(() {
if (course.selfLiked ?? false) if (course?.selfLiked ?? false)
course.likes -= 1; course?.likes -= 1;
else else
course.likes += 1; course?.likes += 1;
course.selfLiked = !course.selfLiked ?? false; course?.selfLiked = !(course?.selfLiked ?? false);
}); });
commentKey.currentState.setState(() {}); commentKey.currentState?.setState(() {});
} else { } else {
// SmartDialog.showToast(baseData.msg, alignment: Alignment.center); // SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
} }
@ -494,14 +494,14 @@ class _ClassDetails extends State<ClassDetails> with WidgetsBindingObserver {
/// ///
_queryMemberComment(String content) async { _queryMemberComment(String content) async {
BaseData baseData = await apiService.memberComment({ BaseData baseData = await apiService!.memberComment({
"content": content, "content": content,
"parentId": parenId, "parentId": parenId,
"relationalId": widget.arguments["id"], "relationalId": widget.arguments["id"],
"relationalType": 3 "relationalType": 3
}).catchError((error) {}); }).catchError((error) {});
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
CommentListState state = commentKey.currentState; CommentListState state = commentKey.currentState as CommentListState;
state.queryMemberCommentList(); state.queryMemberCommentList();
commentTextController.text = ""; commentTextController.text = "";
FocusScope.of(context).unfocus(); FocusScope.of(context).unfocus();
@ -512,7 +512,7 @@ class _ClassDetails extends State<ClassDetails> with WidgetsBindingObserver {
/// ///
_toComment() { _toComment() {
if (commentKey.currentContext == null) return; if (commentKey.currentContext == null) return;
RenderBox firstRenderBox = commentKey.currentContext.findRenderObject(); RenderBox firstRenderBox = commentKey.currentContext!.findRenderObject() as RenderBox;
Offset first = firstRenderBox.localToGlobal(Offset.zero); Offset first = firstRenderBox.localToGlobal(Offset.zero);
scrollController.animateTo( scrollController.animateTo(
first.dy + first.dy +
@ -532,9 +532,9 @@ class _ClassDetails extends State<ClassDetails> with WidgetsBindingObserver {
/// ///
delComment(memberComment) async { delComment(memberComment) async {
BaseData baseData = await apiService.delComment(memberComment.id); BaseData baseData = await apiService!.delComment(memberComment.id);
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
CommentListState state = commentKey.currentState; CommentListState state = commentKey.currentState as CommentListState;
state.queryMemberCommentList(); state.queryMemberCommentList();
} }
} }

147
lib/community/community_view/class_details_video.dart

@ -6,23 +6,22 @@ import 'package:huixiang/view_widget/custom_image.dart';
import 'package:video_player/video_player.dart'; import 'package:video_player/video_player.dart';
class ClassDetailsVideo extends StatefulWidget { class ClassDetailsVideo extends StatefulWidget {
final Function(bool isShowImg) changeShowImg; final Function(bool isShowImg)? changeShowImg;
final Function(double height) heightFun; final Function(double height)? heightFun;
final bool isShowImg; final bool? isShowImg;
final Function exitFull; final Function? exitFull;
final String coverImg; final String? coverImg;
final String videoUrl; final String? videoUrl;
ClassDetailsVideo( ClassDetailsVideo(
{ {Key? key,
Key key, this.changeShowImg,
this.changeShowImg, this.isShowImg,
this.isShowImg, this.exitFull,
this.exitFull, this.heightFun,
this.heightFun, this.coverImg,
this.coverImg, this.videoUrl})
this.videoUrl : super(key: key);
}) : super(key: key);
@override @override
State<StatefulWidget> createState() { State<StatefulWidget> createState() {
@ -31,9 +30,9 @@ class ClassDetailsVideo extends StatefulWidget {
} }
class ClassDetailsVideoState extends State<ClassDetailsVideo> { class ClassDetailsVideoState extends State<ClassDetailsVideo> {
VideoPlayerController videoPlayerController; VideoPlayerController? videoPlayerController;
ChewieController chewieAudioController; ChewieController? chewieAudioController;
Chewie chewies; Chewie? chewies;
GlobalKey globalKey = GlobalKey(); GlobalKey globalKey = GlobalKey();
double height = 0; double height = 0;
@ -43,7 +42,7 @@ class ClassDetailsVideoState extends State<ClassDetailsVideo> {
SystemChrome.setPreferredOrientations([ SystemChrome.setPreferredOrientations([
DeviceOrientation.portraitUp, DeviceOrientation.portraitUp,
]); ]);
if(widget.videoUrl != null){ if (widget.videoUrl != null) {
initVideo(widget.videoUrl); initVideo(widget.videoUrl);
} }
} }
@ -51,56 +50,61 @@ class ClassDetailsVideoState extends State<ClassDetailsVideo> {
@override @override
void didChangeDependencies() { void didChangeDependencies() {
if (widget.heightFun != null) if (widget.heightFun != null)
WidgetsBinding.instance.addPostFrameCallback(_getContainerHeight); WidgetsBinding.instance?.addPostFrameCallback(_getContainerHeight);
super.didChangeDependencies(); super.didChangeDependencies();
} }
_getContainerHeight(_) { _getContainerHeight(_) {
if (globalKey.currentContext != null) if (globalKey.currentContext != null)
height = globalKey.currentContext.size.height; height = globalKey.currentContext!.size!.height;
if (widget.heightFun != null) widget.heightFun(height); if (widget.heightFun != null) widget.heightFun!(height);
print("height: $height"); print("height: $height");
} }
initVideo(videoUrl) async { initVideo(videoUrl) async {
if (videoPlayerController != null) { if (videoPlayerController != null) {
videoPlayerController.pause(); videoPlayerController!.pause();
videoPlayerController.dispose(); videoPlayerController!.dispose();
} }
videoPlayerController = VideoPlayerController.network( videoPlayerController = VideoPlayerController.network(
videoUrl, videoUrl,
)..initialize().then((value) { )..initialize().then((value) {
chewieAudioController = ChewieController( chewieAudioController = ChewieController(
videoPlayerController: videoPlayerController, videoPlayerController: videoPlayerController!,
aspectRatio: videoPlayerController.value.aspectRatio, aspectRatio: videoPlayerController!.value.aspectRatio,
// //
autoPlay: false, autoPlay: false,
// //
looping: false, looping: false,
// //
allowFullScreen: true, allowFullScreen: true,
// //
materialProgressColors: chewie.ChewieProgressColors( materialProgressColors: chewie.ChewieProgressColors(
playedColor: Colors.white, playedColor: Colors.white,
handleColor: Colors.white, handleColor: Colors.white,
backgroundColor: Colors.grey, backgroundColor: Colors.grey,
bufferedColor: Colors.transparent, bufferedColor: Colors.transparent,
), ),
autoInitialize: true, autoInitialize: true,
); );
chewieAudioController.addListener(_fullScreenListener); chewieAudioController!.addListener(_fullScreenListener);
if (mounted) setState(() {}); if (mounted) setState(() {});
}); });
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
key: globalKey,child:(videoPlayerController?.value?.isInitialized ?? false) ?videoWidget( key: globalKey,
MediaQuery.of(context).size.width, child: (videoPlayerController?.value.isInitialized ?? false)
(MediaQuery.of(context).size.width/videoPlayerController.value.aspectRatio)-43, ? videoWidget(
widget.coverImg, MediaQuery.of(context).size.width,
):Container()); (MediaQuery.of(context).size.width /
videoPlayerController!.value.aspectRatio) -
43,
widget.coverImg,
)
: Container());
} }
@override @override
@ -108,16 +112,15 @@ class ClassDetailsVideoState extends State<ClassDetailsVideo> {
super.dispose(); super.dispose();
if (chewieAudioController != null) { if (chewieAudioController != null) {
chewieAudioController.pause(); chewieAudioController!.pause();
chewieAudioController.dispose(); chewieAudioController!.dispose();
chewieAudioController = null; chewieAudioController = null;
} }
if (videoPlayerController != null) { if (videoPlayerController != null) {
videoPlayerController.pause(); videoPlayerController!.pause();
videoPlayerController.dispose(); videoPlayerController!.dispose();
} }
} }
Widget videoWidget(double width, double height, src) { Widget videoWidget(double width, double height, src) {
@ -129,26 +132,26 @@ class ClassDetailsVideoState extends State<ClassDetailsVideo> {
child: Stack(children: [ child: Stack(children: [
(chewieAudioController != null (chewieAudioController != null
? Container( ? Container(
color: Colors.black, color: Colors.black,
width: width, width: width,
// height: width / 7 * 5, // height: width / 7 * 5,
height: height, height: height,
child: chewies = Chewie( child: chewies = Chewie(
controller: chewieAudioController, controller: chewieAudioController!,
), ),
) )
: Container( : Container(
width: width, width: width,
// height:width / 7 * 5, // height:width / 7 * 5,
height: height, height: height,
)), )),
if (widget.isShowImg) if (widget.isShowImg ?? false)
GestureDetector( GestureDetector(
onTap: () { onTap: () {
setState(() { setState(() {
widget.changeShowImg(false); widget.changeShowImg!(false);
if (chewieAudioController != null) if (chewieAudioController != null)
chewieAudioController.play(); chewieAudioController!.play();
}); });
}, },
child: Container( child: Container(
@ -185,9 +188,9 @@ class ClassDetailsVideoState extends State<ClassDetailsVideo> {
} }
Future<void> _fullScreenListener() async { Future<void> _fullScreenListener() async {
if (!chewieAudioController.isFullScreen) { if (!chewieAudioController!.isFullScreen) {
Future.delayed(Duration(seconds: 1), () { Future.delayed(Duration(seconds: 1), () {
widget.exitFull(); widget.exitFull!();
}); });
} }
} }

4
lib/community/community_view/class_list_view.dart

@ -45,7 +45,9 @@ class _ClassListView extends State<ClassListView> {
onTap: () { onTap: () {
Navigator.of(context).pushNamed('/router/class_details', Navigator.of(context).pushNamed('/router/class_details',
arguments: {"id": widget.classList[index].id}) arguments: {"id": widget.classList[index].id})
.then((value) => {widget.classList[index].viewers = value != null?value:widget.classList[index].viewers+1}); .then((value) => {
widget.classList[index].viewers = value != null ? value as int : widget.classList[index].viewers+1
});
}, },
child: classListItem(widget.classList[index]), child: classListItem(widget.classList[index]),
); );

2
lib/community/community_view/class_title_tab.dart

@ -20,7 +20,7 @@ class ClassTitleTab extends StatefulWidget {
class _ClassTitleTab extends State<ClassTitleTab> class _ClassTitleTab extends State<ClassTitleTab>
with SingleTickerProviderStateMixin { with SingleTickerProviderStateMixin {
TabController tabController; TabController? tabController;
@override @override
void initState() { void initState() {

2
lib/community/community_view/community_comment.dart

@ -122,7 +122,7 @@ class _CommunityComment extends State<CommunityComment> {
: widget.memberList.liked; : widget.memberList.liked;
}, },
likeCount: widget.memberList.likes, likeCount: widget.memberList.likes,
countBuilder: (int count, bool isLiked, String text) { countBuilder: (int? count, bool isLiked, String text) {
return Text( return Text(
text, text,
style: TextStyle( style: TextStyle(

64
lib/community/community_view/community_dynamic.dart

@ -21,19 +21,19 @@ import '../photo_view_gallery_screen.dart';
class CommunityDynamic extends StatefulWidget { class CommunityDynamic extends StatefulWidget {
final int itemCount; final int itemCount;
final Function(double height) heightFun; final Function(double height)? heightFun;
final bool isDetails; final bool isDetails;
final int commentType; final int commentType;
final Function removalDynamic; final Function? removalDynamic;
final Function exitFull; final Function? exitFull;
final bool isList; final bool isList;
final Article article; final Article article;
final String userId; final String? userId;
CommunityDynamic( CommunityDynamic(
this.article, this.article,
this.commentType, { this.commentType, {
Key key, Key? key,
this.itemCount = 9, this.itemCount = 9,
this.heightFun, this.heightFun,
this.isDetails = false, this.isDetails = false,
@ -52,11 +52,11 @@ class CommunityDynamic extends StatefulWidget {
class _CommunityDynamic extends State<CommunityDynamic> { class _CommunityDynamic extends State<CommunityDynamic> {
GlobalKey globalKey = GlobalKey(); GlobalKey globalKey = GlobalKey();
double height = 0; double height = 0;
ApiService apiService; ApiService? apiService;
VideoPlayerController videoPlayerController; VideoPlayerController? videoPlayerController;
ChewieController chewieAudioController; ChewieController? chewieAudioController;
Chewie chewies; Chewie? chewies;
@override @override
void initState() { void initState() {
@ -66,14 +66,14 @@ class _CommunityDynamic extends State<CommunityDynamic> {
apiService = ApiService( apiService = ApiService(
Dio(), Dio(),
context: context, context: context,
token: value.getString('token'), token: value.getString('token')!,
), ),
}, },
); );
initVideo(); initVideo();
} }
String filePath; String? filePath;
initVideo() async { initVideo() async {
if (widget?.article?.content == null) return; if (widget?.article?.content == null) return;
@ -88,8 +88,8 @@ class _CommunityDynamic extends State<CommunityDynamic> {
cnt["video"], cnt["video"],
)..initialize().then((value) { )..initialize().then((value) {
chewieAudioController = ChewieController( chewieAudioController = ChewieController(
videoPlayerController: videoPlayerController, videoPlayerController: videoPlayerController!,
aspectRatio: videoPlayerController.value.aspectRatio, aspectRatio: videoPlayerController!.value.aspectRatio,
// //
autoPlay: false, autoPlay: false,
// //
@ -105,7 +105,7 @@ class _CommunityDynamic extends State<CommunityDynamic> {
), ),
autoInitialize: true, autoInitialize: true,
); );
chewieAudioController.addListener(_fullScreenListener); chewieAudioController!.addListener(_fullScreenListener);
if (mounted) setState(() {}); if (mounted) setState(() {});
}); });
} }
@ -114,9 +114,9 @@ class _CommunityDynamic extends State<CommunityDynamic> {
//// ////
_vipFollow(followId, isFollow) async { _vipFollow(followId, isFollow) async {
BaseData baseData = await apiService.follow(followId); BaseData baseData = await apiService!.follow(followId);
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
widget.exitFull(); widget.exitFull!();
SmartDialog.showToast(isFollow ? "关注成功" : "取关成功", SmartDialog.showToast(isFollow ? "关注成功" : "取关成功",
alignment: Alignment.center); alignment: Alignment.center);
setState(() {}); setState(() {});
@ -127,9 +127,9 @@ class _CommunityDynamic extends State<CommunityDynamic> {
/// ///
_deleteDynamic(id) async { _deleteDynamic(id) async {
BaseData baseData = await apiService.deleteTrend(id); BaseData baseData = await apiService!.deleteTrend(id);
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
widget.exitFull(); widget.exitFull!();
SmartDialog.showToast("删除成功", alignment: Alignment.center); SmartDialog.showToast("删除成功", alignment: Alignment.center);
setState(() {}); setState(() {});
} else { } else {
@ -222,7 +222,7 @@ class _CommunityDynamic extends State<CommunityDynamic> {
], ],
), ),
), ),
if (widget?.article?.updateUser != widget.userId ?? "") if (widget?.article?.updateUser != (widget.userId ?? ""))
GestureDetector( GestureDetector(
onTap: () { onTap: () {
setState(() { setState(() {
@ -342,7 +342,7 @@ class _CommunityDynamic extends State<CommunityDynamic> {
} }
/// ///
Widget buildMedia(String subjectInfo) { Widget buildMedia(String? subjectInfo) {
if (subjectInfo == null || !subjectInfo.startsWith("{")) { if (subjectInfo == null || !subjectInfo.startsWith("{")) {
return Container(); return Container();
} }
@ -425,7 +425,7 @@ class _CommunityDynamic extends State<CommunityDynamic> {
MediaQuery.of(context).size.width - 32, MediaQuery.of(context).size.width - 32,
videoPlayerController != null videoPlayerController != null
? (MediaQuery.of(context).size.width - 32) / ? (MediaQuery.of(context).size.width - 32) /
videoPlayerController.value.aspectRatio videoPlayerController!.value.aspectRatio
: MediaQuery.of(context).size.width / 2, : MediaQuery.of(context).size.width / 2,
cnt["video"].replaceAll(".mp4", "_poster.jpg"), cnt["video"].replaceAll(".mp4", "_poster.jpg"),
); );
@ -448,14 +448,14 @@ class _CommunityDynamic extends State<CommunityDynamic> {
super.dispose(); super.dispose();
if (chewieAudioController != null) { if (chewieAudioController != null) {
chewieAudioController.pause(); chewieAudioController!.pause();
chewieAudioController.dispose(); chewieAudioController!.dispose();
chewieAudioController = null; chewieAudioController = null;
} }
if (videoPlayerController != null) { if (videoPlayerController != null) {
videoPlayerController.pause(); videoPlayerController!.pause();
videoPlayerController.dispose(); videoPlayerController!.dispose();
} }
} }
@ -470,7 +470,7 @@ class _CommunityDynamic extends State<CommunityDynamic> {
width: width, width: width,
height: height, height: height,
child: chewies = Chewie( child: chewies = Chewie(
controller: chewieAudioController, controller: chewieAudioController!,
), ),
) )
: Container( : Container(
@ -489,7 +489,7 @@ class _CommunityDynamic extends State<CommunityDynamic> {
child: MImage( child: MImage(
src, src,
aspectRatio: videoPlayerController != null aspectRatio: videoPlayerController != null
? videoPlayerController.value.aspectRatio ? videoPlayerController!.value.aspectRatio
: (width / 7 * 5), : (width / 7 * 5),
fit: BoxFit.cover, fit: BoxFit.cover,
errorSrc: "assets/image/default_2_1.png", errorSrc: "assets/image/default_2_1.png",
@ -510,9 +510,9 @@ class _CommunityDynamic extends State<CommunityDynamic> {
} }
Future<void> _fullScreenListener() async { Future<void> _fullScreenListener() async {
if (!chewieAudioController.isFullScreen) { if (!chewieAudioController!.isFullScreen) {
Future.delayed(Duration(seconds: 1), () { Future.delayed(Duration(seconds: 1), () {
widget.exitFull(); widget.exitFull!();
}); });
} }
} }
@ -595,14 +595,14 @@ class _CommunityDynamic extends State<CommunityDynamic> {
@override @override
void didChangeDependencies() { void didChangeDependencies() {
if (widget.heightFun != null) if (widget.heightFun != null)
WidgetsBinding.instance.addPostFrameCallback(_getContainerHeight); WidgetsBinding.instance?.addPostFrameCallback(_getContainerHeight);
super.didChangeDependencies(); super.didChangeDependencies();
} }
_getContainerHeight(_) { _getContainerHeight(_) {
if (globalKey.currentContext != null) if (globalKey.currentContext != null)
height = globalKey.currentContext.size.height; height = globalKey.currentContext!.size!.height;
if (widget.heightFun != null) widget.heightFun(height); if (widget.heightFun != null) widget.heightFun!(height);
print("height: $height"); print("height: $height");
} }
} }

2
lib/community/community_view/course_banner.dart

@ -24,7 +24,7 @@ class CourseBanner extends StatefulWidget {
} }
class _CourseBanner extends State<CourseBanner> { class _CourseBanner extends State<CourseBanner> {
ApiService apiService; ApiService? apiService;
final RefreshController refreshController = RefreshController(); final RefreshController refreshController = RefreshController();
List<BannerData> bannerData = []; List<BannerData> bannerData = [];

16
lib/community/community_view/home_class.dart

@ -21,8 +21,8 @@ class HomeClass extends StatefulWidget {
} }
class _HomeClass extends State<HomeClass> { class _HomeClass extends State<HomeClass> {
ApiService apiService; ApiService? apiService;
BMFCoordinate latLng; BMFCoordinate? latLng;
final TextEditingController editingController = TextEditingController(); final TextEditingController editingController = TextEditingController();
@ -76,23 +76,23 @@ class _HomeClass extends State<HomeClass> {
padding: EdgeInsets.symmetric(horizontal: 10), padding: EdgeInsets.symmetric(horizontal: 10),
itemCount: widget.collectMap[collectList.id] == null itemCount: widget.collectMap[collectList.id] == null
? 0 ? 0
: widget.collectMap[collectList.id].length, : widget.collectMap[collectList.id]!.length,
itemBuilder: (context, position) { itemBuilder: (context, position) {
return GestureDetector( return GestureDetector(
onTap: () { onTap: () {
Navigator.of(context).pushNamed('/router/class_details', Navigator.of(context).pushNamed('/router/class_details',
arguments: { arguments: {
"id": widget.collectMap[collectList.id][position].id "id": widget.collectMap[collectList.id]![position].id
}).then((value) => { }).then((value) => {
widget.collectMap[collectList.id][position].viewers = widget.collectMap[collectList.id]![position].viewers =
value != null value != null
? value ? value as int
: widget.collectMap[collectList.id][position] : widget.collectMap[collectList.id]![position]
.viewers + .viewers +
1 1
}); });
}, },
child: classItem(widget.collectMap[collectList.id][position]), child: classItem(widget.collectMap[collectList.id]![position]),
); );
}, },
), ),

4
lib/community/headlines/activity_top_list.dart

@ -24,8 +24,8 @@ class ActivityTopList extends StatefulWidget {
} }
class _ActivityTopList extends State<ActivityTopList> { class _ActivityTopList extends State<ActivityTopList> {
ApiService apiService; ApiService? apiService;
BMFCoordinate latLng; BMFCoordinate? latLng;
final TextEditingController editingController = TextEditingController(); final TextEditingController editingController = TextEditingController();

10
lib/community/headlines/article_list.dart

@ -22,7 +22,7 @@ class ArticleList extends StatefulWidget {
} }
class _ArticleList extends State<ArticleList> { class _ArticleList extends State<ArticleList> {
ApiService apiService; ApiService? apiService;
int pageNum = 0; int pageNum = 0;
@override @override
@ -31,7 +31,7 @@ class _ArticleList extends State<ArticleList> {
SharedPreferences.getInstance().then((value) => { SharedPreferences.getInstance().then((value) => {
apiService = ApiService(Dio(), apiService = ApiService(Dio(),
context: context, token: value.getString("token")), context: context, token: value.getString("token")!),
}); });
} }
@ -141,7 +141,7 @@ class _ArticleList extends State<ArticleList> {
), ),
Expanded( Expanded(
child: Text( child: Text(
"${widget?.articles[position]?.viewers}" ?? "", "${widget.articles[position].viewers}" ?? "",
style: TextStyle( style: TextStyle(
fontSize: 12.sp, fontSize: 12.sp,
fontWeight: MyFontWeight.regular, fontWeight: MyFontWeight.regular,
@ -149,7 +149,7 @@ class _ArticleList extends State<ArticleList> {
), ),
)), )),
Text( Text(
widget?.articles[position]?.createTime?.split(" ")[0] ?? widget.articles[position].createTime.split(" ")[0] ??
"", "",
style: TextStyle( style: TextStyle(
fontSize: 12.sp, fontSize: 12.sp,
@ -164,7 +164,7 @@ class _ArticleList extends State<ArticleList> {
)), )),
SizedBox(width: 12), SizedBox(width: 12),
MImage( MImage(
widget?.articles[position]?.coverImg ?? "", widget.articles[position].coverImg ?? "",
fit: BoxFit.cover, fit: BoxFit.cover,
radius: BorderRadius.all(Radius.circular(2)), radius: BorderRadius.all(Radius.circular(2)),
width: 100, width: 100,

14
lib/community/headlines/article_page.dart

@ -36,7 +36,7 @@ class _ArticlePage extends State<ArticlePage>
final ScrollController scrollController = ScrollController(); final ScrollController scrollController = ScrollController();
final RefreshController refreshController = RefreshController(); final RefreshController refreshController = RefreshController();
ApiService apiService; ApiService? apiService;
List<GlobalKey> globaKeys = []; List<GlobalKey> globaKeys = [];
List<Brand> brands = []; List<Brand> brands = [];
List<BannerData> bannerData = []; List<BannerData> bannerData = [];
@ -74,10 +74,10 @@ class _ArticlePage extends State<ArticlePage>
apiService = ApiService( apiService = ApiService(
Dio(), Dio(),
context: context, context: context,
token: value.getString("token"), token: value.getString("token")!,
); );
} }
BaseData<PageInfo<BannerData>> baseData = await apiService.queryBanner({ BaseData<PageInfo<BannerData>> baseData = await apiService!.queryBanner({
"model": {"type": "INFORMATION"}, "model": {"type": "INFORMATION"},
}).catchError((onError) { }).catchError((onError) {
refreshController.refreshFailed(); refreshController.refreshFailed();
@ -100,10 +100,10 @@ class _ArticlePage extends State<ArticlePage>
apiService = ApiService( apiService = ApiService(
Dio(), Dio(),
context: context, context: context,
token: value.getString("token"), token: value.getString("token")!,
); );
} }
BaseData<PageInfo<Article>> baseData = await apiService.queryArticle({ BaseData<PageInfo<Article>> baseData = await apiService!.queryArticle({
"pageNum": pageNum, "pageNum": pageNum,
"pageSize": 10, "pageSize": 10,
"searchKey": "", "searchKey": "",
@ -147,11 +147,11 @@ class _ArticlePage extends State<ArticlePage>
apiService = ApiService( apiService = ApiService(
Dio(), Dio(),
context: context, context: context,
token: value.getString("token"), token: value.getString("token")!,
); );
} }
BaseData<List<HeadlinesList>> baseData = BaseData<List<HeadlinesList>> baseData =
await apiService.headlinesList().catchError((onError) {}); await apiService!.headlinesList().catchError((onError) {});
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
setState(() { setState(() {
headlines.clear(); headlines.clear();

2
lib/community/headlines/headlines_banner.dart

@ -24,7 +24,7 @@ class HeadlinesBanner extends StatefulWidget {
} }
class _HeadlinesBanner extends State<HeadlinesBanner> { class _HeadlinesBanner extends State<HeadlinesBanner> {
ApiService apiService; ApiService? apiService;
final RefreshController refreshController = RefreshController(); final RefreshController refreshController = RefreshController();
List<BannerData> bannerData = []; List<BannerData> bannerData = [];

4
lib/community/headlines/headlines_collection.dart

@ -24,8 +24,8 @@ class HeadlinesCollection extends StatefulWidget {
} }
class _HeadlinesCollection extends State<HeadlinesCollection> { class _HeadlinesCollection extends State<HeadlinesCollection> {
ApiService apiService; ApiService? apiService;
BMFCoordinate latLng; BMFCoordinate? latLng;
final TextEditingController editingController = TextEditingController(); final TextEditingController editingController = TextEditingController();

16
lib/community/headlines/headlines_column_details.dart

@ -18,7 +18,7 @@ import 'package:shared_preferences/shared_preferences.dart';
class HeadlinesColumnDetails extends StatefulWidget { class HeadlinesColumnDetails extends StatefulWidget {
final Map<String, dynamic> arguments; final Map<String, dynamic> arguments;
HeadlinesColumnDetails({this.arguments}); HeadlinesColumnDetails({required this.arguments});
@override @override
State<StatefulWidget> createState() { State<StatefulWidget> createState() {
@ -28,9 +28,9 @@ class HeadlinesColumnDetails extends StatefulWidget {
class _HeadlinesColumnDetails extends State<HeadlinesColumnDetails> class _HeadlinesColumnDetails extends State<HeadlinesColumnDetails>
with WidgetsBindingObserver { with WidgetsBindingObserver {
ApiService apiService; ApiService? apiService;
List<Article> articles = []; List<Article> articles = [];
HeadlinesListDetails headlinesListDetails; HeadlinesListDetails? headlinesListDetails;
List<HeadlinesList> headlines = []; List<HeadlinesList> headlines = [];
final RefreshController refreshController = RefreshController(); final RefreshController refreshController = RefreshController();
final ScrollController scrollController = ScrollController(); final ScrollController scrollController = ScrollController();
@ -39,7 +39,7 @@ class _HeadlinesColumnDetails extends State<HeadlinesColumnDetails>
@override @override
void initState() { void initState() {
super.initState(); super.initState();
WidgetsBinding.instance.addObserver(this); WidgetsBinding.instance?.addObserver(this);
_onRefresh(); _onRefresh();
} }
@ -50,11 +50,11 @@ class _HeadlinesColumnDetails extends State<HeadlinesColumnDetails>
apiService = ApiService( apiService = ApiService(
Dio(), Dio(),
context: context, context: context,
token: value.getString("token"), token: value.getString("token")!,
); );
} }
BaseData<HeadlinesListDetails> baseData = BaseData<HeadlinesListDetails> baseData =
await apiService.headlinesDetails(id).catchError((error) {}); await apiService!.headlinesDetails(id).catchError((error) {});
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
setState(() { setState(() {
headlinesListDetails = baseData.data; headlinesListDetails = baseData.data;
@ -69,10 +69,10 @@ class _HeadlinesColumnDetails extends State<HeadlinesColumnDetails>
apiService = ApiService( apiService = ApiService(
Dio(), Dio(),
context: context, context: context,
token: value.getString("token"), token: value.getString("token")!,
); );
} }
BaseData<PageInfo<Article>> baseData = await apiService.queryArticle({ BaseData<PageInfo<Article>> baseData = await apiService!.queryArticle({
"pageNum": pageNum, "pageNum": pageNum,
"pageSize": 10, "pageSize": 10,
"searchKey": "", "searchKey": "",

37
lib/community/release_dynamic.dart

@ -29,7 +29,7 @@ class _ReleaseDynamic extends State<ReleaseDynamic> {
bool isRelease = false; bool isRelease = false;
int dynamicType = 0; int dynamicType = 0;
TextEditingController textEditingController = TextEditingController(); TextEditingController textEditingController = TextEditingController();
ApiService apiService; ApiService? apiService;
@override @override
void initState() { void initState() {
@ -39,7 +39,7 @@ class _ReleaseDynamic extends State<ReleaseDynamic> {
apiService = ApiService( apiService = ApiService(
Dio(), Dio(),
context: context, context: context,
token: value.getString("token"), token: value.getString("token")!,
showLoading: false, showLoading: false,
); );
}); });
@ -167,9 +167,9 @@ class _ReleaseDynamic extends State<ReleaseDynamic> {
subjectType = "video"; subjectType = "video";
} }
List<String> remoteImageUrls = []; List<String?> remoteImageUrls = [];
String remoteVideoUrl = ""; String? remoteVideoUrl = "";
String remoteVideoCoverImg = ""; String? remoteVideoCoverImg = "";
if (mediaPaths.length > 0) { if (mediaPaths.length > 0) {
if (dynamicType == 1) { if (dynamicType == 1) {
remoteImageUrls = mediaPaths.map((e) => e.remotePath).toList(); remoteImageUrls = mediaPaths.map((e) => e.remotePath).toList();
@ -179,7 +179,7 @@ class _ReleaseDynamic extends State<ReleaseDynamic> {
} }
} }
BaseData<bool> baseData = await apiService.trend({ BaseData<bool> baseData = await apiService!.trend({
"images": remoteImageUrls, "images": remoteImageUrls,
"subject": dynamicText, "subject": dynamicText,
"subjectType": subjectType, "subjectType": subjectType,
@ -202,18 +202,19 @@ class _ReleaseDynamic extends State<ReleaseDynamic> {
Future<void> fileUpload() async { Future<void> fileUpload() async {
if (mediaPaths != null && mediaPaths.length > 0) { if (mediaPaths != null && mediaPaths.length > 0) {
await Future.forEach(mediaPaths, (element) async { await Future.forEach(mediaPaths, (element) async {
element = (element as Medias);
if ((element.remotePath == null || element.remotePath == "") && if ((element.remotePath == null || element.remotePath == "") &&
(element != null && (element != null &&
element.path != null && element.path != null &&
element.path != "" && element.path != "" &&
await File(element.path).exists())) { await File(element.path!).exists())) {
File file = File(element.path); File file = File(element.path!);
if (dynamicType == 2) { if (dynamicType == 2) {
String thumbnail; String thumbnail;
if (element.thumbPath != null && if (element.thumbPath != null &&
element.thumbPath != "" && element.thumbPath != "" &&
await File(element.thumbPath).exists()) { await File(element.thumbPath!).exists()) {
thumbnail = element.thumbPath; thumbnail = element.thumbPath!;
} else { } else {
thumbnail = await Thumbnails.getThumbnail( thumbnail = await Thumbnails.getThumbnail(
videoFile: file.path, videoFile: file.path,
@ -224,7 +225,7 @@ class _ReleaseDynamic extends State<ReleaseDynamic> {
if (thumbnail != null && if (thumbnail != null &&
thumbnail != "" && thumbnail != "" &&
await File(thumbnail).exists()) { await File(thumbnail).exists()) {
BaseData<UploadResult> baseData = await apiService.upload( BaseData<UploadResult> baseData = await apiService!.upload(
File(thumbnail), File(thumbnail),
123123123, 123123123,
dynamicType == 2 dynamicType == 2
@ -236,7 +237,7 @@ class _ReleaseDynamic extends State<ReleaseDynamic> {
} }
} }
} }
BaseData<UploadResult> baseData = await apiService.upload( BaseData<UploadResult> baseData = await apiService!.upload(
file, file,
123123123, 123123123,
dynamicType == 2 dynamicType == 2
@ -265,8 +266,8 @@ class _ReleaseDynamic extends State<ReleaseDynamic> {
borderRadius: BorderRadius.circular(4), borderRadius: BorderRadius.circular(4),
child: Image.file( child: Image.file(
File(media.galleryMode == GalleryMode.video File(media.galleryMode == GalleryMode.video
? media.thumbPath ? media.thumbPath!
: media.path), : media.path!),
fit: BoxFit.cover, fit: BoxFit.cover,
width: double.infinity, width: double.infinity,
height: double.infinity, height: double.infinity,
@ -523,8 +524,8 @@ class Medias {
this.galleryMode = media.galleryMode; this.galleryMode = media.galleryMode;
} }
String thumbPath; String? thumbPath;
String path; String? path;
GalleryMode galleryMode; GalleryMode? galleryMode;
String remotePath; String? remotePath;
} }

13
lib/generated/intl/messages_all.dart

@ -30,7 +30,7 @@ Map<String, LibraryLoader> _deferredLibraries = {
'zh_TW': () => new Future.value(null), 'zh_TW': () => new Future.value(null),
}; };
MessageLookupByLibrary _findExact(String localeName) { MessageLookupByLibrary? _findExact(String localeName) {
switch (localeName) { switch (localeName) {
case 'en': case 'en':
return messages_en.messages; return messages_en.messages;
@ -50,9 +50,8 @@ MessageLookupByLibrary _findExact(String localeName) {
/// User programs should call this before using [localeName] for messages. /// User programs should call this before using [localeName] for messages.
Future<bool> initializeMessages(String localeName) async { Future<bool> initializeMessages(String localeName) async {
var availableLocale = Intl.verifiedLocale( var availableLocale = Intl.verifiedLocale(
localeName, localeName, (locale) => _deferredLibraries[locale] != null,
(locale) => _deferredLibraries[locale] != null, onFailure: (_) => null);
onFailure: (_) => null);
if (availableLocale == null) { if (availableLocale == null) {
return new Future.value(false); return new Future.value(false);
} }
@ -71,9 +70,9 @@ bool _messagesExistFor(String locale) {
} }
} }
MessageLookupByLibrary _findGeneratedMessagesFor(String locale) { MessageLookupByLibrary? _findGeneratedMessagesFor(String locale) {
var actualLocale = Intl.verifiedLocale(locale, _messagesExistFor, var actualLocale =
onFailure: (_) => null); Intl.verifiedLocale(locale, _messagesExistFor, onFailure: (_) => null);
if (actualLocale == null) return null; if (actualLocale == null) return null;
return _findExact(actualLocale); return _findExact(actualLocale);
} }

1289
lib/generated/intl/messages_en.dart

File diff suppressed because it is too large Load Diff

1279
lib/generated/intl/messages_zh_CN.dart

File diff suppressed because it is too large Load Diff

1279
lib/generated/intl/messages_zh_Hans_CN.dart

File diff suppressed because it is too large Load Diff

1277
lib/generated/intl/messages_zh_Hant_CN.dart

File diff suppressed because it is too large Load Diff

1279
lib/generated/intl/messages_zh_TW.dart

File diff suppressed because it is too large Load Diff

43
lib/generated/l10n.dart

@ -10,28 +10,43 @@ import 'intl/messages_all.dart';
// ignore_for_file: non_constant_identifier_names, lines_longer_than_80_chars // ignore_for_file: non_constant_identifier_names, lines_longer_than_80_chars
// ignore_for_file: join_return_with_assignment, prefer_final_in_for_each // ignore_for_file: join_return_with_assignment, prefer_final_in_for_each
// ignore_for_file: avoid_redundant_argument_values // ignore_for_file: avoid_redundant_argument_values, avoid_escaping_inner_quotes
class S { class S {
S(); S();
static S current; static S? _current;
static const AppLocalizationDelegate delegate = static S get current {
AppLocalizationDelegate(); assert(_current != null,
'No instance of S was loaded. Try to initialize the S delegate before accessing S.current.');
return _current!;
}
static const AppLocalizationDelegate delegate = AppLocalizationDelegate();
static Future<S> load(Locale locale) { static Future<S> load(Locale locale) {
final name = (locale.countryCode?.isEmpty ?? false) ? locale.languageCode : locale.toString(); final name = (locale.countryCode?.isEmpty ?? false)
? locale.languageCode
: locale.toString();
final localeName = Intl.canonicalizedLocale(name); final localeName = Intl.canonicalizedLocale(name);
return initializeMessages(localeName).then((_) { return initializeMessages(localeName).then((_) {
Intl.defaultLocale = localeName; Intl.defaultLocale = localeName;
S.current = S(); final instance = S();
S._current = instance;
return S.current; return instance;
}); });
} }
static S of(BuildContext context) { static S of(BuildContext context) {
final instance = S.maybeOf(context);
assert(instance != null,
'No instance of S present in the widget tree. Did you add S.delegate in localizationsDelegates?');
return instance!;
}
static S? maybeOf(BuildContext context) {
return Localizations.of<S>(context, S); return Localizations.of<S>(context, S);
} }
@ -5653,8 +5668,10 @@ class AppLocalizationDelegate extends LocalizationsDelegate<S> {
return const <Locale>[ return const <Locale>[
Locale.fromSubtags(languageCode: 'en'), Locale.fromSubtags(languageCode: 'en'),
Locale.fromSubtags(languageCode: 'zh', countryCode: 'CN'), Locale.fromSubtags(languageCode: 'zh', countryCode: 'CN'),
Locale.fromSubtags(languageCode: 'zh', scriptCode: 'Hans', countryCode: 'CN'), Locale.fromSubtags(
Locale.fromSubtags(languageCode: 'zh', scriptCode: 'Hant', countryCode: 'CN'), languageCode: 'zh', scriptCode: 'Hans', countryCode: 'CN'),
Locale.fromSubtags(
languageCode: 'zh', scriptCode: 'Hant', countryCode: 'CN'),
Locale.fromSubtags(languageCode: 'zh', countryCode: 'TW'), Locale.fromSubtags(languageCode: 'zh', countryCode: 'TW'),
]; ];
} }
@ -5667,11 +5684,9 @@ class AppLocalizationDelegate extends LocalizationsDelegate<S> {
bool shouldReload(AppLocalizationDelegate old) => false; bool shouldReload(AppLocalizationDelegate old) => false;
bool _isSupported(Locale locale) { bool _isSupported(Locale locale) {
if (locale != null) { for (var supportedLocale in supportedLocales) {
for (var supportedLocale in supportedLocales) { if (supportedLocale.languageCode == locale.languageCode) {
if (supportedLocale.languageCode == locale.languageCode) { return true;
return true;
}
} }
} }
return false; return false;

12
lib/main.dart

@ -109,7 +109,7 @@ void main() async {
} }
ImgCachePath(); ImgCachePath();
initSdk(); initSdk();
bool isFirst = sharedPreferences.getBool("isFirst"); bool isFirst = sharedPreferences.getBool("isFirst") ?? true;
runApp(MyApp(locale, isFirst)); runApp(MyApp(locale, isFirst));
// FlutterBugly.postCatchedException((){ // FlutterBugly.postCatchedException((){
@ -199,9 +199,9 @@ class MyApp extends StatelessWidget {
S.delegate S.delegate
], ],
localeListResolutionCallback: localeListResolutionCallback:
(List<Locale> locales, Iterable<Locale> supportedLocales) { (List<Locale>? locales, Iterable<Locale> supportedLocales) {
print("locale: ${locales[0]}"); print("locale: ${locales?[0]}");
return appLocale ?? locales[0]; return appLocale ?? locales?[0];
}, },
supportedLocales: S.delegate.supportedLocales, supportedLocales: S.delegate.supportedLocales,
home: (isFirst ?? true) ? GuidePage() : LoginPage(), home: (isFirst ?? true) ? GuidePage() : LoginPage(),
@ -217,8 +217,8 @@ class MyApp extends StatelessWidget {
}, },
), ),
onGenerateRoute: (settings) { onGenerateRoute: (settings) {
final String name = settings.name; final String? name = settings.name;
final Function pageContentBuilder = routers[name]; final Function? pageContentBuilder = routers[name];
if (pageContentBuilder != null) { if (pageContentBuilder != null) {
final Route route = CupertinoPageRoute( final Route route = CupertinoPageRoute(
builder: (context) { builder: (context) {

26
lib/mine/mine_page.dart

@ -33,10 +33,10 @@ class MinePage extends StatefulWidget {
} }
class _MinePage extends State<MinePage> with AutomaticKeepAliveClientMixin { class _MinePage extends State<MinePage> with AutomaticKeepAliveClientMixin {
ApiService apiService; ApiService? apiService;
UserInfo userInfo; UserInfo? userInfo;
List<Rank> ranks = []; List<Rank> ranks = [];
SocialInfo infoNumber; SocialInfo? infoNumber;
final RefreshController _refreshController = RefreshController(); final RefreshController _refreshController = RefreshController();
_toUserInfo() async { _toUserInfo() async {
@ -80,17 +80,17 @@ class _MinePage extends State<MinePage> with AutomaticKeepAliveClientMixin {
if (value.containsKey('user') && if (value.containsKey('user') &&
value.getString('user') != null && value.getString('user') != null &&
value.getString('user') != "") { value.getString('user') != "") {
userInfo = UserInfo.fromJson(jsonDecode(value.getString('user'))); userInfo = UserInfo.fromJson(jsonDecode(value.getString('user')!));
} }
apiService = ApiService( apiService = ApiService(
Dio(), Dio(),
context: context, context: context,
token: value.getString('token'), token: value.getString('token')!,
showLoading: false, showLoading: false,
); );
BaseData<List<Rank>> rankData = BaseData<List<Rank>> rankData =
await apiService.rankList().catchError((onError) { await apiService!.rankList().catchError((onError) {
_refreshController.refreshFailed(); _refreshController.refreshFailed();
}); });
if (rankData != null && rankData.isSuccess) { if (rankData != null && rankData.isSuccess) {
@ -99,7 +99,7 @@ class _MinePage extends State<MinePage> with AutomaticKeepAliveClientMixin {
} }
BaseData<UserInfo> baseDate = BaseData<UserInfo> baseDate =
await apiService.queryInfo().catchError((onError) { await apiService!.queryInfo().catchError((onError) {
_refreshController.refreshFailed(); _refreshController.refreshFailed();
}); });
if (baseDate != null && baseDate.isSuccess) { if (baseDate != null && baseDate.isSuccess) {
@ -127,12 +127,12 @@ class _MinePage extends State<MinePage> with AutomaticKeepAliveClientMixin {
apiService = ApiService( apiService = ApiService(
Dio(), Dio(),
context: context, context: context,
token: value.getString("token"), token: value.getString("token")!,
showLoading: false, showLoading: false,
); );
BaseData<SocialInfo> baseData = BaseData<SocialInfo> baseData =
await apiService.socialInfo().catchError((onError) { await apiService!.socialInfo().catchError((onError) {
_refreshController.refreshFailed(); _refreshController.refreshFailed();
}); });
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
@ -202,7 +202,7 @@ class _MinePage extends State<MinePage> with AutomaticKeepAliveClientMixin {
ranks: ranks, ranks: ranks,
userInfo: userInfo, userInfo: userInfo,
rank: double.tryParse( rank: double.tryParse(
userInfo?.expendAmount ?? "0") userInfo?.expendAmount ?? "0")!
.toInt(), .toInt(),
rankMax: rankMax:
userInfo?.memberRankVo?.nextOrigin ?? 0, userInfo?.memberRankVo?.nextOrigin ?? 0,
@ -345,7 +345,7 @@ class _MinePage extends State<MinePage> with AutomaticKeepAliveClientMixin {
child: Column( child: Column(
children: [ children: [
Text( Text(
infoNumber != null ? infoNumber.follow.toString() : "0", infoNumber != null ? infoNumber!.follow.toString() : "0",
style: TextStyle( style: TextStyle(
color: Color(0xFF000000), color: Color(0xFF000000),
fontSize: 15.sp, fontSize: 15.sp,
@ -382,7 +382,7 @@ class _MinePage extends State<MinePage> with AutomaticKeepAliveClientMixin {
child: Column( child: Column(
children: [ children: [
Text( Text(
infoNumber != null ? infoNumber.fans.toString() : "0", infoNumber != null ? infoNumber!.fans.toString() : "0",
style: TextStyle( style: TextStyle(
color: Color(0xFF000000), color: Color(0xFF000000),
fontSize: 15.sp, fontSize: 15.sp,
@ -420,7 +420,7 @@ class _MinePage extends State<MinePage> with AutomaticKeepAliveClientMixin {
children: [ children: [
Text( Text(
infoNumber != null infoNumber != null
? infoNumber.achievementNumber.toString() ? infoNumber!.achievementNumber.toString()
: "0", : "0",
style: TextStyle( style: TextStyle(
color: Color(0xFF000000), color: Color(0xFF000000),

27
lib/mine/mine_view/mine_view.dart

@ -19,7 +19,7 @@ import 'package:shared_preferences/shared_preferences.dart';
// import 'package:qrscan/qrscan.dart' as scanner; // import 'package:qrscan/qrscan.dart' as scanner;
class MineView extends StatefulWidget { class MineView extends StatefulWidget {
final UserInfo userInfo; final UserInfo? userInfo;
final GestureTapCallback toUserInfo; final GestureTapCallback toUserInfo;
final GestureTapCallback toIntegralPage; final GestureTapCallback toIntegralPage;
@ -32,7 +32,7 @@ class MineView extends StatefulWidget {
} }
class _MineView extends State<MineView> { class _MineView extends State<MineView> {
ApiService apiService; ApiService? apiService;
/// ///
queryWiped(memberCouponId) async { queryWiped(memberCouponId) async {
@ -41,10 +41,10 @@ class _MineView extends State<MineView> {
apiService = ApiService( apiService = ApiService(
Dio(), Dio(),
context: context, context: context,
token: value.getString("token"), token: value.getString("token")!,
); );
} }
BaseData baseData = await apiService.wiped(memberCouponId); BaseData baseData = await apiService!.wiped(memberCouponId);
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
SmartDialog.showToast("核销成功", alignment: Alignment.center); SmartDialog.showToast("核销成功", alignment: Alignment.center);
} else { } else {
@ -125,16 +125,17 @@ class _MineView extends State<MineView> {
/// ///
activityShowAlertDialog(result.toString()); activityShowAlertDialog(result.toString());
return; return;
}if(result.toString().contains("type\":\"wiped")){ }
if(result.toString().contains("type\":\"wiped")){
/// ///
queryWiped(jsonDecode(result.toString())["memberCouponId"]); queryWiped(jsonDecode(result.toString())["memberCouponId"]);
return; return;
} }
// String result = await scanner.scan(); // String result = await scanner.scan();
Uri uri = Uri.parse(result); Uri uri = Uri.parse("$result");
String tableId = uri.queryParameters["tableId"]; String? tableId = uri.queryParameters["tableId"];
String tenantCode = uri.queryParameters["tenantCode"]; String? tenantCode = uri.queryParameters["tenantCode"];
String shopId = uri.queryParameters["shopId"]; String? shopId = uri.queryParameters["shopId"];
if (tableId != null && if (tableId != null &&
tableId != "" && tableId != "" &&
tenantCode != null && tenantCode != null &&
@ -183,7 +184,7 @@ class _MineView extends State<MineView> {
child: Stack( child: Stack(
children: [ children: [
MImage( MImage(
widget.userInfo == null ? "" : widget.userInfo.headimg, widget.userInfo == null ? "" : widget.userInfo!.headimg,
isCircle: true, isCircle: true,
width: 50, width: 50,
height: 50, height: 50,
@ -237,7 +238,7 @@ class _MineView extends State<MineView> {
child: Text( child: Text(
widget.userInfo == null widget.userInfo == null
? S.of(context).denglu ? S.of(context).denglu
: "${widget.userInfo.nickname}", : "${widget.userInfo!.nickname}",
style: TextStyle( style: TextStyle(
fontSize: 16.sp, fontSize: 16.sp,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
@ -245,7 +246,7 @@ class _MineView extends State<MineView> {
), ),
), ),
), ),
if(widget.userInfo.level != 1) if(widget.userInfo != null && widget.userInfo!.level != 1)
Image.asset( Image.asset(
"assets/image/icon_user.png", "assets/image/icon_user.png",
width: 18.w, width: 18.w,
@ -265,7 +266,7 @@ class _MineView extends State<MineView> {
: Text( : Text(
widget.userInfo == null widget.userInfo == null
? "" ? ""
: "我的积分:${widget.userInfo.points}", : "我的积分:${widget.userInfo!.points}",
style: TextStyle( style: TextStyle(
fontSize: 12.sp, fontSize: 12.sp,
fontWeight: MyFontWeight.regular, fontWeight: MyFontWeight.regular,

12
lib/retrofit/retrofit_api.dart

@ -56,14 +56,14 @@ import 'data/wx_pay.dart';
part 'retrofit_api.g.dart'; part 'retrofit_api.g.dart';
// const base_url = "https://pos.platform.lotus-wallet.com/app/"; /// const base_url = "https://pos.platform.lotus-wallet.com/app/"; ///
// const baseUrl = "https://pos.platform.lotus-wallet.com/app/"; /// const baseUrl = "https://pos.platform.lotus-wallet.com/app/"; ///
// const base_url = "http://platform.prod.kunqi.lotus-wallet.com/app/"; ///222 // const base_url = "http://platform.prod.kunqi.lotus-wallet.com/app/"; ///222
// const baseUrl = "http://platform.prod.kunqi.lotus-wallet.com/app/"; ///222 // const baseUrl = "http://platform.prod.kunqi.lotus-wallet.com/app/"; ///222
const base_url = "http://192.168.10.236:8766/app/"; /// // const base_url = "http://192.168.10.236:8766/app/"; ///
const baseUrl = "http://192.168.10.236:8766/app/"; /// // const baseUrl = "http://192.168.10.236:8766/app/"; ///
// const base_url = "http://192.168.10.37:8766/app/"; // const base_url = "http://192.168.10.37:8766/app/";
// const baseUrl = "http://192.168.10.37:8766/app/"; // const baseUrl = "http://192.168.10.37:8766/app/";
@ -173,7 +173,7 @@ abstract class ApiService {
@GET( @GET(
"https://restapi.amap.com/v3/place/around?key=542b46afa8e4b88fe1eb3c4d0ba0872f&location={lat},{lng}&keywords={keywords}&offset={size}&page={page}&extensions=all") "https://restapi.amap.com/v3/place/around?key=542b46afa8e4b88fe1eb3c4d0ba0872f&location={lat},{lng}&keywords={keywords}&offset={size}&page={page}&extensions=all")
Future<dynamic> searchPoi(@Path("lat") String lat, @Path("lng") String lng, Future<dynamic> searchPoi(@Path("lat") String lat, @Path("lng") String lng,
@Path("keywords") String keywords, int size, int page); @Path("keywords") String? keywords, int size, int page);
/// ///
@POST("/auth/platform/memberLogin") @POST("/auth/platform/memberLogin")
@ -354,7 +354,7 @@ abstract class ApiService {
//// ////
@GET("/information/likes/{id}") @GET("/information/likes/{id}")
Future<BaseData> informationLikes(@Path("id") String id); Future<BaseData> informationLikes(@Path("id") String? id);
/// ///
@POST("/memberComment") @POST("/memberComment")

26
lib/view_widget/keyboard/keyboard_widget.dart

@ -1,6 +1,6 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:huixiang/view_widget/keyboard/custom_keyboard_button.dart'; import 'package:huixiang/view_widget/keyboard/custom_keyboard_button.dart';
import 'package:huixiang/view_widget/keyboard/pay_password.dart'; import 'package:huixiang/view_widget/keyboard/pay_password.dart' as K;
/// ///
class MyKeyboard extends StatefulWidget { class MyKeyboard extends StatefulWidget {
@ -22,52 +22,52 @@ class MyKeyboardStat extends State<MyKeyboard> {
var backMethod; var backMethod;
void onCommitChange() { void onCommitChange() {
widget.callback(KeyEvent("commit")); widget.callback(K.KeyEvent("commit"));
} }
void onOneChange(BuildContext cont) { void onOneChange(BuildContext cont) {
widget.callback(KeyEvent("1")); widget.callback(K.KeyEvent("1"));
} }
void onTwoChange(BuildContext cont) { void onTwoChange(BuildContext cont) {
widget.callback(KeyEvent("2")); widget.callback(K.KeyEvent("2"));
} }
void onThreeChange(BuildContext cont) { void onThreeChange(BuildContext cont) {
widget.callback(KeyEvent("3")); widget.callback(K.KeyEvent("3"));
} }
void onFourChange(BuildContext cont) { void onFourChange(BuildContext cont) {
widget.callback(KeyEvent("4")); widget.callback(K.KeyEvent("4"));
} }
void onFiveChange(BuildContext cont) { void onFiveChange(BuildContext cont) {
widget.callback(KeyEvent("5")); widget.callback(K.KeyEvent("5"));
} }
void onSixChange(BuildContext cont) { void onSixChange(BuildContext cont) {
widget.callback(KeyEvent("6")); widget.callback(K.KeyEvent("6"));
} }
void onSevenChange(BuildContext cont) { void onSevenChange(BuildContext cont) {
widget.callback(KeyEvent("7")); widget.callback(K.KeyEvent("7"));
} }
void onEightChange(BuildContext cont) { void onEightChange(BuildContext cont) {
widget.callback(KeyEvent("8")); widget.callback(K.KeyEvent("8"));
} }
void onNineChange(BuildContext cont) { void onNineChange(BuildContext cont) {
widget.callback(KeyEvent("9")); widget.callback(K.KeyEvent("9"));
} }
void onZeroChange(BuildContext cont) { void onZeroChange(BuildContext cont) {
widget.callback(KeyEvent("0")); widget.callback(K.KeyEvent("0"));
} }
/// ///
void onDeleteChange() { void onDeleteChange() {
widget.callback(KeyEvent("del")); widget.callback(K.KeyEvent("del"));
} }
@override @override

22
lib/view_widget/mine_vip_view.dart

@ -14,12 +14,12 @@ class MineVipView extends StatelessWidget {
final int rankMax; final int rankMax;
final int rank; final int rank;
final String createTime; final String createTime;
final String tag; final String? tag;
final double padding; final double padding;
final UserInfo userInfo; final UserInfo? userInfo;
final List<Rank> ranks; final List<Rank>? ranks;
final bool showRank; final bool? showRank;
final String price; final String? price;
MineVipView({ MineVipView({
this.vipLevel = 1, this.vipLevel = 1,
@ -48,10 +48,10 @@ class MineVipView extends StatelessWidget {
Color textColor = Colors.white; Color textColor = Colors.white;
if (userInfo != null && if (userInfo != null &&
userInfo.memberRankVo != null && userInfo!.memberRankVo != null &&
ranks != null && ranks != null &&
ranks.length > 0) { ranks!.length > 0) {
curLevel = (ranks.indexWhere((element) => element.id == userInfo.memberRankVo.id) + 1); curLevel = (ranks!.indexWhere((element) => element.id == userInfo!.memberRankVo.id) + 1);
vipLevel = curLevel; vipLevel = curLevel;
} }
@ -330,9 +330,9 @@ class MineVipView extends StatelessWidget {
Navigator.of(context) Navigator.of(context)
.pushNamed('/router/mine_vip_core', arguments: { .pushNamed('/router/mine_vip_core', arguments: {
"rankLevel": curLevel, "rankLevel": curLevel,
"userInfo":userInfo.masterCardRankName, "userInfo":userInfo!.masterCardRankName,
"createTime": (userInfo != null) ? "${userInfo.createTime}" : "", "createTime": (userInfo != null) ? "${userInfo!.createTime}" : "",
"expendAmount": double.tryParse(userInfo?.expendAmount??"0").toInt(), "expendAmount": double.tryParse(userInfo?.expendAmount??"0")!.toInt(),
}); });
}); });
} }

31
lib/web/web_view/comment_list.dart

@ -16,18 +16,18 @@ import 'package:like_button/like_button.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
class CommentList extends StatefulWidget { class CommentList extends StatefulWidget {
final bool isKeyBoardShow; final bool isKeyBoardShow;
final Function reply; final Function reply;
final Function delCommentTips; final Function delCommentTips;
final double fontSize; final double fontSize;
final String relationalId; final String? relationalId;
final int relationalType; final int relationalType;
final int like; final int like;
final Function requestApiFinish; final Function? requestApiFinish;
CommentList(Key key, this.like, this.relationalId,this.relationalType, CommentList(Key key, this.like, this.relationalId, this.relationalType,
this.isKeyBoardShow, this.reply, this.delCommentTips, this.fontSize,{this.requestApiFinish}) this.isKeyBoardShow, this.reply, this.delCommentTips, this.fontSize,
{this.requestApiFinish})
: super(key: key); : super(key: key);
@override @override
@ -39,17 +39,18 @@ class CommentList extends StatefulWidget {
class CommentListState extends State<CommentList> { class CommentListState extends State<CommentList> {
int commentTotal = 0; int commentTotal = 0;
List<MemberCommentList> memberList = []; List<MemberCommentList> memberList = [];
ApiService apiService; ApiService? apiService;
// //
queryCommentLike(String id) async { queryCommentLike(String id) async {
SharedPreferences sharedPreferences = await SharedPreferences.getInstance(); SharedPreferences sharedPreferences = await SharedPreferences.getInstance();
String token = sharedPreferences.getString("token"); String token = sharedPreferences.getString("token") ?? "";
if (token == null || token == "") { if (token == null || token == "") {
LoginTipsDialog().show(context); LoginTipsDialog().show(context);
return; return;
} }
BaseData baseData = await apiService.commentLike(id).catchError((error) {}); BaseData baseData =
await apiService!.commentLike(id).catchError((error) {});
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
memberList.forEach((element) { memberList.forEach((element) {
if (element.id == id) { if (element.id == id) {
@ -59,7 +60,6 @@ class CommentListState extends State<CommentList> {
} else { } else {
element.likes += 1; element.likes += 1;
element.liked = true; element.liked = true;
} }
} }
}); });
@ -198,18 +198,17 @@ class CommentListState extends State<CommentList> {
// //
queryMemberCommentList() async { queryMemberCommentList() async {
if(widget?.relationalId == null || widget.relationalId.isEmpty) if (widget?.relationalId == null || widget.relationalId!.isEmpty) return;
return;
SharedPreferences sharedPreferences = await SharedPreferences.getInstance(); SharedPreferences sharedPreferences = await SharedPreferences.getInstance();
if (apiService == null) if (apiService == null)
apiService = ApiService( apiService = ApiService(
Dio(), Dio(),
context: context, context: context,
token: sharedPreferences.getString("token"), token: sharedPreferences.getString("token") ?? "",
showLoading: false, showLoading: false,
); );
BaseData<PageInfo<MemberCommentList>> baseData = BaseData<PageInfo<MemberCommentList>> baseData =
await apiService.memberCommentList({ await apiService!.memberCommentList({
"pageNum": 1, "pageNum": 1,
"pageSize": 100, "pageSize": 100,
"relationalId": widget.relationalId, "relationalId": widget.relationalId,
@ -219,7 +218,9 @@ class CommentListState extends State<CommentList> {
setState(() { setState(() {
memberList.clear(); memberList.clear();
commentTotal = baseData.data.size; commentTotal = baseData.data.size;
widget.requestApiFinish(commentTotal); if (widget.requestApiFinish != null) {
widget.requestApiFinish!(commentTotal);
}
memberList.addAll(baseData.data.list); memberList.addAll(baseData.data.list);
contentHeight(); contentHeight();
setState(() {}); setState(() {});
@ -351,7 +352,7 @@ class CommentListState extends State<CommentList> {
: memberList.liked; : memberList.liked;
}, },
likeCount: memberList.likes, likeCount: memberList.likes,
countBuilder: (int count, bool isLiked, String text) { countBuilder: (int? count, bool isLiked, String text) {
return Text( return Text(
text, text,
style: TextStyle( style: TextStyle(

129
pubspec.lock

@ -8,6 +8,13 @@ packages:
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.1.0" version: "1.1.0"
amap_flutter_location:
dependency: "direct main"
description:
name: amap_flutter_location
url: "https://pub.flutter-io.cn"
source: hosted
version: "3.0.0"
android_intent_plus: android_intent_plus:
dependency: "direct main" dependency: "direct main"
description: description:
@ -21,7 +28,7 @@ packages:
name: async name: async
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.6.1" version: "2.8.2"
barcode: barcode:
dependency: transitive dependency: transitive
description: description:
@ -56,14 +63,14 @@ packages:
name: characters name: characters
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.1.0" version: "1.2.0"
charcode: charcode:
dependency: transitive dependency: transitive
description: description:
name: charcode name: charcode
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.2.0" version: "1.3.1"
chewie: chewie:
dependency: transitive dependency: transitive
description: description:
@ -92,20 +99,13 @@ packages:
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.15.0" version: "1.15.0"
convert:
dependency: transitive
description:
name: convert
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.1.1"
crypto: crypto:
dependency: transitive dependency: transitive
description: description:
name: crypto name: crypto
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.1.5" version: "3.0.1"
csslib: csslib:
dependency: transitive dependency: transitive
description: description:
@ -173,35 +173,35 @@ packages:
name: flutter_baidu_mapapi_base name: flutter_baidu_mapapi_base
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.0.1" version: "3.0.0"
flutter_baidu_mapapi_map: flutter_baidu_mapapi_map:
dependency: "direct main" dependency: "direct main"
description: description:
name: flutter_baidu_mapapi_map name: flutter_baidu_mapapi_map
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.0.1" version: "3.0.0+2"
flutter_baidu_mapapi_search: flutter_baidu_mapapi_search:
dependency: "direct main" dependency: "direct main"
description: description:
name: flutter_baidu_mapapi_search name: flutter_baidu_mapapi_search
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.0.1" version: "3.0.0"
flutter_baidu_mapapi_utils: flutter_baidu_mapapi_utils:
dependency: "direct main" dependency: "direct main"
description: description:
name: flutter_baidu_mapapi_utils name: flutter_baidu_mapapi_utils
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.0.1" version: "3.0.0"
flutter_bmflocation: flutter_bmflocation:
dependency: "direct main" dependency: "direct main"
description: description:
name: flutter_bmflocation name: flutter_bmflocation
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.0.4" version: "2.0.0-nullsafety.1"
flutter_easyloading: flutter_easyloading:
dependency: "direct main" dependency: "direct main"
description: description:
@ -248,7 +248,7 @@ packages:
name: flutter_plugin_android_lifecycle name: flutter_plugin_android_lifecycle
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.0.11" version: "2.0.5"
flutter_screenutil: flutter_screenutil:
dependency: "direct main" dependency: "direct main"
description: description:
@ -398,14 +398,21 @@ packages:
name: matcher name: matcher
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "0.12.10" version: "0.12.11"
material_color_utilities:
dependency: transitive
description:
name: material_color_utilities
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.1.3"
meta: meta:
dependency: transitive dependency: transitive
description: description:
name: meta name: meta
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.3.0" version: "1.7.0"
nested: nested:
dependency: transitive dependency: transitive
description: description:
@ -461,7 +468,21 @@ packages:
name: path_provider name: path_provider
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.2.0" version: "2.0.9"
path_provider_android:
dependency: transitive
description:
name: path_provider_android
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.0.9"
path_provider_ios:
dependency: transitive
description:
name: path_provider_ios
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.0.7"
path_provider_linux: path_provider_linux:
dependency: transitive dependency: transitive
description: description:
@ -469,6 +490,13 @@ packages:
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.1.5" version: "2.1.5"
path_provider_macos:
dependency: transitive
description:
name: path_provider_macos
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.0.3"
path_provider_platform_interface: path_provider_platform_interface:
dependency: transitive dependency: transitive
description: description:
@ -489,14 +517,14 @@ packages:
name: permission_handler name: permission_handler
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "5.1.0+2" version: "8.3.0"
permission_handler_platform_interface: permission_handler_platform_interface:
dependency: transitive dependency: transitive
description: description:
name: permission_handler_platform_interface name: permission_handler_platform_interface
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.0.2" version: "3.7.0"
petitparser: petitparser:
dependency: transitive dependency: transitive
description: description:
@ -524,7 +552,7 @@ packages:
name: plugin_platform_interface name: plugin_platform_interface
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.0.3" version: "2.1.2"
process: process:
dependency: transitive dependency: transitive
description: description:
@ -690,7 +718,7 @@ packages:
name: test_api name: test_api
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "0.3.0" version: "0.4.8"
thumbnails: thumbnails:
dependency: "direct main" dependency: "direct main"
description: description:
@ -734,14 +762,7 @@ packages:
name: url_launcher name: url_launcher
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "5.7.10" version: "5.4.0"
url_launcher_linux:
dependency: transitive
description:
name: url_launcher_linux
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.0.1+4"
url_launcher_macos: url_launcher_macos:
dependency: transitive dependency: transitive
description: description:
@ -755,35 +776,28 @@ packages:
name: url_launcher_platform_interface name: url_launcher_platform_interface
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.0.9" version: "1.0.1"
url_launcher_web: url_launcher_web:
dependency: transitive dependency: "direct main"
description: description:
name: url_launcher_web name: url_launcher_web
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "0.1.5+3" version: "0.1.1+5"
url_launcher_windows:
dependency: transitive
description:
name: url_launcher_windows
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.0.1+3"
uuid: uuid:
dependency: transitive dependency: transitive
description: description:
name: uuid name: uuid
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.2.2" version: "3.0.6"
vector_math: vector_math:
dependency: transitive dependency: transitive
description: description:
name: vector_math name: vector_math
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.1.0" version: "2.1.1"
video_player: video_player:
dependency: "direct main" dependency: "direct main"
description: description:
@ -846,7 +860,28 @@ packages:
name: webview_flutter name: webview_flutter
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.0.13" version: "2.8.0"
webview_flutter_android:
dependency: transitive
description:
name: webview_flutter_android
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.8.3"
webview_flutter_platform_interface:
dependency: transitive
description:
name: webview_flutter_platform_interface
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.8.1"
webview_flutter_wkwebview:
dependency: transitive
description:
name: webview_flutter_wkwebview
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.7.1"
win32: win32:
dependency: transitive dependency: transitive
description: description:
@ -869,5 +904,5 @@ packages:
source: hosted source: hosted
version: "5.1.2" version: "5.1.2"
sdks: sdks:
dart: ">=2.13.0 <3.0.0" dart: ">=2.14.0 <3.0.0"
flutter: ">=2.2.0" flutter: ">=2.5.0"

22
pubspec.yaml

@ -6,7 +6,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
version: 1.0.0+1 version: 1.0.0+1
environment: environment:
sdk: ">=2.7.0 <3.0.0" sdk: ">=2.12.0 <3.0.0"
dependencies: dependencies:
flutter: flutter:
@ -30,13 +30,17 @@ dependencies:
flutter_staggered_grid_view: ^0.4.0 # Null safety flutter_staggered_grid_view: ^0.4.0 # Null safety
pull_to_refresh: ^2.0.0 # Null safety pull_to_refresh: ^2.0.0 # Null safety
permission_handler: ^5.0.1+1 url_launcher_web: ^0.1.1+5
flutter_bmflocation: ^1.0.3 permission_handler: 8.3.0
flutter_baidu_mapapi_base: ^2.0.1
flutter_baidu_mapapi_map: ^2.0.1 flutter_bmflocation: ^2.0.0-nullsafety.1
flutter_baidu_mapapi_search: ^2.0.1 flutter_baidu_mapapi_base: ^3.0.0
flutter_baidu_mapapi_utils: ^2.0.1 flutter_baidu_mapapi_map: ^3.0.0+2
flutter_baidu_mapapi_search: ^3.0.0
flutter_baidu_mapapi_utils: ^3.0.0
amap_flutter_location: ^3.0.0
dio: ^3.0.10 dio: ^3.0.10
rxdart: ^0.26.0 rxdart: ^0.26.0
@ -64,7 +68,7 @@ dependencies:
# qrscan: ^0.3.1 # qrscan: ^0.3.1
scan: ^1.5.0 scan: ^1.5.0
path_provider: ^1.2.0 path_provider: ^2.0.9
network_to_file_image: ^2.0.0 network_to_file_image: ^2.0.0
flutter_html: ^2.1.5 #2.1.0 flutter_html: ^2.1.5 #2.1.0
@ -78,7 +82,7 @@ dependencies:
package_info: ^2.0.2 package_info: ^2.0.2
sharesdk_plugin: ^1.3.0 sharesdk_plugin: ^1.3.2
flutter_spinkit: ^5.0.0 flutter_spinkit: ^5.0.0
flutter_easyloading: ^3.0.0 flutter_easyloading: ^3.0.0

Loading…
Cancel
Save