用户中心页面添加登录/注册

hmxc
张萌 4 years ago
parent 28dc373fea
commit 7a8521fade

@ -1,3 +1,5 @@
import 'package:akuCommunity/pages/sign/sign_in_page.dart';
import 'package:ani_route/ani_route.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter_icons/flutter_icons.dart'; import 'package:flutter_icons/flutter_icons.dart';
@ -8,6 +10,7 @@ import 'package:akuCommunity/widget/grid_button.dart';
import 'package:akuCommunity/widget/single_ad_space.dart'; import 'package:akuCommunity/widget/single_ad_space.dart';
import 'package:akuCommunity/widget/cached_image_wrapper.dart'; import 'package:akuCommunity/widget/cached_image_wrapper.dart';
import 'package:akuCommunity/routers/page_routers.dart'; import 'package:akuCommunity/routers/page_routers.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
class PersonalIndex extends StatefulWidget { class PersonalIndex extends StatefulWidget {
PersonalIndex({Key key}) : super(key: key); PersonalIndex({Key key}) : super(key: key);
@ -21,6 +24,8 @@ class _PersonalIndexState extends State<PersonalIndex>
@override @override
bool get wantKeepAlive => true; bool get wantKeepAlive => true;
bool _isSigned = false;
SliverAppBar _sliverAppBar(double height) { SliverAppBar _sliverAppBar(double height) {
return SliverAppBar( return SliverAppBar(
pinned: true, pinned: true,
@ -60,19 +65,32 @@ class _PersonalIndexState extends State<PersonalIndex>
'https://dss0.bdstatic.com/70cFuHSh_Q1YnxGkpoWK1HF6hhy/it/u=1851283359,3457678391&fm=26&gp=0.jpg', 'https://dss0.bdstatic.com/70cFuHSh_Q1YnxGkpoWK1HF6hhy/it/u=1851283359,3457678391&fm=26&gp=0.jpg',
width: Screenutil.length(106), width: Screenutil.length(106),
height: Screenutil.length(106), height: Screenutil.length(106),
isSigned: _isSigned,
), ),
), ),
), ),
Container( InkWell(
margin: onTap: (){
EdgeInsets.only(left: Screenutil.length(16)), _isSigned? ARoute.push(context, SignInPage()):null;
child: Text( },
'Cheailune', child: Container(
style: TextStyle( margin: EdgeInsets.only(
fontSize: Screenutil.size(32), left: Screenutil.length(16)),
color: Color(0xffad8940), child: _isSigned
), ? Text(
), 'Cheailune',
style: TextStyle(
fontSize: 32.sp,
color: Color(0xffad8940),
),
)
: Text(
'登录/注册',
style: TextStyle(
fontSize: 32.sp,
color: Color(0xffad8940),
),
)),
), ),
], ],
), ),

@ -17,11 +17,13 @@ class CachedImageWrapper extends StatelessWidget {
final double height; final double height;
final BoxFit fit; final BoxFit fit;
final ImageType imageType; final ImageType imageType;
bool isSigned;
CachedImageWrapper( CachedImageWrapper(
{@required this.url, {@required this.url,
@required this.width, @required this.width,
@required this.height, @required this.height,
this.isSigned=true,
this.imageType: ImageType.normal, this.imageType: ImageType.normal,
this.fit: BoxFit.cover}); this.fit: BoxFit.cover});
@ -35,9 +37,9 @@ class CachedImageWrapper extends StatelessWidget {
width: width, width: width,
height: height, height: height,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.transparent, color:isSigned?Colors.transparent:Colors.grey.withOpacity(0.6),
image: DecorationImage( image:isSigned? DecorationImage(
image: imageProvider, fit: BoxFit.cover, scale: 1), image: imageProvider, fit: BoxFit.cover, scale: 1):null,
), ),
); );
}, },

Loading…
Cancel
Save