fmk
4 years ago
35 changed files with 791 additions and 685 deletions
Before Width: | Height: | Size: 5.1 KiB After Width: | Height: | Size: 4.5 KiB |
Before Width: | Height: | Size: 9.3 KiB After Width: | Height: | Size: 8.0 KiB |
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.2 KiB |
@ -0,0 +1,103 @@
|
||||
import 'package:flutter/material.dart'; |
||||
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
||||
import 'package:huixiang/generated/l10n.dart'; |
||||
import 'package:sharesdk_plugin/sharesdk_defines.dart'; |
||||
|
||||
class ShareDialog extends StatefulWidget { |
||||
final Function(ShareSDKPlatform platform) onTap; |
||||
|
||||
ShareDialog(this.onTap); |
||||
|
||||
@override |
||||
State<StatefulWidget> createState() { |
||||
return _ShareDialog(); |
||||
} |
||||
} |
||||
|
||||
class _ShareDialog extends State<ShareDialog> { |
||||
List<String> platformNames = ["line", "微信好友", "朋友圈", "facebook"]; |
||||
List<String> platformIcons = [ |
||||
"assets/image/icon_line.png", |
||||
"assets/image/icon_weixin.png", |
||||
"assets/image/icon_pengyouquan.png", |
||||
"assets/image/icon_facebook.png" |
||||
]; |
||||
List<ShareSDKPlatform> platforms = [ |
||||
ShareSDKPlatforms.line, |
||||
ShareSDKPlatforms.wechatSession, |
||||
ShareSDKPlatforms.wechatTimeline, |
||||
ShareSDKPlatforms.facebook |
||||
]; |
||||
|
||||
@override |
||||
void initState() { |
||||
super.initState(); |
||||
} |
||||
|
||||
@override |
||||
Widget build(BuildContext context) { |
||||
return Container( |
||||
height: 200.h, |
||||
decoration: BoxDecoration( |
||||
color: Colors.white, |
||||
borderRadius: BorderRadius.vertical(top: Radius.circular(8)), |
||||
), |
||||
padding: EdgeInsets.only(top: 16.h, bottom: 66.h), |
||||
child: Column( |
||||
mainAxisSize: MainAxisSize.max, |
||||
children: [ |
||||
Text( |
||||
S.of(context).fenxiangdao, |
||||
style: TextStyle( |
||||
fontWeight: FontWeight.bold, |
||||
fontSize: 16.sp, |
||||
color: Color(0xFF1A1A1A), |
||||
), |
||||
), |
||||
SizedBox( |
||||
height: 28.h, |
||||
), |
||||
Row( |
||||
children: platforms |
||||
.map((e) => Expanded( |
||||
child: InkWell( |
||||
onTap: () { |
||||
widget.onTap(e); |
||||
Navigator.of(context).pop(); |
||||
}, |
||||
child: Container( |
||||
child: Column( |
||||
mainAxisAlignment: MainAxisAlignment.center, |
||||
crossAxisAlignment: CrossAxisAlignment.center, |
||||
children: [ |
||||
Image.asset( |
||||
platformIcons[platforms.indexOf(e)], |
||||
width: 40.w, |
||||
height: 40.h, |
||||
), |
||||
SizedBox( |
||||
height: 4.h, |
||||
), |
||||
Container( |
||||
height: 18.h, |
||||
child: Text( |
||||
platformNames[platforms.indexOf(e)], |
||||
style: TextStyle( |
||||
fontSize: 12.sp, |
||||
color: Color(0xFF1A1A1A), |
||||
), |
||||
), |
||||
), |
||||
], |
||||
), |
||||
), |
||||
), |
||||
flex: 1, |
||||
)) |
||||
.toList(), |
||||
), |
||||
], |
||||
), |
||||
); |
||||
} |
||||
} |
Loading…
Reference in new issue