From 7f2efa1aa392a49c1f5c84c1bb6f32dca149bfb0 Mon Sep 17 00:00:00 2001 From: laiiihz Date: Mon, 18 Jan 2021 15:07:25 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=B9=E6=8E=A5=E9=80=80=E5=87=BA=E7=99=BB?= =?UTF-8?q?=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/constants/api.dart | 3 +++ lib/pages/home/home_page.dart | 1 - lib/pages/home/widget/animate_app_bar.dart | 1 - .../mine_house_page/mine_house_page.dart | 2 -- lib/pages/personal/personal_page.dart | 23 +++++++++---------- lib/pages/sign/sign_in_page.dart | 3 ++- lib/provider/user_provider.dart | 2 +- lib/utils/logger/logger_view.dart | 3 ++- lib/widget/expandable_text.dart | 2 +- lib/widget/gallery_photo_view_wrapper.dart | 5 ++-- lib/widget/round_check_box.dart | 2 ++ 11 files changed, 24 insertions(+), 23 deletions(-) diff --git a/lib/constants/api.dart b/lib/constants/api.dart index 75122969..ab3385e7 100644 --- a/lib/constants/api.dart +++ b/lib/constants/api.dart @@ -32,4 +32,7 @@ class _User { ///设置用户生日 String get setBirthday => '/user/personalData/updateBirthday'; + + ///用户退出登陆 + String get logout => '/user/signOut'; } diff --git a/lib/pages/home/home_page.dart b/lib/pages/home/home_page.dart index bf7cbb19..407a6922 100644 --- a/lib/pages/home/home_page.dart +++ b/lib/pages/home/home_page.dart @@ -48,7 +48,6 @@ class _HomePageState extends State bool get wantKeepAlive => true; ScrollController _scrollController; - Color _bgColor; List _shopList = []; List data; diff --git a/lib/pages/home/widget/animate_app_bar.dart b/lib/pages/home/widget/animate_app_bar.dart index 8258c76e..3262c804 100644 --- a/lib/pages/home/widget/animate_app_bar.dart +++ b/lib/pages/home/widget/animate_app_bar.dart @@ -12,7 +12,6 @@ class AnimateAppBar extends StatefulWidget with PreferredSizeWidget { _AnimateAppBarState createState() => _AnimateAppBarState(); @override - // TODO: implement preferredSize Size get preferredSize => Size.fromHeight(56); } diff --git a/lib/pages/mine_house_page/mine_house_page.dart b/lib/pages/mine_house_page/mine_house_page.dart index 034a7a5c..21b9571c 100644 --- a/lib/pages/mine_house_page/mine_house_page.dart +++ b/lib/pages/mine_house_page/mine_house_page.dart @@ -4,8 +4,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/base/assets_image.dart'; -import 'package:akuCommunity/routers/page_routers.dart'; -import 'package:akuCommunity/widget/common_app_bar.dart'; class MineHousePage extends StatefulWidget { MineHousePage({Key key}) : super(key: key); diff --git a/lib/pages/personal/personal_page.dart b/lib/pages/personal/personal_page.dart index 0605bc24..2974b991 100644 --- a/lib/pages/personal/personal_page.dart +++ b/lib/pages/personal/personal_page.dart @@ -12,7 +12,6 @@ import 'package:akuCommunity/pages/things_page/fixed_submit_page.dart'; import 'package:akuCommunity/pages/visitor_access_page/visitor_access_page.dart'; import 'package:akuCommunity/painters/user_bottom_bar_painter.dart'; import 'package:akuCommunity/provider/user_provider.dart'; -import 'package:akuCommunity/utils/network/net_util.dart'; import 'package:akuCommunity/widget/grid_buttons.dart'; import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; @@ -74,18 +73,18 @@ class _PersonalIndexState extends State }), ]; - List _orderList = [ - GridButton('待付款', R.ASSETS_ICONS_USER_ICON_DFK_PNG, () {}), - GridButton('待发货', R.ASSETS_ICONS_USER_ICON_DFH_PNG, () {}), - GridButton('待收货', R.ASSETS_ICONS_USER_ICON_DSH_PNG, () {}), - GridButton('待评价', R.ASSETS_ICONS_USER_ICON_DPJ_PNG, () {}), - GridButton('售后', R.ASSETS_ICONS_USER_ICON_SH_PNG, () {}), - ]; + // List _orderList = [ + // GridButton('待付款', R.ASSETS_ICONS_USER_ICON_DFK_PNG, () {}), + // GridButton('待发货', R.ASSETS_ICONS_USER_ICON_DFH_PNG, () {}), + // GridButton('待收货', R.ASSETS_ICONS_USER_ICON_DSH_PNG, () {}), + // GridButton('待评价', R.ASSETS_ICONS_USER_ICON_DPJ_PNG, () {}), + // GridButton('售后', R.ASSETS_ICONS_USER_ICON_SH_PNG, () {}), + // ]; - List _groupOrderList = [ - GridButton('待发货', R.ASSETS_ICONS_USER_ICON_DFH_PNG, () {}), - GridButton('待收货', R.ASSETS_ICONS_USER_ICON_DSH_PNG, () {}), - ]; + // List _groupOrderList = [ + // GridButton('待发货', R.ASSETS_ICONS_USER_ICON_DFH_PNG, () {}), + // GridButton('待收货', R.ASSETS_ICONS_USER_ICON_DSH_PNG, () {}), + // ]; SliverAppBar _sliverAppBar(double height) { final userProvider = Provider.of(context); diff --git a/lib/pages/sign/sign_in_page.dart b/lib/pages/sign/sign_in_page.dart index 2b657474..c02dd143 100644 --- a/lib/pages/sign/sign_in_page.dart +++ b/lib/pages/sign/sign_in_page.dart @@ -10,7 +10,7 @@ import 'package:akuCommunity/pages/sign/sign_up/sign_up_pick_plot_page.dart'; import 'package:akuCommunity/pages/tab_navigator.dart'; import 'package:akuCommunity/provider/sign_up_provider.dart'; import 'package:akuCommunity/provider/user_provider.dart'; -import 'package:ani_route/ani_route.dart'; +import 'package:akuCommunity/utils/logger/logger_data.dart'; import 'package:bot_toast/bot_toast.dart'; import 'package:common_utils/common_utils.dart'; import 'package:dio/dio.dart'; @@ -86,6 +86,7 @@ class _SignInPageState extends State { if (!result) return; CancelFunc cancel = BotToast.showLoading(); Response response = await SignFunc.login(_phone.text, _code.text); + LoggerData.addData(response); if (response.data['status']) { if (response.data['choose'] == 1) { diff --git a/lib/provider/user_provider.dart b/lib/provider/user_provider.dart index 9a524b41..67c853b0 100644 --- a/lib/provider/user_provider.dart +++ b/lib/provider/user_provider.dart @@ -4,7 +4,6 @@ import 'package:akuCommunity/pages/sign/sign_func.dart'; import 'package:akuCommunity/utils/hive_store.dart'; import 'package:akuCommunity/utils/network/base_model.dart'; import 'package:akuCommunity/utils/network/net_util.dart'; -import 'package:flustars/flustars.dart'; import 'package:flutter/material.dart'; class UserProvider extends ChangeNotifier { @@ -30,6 +29,7 @@ class UserProvider extends ChangeNotifier { _isLogin = false; _token = null; _userInfoModel = null; + NetUtil().get(API.user.logout, showMessage: true); NetUtil().dio.options.headers.remove('App-Admin-Token'); HiveStore.appBox.delete('token'); notifyListeners(); diff --git a/lib/utils/logger/logger_view.dart b/lib/utils/logger/logger_view.dart index 4bb3ea32..b2fb82fc 100644 --- a/lib/utils/logger/logger_view.dart +++ b/lib/utils/logger/logger_view.dart @@ -98,7 +98,8 @@ class _LoggerViewState extends State { actions: [ IconButton(icon: Icon(Icons.list), onPressed: () {}), ], - body: ListView.builder( + body: ListView.separated( + separatorBuilder: (context, index) => Divider(height: 1, thickness: 1), itemBuilder: (context, index) => LoggerCard(data: LoggerData.data[index]), itemCount: LoggerData.data.length, diff --git a/lib/widget/expandable_text.dart b/lib/widget/expandable_text.dart index 6efe5c29..4ad89ceb 100644 --- a/lib/widget/expandable_text.dart +++ b/lib/widget/expandable_text.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; - +//TODO Please remove those sh*t code. class ExpandableText extends StatefulWidget { final String text; final int maxLines; diff --git a/lib/widget/gallery_photo_view_wrapper.dart b/lib/widget/gallery_photo_view_wrapper.dart index bad7bcd7..3f655528 100644 --- a/lib/widget/gallery_photo_view_wrapper.dart +++ b/lib/widget/gallery_photo_view_wrapper.dart @@ -102,9 +102,7 @@ class _GalleryPhotoViewWrapperState extends State { Future requestPermission() async { var status = await Permission.photos.status; if (status.isUndetermined) { - Map statuses = await [ - Permission.photos, - ].request(); + await [Permission.photos].request(); } return status.isGranted; } @@ -127,6 +125,7 @@ class _GalleryPhotoViewWrapperState extends State { } //Hero 动画组件 +// ignore: must_be_immutable class GalleryExampleItemThumbnail extends StatelessWidget { GalleryExampleItemThumbnail({Key key, this.galleryExampleItem, this.onTap}) : super(key: key); diff --git a/lib/widget/round_check_box.dart b/lib/widget/round_check_box.dart index 59a39251..adc7a41d 100644 --- a/lib/widget/round_check_box.dart +++ b/lib/widget/round_check_box.dart @@ -1,6 +1,8 @@ import 'package:flutter/material.dart'; import 'package:akuCommunity/utils/headers.dart'; +//TODO one day we need to remove those.😕 +// ignore: must_be_immutable class RoundCheckBox extends StatefulWidget { var value = false;