王亚玲 2 years ago
parent c5ffb51db4
commit e8581eff61

Binary file not shown.

File diff suppressed because one or more lines are too long

@ -1,4 +1,5 @@
import 'dart:async'; import 'dart:async';
import 'package:bot_toast/bot_toast.dart';
import 'package:call_log/call_log.dart'; import 'package:call_log/call_log.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
@ -129,24 +130,25 @@ class _MyAppState extends State<MyApp> {
child: ScreenUtilInit( child: ScreenUtilInit(
designSize: const Size(750, 1334), designSize: const Size(750, 1334),
builder: (context, child) { builder: (context, child) {
return const AnnotatedRegion<SystemUiOverlayStyle>( return AnnotatedRegion<SystemUiOverlayStyle>(
value: SystemUiOverlayStyle( value: const SystemUiOverlayStyle(
statusBarColor: Colors.transparent, // statusBarColor: Colors.transparent, //
statusBarIconBrightness: Brightness.dark), statusBarIconBrightness: Brightness.dark),
child: GetMaterialApp( child: GetMaterialApp(
// get.testmode=true, // get.testmode=true,
debugShowCheckedModeBanner: false, debugShowCheckedModeBanner: false,
home: TabNavigator(), home: const TabNavigator(),
// supportedLocales: [Locale('zh')], builder: (context, child) {
// locale: Locale('zh'), // ScreenUtil.setContext(context);
// builder: ( context,child){ return MediaQuery(
// ScreenUtil.setContext(context); //
// return MediaQuery( data: MediaQueryData.fromWindow(
// // WidgetsBinding.instance!.window)
// data: MediaQuery.of(context).copyWith(textScaleFactor: 1.0), .copyWith(textScaleFactor: 1.0),
// // child: BotToastInit().call(context, child), child: BotToastInit().call(context, child),
// ); );
// }, },
navigatorObservers: [BotToastNavigatorObserver()],
)); ));
}, },
)); ));

@ -52,14 +52,7 @@ class _ContentPageState extends State<ContentPage> {
return GestureDetector( return GestureDetector(
onTap: () async { onTap: () async {
_select = index; _select = index;
if (index != textList.length - 1) { if (index == textList.length - 1) {
await Get.to(() => ContentDetailsPage(
content: content,
ploneBack: (String textContent) {
textList1.add(textContent);
},
));
} else {
await Get.to(() => ContentDetailsPage( await Get.to(() => ContentDetailsPage(
content: "", content: "",
ploneBack: (String textContent) { ploneBack: (String textContent) {
@ -67,22 +60,24 @@ class _ContentPageState extends State<ContentPage> {
textList.setAll(index, {textContent}); textList.setAll(index, {textContent});
}, },
)); ));
setState(() {}); } else {}
} setState(() {});
// print("这是数据" + textList[_s lect]); // print("这是数据" + textList[_s lect]);
// print(index); // print(index);
}, },
onLongPress: () { onLongPress: () {
setState(() {}); setState(() {});
showDialog( if (index == textList.length - 1) {
context: context, showDialog(
builder: (context) { context: context,
return const Centertipsalterwidget( builder: (context) {
desText: '你确定要删除这个短信模版吗,删除之后无法还原。', return const Centertipsalterwidget(
title: '删除短信模板', desText: '你确定要删除这个短信模版吗,删除之后无法还原。',
); title: '删除短信模板',
}); );
});
}
}, },
child: Container( child: Container(
// width: 686.w, // width: 686.w,
@ -94,7 +89,7 @@ class _ContentPageState extends State<ContentPage> {
color: pd color: pd
? widget.isAnswer! ? widget.isAnswer!
? Colors.blue ? Colors.blue
: Color(0xFF72E4C8) : const Color(0xFF72E4C8)
: const Color(0xFFF9F9F9), : const Color(0xFFF9F9F9),
), ),
child: Text( child: Text(

@ -1,3 +1,6 @@
import 'dart:async';
import 'package:bot_toast/bot_toast.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
import 'package:flutter/gestures.dart'; import 'package:flutter/gestures.dart';
@ -21,24 +24,24 @@ class LoginPage extends StatefulWidget {
class _LoginPageState extends State<LoginPage> { class _LoginPageState extends State<LoginPage> {
// String _operator=""; // String _operator="";
// String _phone=""; // String _phone="";
// bool _chooseAgreement = false; bool _chooseAgreement = false;
// bool _getCodeEnable = true; bool _getCodeEnable = true;
// late Timer _timer; late Timer _timer;
//
// /// ///
// String _countDownStr = "发送验证码"; String _countDownStr = "发送验证码";
//
// /// ///
// int _countDownNum = 59; int _countDownNum = 59;
/// ///
late final TextEditingController _phoneController = // late final TextEditingController _phoneController =
TextEditingController(text: ""); // TextEditingController(text: "");
late final TextEditingController _smsCodeController = // late final TextEditingController _smsCodeController =
TextEditingController(text: ""); // TextEditingController(text: "");
// // late FocusNode _smsCodeFocusNode=FocusNode (canRequestFocus: ); // late FocusNode _smsCodeFocusNode=FocusNode (canRequestFocus: );
// bool _cantSelected = false; bool _cantSelected = false;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
@ -46,7 +49,8 @@ class _LoginPageState extends State<LoginPage> {
// _phone = '12345678909'; // _phone = '12345678909';
} }
String ploneText = ""; String ploneText = ""; //
String codeText = ""; //
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return CloudScaffold( return CloudScaffold(
@ -90,15 +94,27 @@ class _LoginPageState extends State<LoginPage> {
style: TextStyle(fontSize: 32.sp, color: const Color(0xFF999999)), style: TextStyle(fontSize: 32.sp, color: const Color(0xFF999999)),
), ),
80.hb, 80.hb,
_getBox('+86', 36, "请输入手机号", 11), _getBox('+86', 36, _phoneTFWidget()),
_getBox('验证码', 32, "请输入验证码", 6), _getBox('验证码', 32, _codeWidget()),
112.hb, 112.hb,
PloneBottom( PloneBottom(
blM: false, blM: false,
border: ploneText.length != 11, border: ploneText.length != 11,
opacity: ploneText.length == 11 ? 1 : 0.4, opacity: ploneText.length == 11 ? 1 : 0.4,
onTap: () { onTap: () {
Get.to(() => const TabNavigator()); if (ploneText.length < 11) {
BotToast.showText(text: "请输入手机号");
} else {
if (codeText.length < 6) {
BotToast.showText(text: "请输入验证码");
} else {
if (_chooseAgreement) {
Get.to(() => const TabNavigator());
} else {
BotToast.showText(text: "请同意并勾选隐私政策");
}
}
}
}, },
text: "立即登录", text: "立即登录",
), ),
@ -110,7 +126,7 @@ class _LoginPageState extends State<LoginPage> {
); );
} }
_getBox(String text, int fontSize, String hit, int num) { _getBox(String text, int fontSize, Widget plone) {
return Container( return Container(
height: 144.w, height: 144.w,
width: double.infinity, width: double.infinity,
@ -138,20 +154,20 @@ class _LoginPageState extends State<LoginPage> {
margin: EdgeInsets.symmetric(horizontal: 32.w), margin: EdgeInsets.symmetric(horizontal: 32.w),
color: const Color(0xFFE8E8E8), color: const Color(0xFFE8E8E8),
), ),
_phoneTFWidget(hit, num), plone,
]), ]),
); );
} }
//
_phoneTFWidget(String hit, int num) { //
_phoneTFWidget() {
return SizedBox( return SizedBox(
// alignment: Alignment.centerLeft, // alignment: Alignment.centerLeft,
// padding: EdgeInsets.symmetric(horizontal: 72.w), // padding: EdgeInsets.symmetric(horizontal: 72.w),
width: 300.w, width: 430.w,
height: 50.w, height: 50.w,
child: TextField( child: TextField(
maxLength: num, maxLength: 11,
inputFormatters: [FilteringTextInputFormatter.allow(RegExp(r'[0-9]'))], inputFormatters: [FilteringTextInputFormatter.allow(RegExp(r'[0-9]'))],
textCapitalization: TextCapitalization.none, textCapitalization: TextCapitalization.none,
onChanged: (text) { onChanged: (text) {
@ -159,14 +175,40 @@ class _LoginPageState extends State<LoginPage> {
setState(() {}); setState(() {});
}, },
decoration: InputDecoration( decoration: InputDecoration(
contentPadding: EdgeInsets.only(bottom: 20.w), contentPadding: EdgeInsets.only(bottom: 20.w),
border: InputBorder.none, border: InputBorder.none,
counterText: "", counterText: "",
//textfieldiOSplaceholder //textfieldiOSplaceholder
hintText: hit, hintText: "请输入手机号",
// //
hintStyle: TextStyle(color: Colors.black12), hintStyle: const TextStyle(color: Colors.black12),
), suffixIcon: GestureDetector(
onTap: !_getCodeEnable
? () {}
: () async {
// await apiClient.request(API.login.phoneCode, data: {
// 'phone': UserTool.userProvider.userInfo.phone,
// });
_beginCountDown();
if (_cantSelected) return;
_cantSelected = true;
Future.delayed(const Duration(seconds: 1), () {
_cantSelected = false;
});
},
child: Container(
width: 180.w,
alignment: Alignment.centerRight,
color: Colors.transparent,
child: Text(
_countDownStr,
style: TextStyle(
color: _getCodeEnable
? kPrimaryColor
: BaseStyle.colorcccccc),
),
),
)),
), ),
); );
} }
@ -174,70 +216,53 @@ class _LoginPageState extends State<LoginPage> {
// //
_codeWidget() { _codeWidget() {
return SizedBox( return SizedBox(
width: 300.w, // alignment: Alignment.centerLeft,
// padding: EdgeInsets.symmetric(horizontal: 72.w),
width: 430.w,
height: 50.w, height: 50.w,
child: TextField( child: TextField(
onChanged: (String phone) { maxLength: 6,
setState(() {}); inputFormatters: [FilteringTextInputFormatter.allow(RegExp(r'[0-9]'))],
}, textCapitalization: TextCapitalization.none,
controller: _smsCodeController, onChanged: (text) {
// focusNode: _smsCodeFocusNode, codeText = text;
keyboardType: TextInputType.number, setState(() {});
style: TextStyle(fontSize: 36.sp, color: BaseStyle.color999999), },
inputFormatters: [ decoration: InputDecoration(
LengthLimitingTextInputFormatter(4), contentPadding: EdgeInsets.only(bottom: 20.w),
], border: InputBorder.none,
cursorColor: Colors.black, counterText: "",
decoration: InputDecoration( //textfieldiOSplaceholder
// prefixIcon: Container( hintText: "请输入验证码",
// width: 10.w, //
// alignment: Alignment.centerLeft, hintStyle: TextStyle(color: Colors.black12),
// child: Text( ),
// "验证码", ),
// style: TextStyle(
// fontSize: 32.sp,
// color: const Color(0xFF000000)),
// ),
// ),
prefixText: "验证码",
prefixStyle: const TextStyle(
color: Colors.black,
),
enabledBorder: const UnderlineInputBorder(
//
borderSide: BorderSide(
color: BaseStyle.color999999,
),
),
hintText: "请输入验证码",
hintStyle: TextStyle(color: BaseStyle.colorcccccc, fontSize: 36.sp),
)),
); );
} }
// // _beginCountDown() {
// _beginCountDown() { ///
// /// setState(() {
// setState(() { _getCodeEnable = false;
// _getCodeEnable = false; _countDownStr = "${_countDownNum}s";
// _countDownStr = "重新获取($_countDownNum)"; });
// }); _timer = Timer.periodic(const Duration(seconds: 1), (timer) {
// _timer = Timer.periodic(const Duration(seconds: 1), (timer) { if (!mounted) {
// if (!mounted) { return;
// return; }
// } setState(() {
// setState(() { if (_countDownNum == 0) {
// if (_countDownNum == 0) { _countDownNum = 59;
// _countDownNum = 59; _countDownStr = "获取验证码";
// _countDownStr = "获取验证码"; _getCodeEnable = true;
// _getCodeEnable = true; _timer.cancel();
// _timer.cancel(); return;
// return; }
// } _countDownStr = "${_countDownNum--}s";
// _countDownStr = "重新获取(${_countDownNum--})"; });
// }); });
// }); }
// }
// //
_recognizer(context, int type) { _recognizer(context, int type) {
@ -255,7 +280,7 @@ class _LoginPageState extends State<LoginPage> {
_getText() { _getText() {
return GestureDetector( return GestureDetector(
onTap: () { onTap: () {
// _chooseAgreement = !_chooseAgreement; _chooseAgreement = !_chooseAgreement;
setState(() {}); setState(() {});
}, },
child: Row( child: Row(
@ -263,16 +288,15 @@ class _LoginPageState extends State<LoginPage> {
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
Container( Container(
width: 50.w, width: 50.w,
height: 50.w, height: 50.w,
padding: EdgeInsets.only(top: 6.w, right: 5.w), padding: EdgeInsets.only(top: 6.w, right: 5.w),
child: const Icon(CupertinoIcons.circle, child: !_chooseAgreement
size: 18, color: Color(0xFFdddddd))), ? const Icon(CupertinoIcons.circle,
// !_chooseAgreement size: 18, color: Color(0xFFdddddd))
// ? const Icon(CupertinoIcons.circle, : const Icon(CupertinoIcons.checkmark_circle,
// size: 18, color: Color(0xFFdddddd)) size: 18, color: Colors.blue),
// : const Icon(CupertinoIcons.checkmark_circle, ),
// size: 18, color: Colors.red)),
RichText( RichText(
text: TextSpan( text: TextSpan(
text: "我已阅读并同意", text: "我已阅读并同意",

@ -1,3 +1,4 @@
import 'package:bot_toast/bot_toast.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:project_telephony/base/base_style.dart'; import 'package:project_telephony/base/base_style.dart';
import 'package:project_telephony/ui/widget/check_radio.dart'; import 'package:project_telephony/ui/widget/check_radio.dart';
@ -33,6 +34,7 @@ List payWay = [
}, },
{'payName': '支付宝支付', 'payUrl': Assets.icons.zhifubao.path} {'payName': '支付宝支付', 'payUrl': Assets.icons.zhifubao.path}
]; ];
Map a = {};
class _MembersPageState extends State<MembersPage> { class _MembersPageState extends State<MembersPage> {
@override @override
@ -66,7 +68,9 @@ class _MembersPageState extends State<MembersPage> {
_getSpay(payWay), _getSpay(payWay),
PloneBottom( PloneBottom(
border: true, border: true,
onTap: () {}, onTap: () async {
if (_selectIndex == 0) {}
},
textColor: const Color(0xFF333333), textColor: const Color(0xFF333333),
text: "立即开通", text: "立即开通",
color1: const Color(0xFFFFF6D8), color1: const Color(0xFFFFF6D8),
@ -107,7 +111,7 @@ class _MembersPageState extends State<MembersPage> {
)), )),
Positioned( Positioned(
child: Container( child: Container(
margin: EdgeInsets.symmetric(horizontal: 64.w, vertical: 16.w), margin: EdgeInsets.symmetric(horizontal: 64.w, vertical: 50.w),
child: _getText())) child: _getText()))
]), ]),
); );
@ -129,9 +133,9 @@ class _MembersPageState extends State<MembersPage> {
), ),
16.hb, 16.hb,
Text( Text(
"解锁全部功能", "暂未开通会员",
style: TextStyle(color: Colors.white, fontSize: BaseStyle.fontSize24), style: TextStyle(color: Colors.white, fontSize: BaseStyle.fontSize24),
) ),
], ],
); );
} }
@ -139,13 +143,18 @@ class _MembersPageState extends State<MembersPage> {
_getVip() { _getVip() {
return Row( return Row(
children: [ children: [
const Text( Text(
"vip", "VIP",
style: TextStyle(color: Color(0xFFFFEAB0)), style: TextStyle(
color: const Color(0xFFFFEAB0),
fontFamily: "BlackItalic",
fontSize: 32.sp),
), ),
Container( Container(
width: 8.w, width: 8.w,
height: 8.w, height: 8.w,
alignment: Alignment.center,
margin: EdgeInsets.symmetric(horizontal: 8.w),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(4), borderRadius: BorderRadius.circular(4),
color: const Color(0xFFFFEAB0), color: const Color(0xFFFFEAB0),
@ -153,12 +162,48 @@ class _MembersPageState extends State<MembersPage> {
), ),
const Text( const Text(
"未开通会员", "未开通会员",
style: TextStyle(color: Color(0xFFFFEAB0)), style: TextStyle(
color: Color(
0xFFFFEAB0,
),
fontWeight: FontWeight.w700),
) )
], ],
); );
} }
// Future _wxPayFunc() async {
// var base = await apiClient.request(API.user.wallet.assessRecharge, data: {
// 'count': widget.count,
// 'payType': 2,
// });
// if (base.code == 0) {
// var wxPayModel = WxPayModel.fromJson(base.data['content']);
// await PayUtil().callWxPay(
// payModel: wxPayModel,
// );
// } else {
// BotToast.showText(text: "${base.msg}");
// }
// }
// Future _aliPayFunc() async {
// var base = await apiClient.request(API.user.wallet.assessRecharge, data: {
// 'count': widget.count,
// 'payType': 1,
// });
// if (base.code == 0) {
// var re = await PayUtil().callAliPay(base.data['content']);
// if (re) {
// _paySuccess();
// } else {
// BotToast.closeAllLoading();
// }
// } else {
// CloudToast.show(base.msg);
// }
// }
// //
_getRecharge() { _getRecharge() {
return Container( return Container(
@ -223,6 +268,7 @@ class _MembersPageState extends State<MembersPage> {
child: Text( child: Text(
item[index]['payName'], item[index]['payName'],
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.w700,
color: BaseStyle.color333333, color: BaseStyle.color333333,
fontSize: BaseStyle.fontSize28), fontSize: BaseStyle.fontSize28),
), ),

@ -1,7 +1,9 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:project_telephony/base/base_style.dart'; import 'package:project_telephony/base/base_style.dart';
import 'package:project_telephony/main.dart';
import 'package:project_telephony/ui/widget/plone_back_button.dart'; import 'package:project_telephony/ui/widget/plone_back_button.dart';
import 'package:project_telephony/utils/headers.dart'; import 'package:project_telephony/utils/headers.dart';
import 'package:telephony/telephony.dart';
class PrivacyRightsPage extends StatefulWidget { class PrivacyRightsPage extends StatefulWidget {
final String name; final String name;
@ -11,6 +13,14 @@ class PrivacyRightsPage extends StatefulWidget {
_PrivacyRightsPageState createState() => _PrivacyRightsPageState(); _PrivacyRightsPageState createState() => _PrivacyRightsPageState();
} }
final Telephony telephony = Telephony.instance;
// late final bool permissionsGranted;
// String body = "";
// @override
// void initState() async {
// initPlatformState();
// }
class _PrivacyRightsPageState extends State<PrivacyRightsPage> { class _PrivacyRightsPageState extends State<PrivacyRightsPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -32,6 +42,30 @@ class _PrivacyRightsPageState extends State<PrivacyRightsPage> {
); );
} }
// onMessage(SmsMessage message) async {
// setState(() {
// body = message.body ?? "error reading message body.";
// print(body);
// });
// }
//
// onSendStatus(SendStatus status) {
// setState(() {
// body = status == SendStatus.SENT ? "sent" : "delivered";
// });
// }
//
// Future<void> initPlatformState() async {
// final bool? result = await telephony.requestPhoneAndSmsPermissions;
// if (result != null && result) {
// telephony.listenIncomingSms(
// onNewMessage: onMessage,
// onBackgroundMessage: onBackgroundMessage,
// listenInBackground: true);
// }
// if (!mounted) return;
// }
_getRights(bool pd) { _getRights(bool pd) {
return GestureDetector( return GestureDetector(
onTap: () {}, onTap: () {},
@ -53,7 +87,7 @@ class _PrivacyRightsPageState extends State<PrivacyRightsPage> {
fontWeight: FontWeight.bold), fontWeight: FontWeight.bold),
), ),
16.hb, 16.hb,
Text('用于获取设备', Text('用于获取设备1',
style: TextStyle( style: TextStyle(
fontSize: 28.sp, color: BaseStyle.color999999)), fontSize: 28.sp, color: BaseStyle.color999999)),
], ],

@ -1,3 +1,4 @@
import 'package:bot_toast/bot_toast.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:project_telephony/base/base_style.dart'; import 'package:project_telephony/base/base_style.dart';
@ -7,7 +8,10 @@ import 'package:project_telephony/ui/user/members_page.dart';
import 'package:project_telephony/ui/user/privacy_rights_page.dart'; import 'package:project_telephony/ui/user/privacy_rights_page.dart';
import 'package:project_telephony/ui/widget/image_scaffold.dart'; import 'package:project_telephony/ui/widget/image_scaffold.dart';
import 'package:project_telephony/ui/widget/plone_bottom.dart'; import 'package:project_telephony/ui/widget/plone_bottom.dart';
import 'package:project_telephony/ui/widget/plone_image_picker.dart';
import 'package:project_telephony/utils/headers.dart'; import 'package:project_telephony/utils/headers.dart';
import 'package:project_telephony/utils/permissionutils.dart';
import 'package:telephony/telephony.dart';
class UserPage extends StatefulWidget { class UserPage extends StatefulWidget {
const UserPage({Key? key}) : super(key: key); const UserPage({Key? key}) : super(key: key);
@ -16,12 +20,14 @@ class UserPage extends StatefulWidget {
_UserPageState createState() => _UserPageState(); _UserPageState createState() => _UserPageState();
} }
final Telephony telephony = Telephony.instance;
@override @override
void initState() {} void initState() {}
class _UserPageState extends State<UserPage> { class _UserPageState extends State<UserPage> {
bool bl = true;
bool vle = false; bool vle = false;
bool tooken = true;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return CloudScaffold( return CloudScaffold(
@ -58,19 +64,19 @@ class _UserPageState extends State<UserPage> {
// //
_getUser() { _getUser() {
return GestureDetector( return Container(
onTap: () { margin: EdgeInsets.only(left: 64.w, right: 64.w, top: 216.w),
Get.to(() => const LoginPage()); child: Row(
}, children: [
child: Container( GestureDetector(
margin: EdgeInsets.only(left: 64.w, right: 64.w, top: 216.w), onTap: () {
child: Row( Get.to(() => const LoginPage());
children: [ },
Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Text(
bl ? "登录/注册" : "xxxxx", tooken ? "登录/注册" : "xxxxx",
style: TextStyle( style: TextStyle(
fontSize: BaseStyle.fontSize48, fontSize: BaseStyle.fontSize48,
color: BaseStyle.color333333, color: BaseStyle.color333333,
@ -78,26 +84,33 @@ class _UserPageState extends State<UserPage> {
), ),
24.hb, 24.hb,
Text( Text(
bl ? "登录获取更多信息" : "欢迎您登录短信帮手", tooken ? "登录获取更多信息" : "欢迎您登录短信帮手",
style: TextStyle( style: TextStyle(
fontSize: BaseStyle.fontSize28, fontSize: BaseStyle.fontSize28,
color: BaseStyle.color333333), color: BaseStyle.color333333),
) )
], ],
), ),
const Spacer(), ),
Container( const Spacer(),
child: ClipOval( GestureDetector(
child: Image.asset( onTap: () async {
Assets.images.portrait.path, var value = await CloudImagePicker.pickSingleImage(title: '选择图片');
height: 128.w, if (value != null) {
width: 128.w, BotToast.showText(text: '头像成功');
fit: BoxFit.cover, setState(() {});
), }
},
child: ClipOval(
child: Image.asset(
Assets.images.portrait.path,
height: 128.w,
width: 128.w,
fit: BoxFit.cover,
), ),
) ),
], )
), ],
), ),
); );
} }
@ -169,13 +182,18 @@ class _UserPageState extends State<UserPage> {
_getVip() { _getVip() {
return Row( return Row(
children: [ children: [
const Text( Text(
"vip", "VIP",
style: TextStyle(color: Color(0xFFFFEAB0)), style: TextStyle(
color: const Color(0xFFFFEAB0),
fontFamily: "BlackItalic",
fontSize: 32.sp),
), ),
Container( Container(
width: 8.w, width: 8.w,
height: 8.w, height: 8.w,
alignment: Alignment.center,
margin: EdgeInsets.symmetric(horizontal: 8.w),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(4), borderRadius: BorderRadius.circular(4),
color: const Color(0xFFFFEAB0), color: const Color(0xFFFFEAB0),
@ -183,7 +201,11 @@ class _UserPageState extends State<UserPage> {
), ),
const Text( const Text(
"未开通会员", "未开通会员",
style: TextStyle(color: Color(0xFFFFEAB0)), style: TextStyle(
color: Color(
0xFFFFEAB0,
),
fontWeight: FontWeight.w700),
) )
], ],
); );
@ -192,9 +214,9 @@ class _UserPageState extends State<UserPage> {
// //
_getSwitch(String url, String name, bool pd) { _getSwitch(String url, String name, bool pd) {
return GestureDetector( return GestureDetector(
onTap: () { onTap: () async {
pd pd
? "" ? PermissionUtils.requestAllPermission()
: Get.to(() => PrivacyRightsPage( : Get.to(() => PrivacyRightsPage(
name: name, name: name,
)); ));

@ -0,0 +1,154 @@
import 'dart:io';
import 'package:flutter/cupertino.dart';
import 'package:image_picker/image_picker.dart';
// import 'package:image_picker/image_picker.dart';
import 'package:project_telephony/utils/headers.dart';
import 'package:velocity_x/velocity_x.dart';
// import 'package:velocity_x/velocity_x.dart';
class CloudImagePicker {
static Future<List<File>> pickMultiImage(
{required String title,
double maxWidth = 1000,
double maxHeight = 1000}) async {
List<XFile>? files = [];
files = await ImagePicker().pickMultiImage();
if (files == null) {
return <File>[];
} else {
return files.map((e) => File(e.path)).toList();
}
}
static Future<List<File>> pickMultiAndSingleImage(
{required String title,
double maxWidth = 1000,
double maxHeight = 1000}) async {
List<XFile>? files = [];
// _files = await ImagePicker().pickMultiImage();
files = await Get.bottomSheet(CupertinoActionSheet(
title: title.text.isIntrinsic.make(),
actions: [
CupertinoDialogAction(
onPressed: () async {
await ImagePicker().pickMultiImage().then((value) {
if (value != null) {
Get.back(
result: value,
);
}
});
},
child: Row(
children: [
const Icon(CupertinoIcons.photo),
30.wb,
'相册(长按图片多选)'.text.isIntrinsic.make(),
],
),
),
CupertinoDialogAction(
onPressed: () async {
await ImagePicker()
.pickImage(
source: ImageSource.camera,
maxHeight: maxHeight,
maxWidth: maxWidth,
)
.then((value) {
if (value != null) {
XFile pickFile = value;
List<XFile> files = [];
files.add(pickFile);
Get.back(
result: files,
);
}
});
},
child: Row(
children: [
const Icon(CupertinoIcons.camera),
30.wb,
'相机'.text.isIntrinsic.make(),
],
),
),
],
cancelButton: CupertinoDialogAction(
onPressed: Get.back,
child: '取消'.text.isIntrinsic.make(),
),
));
if (files == null) {
return <File>[];
} else {
return files.map((e) => File(e.path)).toList();
}
}
static Future<File?> pickSingleImage(
{required String title,
double maxWidth = 1000,
double maxHeight = 1000}) async {
XFile? xFile = await Get.bottomSheet(CupertinoActionSheet(
title: title.text.isIntrinsic.make(),
actions: [
CupertinoDialogAction(
onPressed: () async {
await ImagePicker()
.pickImage(
source: ImageSource.gallery,
maxHeight: maxHeight,
maxWidth: maxWidth,
)
.then((value) {
Get.back(
result: value,
);
});
},
child: Row(
children: [
const Icon(CupertinoIcons.photo),
30.wb,
'相册'.text.isIntrinsic.make(),
],
)),
CupertinoDialogAction(
onPressed: () async {
await ImagePicker()
.pickImage(
source: ImageSource.camera,
maxHeight: maxHeight,
maxWidth: maxWidth,
)
.then((value) {
Get.back(
result: value,
);
});
},
child: Row(
children: [
const Icon(CupertinoIcons.camera),
30.wb,
'相机'.text.isIntrinsic.make(),
],
)),
],
cancelButton: CupertinoDialogAction(
onPressed: Get.back,
child: '取消'.text.isIntrinsic.make(),
),
));
if (xFile != null) {
return File(xFile.path);
} else {
return null;
}
}
}

@ -80,10 +80,11 @@ class SortWidget extends StatelessWidget {
: Border.all(color: const Color(0xFFFFDF66), width: 1.w)), : Border.all(color: const Color(0xFFFFDF66), width: 1.w)),
child: Column( child: Column(
children: [ children: [
Padding(padding: EdgeInsets.only(top: 16.w)), Padding(padding: EdgeInsets.only(top: 32.w)),
Text( Text(
"${item.month}个月VIP", "${item.month}个月VIP",
style: TextStyle( style: TextStyle(
fontFamily: "SemiBold",
fontSize: BaseStyle.fontSize28, fontSize: BaseStyle.fontSize28,
color: BaseStyle.color333333, color: BaseStyle.color333333,
fontWeight: FontWeight.bold), fontWeight: FontWeight.bold),
@ -99,18 +100,17 @@ class SortWidget extends StatelessWidget {
TextSpan( TextSpan(
text: "${item.pice}", text: "${item.pice}",
style: TextStyle( style: TextStyle(
fontFamily: "SemiBold",
fontSize: 64.sp, fontSize: 64.sp,
color: pickItem == item color: pickItem == item
? const Color(0xFFFF3F3F) ? const Color(0xFFFF3F3F)
: BaseStyle.color333333)) : BaseStyle.color333333))
])), ])),
Text( Text("${(item.pice / item.month).toStringAsFixed(2)}元/月",
"${(item.pice / item.month).toStringAsFixed(2)}元/月", style: TextStyle(
style: TextStyle(
fontSize: BaseStyle.fontSize24, fontSize: BaseStyle.fontSize24,
color: BaseStyle.color999999, color: BaseStyle.color999999,
fontWeight: FontWeight.bold), )),
),
], ],
)), )),
); );

@ -0,0 +1,166 @@
// import 'dart:async';
// import 'dart:convert';
// import 'package:bot_toast/bot_toast.dart';
// import 'package:cloud_car/model/pay/wx_pay_model.dart';
// import 'package:cloud_car/utils/new_work/api_client.dart';
// import 'package:cloud_car/utils/toast/cloud_toast.dart';
// import 'package:dio/dio.dart';
// import 'package:flutter/foundation.dart';
// import 'package:fluwx/fluwx.dart';
// import 'package:power_logger/power_logger.dart';
// import 'package:tobias/tobias.dart';
// import '../model/pay/pay_model.dart';
// enum PAYTYPE {
// ///
// ali,
// ///
// wx,
// ///
// cash,
// ///pos
// pos
// }
// class PayUtil {
// static final PayUtil _instance = PayUtil._();
// factory PayUtil() => _instance;
// PayUtil._();
// void resultSatus(String status) {
// switch (status) {
// case '8000':
// BotToast.showText(text: '正在处理中');
// break;
// case '4000':
// BotToast.showText(text: '订单支付失败');
// break;
// case '5000':
// BotToast.showText(text: '重复请求');
// break;
// case '6001':
// BotToast.showText(text: ' 用户中途取消');
// break;
// case '6002':
// BotToast.showText(text: '网络连接出错');
// break;
// case '6004':
// BotToast.showText(text: '支付结果未知,请查询商户订单列表中订单的支付状态');
// break;
// default:
// BotToast.showText(text: '其他支付错误');
// break;
// }
// }
// String _resultStatus = '';
// ///
// ///
// Future<bool> callAliPay(String order, {String? apiPath}) async {
// var install = await isAliPayInstalled();
// if (!install) {
// BotToast.showText(text: '未安装支付宝!');
// return false;
// }
// Map<dynamic, dynamic> result = {};
// try {
// result = await aliPay(order);
// } catch (e) {
// if (kDebugMode) {
// print(e.toString());
// }
// }
// _resultStatus = result['resultStatus'];
// if (_resultStatus == '9000') {
// String res = result['result'];
// PayModel model = PayModel.fromJson(jsonDecode(res));
// if (apiPath != null) {
// bool confirmResult = await _confirmPayResult(
// apiPath, model.aliPayTradeAppPayResponse.outTradeNo);
// return confirmResult;
// } else {
// CloudToast.show('支付成功');
// return true;
// }
// } else {
// resultSatus(_resultStatus);
// return false;
// }
// }
// Future<bool> _confirmPayResult(String path, String code) async {
// try {
// int status = 0;
// for (var i = 0; i < 3; i++) {
// await Future.delayed(const Duration(milliseconds: 1000), () async {
// Response response = await apiClient.dio.get(path, queryParameters: {
// "code": code,
// });
// status = response.data['status'] as int;
// });
// if (status == 2) {
// break;
// }
// }
// if (status == 2) {
// BotToast.showText(text: '交易成功');
// return true;
// } else {
// BotToast.showText(text: '交易失败 错误码$status');
// return false;
// }
// } catch (e) {
// BotToast.showText(text: '网络请求错误');
// LoggerData.addData(e);
// return false;
// }
// }
// ///
// StreamSubscription? _wxPayStream;
// void wxPayAddListener(
// {required VoidCallback paySuccess,
// Function(BaseWeChatResponse)? payError}) {
// _wxPayStream = weChatResponseEventHandler.listen((event) {
// if (kDebugMode) {
// print('errorCode:${event.errCode} errorStr:${event.errStr}');
// }
// if (event.errCode == 0) {
// paySuccess();
// } else {
// LoggerData.addData(
// 'errorCode:${event.errCode} errorStr:${event.errStr ?? '支付失败'}');
// CloudToast.show(event.errStr ?? '支付失败');
// if (payError != null) payError(event);
// //payError == null ? null : payError(event);
// }
// });
// }
// void removeWxPayListener() {
// _wxPayStream?.cancel();
// }
// Future callWxPay({
// required WxPayModel payModel,
// }) async {
// await payWithWeChat(
// appId: 'wx9bc3ffb23a749254',
// partnerId: payModel.partnerId,
// prepayId: payModel.prepayId,
// packageValue: payModel.package,
// nonceStr: payModel.nonceStr,
// timeStamp: int.parse(payModel.timeStamp),
// sign: payModel.sign);
// }
// }

@ -0,0 +1,16 @@
import 'package:bot_toast/bot_toast.dart';
import 'package:permission_handler/permission_handler.dart';
class PermissionUtils {
static Future requestAllPermission() async {
Map<Permission, PermissionStatus> permission =
await [Permission.phone, Permission.sms].request();
if (await Permission.phone.isGranted) {
BotToast.showText(text: "手机申请通过");
} else {
BotToast.showText(text: "手机申请不通过");
}
}
}

@ -15,6 +15,13 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "4.1.0" version: "4.1.0"
archive:
dependency: transitive
description:
name: archive
url: "https://pub.dartlang.org"
source: hosted
version: "3.3.1"
args: args:
dependency: transitive dependency: transitive
description: description:
@ -29,6 +36,13 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.8.2" version: "2.8.2"
auto_size_text_pk:
dependency: transitive
description:
name: auto_size_text_pk
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.0"
boolean_selector: boolean_selector:
dependency: transitive dependency: transitive
description: description:
@ -127,6 +141,13 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.0.1" version: "2.0.1"
cli_util:
dependency: transitive
description:
name: cli_util
url: "https://pub.dartlang.org"
source: hosted
version: "0.3.5"
clock: clock:
dependency: transitive dependency: transitive
description: description:
@ -147,7 +168,7 @@ packages:
name: collection name: collection
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.15.0" version: "1.16.0"
color: color:
dependency: transitive dependency: transitive
description: description:
@ -155,6 +176,13 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "3.0.0" version: "3.0.0"
common_utils:
dependency: transitive
description:
name: common_utils
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0"
convert: convert:
dependency: transitive dependency: transitive
description: description:
@ -162,6 +190,13 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "3.0.2" version: "3.0.2"
cross_file:
dependency: transitive
description:
name: cross_file
url: "https://pub.dartlang.org"
source: hosted
version: "0.3.3+1"
crypto: crypto:
dependency: transitive dependency: transitive
description: description:
@ -190,20 +225,62 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.1.0" version: "1.1.0"
decimal:
dependency: transitive
description:
name: decimal
url: "https://pub.dartlang.org"
source: hosted
version: "2.2.0"
device_info_plus: device_info_plus:
dependency: "direct main" dependency: "direct main"
description: description:
name: device_info_plus name: device_info_plus
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.0.1" version: "4.0.0"
device_info_plus_linux:
dependency: transitive
description:
name: device_info_plus_linux
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.1"
device_info_plus_macos:
dependency: transitive
description:
name: device_info_plus_macos
url: "https://pub.dartlang.org"
source: hosted
version: "2.2.3"
device_info_plus_platform_interface:
dependency: transitive
description:
name: device_info_plus_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "2.3.0+1"
device_info_plus_web:
dependency: transitive
description:
name: device_info_plus_web
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0"
device_info_plus_windows:
dependency: transitive
description:
name: device_info_plus_windows
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.1"
fake_async: fake_async:
dependency: transitive dependency: transitive
description: description:
name: fake_async name: fake_async
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.2.0" version: "1.3.0"
ffi: ffi:
dependency: transitive dependency: transitive
description: description:
@ -225,6 +302,13 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.0.1" version: "1.0.1"
flustars:
dependency: "direct main"
description:
name: flustars
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.1"
flutter: flutter:
dependency: "direct main" dependency: "direct main"
description: flutter description: flutter
@ -279,6 +363,20 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.0.4" version: "1.0.4"
flutter_native_splash:
dependency: "direct dev"
description:
name: flutter_native_splash
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.3"
flutter_plugin_android_lifecycle:
dependency: transitive
description:
name: flutter_plugin_android_lifecycle
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.7"
flutter_screenutil: flutter_screenutil:
dependency: "direct main" dependency: "direct main"
description: description:
@ -291,6 +389,18 @@ packages:
description: flutter description: flutter
source: sdk source: sdk
version: "0.0.0" version: "0.0.0"
flutter_web_plugins:
dependency: transitive
description: flutter
source: sdk
version: "0.0.0"
fluwx:
dependency: "direct main"
description:
name: fluwx
url: "https://pub.dartlang.org"
source: hosted
version: "3.9.1"
frontend_server_client: frontend_server_client:
dependency: transitive dependency: transitive
description: description:
@ -319,6 +429,13 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.0" version: "2.1.0"
grinder:
dependency: "direct dev"
description:
name: grinder
url: "https://pub.dartlang.org"
source: hosted
version: "0.9.2"
hive: hive:
dependency: "direct main" dependency: "direct main"
description: description:
@ -333,6 +450,13 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.1.0" version: "1.1.0"
http:
dependency: transitive
description:
name: http
url: "https://pub.dartlang.org"
source: hosted
version: "0.13.5"
http_multi_server: http_multi_server:
dependency: transitive dependency: transitive
description: description:
@ -347,6 +471,55 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "4.0.1" version: "4.0.1"
image:
dependency: transitive
description:
name: image
url: "https://pub.dartlang.org"
source: hosted
version: "3.1.3"
image_picker:
dependency: "direct main"
description:
name: image_picker
url: "https://pub.dartlang.org"
source: hosted
version: "0.8.5+3"
image_picker_android:
dependency: transitive
description:
name: image_picker_android
url: "https://pub.dartlang.org"
source: hosted
version: "0.8.5+1"
image_picker_for_web:
dependency: transitive
description:
name: image_picker_for_web
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.8"
image_picker_ios:
dependency: transitive
description:
name: image_picker_ios
url: "https://pub.dartlang.org"
source: hosted
version: "0.8.5+6"
image_picker_platform_interface:
dependency: transitive
description:
name: image_picker_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "2.6.1"
intl:
dependency: transitive
description:
name: intl
url: "https://pub.dartlang.org"
source: hosted
version: "0.17.0"
io: io:
dependency: transitive dependency: transitive
description: description:
@ -362,7 +535,7 @@ packages:
source: hosted source: hosted
version: "0.6.4" version: "0.6.4"
json_annotation: json_annotation:
dependency: transitive dependency: "direct main"
description: description:
name: json_annotation name: json_annotation
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
@ -409,7 +582,7 @@ packages:
name: material_color_utilities name: material_color_utilities
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.1.3" version: "0.1.4"
meta: meta:
dependency: transitive dependency: transitive
description: description:
@ -451,7 +624,7 @@ packages:
name: path name: path
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.8.0" version: "1.8.1"
path_provider: path_provider:
dependency: transitive dependency: transitive
description: description:
@ -501,6 +674,41 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.0.7" version: "2.0.7"
permission_handler:
dependency: "direct main"
description:
name: permission_handler
url: "https://pub.dartlang.org"
source: hosted
version: "10.0.0"
permission_handler_android:
dependency: transitive
description:
name: permission_handler_android
url: "https://pub.dartlang.org"
source: hosted
version: "10.0.0"
permission_handler_apple:
dependency: transitive
description:
name: permission_handler_apple
url: "https://pub.dartlang.org"
source: hosted
version: "9.0.4"
permission_handler_platform_interface:
dependency: transitive
description:
name: permission_handler_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "3.7.0"
permission_handler_windows:
dependency: transitive
description:
name: permission_handler_windows
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.0"
petitparser: petitparser:
dependency: transitive dependency: transitive
description: description:
@ -557,6 +765,69 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.2.0" version: "1.2.0"
rational:
dependency: transitive
description:
name: rational
url: "https://pub.dartlang.org"
source: hosted
version: "2.2.0"
shared_preferences:
dependency: transitive
description:
name: shared_preferences
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.15"
shared_preferences_android:
dependency: transitive
description:
name: shared_preferences_android
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.12"
shared_preferences_ios:
dependency: transitive
description:
name: shared_preferences_ios
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.1"
shared_preferences_linux:
dependency: transitive
description:
name: shared_preferences_linux
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.1"
shared_preferences_macos:
dependency: transitive
description:
name: shared_preferences_macos
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.4"
shared_preferences_platform_interface:
dependency: transitive
description:
name: shared_preferences_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0"
shared_preferences_web:
dependency: transitive
description:
name: shared_preferences_web
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.4"
shared_preferences_windows:
dependency: transitive
description:
name: shared_preferences_windows
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.1"
shelf: shelf:
dependency: transitive dependency: transitive
description: description:
@ -596,7 +867,14 @@ packages:
name: source_span name: source_span
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.8.1" version: "1.8.2"
sp_util:
dependency: transitive
description:
name: sp_util
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.3"
stack_trace: stack_trace:
dependency: transitive dependency: transitive
description: description:
@ -625,6 +903,13 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.1.0" version: "1.1.0"
synchronized:
dependency: transitive
description:
name: synchronized
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.0+2"
telephony: telephony:
dependency: "direct main" dependency: "direct main"
description: description:
@ -645,7 +930,7 @@ packages:
name: test_api name: test_api
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.4.8" version: "0.4.9"
time: time:
dependency: transitive dependency: transitive
description: description:
@ -660,6 +945,13 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.0.0" version: "1.0.0"
tobias:
dependency: "direct main"
description:
name: tobias
url: "https://pub.dartlang.org"
source: hosted
version: "2.4.1"
typed_data: typed_data:
dependency: transitive dependency: transitive
description: description:
@ -667,13 +959,34 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.3.0" version: "1.3.0"
universal_io:
dependency: transitive
description:
name: universal_io
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.4"
vector_math: vector_math:
dependency: transitive dependency: transitive
description: description:
name: vector_math name: vector_math
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.1" version: "2.1.2"
velocity_x:
dependency: "direct main"
description:
name: velocity_x
url: "https://pub.dartlang.org"
source: hosted
version: "3.5.1"
vxstate:
dependency: transitive
description:
name: vxstate
url: "https://pub.dartlang.org"
source: hosted
version: "2.2.0"
watcher: watcher:
dependency: transitive dependency: transitive
description: description:
@ -717,5 +1030,5 @@ packages:
source: hosted source: hosted
version: "3.1.1" version: "3.1.1"
sdks: sdks:
dart: ">=2.16.1 <3.0.0" dart: ">=2.17.0-0 <3.0.0"
flutter: ">=2.8.1" flutter: ">=2.8.1"

@ -37,6 +37,7 @@ dependencies:
# 获取来电状态 # 获取来电状态
telephony: any telephony: any
provider: ^6.0.3 provider: ^6.0.3
permission_handler: ^10.0.0
# 获取通话记录 # 获取通话记录
call_log: ^4.0.0 call_log: ^4.0.0
# 后台设置 # 后台设置
@ -55,6 +56,18 @@ dependencies:
bot_toast: ^4.0.3 bot_toast: ^4.0.3
# 汉转音 # 汉转音
lpinyin: ^2.0.3 lpinyin: ^2.0.3
#各种扩展
velocity_x: ^3.0.0
# 相机
image_picker: ^0.8.5
#微信登录及支付
fluwx: ^3.8.3
#支付宝支付
tobias: ^2.4.0+2
# 工具
flustars: ^2.0.1
# model生成
json_annotation: ^4.6.0
# # jdk # # jdk
# jverify: ^2.2.5 # jverify: ^2.2.5
## pub 集成 ## pub 集成
@ -76,14 +89,25 @@ dev_dependencies:
yaml: ^3.1.0 yaml: ^3.1.0
pub_semver: ^2.1.0 pub_semver: ^2.1.0
flutter_gen_runner: ^4.1.3 flutter_gen_runner: ^4.1.3
# patgh: ^1.8.1
#脚本工具
grinder: ^0.9.1
flutter_native_splash: ^1.1.8+4
flutter: flutter:
uses-material-design: true uses-material-design: true
generate: true generate: true
assets: fonts:
- assets/ - family: BlackItalic
- assets/icons/ fonts:
- assets/images/ - asset: asset/fonts/Barlow-BlackItalic.ttf
- family: SemiBold
fonts:
- asset: asset/fonts/Barlow-SemiBold.ttf
assets:
- assets/
- assets/icons/
- assets/images/
# - assets/data/ # - assets/data/

@ -0,0 +1,62 @@
part of './grind.dart';
@Task('打包Android项目')
buildApk() async {
await runAsync(
'fvm',
arguments: [
'flutter',
'build',
'apk',
'--target-platform=android-arm64',
'--dart-define',
'BUILD_TYPE=PRODUCT',
],
);
String date = DateUtil.formatDate(DateTime.now(), format: 'yy_MM_dd_HH_mm');
String version = await getVersion();
await runAsync('rm', arguments: ['-rf', Config.apkDir]);
await runAsync('mkdir', arguments: ['-p', Config.apkDir]);
await runAsync('mv', arguments: [
Config.buildPath,
'${Config.apkDir}/${Config.packageName}_${version}_release_$date.apk'
]);
}
@Task('打包Android项目')
buildApkDev() async {
await runAsync(
'fvm',
arguments: [
'flutter',
'build',
'apk',
'--target-platform=android-arm64',
'--dart-define',
'BUILD_TYPE=Dev',
],
);
String date = DateUtil.formatDate(DateTime.now(), format: 'yy_MM_dd_HH_mm');
String version = await getVersion();
await runAsync('rm', arguments: ['-rf', Config.apkDevDir]);
await runAsync('mkdir', arguments: ['-p', Config.apkDevDir]);
await runAsync('mv', arguments: [
Config.buildPath,
'${Config.apkDevDir}/${Config.packageName}_${version}_beta_$date.apk'
]);
}
@Task('打包iOS项目')
buildIos() async {
await runAsync(
'fvm',
arguments: [
'flutter',
'build',
'ios',
'--dart-define',
'BUILD_TYPE=PRODUCT',
],
);
}

@ -0,0 +1,64 @@
part of './grind.dart';
@Task('import 排序')
void sort() {
Pub.run('import_sorter:main');
}
@Task('格式化dart代码')
void format() {
DartFmt.format(libDir);
}
@Task('自动提交修改')
@Depends(sort, format, gitPush)
void git() {
log(' commit to git');
run(
'git',
arguments: [
'commit',
'-a',
'-m',
'[auto task] sort & format',
],
);
}
@Task('推送代码')
void gitPush() {
log(' push to git');
run(
'git',
arguments: ['push'],
);
}
@Task('build runner')
void gen() async {
await runAsync(
'fvm',
arguments: [
'flutter',
'pub',
'run',
'build_runner',
'build',
],
);
}
@Task('build runner clean')
void genClean() async {
await runAsync(
'fvm',
arguments: [
'flutter',
'pub',
'run',
'build_runner',
'build',
'--delete-conflicting-outputs'
],
);
}

@ -0,0 +1,70 @@
import 'dart:io';
import 'package:flustars/flustars.dart';
import 'package:grinder/grinder.dart';
import 'package:path/path.dart';
import 'package:pub_semver/pub_semver.dart';
import 'package:yaml/yaml.dart';
import 'config.dart';
import 'version_tool.dart';
part '_build.dart';
part '_project_manage.dart';
main(args) => grind(args);
@Task('add minor version number')
void addVersion() async {
String projectPath = Directory('.').absolute.path;
String yamlPath = join(projectPath, 'pubspec.yaml');
String yamlContent = await File(yamlPath).readAsString();
dynamic content = loadYaml(yamlContent);
String version = content['version'];
//rename version
Version resultVersion = VersionTool.fromText(version).nextMinorTag('dev');
String result = yamlContent.replaceFirst(version, resultVersion.toString());
await File(yamlPath).writeAsString(result);
}
@Task('add path version number')
void addVersionPatch() async {
String projectPath = Directory('.').absolute.path;
String yamlPath = join(projectPath, 'pubspec.yaml');
String yamlContent = await File(yamlPath).readAsString();
dynamic content = loadYaml(yamlContent);
String version = content['version'];
//rename version
Version resultVersion = VersionTool.fromText(version).nextPatchTag('dev');
String result = yamlContent.replaceFirst(version, resultVersion.toString());
await File(yamlPath).writeAsString(result);
}
@Task('add major version number')
void addVersionMajor() async {
String projectPath = Directory('.').absolute.path;
String yamlPath = join(projectPath, 'pubspec.yaml');
String yamlContent = await File(yamlPath).readAsString();
dynamic content = loadYaml(yamlContent);
String version = content['version'];
//rename version
Version resultVersion = VersionTool.fromText(version).nextMajorTag('dev');
String result = yamlContent.replaceFirst(version, resultVersion.toString());
await File(yamlPath).writeAsString(result);
}
@Task()
Future<String> getVersion() async {
String projectPath = Directory('.').absolute.path;
String yamlPath = join(projectPath, 'pubspec.yaml');
String yamlContent = await File(yamlPath).readAsString();
dynamic content = loadYaml(yamlContent);
String version = content['version'];
return version;
}

@ -0,0 +1,59 @@
import 'package:pub_semver/pub_semver.dart';
enum VersionNumber {
major,
minor,
patch,
}
class VersionTool {
Version version;
VersionTool(this.version);
VersionTool.fromText(String text) : version = Version.parse(text);
Version get nextMajor => _addBuildNumber(VersionNumber.major);
Version get nextMinor => _addBuildNumber(VersionNumber.minor);
Version get nextPatch => _addBuildNumber(VersionNumber.patch);
Version nextMajorTag(String tag) => _addBuildNumber(
VersionNumber.major,
tag: tag,
);
Version nextMinorTag(String tag) => _addBuildNumber(
VersionNumber.minor,
tag: tag,
);
Version nextPatchTag(String tag) => _addBuildNumber(
VersionNumber.patch,
tag: tag,
);
Version _addBuildNumber(VersionNumber type, {String? tag}) {
switch (type) {
case VersionNumber.major:
return Version(
version.major,
version.minor,
version.patch + 1,
pre: tag,
build: '${(version.build.first as int) + 1}',
);
case VersionNumber.minor:
return Version(
version.major,
version.minor + 1,
0,
pre: tag,
build: '${(version.build.first as int) + 1}',
);
case VersionNumber.patch:
return Version(
version.major + 1,
0,
0,
pre: tag,
build: '${(version.build.first as int) + 1}',
);
}
}
}
Loading…
Cancel
Save