Commit 46d2a8575728f3ee7852126bea12ecb01374a2e2

Authored by weixin_45529955
2 parents 30705b8a 6267611f

Merge branch 'v7.2.0+' into v6.1.0+

Showing 29 changed files with 1862 additions and 181 deletions
class SellerVersionModel {
int? ret;
List<SellerVersionSunModel>? data;
... ... @@ -37,6 +36,7 @@ class SellerVersionSunModel {
String? rdate;
String? edate;
String? cdate;
double? price;
SellerVersionSunModel(
{this.id,
... ... @@ -46,9 +46,10 @@ class SellerVersionSunModel {
this.vname,
this.rdate,
this.edate,
this.cdate});
this.cdate,
this.price});
SellerVersionSunModel.fromJson(Map<String, dynamic> json){
SellerVersionSunModel.fromJson(Map<String, dynamic> json) {
id = json['id'];
sid = json['sid'];
vid = json['vid'];
... ... @@ -59,7 +60,10 @@ class SellerVersionSunModel {
// edate = json['vid'] == '4' ? '1695005146' : '1694832346';
edate = json['edate'];
cdate = json['cdate'];
}
price = json['price'] is num
? (json['price'] as num).toDouble()
: double.tryParse('${json['price']}');
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
... ... @@ -71,6 +75,7 @@ class SellerVersionSunModel {
data['rdate'] = this.rdate;
data['edate'] = this.edate;
data['cdate'] = this.cdate;
data['price'] = this.price;
return data;
}
}
... ...
... ... @@ -3,7 +3,7 @@ class HttpUrl {
static const String server_address = "http://xt04.colorcun.com/"; //服务端请求地址
// static const String server_address = "http://192.168.5.90:8000/public/"; //服务端请求地址
static const String app_user_login =
"?service=Android.User.AppUserLogin"; //登录地址
static const String user_token_init =
... ... @@ -480,6 +480,8 @@ class HttpUrl {
static const String get_seller_version =
"?service=App.SellerVersion.GetSellerVersion"; // 获取商家的版本信息
static const String get_version_list =
"?service=App.SellerVersion.GetVersionList"; // 获取所有版本列表
static const String get_seller_template_color_list =
"?service=App.Seller.GetSellerTemplateColorList"; // 模板/颜色配置信息
... ... @@ -675,14 +677,9 @@ class HttpUrl {
static const get_free_meal_config_by_seller =
"?service=App.Activity.GetFreeMealConfigBySeller"; // 获取当餐免费的配置信息
static const clear_seller_user_wechat_bind =
static const clear_seller_user_wechat_bind =
"?service=App.Wechat.ClearSellerUserWechatBind"; // 解绑员工账号微信
static const get_customer_target_group_list =
"?service=App.Activity.GetCustomerTargetGroupList"; // 获取客户目标群体列表
... ...
... ... @@ -183,6 +183,9 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver {
// }
WidgetsBinding.instance.addObserver(this);
EventBus().on('refreshSellerVersion', (arg) {
getSellerVersion();
});
_currIndex = widget.initialIndex;
... ... @@ -2118,6 +2121,7 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver {
LogUtil.v("home_dispose");
// bus.off('refresh_token');
EventBus().off('refreshSellerVersion');
if (timer != null) {
timer!.cancel();
}
... ... @@ -2130,4 +2134,4 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver {
// AzhonAppUpdate.dispose();
WidgetsBinding.instance.removeObserver(this);
}
}
\ No newline at end of file
}
... ...
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:fluwx/fluwx.dart';
import 'package:one_key/models/seller_version_model.dart';
import 'package:one_key/models/wechat_pay_model.dart';
import 'package:one_key/provider/collect_store_provider.dart';
import 'package:one_key/provider/user_model.dart';
import 'package:one_key/res/colors.dart';
import 'package:one_key/utils/event_bus.dart';
import 'package:one_key/utils/utils.dart';
import 'package:one_key/widgets/system_app_bar.dart';
import 'package:provider/provider.dart';
class FunctionUpgradePage extends StatefulWidget {
const FunctionUpgradePage({super.key, required this.collectStoreProvider});
final CollectStoreProvider collectStoreProvider;
@override
State<FunctionUpgradePage> createState() => _FunctionUpgradePageState();
}
class _FunctionUpgradePageState extends State<FunctionUpgradePage> {
final List<_UpgradeModule> _modules = [];
bool _loading = true;
bool _loadFailed = false;
late FluwxCancelable _wxPay;
final Fluwx _fluwx = Fluwx();
_UpgradeModule? get _selectedModule {
for (final module in _modules) {
if (module.selected) {
return module;
}
}
return null;
}
double get _total => _selectedModule?.price ?? 0;
bool get _hasSelection => _selectedModule != null;
@override
void initState() {
super.initState();
Utils.changeStatusColor(color: Colors.transparent);
_wxPay = _fluwx.addSubscriber((res) {
_wxPay.cancel();
if (res is WeChatPaymentResponse) {
if (res.errCode == 0) {
_handlePaySuccess();
} else if (res.errCode == -1) {
Utils.showToast('支付错误');
} else if (res.errCode == -2) {
Utils.showToast('您已取消支付');
}
}
});
WidgetsBinding.instance.addPostFrameCallback((_) {
_loadModules();
});
}
Future<void> _loadModules() async {
setState(() {
_loading = true;
_loadFailed = false;
});
final List<SellerVersionSunModel>? list =
await widget.collectStoreProvider.getFunctionUpgradeList(context);
if (!mounted) {
return;
}
setState(() {
_modules.clear();
if (list != null) {
for (final item in list) {
final _UpgradeModule? module = _mapModule(item);
if (module != null) {
module.selected = false;
_modules.add(module);
}
}
}
_loading = false;
_loadFailed = list == null;
});
}
_UpgradeModule? _mapModule(SellerVersionSunModel item) {
final String? vid = item.vid;
final String? name = item.vname;
if (vid == null || name == null || name.trim().isEmpty) {
return null;
}
final String vtype = item.vtype ?? '';
final String desc;
if (vtype == '1') {
desc = '包含现有全部功能组件模块以及未来扩展的功能模块。';
} else if (vtype == '3') {
desc = '$name为独立功能模块,开通后有效期一年。';
} else {
desc = '$name套餐,开通后有效期一年。';
}
return _UpgradeModule(
vid: vid,
name: name,
desc: desc,
price: item.price ?? 0,
);
}
void _toggleModule(int index) {
final bool selected = _modules[index].selected;
setState(() {
for (final module in _modules) {
module.selected = false;
}
_modules[index].selected = !selected;
});
}
Future<void> _pay() async {
final _UpgradeModule? selected = _selectedModule;
if (selected == null) {
Utils.showToast('请先选择需要开通的模块');
return;
}
if (selected.price <= 0) {
Utils.showToast('当前模块暂不支持购买');
return;
}
final bool isInstalled = await _fluwx.isWeChatInstalled;
if (!isInstalled) {
Utils.showToast('请先安装微信');
return;
}
final String? sellerid =
Provider.of<UserModel>(context, listen: false).user?.sellerid;
if (sellerid == null || sellerid.isEmpty) {
Utils.showToast('商家信息异常');
return;
}
final bool success = await widget.collectStoreProvider.appPayJiSuVersion(
context,
{'sellerid': sellerid, 'vid': selected.vid},
);
if (!success || !mounted) {
return;
}
final WechatPaySunModel? sunModel = widget.collectStoreProvider.sunModel;
if (sunModel == null ||
sunModel.appId == null ||
sunModel.package == null ||
sunModel.timeStamp == null ||
sunModel.nonceStr == null) {
Utils.showToast('支付参数异常');
return;
}
final String prepayId = sunModel.package!.substring(10);
final Map<String, String?> signParams = {
'appid': sunModel.appId,
'partnerid': '1489752232',
'prepayid': prepayId,
'timestamp': sunModel.timeStamp,
'noncestr': sunModel.nonceStr,
'package': 'Sign=WXPay',
};
final String sign = Utils.keySort(signParams);
_fluwx
.pay(
which: Payment(
appId: sunModel.appId!,
partnerId: '1489752232',
prepayId: prepayId,
packageValue: 'Sign=WXPay',
nonceStr: sunModel.nonceStr!,
timestamp: int.parse(sunModel.timeStamp!),
sign: sign,
),
)
.then((data) {
print('version pay: $data');
}).catchError((error) {
print(error.toString());
Utils.showToast('支付调起失败');
});
}
Future<void> _handlePaySuccess() async {
Utils.showToast('购买成功');
await widget.collectStoreProvider
.refreshSellerVersion(context, showLoading: false);
EventBus().emit('refreshSellerVersion');
if (!mounted) {
return;
}
if (Navigator.canPop(context)) {
Navigator.pop(context);
}
}
String _formatPrice(double price) {
if (price == price.roundToDouble()) {
return price.toInt().toString();
}
return price.toStringAsFixed(2);
}
@override
void dispose() {
_wxPay.cancel();
EventBus().emit('changeStatusColor');
super.dispose();
}
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: MyColours.color_F0F0F0,
appBar: SystemAppBar('功能升级'),
body: Column(
children: [
Expanded(child: _buildBody()),
_buildBottomBar(),
],
),
);
}
Widget _buildBody() {
if (_loading) {
return const Center(
child: CircularProgressIndicator(color: MyColours.color_529EA4),
);
}
return SingleChildScrollView(
padding: EdgeInsets.all(ScreenUtil().setWidth(24)),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
width: double.infinity,
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(24),
vertical: ScreenUtil().setWidth(18),
),
decoration: BoxDecoration(
color: MyColours.color_529EA4,
borderRadius: BorderRadius.circular(
ScreenUtil().setWidth(10),
),
),
child: Text(
'请选择购买的组件模块,所有模块购买激活后均有一年有效期。',
style: TextStyle(
color: MyColours.color_ffffff,
fontSize: ScreenUtil().setSp(26),
height: 1.5,
),
),
),
SizedBox(height: ScreenUtil().setWidth(24)),
if (_loadFailed)
_buildRetry()
else if (_modules.isEmpty)
_buildEmpty()
else
for (int index = 0; index < _modules.length; index++)
_buildModuleCard(index),
],
),
);
}
Widget _buildRetry() {
return Container(
width: double.infinity,
padding: EdgeInsets.symmetric(vertical: ScreenUtil().setWidth(80)),
alignment: Alignment.center,
child: Column(
children: [
Text(
'加载失败,请稍后重试',
style: TextStyle(
color: MyColours.color_999999,
fontSize: ScreenUtil().setSp(26),
),
),
SizedBox(height: ScreenUtil().setWidth(24)),
GestureDetector(
onTap: _loadModules,
child: Container(
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(40),
vertical: ScreenUtil().setWidth(16),
),
decoration: BoxDecoration(
color: MyColours.color_529EA4,
borderRadius: BorderRadius.circular(
ScreenUtil().setWidth(8),
),
),
child: Text(
'重新加载',
style: TextStyle(
color: MyColours.color_ffffff,
fontSize: ScreenUtil().setSp(26),
),
),
),
),
],
),
);
}
Widget _buildEmpty() {
return Container(
width: double.infinity,
padding: EdgeInsets.symmetric(vertical: ScreenUtil().setWidth(80)),
alignment: Alignment.center,
child: Text(
'暂无可升级的功能',
style: TextStyle(
color: MyColours.color_999999,
fontSize: ScreenUtil().setSp(26),
),
),
);
}
Widget _buildModuleCard(int index) {
final _UpgradeModule module = _modules[index];
final bool selected = module.selected;
return GestureDetector(
onTap: () => _toggleModule(index),
child: Container(
margin: EdgeInsets.only(bottom: ScreenUtil().setWidth(20)),
padding: EdgeInsets.all(ScreenUtil().setWidth(24)),
decoration: BoxDecoration(
color: MyColours.color_ffffff,
borderRadius: BorderRadius.circular(ScreenUtil().setWidth(12)),
border: Border.all(
color: selected ? MyColours.color_529EA4 : MyColours.color_d9d9d9,
width: ScreenUtil().setWidth(2),
),
),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Image.asset(
Utils.getImgPath(selected ? 'base_radio_sel' : 'base_radio_un'),
width: ScreenUtil().setWidth(36),
height: ScreenUtil().setWidth(36),
),
SizedBox(width: ScreenUtil().setWidth(18)),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: Text(
module.name,
style: TextStyle(
color: MyColours.color_353535,
fontSize: ScreenUtil().setSp(30),
fontWeight: FontWeight.bold,
),
),
),
SizedBox(width: ScreenUtil().setWidth(16)),
Text(
'¥${_formatPrice(module.price)}',
style: TextStyle(
color: MyColours.color_529EA4,
fontSize: ScreenUtil().setSp(30),
fontWeight: FontWeight.bold,
),
),
],
),
SizedBox(height: ScreenUtil().setWidth(12)),
Text(
module.desc,
style: TextStyle(
color: MyColours.color_999999,
fontSize: ScreenUtil().setSp(24),
height: 1.4,
),
),
],
),
),
],
),
),
);
}
Widget _buildBottomBar() {
return Container(
color: const Color(0xFF98C0C8),
padding: EdgeInsets.fromLTRB(
ScreenUtil().setWidth(24),
ScreenUtil().setWidth(16),
ScreenUtil().setWidth(24),
ScreenUtil().setWidth(16),
),
child: SafeArea(
top: false,
child: Row(
children: [
Text(
'¥${_formatPrice(_total)}',
style: TextStyle(
color: MyColours.color_ffffff,
fontSize: ScreenUtil().setSp(36),
fontWeight: FontWeight.bold,
),
),
const Spacer(),
GestureDetector(
onTap: _hasSelection ? _pay : null,
child: Container(
width: ScreenUtil().setWidth(220),
height: ScreenUtil().setWidth(78),
alignment: Alignment.center,
decoration: BoxDecoration(
color: MyColours.color_ffffff,
borderRadius:
BorderRadius.circular(ScreenUtil().setWidth(39)),
),
child: Text(
'立即支付',
style: TextStyle(
color: _hasSelection
? MyColours.color_515151
: MyColours.color_999999,
fontSize: ScreenUtil().setSp(30),
fontWeight: FontWeight.bold,
),
),
),
),
],
),
),
);
}
}
class _UpgradeModule {
_UpgradeModule({
required this.vid,
required this.name,
required this.desc,
required this.price,
});
final String vid;
final String name;
final String desc;
final double price;
bool selected = false;
}
... ...
... ... @@ -29,6 +29,7 @@ import 'package:one_key/widgets/h_empty_view.dart';
import 'package:one_key/widgets/my_item.dart';
import 'package:one_key/widgets/round_button.dart';
import 'package:one_key/widgets/v_empty_view.dart';
import 'package:one_key/pages/my/function_upgrade_page.dart';
import 'package:provider/provider.dart';
import '../../app.dart';
... ... @@ -135,6 +136,10 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver {
_getCustomerActivityBaseinfo();
// getMyPageCountData();
});
EventBus().on('refreshSellerVersion', (arg) {
getSellerVersion();
getMyPageCountData();
});
}
@override
... ... @@ -146,6 +151,7 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver {
EventBus().off('refreshMySms');
EventBus().off('refreshMyImage');
EventBus().off('refreshSellerVersion');
}
@override
... ... @@ -2331,6 +2337,41 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver {
],
)),
VEmptyView(48),
InkWell(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (_) => FunctionUpgradePage(
collectStoreProvider:
collectStoreProvider),
),
);
},
child: Row(
children: [
Image.asset(
Utils.getImgPath('bbsj'),
width: ScreenUtil().setWidth(22 * 2),
),
HEmptyView(26),
Text(
'功能升级',
style: TextStyle(
fontWeight: FontWeight.bold,
color: MyColours.color_515151,
fontSize:
ScreenUtil().setWidth(28)),
),
Spacer(),
Image.asset(
"assets/arrow_right_new.png",
width: ScreenUtil().setWidth(14),
height: ScreenUtil().setWidth(22),
)
],
)),
VEmptyView(48),
Consumer<UserModel>(
builder: (BuildContext context, UserModel model,
Widget? child) {
... ...
... ... @@ -166,6 +166,9 @@ class HomePageSimState extends State<HomePageSim> with WidgetsBindingObserver {
// }
WidgetsBinding.instance.addObserver(this);
EventBus().on('refreshSellerVersion', (arg) {
getSellerVersion();
});
_currIndex = widget.initialIndex;
... ... @@ -2066,6 +2069,7 @@ class HomePageSimState extends State<HomePageSim> with WidgetsBindingObserver {
LogUtil.v("home_dispose");
// bus.off('refresh_token');
EventBus().off('refreshSellerVersion');
if (timer != null) {
timer!.cancel();
}
... ...
... ... @@ -28,6 +28,7 @@ import 'package:one_key/widgets/h_empty_view.dart';
import 'package:one_key/widgets/my_item.dart';
import 'package:one_key/widgets/round_button.dart';
import 'package:one_key/widgets/v_empty_view.dart';
import 'package:one_key/pages/my/function_upgrade_page.dart';
import 'package:provider/provider.dart';
import '../../app.dart';
... ... @@ -131,6 +132,10 @@ class MyPageSimState extends State<MyPageSim> with WidgetsBindingObserver {
EventBus().on('refreshMySms', (arg) {
getMyPageCountData();
});
EventBus().on('refreshSellerVersion', (arg) {
getSellerVersion();
getMyPageCountData();
});
}
void wxSubscriptionClose() => _wxPay?.cancel();
... ... @@ -142,6 +147,7 @@ class MyPageSimState extends State<MyPageSim> with WidgetsBindingObserver {
// AzhonAppUpdate.dispose();
EventBus().off('changeStatusColor');
EventBus().off('refreshMySms');
EventBus().off('refreshSellerVersion');
wxSubscriptionClose();
}
... ... @@ -1799,6 +1805,41 @@ class MyPageSimState extends State<MyPageSim> with WidgetsBindingObserver {
],
)),
VEmptyView(48),
InkWell(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (_) => FunctionUpgradePage(
collectStoreProvider:
collectStoreProvider),
),
);
},
child: Row(
children: [
Image.asset(
Utils.getImgPath('bbsj'),
width: ScreenUtil().setWidth(28 * 2),
),
HEmptyView(26),
Text(
'功能升级',
style: TextStyle(
fontWeight: FontWeight.bold,
color: MyColours.color_515151,
fontSize:
ScreenUtil().setWidth(28)),
),
Spacer(),
Image.asset(
"assets/arrow_right_new.png",
width: ScreenUtil().setWidth(14),
height: ScreenUtil().setWidth(22),
)
],
)),
VEmptyView(48),
Consumer<UserModel>(
builder: (BuildContext context, UserModel model,
Widget? child) {
... ...
... ... @@ -739,6 +739,71 @@ class CollectStoreProvider with ChangeNotifier {
}
}
// 获取功能升级页可购买的版本/模块列表
Future<List<SellerVersionSunModel>?> getFunctionUpgradeList(
BuildContext context,
{bool showLoading = true}) async {
try {
final BaseResp<dynamic> baseResp = await DioUtil().request<dynamic>(
context, Method.post, HttpUrl.get_version_list,
data: const <String, String?>{}, showLoading: showLoading);
if (baseResp.code == Constant.status_success) {
final Map<String, dynamic> response =
baseResp.responseData as Map<String, dynamic>;
final List<dynamic>? rawList = response['data'] as List<dynamic>?;
final List<SellerVersionSunModel> list = <SellerVersionSunModel>[];
if (rawList != null) {
for (final item in rawList) {
if (item is! Map) {
continue;
}
final Map<String, dynamic> map = Map<String, dynamic>.from(item);
final dynamic id = map['id'];
final dynamic name = map['name'];
if (id == null || name == null) {
continue;
}
list.add(SellerVersionSunModel(
vid: '$id',
vname: '$name',
vtype: map['type'] == null ? null : '${map['type']}',
price: map['price'] is num
? (map['price'] as num).toDouble()
: double.tryParse('${map['price']}'),
));
}
}
return list;
}
Utils.showToast(baseResp.msg ?? '请求失败,请重试');
} catch (error) {
print(error.toString());
Utils.showToast('请求失败,请重试');
}
return null;
}
// 刷新商家版本信息,并同步通知依赖页面的 UI。
Future<bool> refreshSellerVersion(BuildContext context,
{bool showLoading = true}) async {
final bool success =
await getSellerVersion(context, showLoading: showLoading);
final user = Provider.of<UserModel>(context, listen: false).user;
if (user != null) {
final Map<String, String?> params = {
'sellerid': user.sellerid,
};
if (Utils.getAuthority(context, '个人-月订单量')) {
params['uid'] = user.openid;
}
await getMyPageCountData(context, params, showLoading: showLoading);
}
notifyListeners();
return success;
}
/// App调起支付(购买版本)
Future<bool> appPayJiSuVersion(
BuildContext context, Map<String, String?> params,
... ...
import 'dart:async';
import 'dart:ui';
import 'package:cached_network_image/cached_network_image.dart';
... ... @@ -14,12 +13,12 @@ import 'package:flutter_lunar_datetime_picker/flutter_lunar_datetime_picker.dart
import 'package:flutter_picker_plus/flutter_picker_plus.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:one_key/models/filter_btn_model.dart';
import 'package:one_key/models/remark.dart';
import 'package:one_key/models/seller_role_model.dart';
import 'package:one_key/models/table_list.dart';
import 'package:one_key/pages/my/function_upgrade_page.dart';
import 'package:one_key/pages/message/message_dialog_item_f.dart';
import 'package:one_key/provider/message_dialog_model.dart';
... ... @@ -78,6 +77,18 @@ typedef ClickkListCallbac = void Function(List<String?> value);
// };
class DialogUtil {
static void goFunctionUpgradePage(BuildContext context) {
final CollectStoreProvider collectStoreProvider =
Provider.of<CollectStoreProvider>(context, listen: false);
Navigator.push(
context,
MaterialPageRoute(
builder: (_) =>
FunctionUpgradePage(collectStoreProvider: collectStoreProvider),
),
);
}
static List<Widget> labelSelectBtn(List<CustomerLabelSunModel> labelList,
state, List<String?> datas, ClickkListCallbac callback) {
List<Widget> temp = [];
... ... @@ -1084,6 +1095,7 @@ class DialogUtil {
static showSellerVersionEdateDialog(BuildContext context,
List<SellerVersionSunModel> showData, CustomCallBack callback,
{GestureTapCallback? onTapLeft, GestureTapCallback? onTapRight}) {
final BuildContext outerContext = context;
List<String?> names = showData.map((e) => e.vname).toList();
ScrollController controller = ScrollController();
return showDialog(
... ... @@ -1204,17 +1216,12 @@ class DialogUtil {
MyDivider(double.infinity, w(1),
color: MyColours.color_DBDBDB),
Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(
flex: 1,
child: RoundButton(
text: '确定',
// width: (ScreenUtil().screenWidth -
// ScreenUtil().setWidth(62) * 2) /
// 2,
height: ScreenUtil().setWidth(112),
// radius: ScreenUtil().setWidth(10),
gradientStart: Colors.transparent,
gradientEnd: Colors.transparent,
textColor: MyColours.color_515151,
... ... @@ -1225,6 +1232,25 @@ class DialogUtil {
Navigator.pop(context);
}
})),
MyDivider(ScreenUtil().setWidth(2),
ScreenUtil().setWidth(112),
color: MyColours.color_DBDBDB),
Expanded(
flex: 1,
child: RoundButton(
text: '去购买',
height: ScreenUtil().setWidth(112),
gradientStart: Colors.transparent,
gradientEnd: Colors.transparent,
textColor: MyColours.color_438E93,
fontSize: 32,
onPressed: () {
if (Navigator.canPop(context)) {
Navigator.pop(context);
}
DialogUtil.goFunctionUpgradePage(
outerContext);
})),
],
),
])));
... ... @@ -1419,6 +1445,7 @@ class DialogUtil {
static showSellerVersionBuyDialog(
BuildContext context, String title, CustomCallBack callback,
{GestureTapCallback? onTapLeft, GestureTapCallback? onTapRight}) {
final BuildContext outerContext = context;
return showDialog(
context: context,
barrierDismissible: true,
... ... @@ -1501,41 +1528,25 @@ class DialogUtil {
Navigator.pop(context);
}
})),
// MyDivider(ScreenUtil().setWidth(2),
// ScreenUtil().setWidth(112),
// color: MyColours.color_DBDBDB),
// Expanded(
// flex: 1,
// child: RoundButton(
// text: '前往开通',
// // width: (ScreenUtil().screenWidth -
// // ScreenUtil().setWidth(62) * 2) /
// // 2,
// height: ScreenUtil().setWidth(112),
// // radius: ScreenUtil().setWidth(10),
// gradientStart: Colors.transparent,
// gradientEnd: Colors.transparent,
// textColor: MyColours.color_438E93,
// fontSize: 32,
// onPressed: () {
// // Navigator.pop(context, {
// // 'spec': menuSunModel.specCan != null &&
// // menuSunModel.specCan.length > 0
// // ? menuSunModel.specCan
// // .where((element) =>
// // element.select == true)
// // .toList()
// // : [],
// // 'practice': menuSunModel.practice !=
// // null &&
// // menuSunModel.practice.length > 0
// // ? menuSunModel.practice
// // .where((element) =>
// // element.select == true)
// // .toList()
// // : []
// // });
// })),
MyDivider(ScreenUtil().setWidth(2),
ScreenUtil().setWidth(112),
color: MyColours.color_DBDBDB),
Expanded(
flex: 1,
child: RoundButton(
text: '去购买',
height: ScreenUtil().setWidth(112),
gradientStart: Colors.transparent,
gradientEnd: Colors.transparent,
textColor: MyColours.color_438E93,
fontSize: 32,
onPressed: () {
if (Navigator.canPop(context)) {
Navigator.pop(context);
}
DialogUtil.goFunctionUpgradePage(
outerContext);
})),
],
),
])));
... ... @@ -11364,6 +11375,7 @@ class DialogUtil {
VoidCallback? lCallback,
VoidCallback? rCallback}) async {
// bool isRed = content != '' ? false : true;
final BuildContext outerContext = context;
final action = await showDialog(
context: context,
barrierDismissible: false,
... ... @@ -11450,15 +11462,13 @@ class DialogUtil {
// Navigator.pop(context);
// }),
Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
RoundButton(
text: lTitle,
width: (ScreenUtil().screenWidth -
ScreenUtil().setWidth(62) * 2) /
2,
3,
height: ScreenUtil().setWidth(112),
// radius: ScreenUtil().setWidth(10),
gradientStart: Colors.transparent,
gradientEnd: Colors.transparent,
textColor: MyColours.color_E6000000,
... ... @@ -11476,9 +11486,8 @@ class DialogUtil {
text: rTitle,
width: (ScreenUtil().screenWidth -
ScreenUtil().setWidth(62) * 2) /
2,
3,
height: ScreenUtil().setWidth(112),
// radius: ScreenUtil().setWidth(10),
gradientStart: Colors.transparent,
gradientEnd: Colors.transparent,
textColor: MyColours.color_438E93,
... ... @@ -11489,6 +11498,26 @@ class DialogUtil {
Navigator.pop(context);
}
}),
MyDivider(ScreenUtil().setWidth(2),
ScreenUtil().setWidth(112),
color: MyColours.color_f3f3f3),
RoundButton(
text: '去购买',
width: (ScreenUtil().screenWidth -
ScreenUtil().setWidth(62) * 2) /
3,
height: ScreenUtil().setWidth(112),
gradientStart: Colors.transparent,
gradientEnd: Colors.transparent,
textColor: MyColours.color_438E93,
fontSize: 32,
onPressed: () {
if (Navigator.canPop(context)) {
Navigator.pop(context);
}
DialogUtil.goFunctionUpgradePage(
outerContext);
}),
],
)
],
... ... @@ -11507,7 +11536,7 @@ class DialogUtil {
{String title = "",
String content = "内容",
String lTitle = "我知道了",
String rTitle = "立即续费",
String rTitle = "去购买",
Color rColor = MyColours.color_438E93,
bool isBold = false,
bool isBoldContent = false,
... ... @@ -11515,6 +11544,7 @@ class DialogUtil {
VoidCallback? lCallback,
VoidCallback? rCallback}) async {
// bool isRed = content != '' ? false : true;
final BuildContext outerContext = context;
final action = await showDialog(
context: context,
barrierDismissible: false,
... ... @@ -11586,62 +11616,46 @@ class DialogUtil {
VEmptyView(66),
MyDivider(double.infinity, ScreenUtil().setWidth(2),
color: MyColours.color_f3f3f3),
RoundButton(
text: lTitle,
width: (ScreenUtil().screenWidth -
ScreenUtil().setWidth(62) * 2),
height: ScreenUtil().setWidth(112),
// radius: ScreenUtil().setWidth(10),
gradientStart: Colors.transparent,
gradientEnd: Colors.transparent,
textColor: MyColours.color_E6000000,
isBold: false,
fontSize: 32,
onPressed: () {
if (Navigator.canPop(context)) {
Navigator.pop(context);
}
}),
// Row(
// // mainAxisAlignment: MainAxisAlignment.spaceBetween,
// children: [
// RoundButton(
// text: lTitle,
// width: (ScreenUtil().screenWidth -
// ScreenUtil().setWidth(62) * 2) /
// 2,
// height: ScreenUtil().setWidth(112),
// // radius: ScreenUtil().setWidth(10),
// gradientStart: Colors.transparent,
// gradientEnd: Colors.transparent,
// textColor: MyColours.color_E6000000,
// isBold: false,
// fontSize: 32,
// onPressed: () {
// Navigator.pop(context);
// }),
// MyDivider(ScreenUtil().setWidth(2),
// ScreenUtil().setWidth(112),
// color: MyColours.color_f3f3f3),
// RoundButton(
// text: rTitle,
// width: (ScreenUtil().screenWidth -
// ScreenUtil().setWidth(62) * 2) /
// 2,
// height: ScreenUtil().setWidth(112),
// // radius: ScreenUtil().setWidth(10),
// gradientStart: Colors.transparent,
// gradientEnd: Colors.transparent,
// textColor: MyColours.color_438E93,
// fontSize: 32,
// onPressed: () {
// rCallback();
// Navigator.pop(
// context,
// );
// }),
// ],
// )
Row(
children: [
RoundButton(
text: lTitle,
width: (ScreenUtil().screenWidth -
ScreenUtil().setWidth(62) * 2) /
2,
height: ScreenUtil().setWidth(112),
gradientStart: Colors.transparent,
gradientEnd: Colors.transparent,
textColor: MyColours.color_E6000000,
isBold: false,
fontSize: 32,
onPressed: () {
if (Navigator.canPop(context)) {
Navigator.pop(context);
}
}),
MyDivider(ScreenUtil().setWidth(2),
ScreenUtil().setWidth(112),
color: MyColours.color_f3f3f3),
RoundButton(
text: rTitle,
width: (ScreenUtil().screenWidth -
ScreenUtil().setWidth(62) * 2) /
2,
height: ScreenUtil().setWidth(112),
gradientStart: Colors.transparent,
gradientEnd: Colors.transparent,
textColor: MyColours.color_438E93,
fontSize: 32,
onPressed: () {
if (Navigator.canPop(context)) {
Navigator.pop(context);
}
DialogUtil.goFunctionUpgradePage(
outerContext);
}),
],
)
],
),
),
... ... @@ -11666,6 +11680,7 @@ class DialogUtil {
VoidCallback? lCallback,
VoidCallback? rCallback}) async {
// bool isRed = content != '' ? false : true;
final BuildContext outerContext = context;
final action = await showDialog(
context: context,
barrierDismissible: false,
... ... @@ -11747,15 +11762,13 @@ class DialogUtil {
// lCallback();
// }),
Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
RoundButton(
text: lTitle,
width: (ScreenUtil().screenWidth -
ScreenUtil().setWidth(62) * 2) /
2,
3,
height: ScreenUtil().setWidth(112),
// radius: ScreenUtil().setWidth(10),
gradientStart: Colors.transparent,
gradientEnd: Colors.transparent,
textColor: MyColours.color_E6000000,
... ... @@ -11774,9 +11787,8 @@ class DialogUtil {
text: rTitle,
width: (ScreenUtil().screenWidth -
ScreenUtil().setWidth(62) * 2) /
2,
3,
height: ScreenUtil().setWidth(112),
// radius: ScreenUtil().setWidth(10),
gradientStart: Colors.transparent,
gradientEnd: Colors.transparent,
textColor: MyColours.color_438E93,
... ... @@ -11787,6 +11799,26 @@ class DialogUtil {
Navigator.pop(context);
}
}),
MyDivider(ScreenUtil().setWidth(2),
ScreenUtil().setWidth(112),
color: MyColours.color_f3f3f3),
RoundButton(
text: '去购买',
width: (ScreenUtil().screenWidth -
ScreenUtil().setWidth(62) * 2) /
3,
height: ScreenUtil().setWidth(112),
gradientStart: Colors.transparent,
gradientEnd: Colors.transparent,
textColor: MyColours.color_438E93,
fontSize: 32,
onPressed: () {
if (Navigator.canPop(context)) {
Navigator.pop(context);
}
DialogUtil.goFunctionUpgradePage(
outerContext);
}),
],
)
],
... ... @@ -11805,7 +11837,7 @@ class DialogUtil {
{String title = "",
String content = "内容",
String lTitle = "我知道了",
String rTitle = "立即续费",
String rTitle = "去购买",
Color rColor = MyColours.color_438E93,
bool isBold = false,
bool isBoldContent = false,
... ... @@ -11813,6 +11845,7 @@ class DialogUtil {
VoidCallback? lCallback,
VoidCallback? rCallback}) async {
// bool isRed = content != '' ? false : true;
final BuildContext outerContext = context;
final action = await showDialog(
context: context,
barrierDismissible: false,
... ... @@ -11878,64 +11911,47 @@ class DialogUtil {
VEmptyView(66),
MyDivider(double.infinity, ScreenUtil().setWidth(2),
color: MyColours.color_f3f3f3),
RoundButton(
text: lTitle,
width: (ScreenUtil().screenWidth -
ScreenUtil().setWidth(62) * 2),
height: ScreenUtil().setWidth(112),
// radius: ScreenUtil().setWidth(10),
gradientStart: Colors.transparent,
gradientEnd: Colors.transparent,
textColor: MyColours.color_E6000000,
isBold: false,
fontSize: 32,
onPressed: () {
if (Navigator.canPop(context)) {
Navigator.pop(context);
}
lCallback!();
}),
// Row(
// // mainAxisAlignment: MainAxisAlignment.spaceBetween,
// children: [
// RoundButton(
// text: lTitle,
// width: (ScreenUtil().screenWidth -
// ScreenUtil().setWidth(62) * 2) /
// 2,
// height: ScreenUtil().setWidth(112),
// // radius: ScreenUtil().setWidth(10),
// gradientStart: Colors.transparent,
// gradientEnd: Colors.transparent,
// textColor: MyColours.color_E6000000,
// isBold: false,
// fontSize: 32,
// onPressed: () {
// Navigator.pop(context);
// lCallback();
// }),
// MyDivider(ScreenUtil().setWidth(2),
// ScreenUtil().setWidth(112),
// color: MyColours.color_f3f3f3),
// RoundButton(
// text: rTitle,
// width: (ScreenUtil().screenWidth -
// ScreenUtil().setWidth(62) * 2) /
// 2,
// height: ScreenUtil().setWidth(112),
// // radius: ScreenUtil().setWidth(10),
// gradientStart: Colors.transparent,
// gradientEnd: Colors.transparent,
// textColor: MyColours.color_438E93,
// fontSize: 32,
// onPressed: () {
// rCallback();
// Navigator.pop(
// context,
// );
// }),
// ],
// )
Row(
children: [
RoundButton(
text: lTitle,
width: (ScreenUtil().screenWidth -
ScreenUtil().setWidth(62) * 2) /
2,
height: ScreenUtil().setWidth(112),
gradientStart: Colors.transparent,
gradientEnd: Colors.transparent,
textColor: MyColours.color_E6000000,
isBold: false,
fontSize: 32,
onPressed: () {
if (Navigator.canPop(context)) {
Navigator.pop(context);
}
lCallback?.call();
}),
MyDivider(ScreenUtil().setWidth(2),
ScreenUtil().setWidth(112),
color: MyColours.color_f3f3f3),
RoundButton(
text: rTitle,
width: (ScreenUtil().screenWidth -
ScreenUtil().setWidth(62) * 2) /
2,
height: ScreenUtil().setWidth(112),
gradientStart: Colors.transparent,
gradientEnd: Colors.transparent,
textColor: MyColours.color_438E93,
fontSize: 32,
onPressed: () {
if (Navigator.canPop(context)) {
Navigator.pop(context);
}
DialogUtil.goFunctionUpgradePage(
outerContext);
}),
],
)
],
),
),
... ... @@ -13414,5 +13430,4 @@ class DialogUtil {
},
);
}
}
... ...
package io.flutter.plugins;
import androidx.annotation.Keep;
import androidx.annotation.NonNull;
import io.flutter.Log;
import io.flutter.embedding.engine.FlutterEngine;
/**
* Generated file. Do not edit.
* This file is generated by the Flutter tool based on the
* plugins that support the Android platform.
*/
@Keep
public final class GeneratedPluginRegistrant {
private static final String TAG = "GeneratedPluginRegistrant";
public static void registerWith(@NonNull FlutterEngine flutterEngine) {
try {
flutterEngine.getPlugins().add(new com.example.flutter_sms.FlutterSmsPlugin());
} catch (Exception e) {
Log.e(TAG, "Error registering plugin flutter_sms, com.example.flutter_sms.FlutterSmsPlugin", e);
}
try {
flutterEngine.getPlugins().add(new io.flutter.plugins.urllauncher.UrlLauncherPlugin());
} catch (Exception e) {
Log.e(TAG, "Error registering plugin url_launcher_android, io.flutter.plugins.urllauncher.UrlLauncherPlugin", e);
}
}
}
... ...
sdk.dir=/Users/wangdongni/Library/Android/sdk
flutter.sdk=/Users/wangdongni/fvm/versions/custom_3.27.5_ohos_1.0.6
\ No newline at end of file
... ...
// This is a generated file; do not edit or check into version control.
FLUTTER_ROOT=/Users/wangdongni/fvm/versions/custom_3.27.5_ohos_1.0.6
FLUTTER_APPLICATION_PATH=/Users/wangdongni/Desktop/Flutter-ReserveApp/library/fluttertpc_flutter_sms-b91cabe9da18110ddf67e9114083b7699cdec588/example
COCOAPODS_PARALLEL_CODE_SIGN=true
FLUTTER_TARGET=lib/main.dart
FLUTTER_BUILD_DIR=build
FLUTTER_BUILD_NAME=1.0.0
FLUTTER_BUILD_NUMBER=1
EXCLUDED_ARCHS[sdk=iphonesimulator*]=i386
EXCLUDED_ARCHS[sdk=iphoneos*]=armv7
DART_OBFUSCATION=false
TRACK_WIDGET_CREATION=true
TREE_SHAKE_ICONS=false
PACKAGE_CONFIG=.dart_tool/package_config.json
... ...
#!/bin/sh
# This is a generated file; do not edit or check into version control.
export "FLUTTER_ROOT=/Users/wangdongni/fvm/versions/custom_3.27.5_ohos_1.0.6"
export "FLUTTER_APPLICATION_PATH=/Users/wangdongni/Desktop/Flutter-ReserveApp/library/fluttertpc_flutter_sms-b91cabe9da18110ddf67e9114083b7699cdec588/example"
export "COCOAPODS_PARALLEL_CODE_SIGN=true"
export "FLUTTER_TARGET=lib/main.dart"
export "FLUTTER_BUILD_DIR=build"
export "FLUTTER_BUILD_NAME=1.0.0"
export "FLUTTER_BUILD_NUMBER=1"
export "DART_OBFUSCATION=false"
export "TRACK_WIDGET_CREATION=true"
export "TREE_SHAKE_ICONS=false"
export "PACKAGE_CONFIG=.dart_tool/package_config.json"
... ...
//
// Generated file. Do not edit.
//
// clang-format off
#ifndef GeneratedPluginRegistrant_h
#define GeneratedPluginRegistrant_h
#import <Flutter/Flutter.h>
NS_ASSUME_NONNULL_BEGIN
@interface GeneratedPluginRegistrant : NSObject
+ (void)registerWithRegistry:(NSObject<FlutterPluginRegistry>*)registry;
@end
NS_ASSUME_NONNULL_END
#endif /* GeneratedPluginRegistrant_h */
... ...
//
// Generated file. Do not edit.
//
// clang-format off
#import "GeneratedPluginRegistrant.h"
#if __has_include(<flutter_sms/FlutterSmsPlugin.h>)
#import <flutter_sms/FlutterSmsPlugin.h>
#else
@import flutter_sms;
#endif
#if __has_include(<url_launcher_ios/URLLauncherPlugin.h>)
#import <url_launcher_ios/URLLauncherPlugin.h>
#else
@import url_launcher_ios;
#endif
@implementation GeneratedPluginRegistrant
+ (void)registerWithRegistry:(NSObject<FlutterPluginRegistry>*)registry {
[FlutterSmsPlugin registerWithRegistrar:[registry registrarForPlugin:@"FlutterSmsPlugin"]];
[URLLauncherPlugin registerWithRegistrar:[registry registrarForPlugin:@"URLLauncherPlugin"]];
}
@end
... ...
//
// Generated file. Do not edit.
//
import FlutterMacOS
import Foundation
import url_launcher_macos
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin"))
}
... ...
// This is a generated file; do not edit or check into version control.
FLUTTER_ROOT=/Users/wangdongni/fvm/versions/custom_3.27.5_ohos_1.0.6
FLUTTER_APPLICATION_PATH=/Users/wangdongni/Desktop/Flutter-ReserveApp/library/fluttertpc_flutter_sms-b91cabe9da18110ddf67e9114083b7699cdec588/example
COCOAPODS_PARALLEL_CODE_SIGN=true
FLUTTER_BUILD_DIR=build
FLUTTER_BUILD_NAME=1.0.0
FLUTTER_BUILD_NUMBER=1
DART_OBFUSCATION=false
TRACK_WIDGET_CREATION=true
TREE_SHAKE_ICONS=false
PACKAGE_CONFIG=.dart_tool/package_config.json
... ...
#!/bin/sh
# This is a generated file; do not edit or check into version control.
export "FLUTTER_ROOT=/Users/wangdongni/fvm/versions/custom_3.27.5_ohos_1.0.6"
export "FLUTTER_APPLICATION_PATH=/Users/wangdongni/Desktop/Flutter-ReserveApp/library/fluttertpc_flutter_sms-b91cabe9da18110ddf67e9114083b7699cdec588/example"
export "COCOAPODS_PARALLEL_CODE_SIGN=true"
export "FLUTTER_BUILD_DIR=build"
export "FLUTTER_BUILD_NAME=1.0.0"
export "FLUTTER_BUILD_NUMBER=1"
export "DART_OBFUSCATION=false"
export "TRACK_WIDGET_CREATION=true"
export "TREE_SHAKE_ICONS=false"
export "PACKAGE_CONFIG=.dart_tool/package_config.json"
... ...
hwsdk.dir=/Applications/DevEco-Studio.app/Contents/sdk
flutter.sdk=/Users/wangdongni/fvm/versions/custom_3.27.5_ohos_1.0.6
\ No newline at end of file
... ...
# Generated by pub
# See https://dart.dev/tools/pub/glossary#lockfile
packages:
async:
dependency: transitive
description:
name: async
sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c"
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.11.0"
boolean_selector:
dependency: transitive
description:
name: boolean_selector
sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66"
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.1.1"
characters:
dependency: transitive
description:
name: characters
sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.3.0"
clock:
dependency: transitive
description:
name: clock
sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.1.1"
collection:
dependency: transitive
description:
name: collection
sha256: a1ace0a119f20aabc852d165077c036cd864315bd99b7eaa10a60100341941bf
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.19.0"
fake_async:
dependency: transitive
description:
name: fake_async
sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.3.1"
flutter:
dependency: "direct main"
description: flutter
source: sdk
version: "0.0.0"
flutter_sms:
dependency: "direct dev"
description:
path: ".."
relative: true
source: path
version: "2.3.3"
flutter_test:
dependency: "direct dev"
description: flutter
source: sdk
version: "0.0.0"
flutter_web_plugins:
dependency: transitive
description: flutter
source: sdk
version: "0.0.0"
leak_tracker:
dependency: transitive
description:
name: leak_tracker
sha256: "7bb2830ebd849694d1ec25bf1f44582d6ac531a57a365a803a6034ff751d2d06"
url: "https://pub.flutter-io.cn"
source: hosted
version: "10.0.7"
leak_tracker_flutter_testing:
dependency: transitive
description:
name: leak_tracker_flutter_testing
sha256: "9491a714cca3667b60b5c420da8217e6de0d1ba7a5ec322fab01758f6998f379"
url: "https://pub.flutter-io.cn"
source: hosted
version: "3.0.8"
leak_tracker_testing:
dependency: transitive
description:
name: leak_tracker_testing
sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3"
url: "https://pub.flutter-io.cn"
source: hosted
version: "3.0.1"
matcher:
dependency: transitive
description:
name: matcher
sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.12.16+1"
material_color_utilities:
dependency: transitive
description:
name: material_color_utilities
sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.11.1"
meta:
dependency: transitive
description:
name: meta
sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.15.0"
path:
dependency: transitive
description:
name: path
sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.9.0"
plugin_platform_interface:
dependency: transitive
description:
name: plugin_platform_interface
sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02"
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.1.8"
sky_engine:
dependency: transitive
description: flutter
source: sdk
version: "0.0.0"
source_span:
dependency: transitive
description:
name: source_span
sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.10.0"
stack_trace:
dependency: transitive
description:
name: stack_trace
sha256: "9f47fd3630d76be3ab26f0ee06d213679aa425996925ff3feffdec504931c377"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.12.0"
stream_channel:
dependency: transitive
description:
name: stream_channel
sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.1.2"
string_scanner:
dependency: transitive
description:
name: string_scanner
sha256: "688af5ed3402a4bde5b3a6c15fd768dbf2621a614950b17f04626c431ab3c4c3"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.3.0"
term_glyph:
dependency: transitive
description:
name: term_glyph
sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.2.1"
test_api:
dependency: transitive
description:
name: test_api
sha256: "664d3a9a64782fcdeb83ce9c6b39e78fd2971d4e37827b9b06c3aa1edc5e760c"
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.7.3"
url_launcher:
dependency: transitive
description:
name: url_launcher
sha256: f6a7e5c4835bb4e3026a04793a4199ca2d14c739ec378fdfe23fc8075d0439f8
url: "https://pub.flutter-io.cn"
source: hosted
version: "6.3.2"
url_launcher_android:
dependency: transitive
description:
name: url_launcher_android
sha256: "0aedad096a85b49df2e4725fa32118f9fa580f3b14af7a2d2221896a02cd5656"
url: "https://pub.flutter-io.cn"
source: hosted
version: "6.3.17"
url_launcher_ios:
dependency: transitive
description:
name: url_launcher_ios
sha256: "7f2022359d4c099eea7df3fdf739f7d3d3b9faf3166fb1dd390775176e0b76cb"
url: "https://pub.flutter-io.cn"
source: hosted
version: "6.3.3"
url_launcher_linux:
dependency: transitive
description:
name: url_launcher_linux
sha256: "4e9ba368772369e3e08f231d2301b4ef72b9ff87c31192ef471b380ef29a4935"
url: "https://pub.flutter-io.cn"
source: hosted
version: "3.2.1"
url_launcher_macos:
dependency: transitive
description:
name: url_launcher_macos
sha256: "17ba2000b847f334f16626a574c702b196723af2a289e7a93ffcb79acff855c2"
url: "https://pub.flutter-io.cn"
source: hosted
version: "3.2.2"
url_launcher_platform_interface:
dependency: transitive
description:
name: url_launcher_platform_interface
sha256: "552f8a1e663569be95a8190206a38187b531910283c3e982193e4f2733f01029"
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.3.2"
url_launcher_web:
dependency: transitive
description:
name: url_launcher_web
sha256: "4bd2b7b4dc4d4d0b94e5babfffbca8eac1a126c7f3d6ecbc1a11013faa3abba2"
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.4.1"
url_launcher_windows:
dependency: transitive
description:
name: url_launcher_windows
sha256: "3284b6d2ac454cf34f114e1d3319866fdd1e19cdc329999057e44ffe936cfa77"
url: "https://pub.flutter-io.cn"
source: hosted
version: "3.1.4"
vector_math:
dependency: transitive
description:
name: vector_math
sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803"
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.1.4"
vm_service:
dependency: transitive
description:
name: vm_service
sha256: f6be3ed8bd01289b34d679c2b62226f63c0e69f9fd2e50a6b3c1c729a961041b
url: "https://pub.flutter-io.cn"
source: hosted
version: "14.3.0"
web:
dependency: transitive
description:
name: web
sha256: "868d88a33d8a87b18ffc05f9f030ba328ffefba92d6c127917a2ba740f9cfe4a"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.1.1"
sdks:
dart: ">=3.6.0 <4.0.0"
flutter: ">=3.27.0"
... ...
# Generated by pub
# See https://dart.dev/tools/pub/glossary#lockfile
packages:
async:
dependency: transitive
description:
name: async
sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c"
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.11.0"
boolean_selector:
dependency: transitive
description:
name: boolean_selector
sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66"
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.1.1"
characters:
dependency: transitive
description:
name: characters
sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.3.0"
clock:
dependency: transitive
description:
name: clock
sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.1.1"
collection:
dependency: transitive
description:
name: collection
sha256: a1ace0a119f20aabc852d165077c036cd864315bd99b7eaa10a60100341941bf
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.19.0"
fake_async:
dependency: transitive
description:
name: fake_async
sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.3.1"
flutter:
dependency: "direct main"
description: flutter
source: sdk
version: "0.0.0"
flutter_test:
dependency: "direct dev"
description: flutter
source: sdk
version: "0.0.0"
flutter_web_plugins:
dependency: "direct main"
description: flutter
source: sdk
version: "0.0.0"
leak_tracker:
dependency: transitive
description:
name: leak_tracker
sha256: "7bb2830ebd849694d1ec25bf1f44582d6ac531a57a365a803a6034ff751d2d06"
url: "https://pub.flutter-io.cn"
source: hosted
version: "10.0.7"
leak_tracker_flutter_testing:
dependency: transitive
description:
name: leak_tracker_flutter_testing
sha256: "9491a714cca3667b60b5c420da8217e6de0d1ba7a5ec322fab01758f6998f379"
url: "https://pub.flutter-io.cn"
source: hosted
version: "3.0.8"
leak_tracker_testing:
dependency: transitive
description:
name: leak_tracker_testing
sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3"
url: "https://pub.flutter-io.cn"
source: hosted
version: "3.0.1"
matcher:
dependency: transitive
description:
name: matcher
sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.12.16+1"
material_color_utilities:
dependency: transitive
description:
name: material_color_utilities
sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.11.1"
meta:
dependency: transitive
description:
name: meta
sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.15.0"
path:
dependency: transitive
description:
name: path
sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.9.0"
plugin_platform_interface:
dependency: "direct main"
description:
name: plugin_platform_interface
sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02"
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.1.8"
sky_engine:
dependency: transitive
description: flutter
source: sdk
version: "0.0.0"
source_span:
dependency: transitive
description:
name: source_span
sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.10.0"
stack_trace:
dependency: transitive
description:
name: stack_trace
sha256: "9f47fd3630d76be3ab26f0ee06d213679aa425996925ff3feffdec504931c377"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.12.0"
stream_channel:
dependency: transitive
description:
name: stream_channel
sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.1.2"
string_scanner:
dependency: transitive
description:
name: string_scanner
sha256: "688af5ed3402a4bde5b3a6c15fd768dbf2621a614950b17f04626c431ab3c4c3"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.3.0"
term_glyph:
dependency: transitive
description:
name: term_glyph
sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.2.1"
test_api:
dependency: transitive
description:
name: test_api
sha256: "664d3a9a64782fcdeb83ce9c6b39e78fd2971d4e37827b9b06c3aa1edc5e760c"
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.7.3"
url_launcher:
dependency: "direct main"
description:
name: url_launcher
sha256: f6a7e5c4835bb4e3026a04793a4199ca2d14c739ec378fdfe23fc8075d0439f8
url: "https://pub.flutter-io.cn"
source: hosted
version: "6.3.2"
url_launcher_android:
dependency: transitive
description:
name: url_launcher_android
sha256: "0aedad096a85b49df2e4725fa32118f9fa580f3b14af7a2d2221896a02cd5656"
url: "https://pub.flutter-io.cn"
source: hosted
version: "6.3.17"
url_launcher_ios:
dependency: transitive
description:
name: url_launcher_ios
sha256: "7f2022359d4c099eea7df3fdf739f7d3d3b9faf3166fb1dd390775176e0b76cb"
url: "https://pub.flutter-io.cn"
source: hosted
version: "6.3.3"
url_launcher_linux:
dependency: transitive
description:
name: url_launcher_linux
sha256: "4e9ba368772369e3e08f231d2301b4ef72b9ff87c31192ef471b380ef29a4935"
url: "https://pub.flutter-io.cn"
source: hosted
version: "3.2.1"
url_launcher_macos:
dependency: transitive
description:
name: url_launcher_macos
sha256: "17ba2000b847f334f16626a574c702b196723af2a289e7a93ffcb79acff855c2"
url: "https://pub.flutter-io.cn"
source: hosted
version: "3.2.2"
url_launcher_platform_interface:
dependency: transitive
description:
name: url_launcher_platform_interface
sha256: "552f8a1e663569be95a8190206a38187b531910283c3e982193e4f2733f01029"
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.3.2"
url_launcher_web:
dependency: transitive
description:
name: url_launcher_web
sha256: "4bd2b7b4dc4d4d0b94e5babfffbca8eac1a126c7f3d6ecbc1a11013faa3abba2"
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.4.1"
url_launcher_windows:
dependency: transitive
description:
name: url_launcher_windows
sha256: "3284b6d2ac454cf34f114e1d3319866fdd1e19cdc329999057e44ffe936cfa77"
url: "https://pub.flutter-io.cn"
source: hosted
version: "3.1.4"
vector_math:
dependency: transitive
description:
name: vector_math
sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803"
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.1.4"
vm_service:
dependency: transitive
description:
name: vm_service
sha256: f6be3ed8bd01289b34d679c2b62226f63c0e69f9fd2e50a6b3c1c729a961041b
url: "https://pub.flutter-io.cn"
source: hosted
version: "14.3.0"
web:
dependency: transitive
description:
name: web
sha256: "868d88a33d8a87b18ffc05f9f030ba328ffefba92d6c127917a2ba740f9cfe4a"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.1.1"
sdks:
dart: ">=3.6.0 <4.0.0"
flutter: ">=3.27.0"
... ...
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:one_key/models/seller_version_model.dart';
import 'package:one_key/provider/collect_store_provider.dart';
import 'package:one_key/utils/dialog_util.dart';
import 'package:provider/provider.dart';
class _FakeCollectStoreProvider extends CollectStoreProvider {
@override
Future<List<SellerVersionSunModel>?> getFunctionUpgradeList(
BuildContext context, {
bool showLoading = true,
}) async {
return <SellerVersionSunModel>[];
}
}
Widget _buildTestApp(
_FakeCollectStoreProvider provider,
void Function(BuildContext context) openDialog,
) {
return ScreenUtilInit(
designSize: const Size(750, 1334),
minTextAdapt: true,
splitScreenMode: true,
builder: (context, child) {
return ChangeNotifierProvider<CollectStoreProvider>.value(
value: provider,
child: MaterialApp(
home: Scaffold(
body: Center(
child: Builder(
builder: (context) {
return TextButton(
onPressed: () => openDialog(context),
child: const Text('打开弹窗'),
);
},
),
),
),
),
);
},
);
}
Future<void> _tapAndOpenUpgrade(WidgetTester tester) async {
await tester.tap(find.text('打开弹窗'));
await tester.pumpAndSettle();
expect(find.text('去购买'), findsOneWidget);
await tester.tap(find.text('去购买'));
await tester.pump();
await tester.pump(const Duration(milliseconds: 600));
expect(find.text('功能升级'), findsOneWidget);
}
void _setPhoneViewport(WidgetTester tester) {
tester.view.physicalSize = const Size(1080, 2340);
tester.view.devicePixelRatio = 1.0;
addTearDown(() {
tester.view.physicalSize = const Size(800, 600);
tester.view.devicePixelRatio = 1.0;
});
}
void main() {
testWidgets('未购买模块弹窗可以去购买', (tester) async {
_setPhoneViewport(tester);
final provider = _FakeCollectStoreProvider();
await tester.pumpWidget(
_buildTestApp(provider, (context) {
DialogUtil.showSellerVersionBuyDialog(context, '宴会管理', (_) {});
}),
);
await _tapAndOpenUpgrade(tester);
});
testWidgets('普通版模块过期弹窗可以去购买', (tester) async {
_setPhoneViewport(tester);
final provider = _FakeCollectStoreProvider();
final showData = <SellerVersionSunModel>[
SellerVersionSunModel(
vid: '12',
vname: '宴会管理',
edate: '1798761600',
),
];
await tester.pumpWidget(
_buildTestApp(provider, (context) {
DialogUtil.showSellerVersionEdateDialog(context, showData, (_) {});
}),
);
await _tapAndOpenUpgrade(tester);
});
testWidgets('极速版模块过期弹窗可以去购买', (tester) async {
_setPhoneViewport(tester);
final provider = _FakeCollectStoreProvider();
await tester.pumpWidget(
_buildTestApp(provider, (context) {
DialogUtil.cupertinoAlertSellerEdateDialogSim(
context,
title: '温馨提示',
content: '2026-10-01',
rCallback: () {},
);
}),
);
await _tapAndOpenUpgrade(tester);
});
testWidgets('普通版店铺过期弹窗可以去购买', (tester) async {
_setPhoneViewport(tester);
final provider = _FakeCollectStoreProvider();
await tester.pumpWidget(
_buildTestApp(provider, (context) {
DialogUtil.cupertinoAlertSellerHasEdateDialog(
context,
title: '温馨提示',
lCallback: () {},
rCallback: () {},
);
}),
);
await _tapAndOpenUpgrade(tester);
});
testWidgets('极速版店铺过期弹窗可以去购买', (tester) async {
_setPhoneViewport(tester);
final provider = _FakeCollectStoreProvider();
await tester.pumpWidget(
_buildTestApp(provider, (context) {
DialogUtil.cupertinoAlertSellerHasEdateDialogSim(
context,
title: '温馨提示',
lCallback: () {},
rCallback: () {},
);
}),
);
await _tapAndOpenUpgrade(tester);
});
}
... ...
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:one_key/models/seller_version_model.dart';
import 'package:one_key/provider/collect_store_provider.dart';
import 'package:one_key/utils/dialog_util.dart';
import 'package:provider/provider.dart';
class _PreviewCollectStoreProvider extends CollectStoreProvider {
@override
Future<List<SellerVersionSunModel>?> getFunctionUpgradeList(
BuildContext context, {
bool showLoading = true,
}) async {
return <SellerVersionSunModel>[];
}
}
Widget _buildPreviewApp(
_PreviewCollectStoreProvider provider,
void Function(BuildContext context) openDialog,
) {
return ScreenUtilInit(
designSize: const Size(750, 1334),
minTextAdapt: true,
splitScreenMode: true,
builder: (context, child) {
return ChangeNotifierProvider<CollectStoreProvider>.value(
value: provider,
child: MaterialApp(
home: Scaffold(
backgroundColor: Colors.white,
body: Center(
child: Builder(
builder: (context) {
return TextButton(
onPressed: () => openDialog(context),
child: const Text('打开弹窗'),
);
},
),
),
),
),
);
},
);
}
void _setPhoneViewport(WidgetTester tester) {
tester.view.physicalSize = const Size(1080, 2340);
tester.view.devicePixelRatio = 1.0;
const MethodChannel statusBarChannel =
MethodChannel('plugins.sameer.com/statusbar');
tester.binding.defaultBinaryMessenger.setMockMethodCallHandler(
statusBarChannel,
(call) async => null,
);
addTearDown(() {
tester.view.physicalSize = const Size(800, 600);
tester.view.devicePixelRatio = 1.0;
tester.binding.defaultBinaryMessenger.setMockMethodCallHandler(
statusBarChannel,
null,
);
});
}
void main() {
testWidgets('导出未购买和跳转预览图', (tester) async {
_setPhoneViewport(tester);
final provider = _PreviewCollectStoreProvider();
await tester.pumpWidget(
_buildPreviewApp(provider, (context) {
DialogUtil.showSellerVersionBuyDialog(context, '宴会管理', (_) {});
}),
);
await tester.tap(find.text('打开弹窗'));
await tester.pumpAndSettle();
await expectLater(
find.byType(MaterialApp),
matchesGoldenFile('goldens/preview_buy_dialog.png'),
);
await tester.tap(find.text('去购买'));
await tester.pump();
await tester.pump(const Duration(milliseconds: 600));
await tester.pump(const Duration(milliseconds: 200));
await expectLater(
find.byType(MaterialApp),
matchesGoldenFile('goldens/preview_upgrade_page.png'),
);
});
testWidgets('导出普通版模块过期预览图', (tester) async {
_setPhoneViewport(tester);
final provider = _PreviewCollectStoreProvider();
final showData = <SellerVersionSunModel>[
SellerVersionSunModel(
vid: '12',
vname: '宴会管理',
edate: '1798761600',
),
];
await tester.pumpWidget(
_buildPreviewApp(provider, (context) {
DialogUtil.showSellerVersionEdateDialog(context, showData, (_) {});
}),
);
await tester.tap(find.text('打开弹窗'));
await tester.pumpAndSettle();
await expectLater(
find.byType(MaterialApp),
matchesGoldenFile('goldens/preview_expire_dialog.png'),
);
});
testWidgets('导出极速版模块过期预览图', (tester) async {
_setPhoneViewport(tester);
final provider = _PreviewCollectStoreProvider();
await tester.pumpWidget(
_buildPreviewApp(provider, (context) {
DialogUtil.cupertinoAlertSellerEdateDialogSim(
context,
title: '温馨提示',
content: '2026-10-01',
rCallback: () {},
);
}),
);
await tester.tap(find.text('打开弹窗'));
await tester.pumpAndSettle();
await expectLater(
find.byType(MaterialApp),
matchesGoldenFile('goldens/preview_sim_expire_dialog.png'),
);
});
testWidgets('导出普通版店铺过期预览图', (tester) async {
_setPhoneViewport(tester);
final provider = _PreviewCollectStoreProvider();
await tester.pumpWidget(
_buildPreviewApp(provider, (context) {
DialogUtil.cupertinoAlertSellerHasEdateDialog(
context,
title: '温馨提示',
lCallback: () {},
rCallback: () {},
);
}),
);
await tester.tap(find.text('打开弹窗'));
await tester.pumpAndSettle();
await expectLater(
find.byType(MaterialApp),
matchesGoldenFile('goldens/preview_store_expire_dialog.png'),
);
});
testWidgets('导出极速版店铺过期预览图', (tester) async {
_setPhoneViewport(tester);
final provider = _PreviewCollectStoreProvider();
await tester.pumpWidget(
_buildPreviewApp(provider, (context) {
DialogUtil.cupertinoAlertSellerHasEdateDialogSim(
context,
title: '温馨提示',
lCallback: () {},
rCallback: () {},
);
}),
);
await tester.tap(find.text('打开弹窗'));
await tester.pumpAndSettle();
await expectLater(
find.byType(MaterialApp),
matchesGoldenFile('goldens/preview_sim_store_expire_dialog.png'),
);
});
}
... ...