| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120 |
- import 'package:electronic_assistant/resource/assets.gen.dart';
- import 'package:electronic_assistant/resource/colors.gen.dart';
- import 'package:electronic_assistant/resource/string.gen.dart';
- import 'package:electronic_assistant/utils/common_style.dart';
- import 'package:flutter/cupertino.dart';
- import 'package:flutter_screenutil/flutter_screenutil.dart';
- import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
- import 'package:get/get.dart';
- void showAddDesktopShortcutDialog(
- {required void Function() onConfirm, required void Function() onCancel}) {
- SmartDialog.show(
- backType: SmartBackType.block,
- clickMaskDismiss: false,
- builder: (_) {
- return IntrinsicHeight(
- child: Column(
- children: [
- Stack(
- children: [
- Assets.images.bgDesktopShortcutHeader
- .image(width: 300.w, height: 142.w),
- Positioned(
- top: 14.w,
- right: 14.w,
- child: GestureDetector(
- onTap: () {
- onCancel.call();
- SmartDialog.dismiss();
- },
- child: Assets.images.iconDesktopShortcutClose
- .image(width: 28.w, height: 28.w),
- ),
- ),
- ],
- ),
- Container(
- decoration: BoxDecoration(
- color: ColorName.white,
- borderRadius: BorderRadius.only(
- bottomLeft: Radius.circular(12.w),
- bottomRight: Radius.circular(12.w))),
- width: 300.w,
- child: Column(
- children: [
- SizedBox(height: 24.h),
- Text(
- StringName.addDesktopShortcut.tr,
- style: TextStyle(
- fontWeight: FontWeight.bold,
- fontSize: 18.sp,
- color: ColorName.primaryTextColor),
- ),
- SizedBox(height: 6.h),
- SizedBox(
- width: 238.w,
- child: Text(
- textAlign: TextAlign.center,
- StringName.addDesktopShortcutTips.tr,
- style: TextStyle(
- fontSize: 14.sp,
- color: ColorName.secondaryTextColor),
- )),
- SizedBox(height: 33.h),
- GestureDetector(
- onTap: () {
- SmartDialog.dismiss();
- onConfirm.call();
- },
- child: Container(
- width: 268.w,
- height: 48.w,
- decoration: getCommonDecoration(8.w),
- child: Center(
- child: Text(
- StringName.addDesktopShortcutBtnTxt.tr,
- style: TextStyle(
- fontSize: 16.sp, color: ColorName.white),
- ))),
- ),
- SizedBox(height: 16.h),
- ],
- ),
- )
- ],
- ),
- );
- });
- }
- void showAddDesktopShortcutTipsDialog(
- {required void Function() onConfirm, required void Function() onDismiss}) {
- SmartDialog.show(
- onDismiss: onDismiss,
- builder: (_) {
- return IntrinsicHeight(
- child: Container(
- color: ColorName.white,
- child: Column(
- children: [
- Text(
- '添加到桌面可能会失败,需要去设置页-权限进行授权,授权后再次尝试即可',
- style: TextStyle(
- fontSize: 14.sp, color: ColorName.primaryTextColor),
- ),
- GestureDetector(
- onTap: () {
- SmartDialog.dismiss();
- onConfirm.call();
- },
- child: SizedBox(
- width: 100.w,
- height: 30.w,
- child: Center(child: Text('确认'))))
- ],
- ),
- ),
- );
- });
- }
|