From fd3952c811e02a678a123aa1cc64e8588e32cbcf Mon Sep 17 00:00:00 2001 From: laiiihz Date: Thu, 25 Mar 2021 19:45:37 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=A4=BE=E5=8C=BA=E6=96=87?= =?UTF-8?q?=E6=9C=AC=E9=A2=9C=E8=89=B2=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/constants/app_theme.dart | 12 +- lib/pages/personal/personal_page.dart | 149 +++++++++--------- .../community_views/widgets/chat_card.dart | 5 +- 3 files changed, 88 insertions(+), 78 deletions(-) diff --git a/lib/constants/app_theme.dart b/lib/constants/app_theme.dart index 42fbb2c8..f81e1b13 100644 --- a/lib/constants/app_theme.dart +++ b/lib/constants/app_theme.dart @@ -7,12 +7,12 @@ class AppTheme { return ThemeData(primarySwatch: Colors.blue).copyWith( primaryColor: Color(0xFFFFD000), accentColor: Color(0xFFFFD000), - textTheme: TextTheme( - subtitle1: TextStyle( - fontSize: 28.sp, - color: Color(0xFF333333), - ), - ), + textTheme: ThemeData.light().textTheme.copyWith( + subtitle1: TextStyle( + fontSize: 28.sp, + color: Color(0xFF333333), + ), + ), floatingActionButtonTheme: FloatingActionButtonThemeData().copyWith( backgroundColor: Color(0xFFFFD000), ), diff --git a/lib/pages/personal/personal_page.dart b/lib/pages/personal/personal_page.dart index 457f0bd1..a2e8f367 100644 --- a/lib/pages/personal/personal_page.dart +++ b/lib/pages/personal/personal_page.dart @@ -1,5 +1,6 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_easyrefresh/easy_refresh.dart'; import 'package:flutter_icons/flutter_icons.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; @@ -34,7 +35,6 @@ class _PersonalIndexState extends State pinned: true, toolbarHeight: 0, elevation: 0, - stretch: true, floating: true, expandedHeight: 450.w - height, backgroundColor: Colors.white, @@ -191,79 +191,86 @@ class _PersonalIndexState extends State @override Widget build(BuildContext context) { - double _statusHeight = MediaQuery.of(context).padding.top; + final double _statusHeight = MediaQuery.of(context).padding.top; + final userProvider = Provider.of(context); return Scaffold( - body: CustomScrollView( - physics: AlwaysScrollableScrollPhysics(parent: BouncingScrollPhysics()), - slivers: [ - _sliverAppBar(_statusHeight), - // SliverToBoxAdapter( - // child: _containerBar('我的订单'), - // ), - // SliverToBoxAdapter( - // child: Container( - // margin: EdgeInsets.only(top: 10.w), - // color: BaseStyle.colorf9f9f9, - // child: GridButtons( - // gridList: _orderList, - // crossCount: 5, - // ), - // ), - // ), - // SliverToBoxAdapter( - // child: Container( - // margin: EdgeInsets.only(top: 32.w, left: 32.w, right: 32.w), - // child: Divider( - // color: Color(0xffd8d8d8), - // ), - // ), - // ), - // SliverToBoxAdapter( - // child: _containerBar('我的团购'), - // ), - // SliverToBoxAdapter( - // child: Container( - // color: BaseStyle.colorf9f9f9, - // margin: EdgeInsets.only(top: 10.w), - // alignment: Alignment.center, - // child: GridButtons( - // gridList: _groupOrderList, - // crossCount: 5, - // ), - // ), - // ), - // SliverToBoxAdapter( - // child: SingleAdSpace( - // imagePath: 'assets/example/guanggao7.png', - // ), - // ), - SliverToBoxAdapter( - child: Container( - decoration: BoxDecoration( - color: Color(0xffffffff), - borderRadius: BorderRadius.all(Radius.circular(8)), - boxShadow: [ - BoxShadow( - color: Colors.grey.withOpacity(0.1), - offset: Offset(1, 1), - ), - ], - ), - margin: EdgeInsets.all(20.w), - padding: EdgeInsets.all(12.w), - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - _containerBar('我的物业'), - ApplicationView.custom( - items: userAppObjects, - needAllApp: false, - ), - ], + body: EasyRefresh( + header: MaterialHeader(), + onRefresh: () async { + await userProvider.updateProfile(); + await userProvider.updateUserDetail(); + }, + child: CustomScrollView( + slivers: [ + _sliverAppBar(_statusHeight), + // SliverToBoxAdapter( + // child: _containerBar('我的订单'), + // ), + // SliverToBoxAdapter( + // child: Container( + // margin: EdgeInsets.only(top: 10.w), + // color: BaseStyle.colorf9f9f9, + // child: GridButtons( + // gridList: _orderList, + // crossCount: 5, + // ), + // ), + // ), + // SliverToBoxAdapter( + // child: Container( + // margin: EdgeInsets.only(top: 32.w, left: 32.w, right: 32.w), + // child: Divider( + // color: Color(0xffd8d8d8), + // ), + // ), + // ), + // SliverToBoxAdapter( + // child: _containerBar('我的团购'), + // ), + // SliverToBoxAdapter( + // child: Container( + // color: BaseStyle.colorf9f9f9, + // margin: EdgeInsets.only(top: 10.w), + // alignment: Alignment.center, + // child: GridButtons( + // gridList: _groupOrderList, + // crossCount: 5, + // ), + // ), + // ), + // SliverToBoxAdapter( + // child: SingleAdSpace( + // imagePath: 'assets/example/guanggao7.png', + // ), + // ), + SliverToBoxAdapter( + child: Container( + decoration: BoxDecoration( + color: Color(0xffffffff), + borderRadius: BorderRadius.all(Radius.circular(8)), + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.1), + offset: Offset(1, 1), + ), + ], + ), + margin: EdgeInsets.all(20.w), + padding: EdgeInsets.all(12.w), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + _containerBar('我的物业'), + ApplicationView.custom( + items: userAppObjects, + needAllApp: false, + ), + ], + ), ), ), - ), - ], + ], + ), ), ); } diff --git a/lib/ui/community/community_views/widgets/chat_card.dart b/lib/ui/community/community_views/widgets/chat_card.dart index 440c58d5..f9a3e6e2 100644 --- a/lib/ui/community/community_views/widgets/chat_card.dart +++ b/lib/ui/community/community_views/widgets/chat_card.dart @@ -222,7 +222,10 @@ class _ChatCardState extends State { if (e.parentName != null) buffer.write('回复${e.parentName}'); buffer.write(':${e.content}'); return InkWell( - child: buffer.toString().text.make(), + child: Text( + buffer.toString(), + style: Theme.of(context).textTheme.subtitle2, + ), onTap: () { SendAChat.send(parentId: e.id, themeId: widget.model.id); },