Browse Source

更新依赖

git@h5.yoqi.me 1 year ago
parent
commit
7088586f8f

File diff suppressed because it is too large
+ 0 - 0
.flutter-plugins-dependencies


+ 1 - 1
ios/Flutter/flutter_export_environment.sh

@@ -10,4 +10,4 @@ export "FLUTTER_BUILD_NUMBER=1"
 export "DART_OBFUSCATION=false"
 export "TRACK_WIDGET_CREATION=false"
 export "TREE_SHAKE_ICONS=false"
-export "PACKAGE_CONFIG=.packages"
+export "PACKAGE_CONFIG=.dart_tool/package_config.json"

+ 5 - 5
lib/main.dart

@@ -67,7 +67,7 @@ class MyOSCClientState extends State<MyOSCClient> {
     return tabTextStyleNormal;
   }
 
-  Image getTabIcon(int curIndex) {
+  Image? getTabIcon(int curIndex) {
     if (curIndex == _tabIndex) {
       return tabImages[curIndex][1];
     }
@@ -92,10 +92,10 @@ class MyOSCClientState extends State<MyOSCClient> {
         body: _body,
         bottomNavigationBar: CupertinoTabBar(
           items: <BottomNavigationBarItem>[
-            BottomNavigationBarItem(icon: getTabIcon(0), label: getTabTitle(0)),
-            BottomNavigationBarItem(icon: getTabIcon(1), label: getTabTitle(1)),
-            BottomNavigationBarItem(icon: getTabIcon(2), label: getTabTitle(2)),
-            BottomNavigationBarItem(icon: getTabIcon(3), label: getTabTitle(3)),
+            BottomNavigationBarItem(icon: getTabIcon(0)!, label: getTabTitle(0)),
+            BottomNavigationBarItem(icon: getTabIcon(1)!, label: getTabTitle(1)),
+            BottomNavigationBarItem(icon: getTabIcon(2)!, label: getTabTitle(2)),
+            BottomNavigationBarItem(icon: getTabIcon(3)!, label: getTabTitle(3)),
           ],
           currentIndex: _tabIndex,
           onTap: (index) {

+ 7 - 7
lib/model/user_info.dart

@@ -2,13 +2,13 @@
 // 用户信息
 class UserInfo {
 
-  String gender;
-  String name;
-  String location;
-  num id;
-  String avatar;
-  String email;
-  String url;
+  String? gender;
+  String? name;
+  String? location;
+  num? id;
+  String? avatar;
+  String? email;
+  String? url;
 
   UserInfo({this.id, this.name, this.gender, this.avatar, this.email, this.location, this.url});
 

+ 5 - 5
lib/pages/CommonWebPage.dart

@@ -4,10 +4,10 @@ import 'package:flutter_webview_plugin/flutter_webview_plugin.dart';
 
 //公共的WebView页面,需要标题和URL参数
 class CommonWebPage extends StatefulWidget {
-  String title;
-  String url;
+  String? title;
+  String? url;
 
-  CommonWebPage({Key key, this.title, this.url}) : super(key: key);
+  CommonWebPage({Key? key, this.title, this.url}) : super(key: key);
 
   @override
   State<StatefulWidget> createState() {
@@ -47,7 +47,7 @@ class CommonWebPageState extends State<CommonWebPage> {
   Widget build(BuildContext context) {
     List<Widget> titleContent = [];
     titleContent.add(Text(
-      widget.title,
+      widget.title!,
       style: TextStyle(color: Colors.white),
     ));
     if (loading) {
@@ -55,7 +55,7 @@ class CommonWebPageState extends State<CommonWebPage> {
     }
     titleContent.add(Container(width: 50.0));
     return WebviewScaffold(
-      url: widget.url,
+      url: widget.url!,
       appBar: AppBar(
         title: Row(
           mainAxisAlignment: MainAxisAlignment.center,

+ 4 - 4
lib/pages/DiscoveryPage.dart

@@ -111,7 +111,7 @@ class DiscoveryPage extends StatelessWidget {
             getIconImage(item.icon),
             Expanded(
                 child: Text(
-              item.title,
+              item.title!,
               style: titleTextStyle,
             )),
             rightArrowIcon
@@ -128,7 +128,7 @@ class DiscoveryPage extends StatelessWidget {
   }
 
   void handleListItemClick(BuildContext ctx, ListItem item) {
-    String title = item.title;
+    String? title = item.title;
     if (title == "扫一扫") {
       scan();
     } else if (title == "线下活动") {
@@ -178,7 +178,7 @@ class DiscoveryPage extends StatelessWidget {
 }
 
 class ListItem {
-  String icon;
-  String title;
+  String? icon;
+  String? title;
   ListItem({this.icon, this.title});
 }

+ 2 - 2
lib/pages/NewsListPage.dart

@@ -20,7 +20,7 @@ class NewsListPageState extends State<NewsListPage> {
   var listData;
   var slideData;
   var curPage = 1;
-  var listTotalSize = 0;
+  int? listTotalSize = 0;
   ScrollController _controller = ScrollController();
   TextStyle titleTextStyle = TextStyle(fontSize: 15.0);
   TextStyle subtitleStyle = TextStyle(color: const Color(0xFFB5BDC0), fontSize: 12.0);
@@ -86,7 +86,7 @@ class NewsListPageState extends State<NewsListPage> {
               List list1 = [];
               list1.addAll(listData);
               list1.addAll(_listData);
-              if (list1.length >= listTotalSize) {
+              if (list1.length >= listTotalSize!) {
                 list1.add(Constants.END_LINE_TAG);
               }
               listData = list1;

+ 63 - 58
lib/pages/PublishTweetPage.dart

@@ -16,24 +16,20 @@ class PublishTweetPage extends StatefulWidget {
 }
 
 class PublishTweetPageState extends State<PublishTweetPage> {
-
   TextEditingController _controller = TextEditingController();
   List<File> fileList = [];
-  Future<File> _imageFile;
+  Future<XFile?>? _imageFile;
   bool isLoading = false;
   String msg = "";
 
   Widget getBody() {
     var textField = TextField(
       decoration: InputDecoration(
-        hintText: "说点什么吧~",
-        hintStyle: TextStyle(
-          color: const Color(0xFF808080)
-        ),
-        border: OutlineInputBorder(
-          borderRadius: const BorderRadius.all(const Radius.circular(10.0))
-        )
-      ),
+          hintText: "说点什么吧~",
+          hintStyle: TextStyle(color: const Color(0xFF808080)),
+          border: OutlineInputBorder(
+              borderRadius:
+                  const BorderRadius.all(const Radius.circular(10.0)))),
       maxLines: 6,
       maxLength: 150,
       controller: _controller,
@@ -47,8 +43,11 @@ class PublishTweetPageState extends State<PublishTweetPage> {
             if (index == 0) {
               // 添加图片按钮
               var addCell = Center(
-                  child: Image.asset('./images/ic_add_pics.png', width: 80.0, height: 80.0,)
-              );
+                  child: Image.asset(
+                './images/ic_add_pics.png',
+                width: 80.0,
+                height: 80.0,
+              ));
               content = GestureDetector(
                 onTap: () {
                   // 添加图片
@@ -59,8 +58,12 @@ class PublishTweetPageState extends State<PublishTweetPage> {
             } else {
               // 被选中的图片
               content = Center(
-                  child: Image.file(fileList[index - 1], width: 80.0, height: 80.0, fit: BoxFit.cover,)
-              );
+                  child: Image.file(
+                fileList[index - 1],
+                width: 80.0,
+                height: 80.0,
+                fit: BoxFit.cover,
+              ));
             }
             return Container(
               margin: const EdgeInsets.all(2.0),
@@ -74,13 +77,15 @@ class PublishTweetPageState extends State<PublishTweetPage> {
       },
     );
     var children = [
-      Text("提示:由于OSC的openapi限制,发布动弹的接口只支持上传一张图片,本项目可添加最多9张图片,但OSC只会接收最后一张图片。", style: TextStyle(fontSize: 12.0),),
+      Text(
+        "提示:由于OSC的openapi限制,发布动弹的接口只支持上传一张图片,本项目可添加最多9张图片,但OSC只会接收最后一张图片。",
+        style: TextStyle(fontSize: 12.0),
+      ),
       textField,
       Container(
           margin: const EdgeInsets.fromLTRB(0.0, 10.0, 0.0, 0.0),
           height: 200.0,
-          child: gridView
-      )
+          child: gridView)
     ];
     if (isLoading) {
       children.add(Container(
@@ -91,11 +96,10 @@ class PublishTweetPageState extends State<PublishTweetPage> {
       ));
     } else {
       children.add(Container(
-        margin: const EdgeInsets.fromLTRB(0.0, 20.0, 0.0, 0.0),
-        child: Center(
-          child: Text(msg),
-        )
-      ));
+          margin: const EdgeInsets.fromLTRB(0.0, 20.0, 0.0, 0.0),
+          child: Center(
+            child: Text(msg),
+          )));
     }
     return Container(
       padding: const EdgeInsets.all(5.0),
@@ -120,33 +124,32 @@ class PublishTweetPageState extends State<PublishTweetPage> {
 
   Widget _bottomSheetBuilder(BuildContext context) {
     return Container(
-      height: 182.0,
-      child: Padding(
-        padding: const EdgeInsets.fromLTRB(0.0, 30.0, 0.0, 30.0),
-        child: Column(
-          children: [
-            _renderBottomMenuItem("相机拍照", ImageSource.camera),
-            Divider(height: 2.0,),
-            _renderBottomMenuItem("图库选择照片", ImageSource.gallery)
-          ],
-        ),
-      )
-    );
+        height: 182.0,
+        child: Padding(
+          padding: const EdgeInsets.fromLTRB(0.0, 30.0, 0.0, 30.0),
+          child: Column(
+            children: [
+              _renderBottomMenuItem("相机拍照", ImageSource.camera),
+              Divider(
+                height: 2.0,
+              ),
+              _renderBottomMenuItem("图库选择照片", ImageSource.gallery)
+            ],
+          ),
+        ));
   }
 
   _renderBottomMenuItem(title, ImageSource source) {
     var item = Container(
       height: 60.0,
-      child: Center(
-        child: Text(title)
-      ),
+      child: Center(child: Text(title)),
     );
     return InkWell(
       child: item,
       onTap: () {
         Navigator.of(context).pop();
         setState(() {
-          _imageFile = ImagePicker.pickImage(source: source);
+          _imageFile = ImagePicker().pickImage(source: source);
         });
       },
     );
@@ -173,12 +176,11 @@ class PublishTweetPageState extends State<PublishTweetPage> {
       request.fields.addAll(params);
       if (fileList != null && fileList.length > 0) {
         for (File f in fileList) {
-          var stream = http.ByteStream(
-              DelegatingStream.typed(f.openRead()));
+          var stream = http.ByteStream(DelegatingStream.typed(f.openRead()));
           var length = await f.length();
           var filename = f.path.substring(f.path.lastIndexOf("/") + 1);
-          request.files.add(http.MultipartFile(
-              'img', stream, length, filename: filename));
+          request.files.add(
+              http.MultipartFile('img', stream, length, filename: filename));
         }
       }
       setState(() {
@@ -222,28 +224,31 @@ class PublishTweetPageState extends State<PublishTweetPage> {
         actions: <Widget>[
           Builder(
             builder: (ctx) {
-              return IconButton(icon: Icon(Icons.send), onPressed: () {
-                // 发送动弹
-                DataUtils.isLogin().then((isLogin) {
-                  if (isLogin) {
-                    return DataUtils.getAccessToken();
-                  } else {
-                    return null;
-                  }
-                }).then((token) {
-                  sendTweet(ctx, token);
-                });
-              });
+              return IconButton(
+                  icon: Icon(Icons.send),
+                  onPressed: () {
+                    // 发送动弹
+                    DataUtils.isLogin().then((isLogin) {
+                      if (isLogin) {
+                        return DataUtils.getAccessToken();
+                      } else {
+                        return null;
+                      }
+                    }).then((token) {
+                      sendTweet(ctx, token);
+                    });
+                  });
             },
           )
         ],
       ),
       body: FutureBuilder(
         future: _imageFile,
-        builder: (BuildContext context, AsyncSnapshot<File> snapshot) {
+        builder: (BuildContext context, AsyncSnapshot<XFile?> snapshot) {
           if (snapshot.connectionState == ConnectionState.done &&
-              snapshot.data != null && _imageFile != null) {
-            fileList.add(snapshot.data);
+              snapshot.data != null &&
+              _imageFile != null) {
+            fileList.add(File(snapshot.data!.path));
             _imageFile = null;
           }
           return getBody();
@@ -251,4 +256,4 @@ class PublishTweetPageState extends State<PublishTweetPage> {
       ),
     );
   }
-}
+}

+ 0 - 1
lib/pages/TestPage.dart

@@ -1,5 +1,4 @@
 import 'package:flutter/material.dart';
-import 'package:flutter/cupertino.dart';
 
 class TestPage extends StatelessWidget {
   @override

+ 20 - 20
lib/pages/TweetDetailPage.dart

@@ -11,9 +11,9 @@ import 'package:flutter_osc/widgets/CommonEndLine.dart';
 // 动弹详情
 
 class TweetDetailPage extends StatefulWidget {
-  Map<String, dynamic> tweetData;
+  Map<String, dynamic>? tweetData;
 
-  TweetDetailPage({Key key, this.tweetData}):super(key: key);
+  TweetDetailPage({Key? key, this.tweetData}):super(key: key);
 
   @override
   State<StatefulWidget> createState() {
@@ -23,8 +23,8 @@ class TweetDetailPage extends StatefulWidget {
 
 class TweetDetailPageState extends State<TweetDetailPage> {
 
-  Map<String, dynamic> tweetData;
-  List commentList;
+  Map<String, dynamic>? tweetData;
+  List? commentList;
   RegExp regExp1 = RegExp("</.*>");
   RegExp regExp2 = RegExp("<.*>");
   TextStyle subtitleStyle = TextStyle(
@@ -39,7 +39,7 @@ class TweetDetailPageState extends State<TweetDetailPage> {
   ScrollController _controller = ScrollController();
   TextEditingController _inputController = TextEditingController();
 
-  TweetDetailPageState({Key key, this.tweetData});
+  TweetDetailPageState({Key? key, this.tweetData});
 
   // 获取动弹的回复
   getReply(bool isLoadMore) {
@@ -50,7 +50,7 @@ class TweetDetailPageState extends State<TweetDetailPage> {
             return;
           }
           Map<String, String> params = Map();
-          var id = this.tweetData['id'];
+          var id = this.tweetData!['id'];
           params['id'] = '$id';
           params['catalog'] = '3';// 3是动弹评论
           params['access_token'] = token;
@@ -67,9 +67,9 @@ class TweetDetailPageState extends State<TweetDetailPage> {
               } else {
                 // 加载更多数据
                 List list = [];
-                list.addAll(commentList);
+                list.addAll(commentList!);
                 list.addAll(json.decode(data)['commentList']);
-                if (list.length >= tweetData['commentCount']) {
+                if (list.length >= tweetData!['commentCount']) {
                   list.add(Constants.END_LINE_TAG);
                 }
                 commentList = list;
@@ -88,7 +88,7 @@ class TweetDetailPageState extends State<TweetDetailPage> {
     _controller.addListener(() {
       var max = _controller.position.maxScrollExtent;
       var pixels = _controller.position.pixels;
-      if (max == pixels && commentList.length < tweetData['commentCount']) {
+      if (max == pixels && commentList!.length < tweetData!['commentCount']) {
         // scroll to end, load next page
         curPage++;
         getReply(true);
@@ -101,7 +101,7 @@ class TweetDetailPageState extends State<TweetDetailPage> {
     var _body = commentList == null ? Center(
       child: CircularProgressIndicator(),
     ) : ListView.builder(
-      itemCount: commentList.length == 0 ? 1 : commentList.length * 2,
+      itemCount: commentList!.length == 0 ? 1 : commentList!.length * 2,
       itemBuilder: renderListItem,
       controller: _controller,
     );
@@ -125,7 +125,7 @@ class TweetDetailPageState extends State<TweetDetailPage> {
 
   Widget renderListItem(BuildContext context, int i) {
     if (i == 0) {
-      return getTweetView(this.tweetData);
+      return getTweetView(this.tweetData!);
     }
     i -= 1;
     if (i.isOdd) {
@@ -137,7 +137,7 @@ class TweetDetailPageState extends State<TweetDetailPage> {
 
   // 渲染评论列表
   _renderCommentRow(context, i) {
-    var listItem = commentList[i];
+    var listItem = commentList![i];
     if (listItem is String && listItem == Constants.END_LINE_TAG) {
       return CommonEndLine();
     }
@@ -200,8 +200,8 @@ class TweetDetailPageState extends State<TweetDetailPage> {
     String title;
     String authorId;
     if (isMainFloor) {
-      title = "@${tweetData['author']}";
-      authorId = "${tweetData['authorid']}";
+      title = "@${tweetData!['author']}";
+      authorId = "${tweetData!['authorid']}";
     } else {
       title = "@${data['commentAuthor']}";
       authorId = "${data['commentAuthorId']}";
@@ -269,10 +269,10 @@ class TweetDetailPageState extends State<TweetDetailPage> {
       DataUtils.isLogin().then((isLogin) {
         if (isLogin) {
           DataUtils.getAccessToken().then((token) {
-            Map<String, String> params = Map();
+            Map<String, String?> params = Map();
             params['access_token'] = token;
-            params['id'] = "${tweetData['id']}";
-            print("id: ${tweetData['id']}");
+            params['id'] = "${tweetData!['id']}";
+            print("id: ${tweetData!['id']}");
             params['catalog'] = "3";
             params['content'] = replyStr;
             params['authorid'] = "$authorId";
@@ -355,7 +355,7 @@ class TweetDetailPageState extends State<TweetDetailPage> {
         child: contentRow,
       ),
     ];
-    String imgSmall = listItem['imgSmall'];
+    String? imgSmall = listItem['imgSmall'];
     if (imgSmall != null && imgSmall.length > 0) {
       // 动弹中有图片
       List<String> list = imgSmall.split(",");
@@ -370,7 +370,7 @@ class TweetDetailPageState extends State<TweetDetailPage> {
       List<Widget> imgList = [];
       List rows = [];
       num len = imgUrlList.length;
-      for (var row = 0; row < getRow(len); row++) {
+      for (var row = 0; row < getRow(len as int); row++) {
         List<Widget> rowArr = [];
         for (var col = 0; col < 3; col++) {
           num index = row * 3 + col;
@@ -379,7 +379,7 @@ class TweetDetailPageState extends State<TweetDetailPage> {
           if (index < len) {
             rowArr.add(Padding(
               padding: const EdgeInsets.all(2.0),
-              child: Image.network(imgUrlList[index], width: cellWidth, height: cellWidth),
+              child: Image.network(imgUrlList[index as int], width: cellWidth, height: cellWidth),
             ));
           }
         }

+ 25 - 25
lib/pages/TweetsListPage.dart

@@ -19,15 +19,15 @@ class TweetsListPage extends StatefulWidget {
 }
 
 class TweetsListPageState extends State<TweetsListPage> {
-  List hotTweetsList;
-  List normalTweetsList;
-  TextStyle authorTextStyle;
-  TextStyle subtitleStyle;
+  List? hotTweetsList;
+  List? normalTweetsList;
+  TextStyle? authorTextStyle;
+  TextStyle? subtitleStyle;
   RegExp regExp1 = RegExp("</.*>");
   RegExp regExp2 = RegExp("<.*>");
   num curPage = 1;
   bool loading = false;
-  ScrollController _controller;
+  ScrollController? _controller;
   bool isUserLogin = false;
 
   @override
@@ -56,9 +56,9 @@ class TweetsListPageState extends State<TweetsListPage> {
     subtitleStyle =
         TextStyle(fontSize: 12.0, color: const Color(0xFFB5BDC0));
     _controller = ScrollController();
-    _controller.addListener(() {
-      var maxScroll = _controller.position.maxScrollExtent;
-      var pixels = _controller.position.pixels;
+    _controller!.addListener(() {
+      var maxScroll = _controller!.position.maxScrollExtent;
+      var pixels = _controller!.position.pixels;
       if (maxScroll == pixels) {
         // load next page
         curPage++;
@@ -86,19 +86,19 @@ class TweetsListPageState extends State<TweetsListPage> {
           params['pageSize'] = "20";
           params['dataType'] = "json";
           NetUtils.get(Api.TWEETS_LIST, params: params).then((data) {
-            Map<String, dynamic> obj = json.decode(data);
+            Map<String, dynamic>? obj = json.decode(data);
             if (!isLoadMore) {
               // first load
               if (isHot) {
-                hotTweetsList = obj['tweetlist'];
+                hotTweetsList = obj!['tweetlist'];
               } else {
-                normalTweetsList = obj['tweetlist'];
+                normalTweetsList = obj!['tweetlist'];
               }
             } else {
               // load more
               List list = [];
-              list.addAll(normalTweetsList);
-              list.addAll(obj['tweetlist']);
+              list.addAll(normalTweetsList!);
+              list.addAll(obj!['tweetlist']);
               normalTweetsList = list;
             }
             filterList(hotTweetsList, true);
@@ -110,12 +110,12 @@ class TweetsListPageState extends State<TweetsListPage> {
   }
 
   // 根据黑名单过滤出新的数组
-  filterList(List<dynamic> objList, bool isHot) {
+  filterList(List<dynamic>? objList, bool isHot) {
     BlackListUtils.getBlackListIds().then((intList) {
       if (intList != null && intList.isNotEmpty && objList != null) {
         List newList = [];
         for (dynamic item in objList) {
-          int authorId = item['authorid'];
+          int? authorId = item['authorid'];
           if (!intList.contains(authorId)) {
             newList.add(item);
           }
@@ -223,7 +223,7 @@ class TweetsListPageState extends State<TweetsListPage> {
         child: contentRow,
       ),
     ];
-    String imgSmall = listItem['imgSmall'];
+    String? imgSmall = listItem['imgSmall'];
     if (imgSmall != null && imgSmall.length > 0) {
       // 动弹中有图片
       List<String> list = imgSmall.split(",");
@@ -238,7 +238,7 @@ class TweetsListPageState extends State<TweetsListPage> {
       List<Widget> imgList = [];
       List<List<Widget>> rows = [];
       num len = imgUrlList.length;
-      for (var row = 0; row < getRow(len); row++) {
+      for (var row = 0; row < getRow(len as int); row++) {
         List<Widget> rowArr = [];
         for (var col = 0; col < 3; col++) {
           num index = row * 3 + col;
@@ -247,7 +247,7 @@ class TweetsListPageState extends State<TweetsListPage> {
           if (index < len) {
             rowArr.add(Padding(
               padding: const EdgeInsets.all(2.0),
-              child: Image.network(imgUrlList[index],
+              child: Image.network(imgUrlList[index as int],
                   width: cellWidth, height: cellWidth),
             ));
           }
@@ -317,13 +317,13 @@ class TweetsListPageState extends State<TweetsListPage> {
 
   // 关进小黑屋
   putIntoBlackHouse(item) {
-    int authorId = item['authorid'];
+    int? authorId = item['authorid'];
     String portrait = "${item['portrait']}";
     String nickname = "${item['author']}";
     DataUtils.getUserInfo().then((info) {
       if (info != null) {
-        int loginUserId = info.id;
-        Map<String, String> params = Map();
+        int? loginUserId = info.id as int?;
+        Map<String, String?> params = Map();
         params['userid'] = '$loginUserId';
         params['authorid'] = '$authorId';
         params['authoravatar'] = portrait;
@@ -383,7 +383,7 @@ class TweetsListPageState extends State<TweetsListPage> {
       );
     } else {
       i = i ~/ 2;
-      return getRowWidget(hotTweetsList[i]);
+      return getRowWidget(hotTweetsList![i]);
     }
   }
 
@@ -394,7 +394,7 @@ class TweetsListPageState extends State<TweetsListPage> {
       );
     } else {
       i = i ~/ 2;
-      return getRowWidget(normalTweetsList[i]);
+      return getRowWidget(normalTweetsList![i]);
     }
   }
 
@@ -422,7 +422,7 @@ class TweetsListPageState extends State<TweetsListPage> {
     } else {
       // 热门动弹列表
       return ListView.builder(
-        itemCount: hotTweetsList.length * 2 - 1,
+        itemCount: hotTweetsList!.length * 2 - 1,
         itemBuilder: (context, i) => renderHotRow(i),
       );
     }
@@ -438,7 +438,7 @@ class TweetsListPageState extends State<TweetsListPage> {
       // 普通动弹列表
       return RefreshIndicator(
         child: ListView.builder(
-          itemCount: normalTweetsList.length * 2 - 1,
+          itemCount: normalTweetsList!.length * 2 - 1,
           itemBuilder: (context, i) => renderNormalRow(i),
           physics: const AlwaysScrollableScrollPhysics(),
           controller: _controller,

+ 2 - 2
lib/pages/UserInfoDetailPage.dart

@@ -11,6 +11,6 @@ class UserInfoDetailPage extends StatefulWidget {
 class UserInfoDetailState extends State<UserInfoDetailPage> {
   @override
   Widget build(BuildContext context) {
-    return null;
+    return Container();
   }
-}
+}

+ 34 - 33
lib/pages/about_page.dart

@@ -1,8 +1,9 @@
 import 'package:flutter/material.dart';
 import 'CommonWebPage.dart';
 
-// "关于"页面
-
+/// Description: 关于页面
+/// Time       : 08/14/2022 Sunday
+/// Author     : liuyuqi.gov@msn.cn
 class AboutPage extends StatefulWidget {
   @override
   State<StatefulWidget> createState() {
@@ -15,7 +16,7 @@ class AboutPageState extends State<AboutPage> {
   TextStyle textStyle = TextStyle(
       color: Colors.blue,
       decoration: TextDecoration.combine([TextDecoration.underline]));
-  Widget authorLink, mayunLink, githubLink;
+  late Widget authorLink, mayunLink, githubLink;
   List<String> urls = [];
   List<String> titles = [];
 
@@ -118,36 +119,36 @@ class AboutPageState extends State<AboutPage> {
   @override
   Widget build(BuildContext context) {
     return Scaffold(
-      appBar: AppBar(
-        title: Text("关于", style: TextStyle(color: Colors.white)),
-        iconTheme: IconThemeData(color: Colors.white),
-      ),
-      body: Center(
-        child: Column(
-          children: [
-            Container(
-              width: 1.0,
-              height: 100.0,
-              color: Colors.transparent,
-            ),
-            Image.asset(
-              './images/ic_osc_logo.png',
-              width: 200.0,
-              height: 56.0,
-            ),
-            Text("基于Google Flutter的开源中国客户端"),
-            authorLink,
-            mayunLink,
-            githubLink,
-            Expanded(flex: 1, child: getImageOrBtn()),
-            Container(
-                margin: const EdgeInsets.fromLTRB(0.0, 0.0, 0.0, 15.0),
-                child: Text(
-                  "本项目仅供学习使用,与开源中国官方无关",
-                  style: TextStyle(fontSize: 12.0),
-                ))
-          ],
+        appBar: AppBar(
+          title: Text("关于", style: TextStyle(color: Colors.white)),
+          iconTheme: IconThemeData(color: Colors.white),
         ),
-      ));
+        body: Center(
+          child: Column(
+            children: [
+              Container(
+                width: 1.0,
+                height: 100.0,
+                color: Colors.transparent,
+              ),
+              Image.asset(
+                './images/ic_osc_logo.png',
+                width: 200.0,
+                height: 56.0,
+              ),
+              Text("基于Google Flutter的开源中国客户端"),
+              authorLink,
+              mayunLink,
+              githubLink,
+              Expanded(flex: 1, child: getImageOrBtn()),
+              Container(
+                  margin: const EdgeInsets.fromLTRB(0.0, 0.0, 0.0, 15.0),
+                  child: Text(
+                    "本项目仅供学习使用,与开源中国官方无关",
+                    style: TextStyle(fontSize: 12.0),
+                  ))
+            ],
+          ),
+        ));
   }
 }

+ 9 - 9
lib/pages/black_house_page.dart

@@ -20,7 +20,7 @@ class BlackHousePage extends StatefulWidget {
 
 class BlackHousePageState extends State<BlackHousePage> {
   bool isLogin = true;
-  List blackDataList;
+  List? blackDataList;
   TextStyle btnStyle = TextStyle(color: Colors.white, fontSize: 12.0);
 
   BlackHousePageState() {
@@ -53,8 +53,8 @@ class BlackHousePageState extends State<BlackHousePage> {
   // 获取用户信息
   getUserInfo() async {
     SharedPreferences sp = await SharedPreferences.getInstance();
-    String accessToken = sp.get(DataUtils.SP_AC_TOKEN);
-    Map<String, String> params = Map();
+    String? accessToken = sp.get(DataUtils.SP_AC_TOKEN) as String?;
+    Map<String, String?> params = Map();
     params['access_token'] = accessToken;
     NetUtils.get(Api.USER_INFO, params: params).then((data) {
       if (data != null) {
@@ -117,7 +117,7 @@ class BlackHousePageState extends State<BlackHousePage> {
   }
 
   showSetFreeDialog(item) {
-    String name = Utf8Utils.decode(item['authorname']);
+    String? name = Utf8Utils.decode(item['authorname']);
     showDialog(
         context: context,
         builder: (BuildContext ctx) {
@@ -168,7 +168,7 @@ class BlackHousePageState extends State<BlackHousePage> {
       return Center(
         child: CircularProgressIndicator(),
       );
-    } else if (blackDataList.length == 0) {
+    } else if (blackDataList!.length == 0) {
       return Center(
         child: Column(
           mainAxisAlignment: MainAxisAlignment.center,
@@ -178,8 +178,8 @@ class BlackHousePageState extends State<BlackHousePage> {
     }
     return GridView.count(
       crossAxisCount: 3,
-      children: List.generate(blackDataList.length, (index) {
-        String name = Utf8Utils.decode(blackDataList[index]['authorname']);
+      children: List.generate(blackDataList!.length, (index) {
+        String name = Utf8Utils.decode(blackDataList![index]['authorname'])!;
         return Container(
           margin: const EdgeInsets.all(2.0),
           color: Colors.black,
@@ -194,7 +194,7 @@ class BlackHousePageState extends State<BlackHousePage> {
                   color: Colors.transparent,
                   image: DecorationImage(
                       image: NetworkImage(
-                          "${blackDataList[index]['authoravatar']}"),
+                          "${blackDataList![index]['authoravatar']}"),
                       fit: BoxFit.cover),
                   border: Border.all(
                     color: Colors.white,
@@ -218,7 +218,7 @@ class BlackHousePageState extends State<BlackHousePage> {
                       borderRadius: BorderRadius.all(Radius.circular(5.0))),
                 ),
                 onTap: () {
-                  showSetFreeDialog(blackDataList[index]);
+                  showSetFreeDialog(blackDataList![index]);
                 },
               ),
             ],

+ 2 - 2
lib/pages/login_page.dart

@@ -16,8 +16,8 @@ class LoginPageState extends State<LoginPage> {
   final int MAX_COUNT = 5;
   bool loading = true;
   GlobalKey<ScaffoldState> _scaffoldKey = GlobalKey();
-  StreamSubscription<String> _onUrlChanged;
-  StreamSubscription<WebViewStateChanged> _onStateChanged;
+  late StreamSubscription<String> _onUrlChanged;
+  late StreamSubscription<WebViewStateChanged> _onStateChanged;
   FlutterWebviewPlugin flutterWebViewPlugin = FlutterWebviewPlugin();
 
   @override

+ 4 - 4
lib/pages/my_info_page.dart

@@ -62,7 +62,7 @@ class MyInfoPageState extends State<MyInfoPage> {
   }
 
   _showUserInfo() {
-    DataUtils.getUserInfo().then((UserInfo userInfo) {
+    DataUtils.getUserInfo().then((UserInfo? userInfo) {
       if (userInfo != null) {
         print(userInfo.name);
         print(userInfo.avatar);
@@ -99,8 +99,8 @@ class MyInfoPageState extends State<MyInfoPage> {
   // 获取用户信息
   getUserInfo() async {
     SharedPreferences sp = await SharedPreferences.getInstance();
-    String accessToken = sp.get(DataUtils.SP_AC_TOKEN);
-    Map<String, String> params = Map();
+    String? accessToken = sp.get(DataUtils.SP_AC_TOKEN) as String?;
+    Map<String, String?> params = Map();
     params['access_token'] = accessToken;
     NetUtils.get(Api.USER_INFO, params: params).then((data) {
       if (data != null) {
@@ -255,7 +255,7 @@ class MyInfoPageState extends State<MyInfoPage> {
           Navigator.of(context).push(MaterialPageRoute(
               builder: (context) => CommonWebPage(
                   title: "我的博客",
-                  url: "https://my.oschina.net/u/${info.id}/blog")));
+                  url: "https://my.oschina.net/u/${info!.id}/blog")));
         });
       }
     });

+ 6 - 6
lib/pages/news_detail_page.dart

@@ -4,9 +4,9 @@ import 'package:flutter_webview_plugin/flutter_webview_plugin.dart';
 
 class NewsDetailPage extends StatefulWidget {
 
-  String id;
+  String? id;
 
-  NewsDetailPage({Key key, this.id}):super(key: key);
+  NewsDetailPage({Key? key, this.id}):super(key: key);
 
   @override
   State<StatefulWidget> createState() => NewsDetailPageState(id: this.id);
@@ -14,12 +14,12 @@ class NewsDetailPage extends StatefulWidget {
 
 class NewsDetailPageState extends State<NewsDetailPage> {
 
-  String id;
+  String? id;
   bool loaded = false;
-  String detailDataStr;
+  String? detailDataStr;
   final flutterWebViewPlugin = FlutterWebviewPlugin();
 
-  NewsDetailPageState({Key key, this.id});
+  NewsDetailPageState({Key? key, this.id});
 
   @override
   void initState() {
@@ -45,7 +45,7 @@ class NewsDetailPageState extends State<NewsDetailPage> {
     }
     titleContent.add(Container(width: 50.0));
     return WebviewScaffold(
-      url: this.id,
+      url: this.id!,
       appBar: AppBar(
         title: Row(
           mainAxisAlignment: MainAxisAlignment.center,

+ 10 - 10
lib/pages/offline_activity_page.dart

@@ -20,7 +20,7 @@ class OfflineActivityPageState extends State<OfflineActivityPage> {
 
   TextStyle titleTextStyle = TextStyle(color: Colors.black, fontSize: 18.0);
 
-  List recData, latestData, ychData;
+  List? recData, latestData, ychData;
 
   @override
   void initState() {
@@ -55,30 +55,30 @@ class OfflineActivityPageState extends State<OfflineActivityPage> {
   Widget getRecBody() {
     if (recData == null) {
       return Center(child: CircularProgressIndicator());
-    } else if (recData.length == 0) {
+    } else if (recData!.length == 0) {
       return Center(child: Text("暂无数据"));
     } else {
-      return ListView.builder(itemBuilder: _renderRecRow, itemCount: recData.length);
+      return ListView.builder(itemBuilder: _renderRecRow, itemCount: recData!.length);
     }
   }
 
   Widget getLatestBody() {
     if (latestData == null) {
       return Center(child: CircularProgressIndicator());
-    } else if (latestData.length == 0) {
+    } else if (latestData!.length == 0) {
       return Center(child: Text("暂无数据"));
     } else {
-      return ListView.builder(itemBuilder: _renderLatestRow, itemCount: latestData.length);
+      return ListView.builder(itemBuilder: _renderLatestRow, itemCount: latestData!.length);
     }
   }
 
   Widget getYchBody() {
     if (ychData == null) {
       return Center(child: CircularProgressIndicator());
-    } else if (ychData.length == 0) {
+    } else if (ychData!.length == 0) {
       return Center(child: Text("暂无数据"));
     } else {
-      return ListView.builder(itemBuilder: _renderYchRow, itemCount: ychData.length);
+      return ListView.builder(itemBuilder: _renderYchRow, itemCount: ychData!.length);
     }
   }
 
@@ -107,7 +107,7 @@ class OfflineActivityPageState extends State<OfflineActivityPage> {
   }
 
   Widget _renderRecRow(BuildContext ctx, int i) {
-    Map itemData = recData[i];
+    Map itemData = recData![i];
     return InkWell(
       child: getCard(itemData),
       onTap: () {
@@ -117,7 +117,7 @@ class OfflineActivityPageState extends State<OfflineActivityPage> {
   }
 
   Widget _renderLatestRow(BuildContext ctx, int i) {
-    Map itemData = latestData[i];
+    Map itemData = latestData![i];
     return InkWell(
       child: getCard(itemData),
       onTap: () {
@@ -127,7 +127,7 @@ class OfflineActivityPageState extends State<OfflineActivityPage> {
   }
 
   Widget _renderYchRow(BuildContext ctx, int i) {
-    Map itemData = ychData[i];
+    Map itemData = ychData![i];
     return InkWell(
       child: getCard(itemData),
       onTap: () {

+ 4 - 4
lib/pages/setting_page.dart

@@ -77,7 +77,7 @@ class SettingPage extends StatelessWidget {
             getIconImage(item.icon),
             Expanded(
                 child: Text(
-              item.title,
+              item.title!,
               style: titleTextStyle,
             )),
             rightArrowIcon
@@ -86,7 +86,7 @@ class SettingPage extends StatelessWidget {
       );
       return InkWell(
         onTap: () {
-          String title = item.title;
+          String? title = item.title;
           if (title == '退出登录') {
             DataUtils.clearLoginInfo().then((arg) {
               Navigator.of(ctx).pop();
@@ -116,7 +116,7 @@ class SettingPage extends StatelessWidget {
 }
 
 class ListItem {
-  String icon;
-  String title;
+  String? icon;
+  String? title;
   ListItem({this.icon, this.title});
 }

+ 18 - 18
lib/util/BlackListUtils.dart

@@ -7,11 +7,11 @@ class BlackListUtils {
   static final String SP_BLACK_LIST = "blackList";
 
   // 将对象数组转化为整型数组
-  static List<int> convert(List objList) {
+  static List<int?> convert(List objList) {
     if (objList == null || objList.isEmpty) {
       return <int>[];
     }
-    List<int> intList = [];
+    List<int?> intList = [];
     for (var obj in objList) {
       intList.add(obj['authorid']);
     }
@@ -19,11 +19,11 @@ class BlackListUtils {
   }
 
   // 字符串转化为整型数组
-  static List<int> _str2intList(String str) {
+  static List<int?>? _str2intList(String? str) {
     if (str != null && str.length > 0) {
       List<String> list = str.split(",");
       if (list != null && list.isNotEmpty) {
-        List<int> intList = [];
+        List<int?> intList = [];
         for (String s in list) {
           intList.add(int.parse(s));
         }
@@ -34,12 +34,12 @@ class BlackListUtils {
   }
 
   // 整型数组转化为字符串
-  static String _intList2Str(List<int> list) {
+  static String? _intList2Str(List<int?> list) {
     if (list == null || list.isEmpty) {
       return null;
     }
     StringBuffer sb = StringBuffer();
-    for (int id in list) {
+    for (int? id in list) {
       sb.write("$id,");
     }
     String result = sb.toString();
@@ -47,8 +47,8 @@ class BlackListUtils {
   }
 
   // 保存黑名单的id
-  static Future<String> saveBlackListIds(List<int> list) async {
-    String str = _intList2Str(list);
+  static Future<String?> saveBlackListIds(List<int?> list) async {
+    String? str = _intList2Str(list);
     if (str != null) {
       SharedPreferences sp = await SharedPreferences.getInstance();
       sp.setString(SP_BLACK_LIST, str);
@@ -60,9 +60,9 @@ class BlackListUtils {
   }
 
   // 获取本地保存的黑名单id数据
-  static Future<List<int>> getBlackListIds() async {
+  static Future<List<int?>?> getBlackListIds() async {
     SharedPreferences sp = await SharedPreferences.getInstance();
-    String str = sp.getString(SP_BLACK_LIST);
+    String? str = sp.getString(SP_BLACK_LIST);
     if (str != null && str.length > 0) {
       return _str2intList(str);
     }
@@ -70,31 +70,31 @@ class BlackListUtils {
   }
 
   // 向黑名单中添加一个id
-  static Future<List<int>> addBlackId(int id) async {
-    List<int> list = await getBlackListIds();
+  static Future<List<int?>?> addBlackId(int? id) async {
+    List<int?>? list = await getBlackListIds();
     if (list != null && list.isNotEmpty) {
       if (!list.contains(id)) {
         list.add(id);
-        String str = await saveBlackListIds(list);
+        String? str = await saveBlackListIds(list);
         return _str2intList(str);
       } else {
         return list;
       }
     } else {
-      List<int> l = [];
+      List<int?> l = [];
       l.add(id);
-      String str = await saveBlackListIds(l);
+      String? str = await saveBlackListIds(l);
       return _str2intList(str);
     }
   }
 
   // 向黑名单中移除一个id
-  static Future<List<int>> removeBlackId(int id) async {
-    List<int> list = await getBlackListIds();
+  static Future<List<int?>?> removeBlackId(int? id) async {
+    List<int?>? list = await getBlackListIds();
     if (list != null && list.isNotEmpty) {
       if (list.contains(id)) {
         list.remove(id);
-        String str = await saveBlackListIds(list);
+        String? str = await saveBlackListIds(list);
         return _str2intList(str);
       }
     }

+ 8 - 8
lib/util/DataUtils.dart

@@ -27,11 +27,11 @@ class DataUtils {
       String refreshToken = data['refresh_token'];
       await sp.setString(SP_RE_TOKEN, refreshToken);
       num uid = data['uid'];
-      await sp.setInt(SP_UID, uid);
+      await sp.setInt(SP_UID, uid as int);
       String tokenType = data['tokenType'];
       await sp.setString(SP_TOKEN_TYPE, tokenType);
       num expiresIn = data['expires_in'];
-      await sp.setInt(SP_EXPIRES_IN, expiresIn);
+      await sp.setInt(SP_EXPIRES_IN, expiresIn as int);
 
       await sp.setBool(SP_IS_LOGIN, true);
     }
@@ -48,7 +48,7 @@ class DataUtils {
   }
 
   // 保存用户个人信息
-  static Future<UserInfo> saveUserInfo(Map data) async {
+  static Future<UserInfo?> saveUserInfo(Map? data) async {
     if (data != null) {
       SharedPreferences sp = await SharedPreferences.getInstance();
       String name = data['name'];
@@ -59,7 +59,7 @@ class DataUtils {
       String email = data['email'];
       String url = data['url'];
       await sp.setString(SP_USER_NAME, name);
-      await sp.setInt(SP_USER_ID, id);
+      await sp.setInt(SP_USER_ID, id as int);
       await sp.setString(SP_USER_GENDER, gender);
       await sp.setString(SP_USER_AVATAR, avatar);
       await sp.setString(SP_USER_LOC, location);
@@ -80,9 +80,9 @@ class DataUtils {
   }
 
   // 获取用户信息
-  static Future<UserInfo> getUserInfo() async {
+  static Future<UserInfo?> getUserInfo() async {
     SharedPreferences sp = await SharedPreferences.getInstance();
-    bool isLogin = sp.getBool(SP_IS_LOGIN);
+    bool? isLogin = sp.getBool(SP_IS_LOGIN);
     if (isLogin == null || !isLogin) {
       return null;
     }
@@ -99,11 +99,11 @@ class DataUtils {
 
   static Future<bool> isLogin() async {
     SharedPreferences sp = await SharedPreferences.getInstance();
-    bool b = sp.getBool(SP_IS_LOGIN);
+    bool? b = sp.getBool(SP_IS_LOGIN);
     return b != null && b;
   }
 
-  static Future<String> getAccessToken() async {
+  static Future<String?> getAccessToken() async {
     SharedPreferences sp = await SharedPreferences.getInstance();
     return sp.getString(SP_AC_TOKEN);
   }

+ 6 - 6
lib/util/NetUtils.dart

@@ -2,7 +2,7 @@ import 'dart:async';
 import 'package:http/http.dart' as http;
 
 class NetUtils {
-  static Future<String> get(String url, {Map<String, String> params}) async {
+  static Future<String> get(String url, {Map<String, String?>? params}) async {
     if (params != null && params.isNotEmpty) {
       StringBuffer sb = StringBuffer("?");
       params.forEach((key, value) {
@@ -12,12 +12,12 @@ class NetUtils {
       paramStr = paramStr.substring(0, paramStr.length - 1);
       url += paramStr;
     }
-    http.Response res = await http.get(url);
+    http.Response res = await http.get(Uri.parse(url));
     return res.body;
   }
-  
-  static Future<String> post(String url, {Map<String, String> params}) async {
-    http.Response res = await http.post(url, body: params);
+
+  static Future<String> post(String url, {Map<String, String?>? params}) async {
+    http.Response res = await http.post(Uri.parse(url), body: params);
     return res.body;
   }
-}
+}

+ 2 - 2
lib/util/Utf8Utils.dart

@@ -2,7 +2,7 @@ import 'dart:convert';
 
 class Utf8Utils {
   
-  static String encode(String origin) {
+  static String? encode(String origin) {
     if (origin == null || origin.length == 0) {
       return null;
     }
@@ -15,7 +15,7 @@ class Utf8Utils {
     return result.substring(0, result.length - 1);
   }
   
-  static String decode(String encodeStr) {
+  static String? decode(String? encodeStr) {
     if (encodeStr == null || encodeStr.length == 0) {
       return null;
     }

+ 13 - 10
lib/widgets/CircleImage.dart

@@ -1,6 +1,6 @@
 import 'package:flutter/material.dart';
 
-enum CircleImageType {network, asset}
+enum CircleImageType { network, asset }
 
 class CircleImage extends StatefulWidget {
   double width;
@@ -8,11 +8,15 @@ class CircleImage extends StatefulWidget {
   String path;
   CircleImageType type; // network, asset
 
-  CircleImage({@required this.width, @required this.height, @required this.path, @required this.type});
+  CircleImage(
+      {required this.width,
+      required this.height,
+      required this.path,
+      required this.type});
 
   @override
   State<StatefulWidget> createState() {
-    return null;
+    return CircleImageState();
   }
 }
 
@@ -21,9 +25,11 @@ class CircleImageState extends State<CircleImage> {
   Widget build(BuildContext context) {
     var img;
     if (widget.type == CircleImageType.network) {
-      img = Image.network(widget.path, width: widget.width, height: widget.height);
+      img = Image.network(widget.path,
+          width: widget.width, height: widget.height);
     } else {
-      img = Image.asset(widget.path, width: widget.width, height: widget.height);
+      img =
+          Image.asset(widget.path, width: widget.width, height: widget.height);
     }
     return Container(
       width: widget.width,
@@ -31,10 +37,7 @@ class CircleImageState extends State<CircleImage> {
       decoration: BoxDecoration(
         shape: BoxShape.circle,
         color: Colors.blue,
-        image: DecorationImage(
-            image: img,
-            fit: BoxFit.cover
-        ),
+        image: DecorationImage(image: img, fit: BoxFit.cover),
         border: Border.all(
           color: Colors.white,
           width: 2.0,
@@ -42,4 +45,4 @@ class CircleImageState extends State<CircleImage> {
       ),
     );
   }
-}
+}

+ 7 - 7
lib/widgets/SlideView.dart

@@ -15,8 +15,8 @@ class SlideView extends StatefulWidget {
 }
 
 class SlideViewState extends State<SlideView> with SingleTickerProviderStateMixin {
-  TabController tabController;
-  List slideData;
+  TabController? tabController;
+  List? slideData;
 
   SlideViewState(data) {
     slideData = data;
@@ -25,12 +25,12 @@ class SlideViewState extends State<SlideView> with SingleTickerProviderStateMixi
   @override
   void initState() {
     super.initState();
-    tabController = TabController(length: slideData == null ? 0 : slideData.length, vsync: this);
+    tabController = TabController(length: slideData == null ? 0 : slideData!.length, vsync: this);
   }
 
   @override
   void dispose() {
-    tabController.dispose();
+    tabController!.dispose();
     super.dispose();
   }
 
@@ -44,9 +44,9 @@ class SlideViewState extends State<SlideView> with SingleTickerProviderStateMixi
   @override
   Widget build(BuildContext context) {
     List<Widget> items = [];
-    if (slideData != null && slideData.length > 0) {
-      for (var i = 0; i < slideData.length; i++) {
-        var item = slideData[i];
+    if (slideData != null && slideData!.length > 0) {
+      for (var i = 0; i < slideData!.length; i++) {
+        var item = slideData![i];
         var imgUrl = item['imgUrl'];
         var title = item['title'];
         var detailUrl = item['detailUrl'];

+ 60 - 25
pubspec.lock

@@ -49,7 +49,14 @@ packages:
       name: collection
       url: "https://pub.flutter-io.cn"
     source: hosted
-    version: "1.15.0"
+    version: "1.16.0"
+  cross_file:
+    dependency: transitive
+    description:
+      name: cross_file
+      url: "https://pub.flutter-io.cn"
+    source: hosted
+    version: "0.3.3+1"
   cupertino_icons:
     dependency: "direct main"
     description:
@@ -63,21 +70,21 @@ packages:
       name: event_bus
       url: "https://pub.flutter-io.cn"
     source: hosted
-    version: "1.1.1"
+    version: "2.0.0"
   fake_async:
     dependency: transitive
     description:
       name: fake_async
       url: "https://pub.flutter-io.cn"
     source: hosted
-    version: "1.2.0"
+    version: "1.3.0"
   ffi:
     dependency: transitive
     description:
       name: ffi
       url: "https://pub.flutter-io.cn"
     source: hosted
-    version: "1.2.1"
+    version: "2.0.1"
   file:
     dependency: transitive
     description:
@@ -97,6 +104,13 @@ packages:
     description: flutter
     source: sdk
     version: "0.0.0"
+  flutter_plugin_android_lifecycle:
+    dependency: transitive
+    description:
+      name: flutter_plugin_android_lifecycle
+      url: "https://pub.flutter-io.cn"
+    source: hosted
+    version: "2.0.7"
   flutter_test:
     dependency: "direct dev"
     description: flutter
@@ -120,28 +134,56 @@ packages:
       name: http
       url: "https://pub.flutter-io.cn"
     source: hosted
-    version: "0.12.2"
+    version: "0.13.5"
   http_parser:
     dependency: transitive
     description:
       name: http_parser
       url: "https://pub.flutter-io.cn"
     source: hosted
-    version: "3.1.4"
+    version: "4.0.1"
   image_picker:
     dependency: "direct main"
     description:
       name: image_picker
       url: "https://pub.flutter-io.cn"
     source: hosted
-    version: "0.4.12+1"
+    version: "0.8.5+3"
+  image_picker_android:
+    dependency: transitive
+    description:
+      name: image_picker_android
+      url: "https://pub.flutter-io.cn"
+    source: hosted
+    version: "0.8.5+2"
+  image_picker_for_web:
+    dependency: transitive
+    description:
+      name: image_picker_for_web
+      url: "https://pub.flutter-io.cn"
+    source: hosted
+    version: "2.1.8"
+  image_picker_ios:
+    dependency: transitive
+    description:
+      name: image_picker_ios
+      url: "https://pub.flutter-io.cn"
+    source: hosted
+    version: "0.8.5+6"
+  image_picker_platform_interface:
+    dependency: transitive
+    description:
+      name: image_picker_platform_interface
+      url: "https://pub.flutter-io.cn"
+    source: hosted
+    version: "2.6.1"
   js:
     dependency: transitive
     description:
       name: js
       url: "https://pub.flutter-io.cn"
     source: hosted
-    version: "0.6.3"
+    version: "0.6.4"
   matcher:
     dependency: transitive
     description:
@@ -155,7 +197,7 @@ packages:
       name: material_color_utilities
       url: "https://pub.flutter-io.cn"
     source: hosted
-    version: "0.1.3"
+    version: "0.1.4"
   meta:
     dependency: transitive
     description:
@@ -169,7 +211,7 @@ packages:
       name: path
       url: "https://pub.flutter-io.cn"
     source: hosted
-    version: "1.8.0"
+    version: "1.8.1"
   path_provider_linux:
     dependency: transitive
     description:
@@ -190,14 +232,7 @@ packages:
       name: path_provider_windows
       url: "https://pub.flutter-io.cn"
     source: hosted
-    version: "2.0.7"
-  pedantic:
-    dependency: transitive
-    description:
-      name: pedantic
-      url: "https://pub.flutter-io.cn"
-    source: hosted
-    version: "1.11.1"
+    version: "2.1.2"
   platform:
     dependency: transitive
     description:
@@ -293,7 +328,7 @@ packages:
       name: source_span
       url: "https://pub.flutter-io.cn"
     source: hosted
-    version: "1.8.1"
+    version: "1.8.2"
   stack_trace:
     dependency: transitive
     description:
@@ -328,28 +363,28 @@ packages:
       name: test_api
       url: "https://pub.flutter-io.cn"
     source: hosted
-    version: "0.4.8"
+    version: "0.4.9"
   typed_data:
     dependency: transitive
     description:
       name: typed_data
       url: "https://pub.flutter-io.cn"
     source: hosted
-    version: "1.3.0"
+    version: "1.3.1"
   vector_math:
     dependency: transitive
     description:
       name: vector_math
       url: "https://pub.flutter-io.cn"
     source: hosted
-    version: "2.1.1"
+    version: "2.1.2"
   win32:
     dependency: transitive
     description:
       name: win32
       url: "https://pub.flutter-io.cn"
     source: hosted
-    version: "2.5.2"
+    version: "2.7.0"
   xdg_directories:
     dependency: transitive
     description:
@@ -358,5 +393,5 @@ packages:
     source: hosted
     version: "0.2.0+1"
 sdks:
-  dart: ">=2.15.0 <3.0.0"
-  flutter: ">=2.8.0"
+  dart: ">=2.17.0 <3.0.0"
+  flutter: ">=3.0.0"

+ 6 - 6
pubspec.yaml

@@ -4,20 +4,20 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
 version: 1.0.0+1
 
 environment:
-  sdk: ">=2.17.6 <3.0.0"
+  sdk: '>=2.12.0 <3.0.0'
 
 dependencies:
   flutter:
     sdk: flutter
 
-  cupertino_icons: ^1.0.3
+  cupertino_icons: ^1.0.5
   flutter_webview_plugin: ^0.4.0
-  image_picker: ^0.4.1
+  image_picker: ^0.8.5+3
 #  fluttertoast: ^2.0.3
-  shared_preferences: ^2.0.7
-  event_bus: ^1.1.0
+  shared_preferences: ^2.0.15
+  event_bus: ^2.0.0
   barcode_scan: ^3.0.1
-  http:  ^0.12.0+4
+  http: ^0.13.5
 
 dev_dependencies:
   flutter_test:

Some files were not shown because too many files changed in this diff