1
This commit is contained in:
3
devtools_options.yaml
Normal file
3
devtools_options.yaml
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
description: This file stores settings for Dart & Flutter DevTools.
|
||||||
|
documentation: https://docs.flutter.dev/tools/devtools/extensions#configure-extension-enablement-states
|
||||||
|
extensions:
|
||||||
@@ -1,32 +1,22 @@
|
|||||||
class UserInfo {
|
class UserInfo {
|
||||||
int? id;
|
int? id;
|
||||||
String? name;
|
String? name;
|
||||||
dynamic avatar;
|
String? avatar;
|
||||||
|
String? description;
|
||||||
String? email;
|
String? email;
|
||||||
dynamic emailVerifiedAt;
|
String? googleId;
|
||||||
dynamic googleId;
|
String? appleId;
|
||||||
dynamic appleId;
|
|
||||||
String? lastLoginIp;
|
|
||||||
String? lastLoginTime;
|
|
||||||
dynamic lastUsedTime;
|
|
||||||
int? status;
|
int? status;
|
||||||
String? createdAt;
|
|
||||||
String? updatedAt;
|
|
||||||
|
|
||||||
UserInfo({
|
UserInfo({
|
||||||
this.id,
|
this.id,
|
||||||
this.name,
|
this.name,
|
||||||
this.avatar,
|
this.avatar,
|
||||||
|
this.description,
|
||||||
this.email,
|
this.email,
|
||||||
this.emailVerifiedAt,
|
|
||||||
this.googleId,
|
this.googleId,
|
||||||
this.appleId,
|
this.appleId,
|
||||||
this.lastLoginIp,
|
|
||||||
this.lastLoginTime,
|
|
||||||
this.lastUsedTime,
|
|
||||||
this.status,
|
this.status,
|
||||||
this.createdAt,
|
|
||||||
this.updatedAt,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
Map<String, dynamic> toJson() {
|
Map<String, dynamic> toJson() {
|
||||||
@@ -34,16 +24,11 @@ class UserInfo {
|
|||||||
map["id"] = id;
|
map["id"] = id;
|
||||||
map["name"] = name;
|
map["name"] = name;
|
||||||
map["avatar"] = avatar;
|
map["avatar"] = avatar;
|
||||||
|
map["description"] = description;
|
||||||
map["email"] = email;
|
map["email"] = email;
|
||||||
map["email_verified_at"] = emailVerifiedAt;
|
|
||||||
map["google_id"] = googleId;
|
map["google_id"] = googleId;
|
||||||
map["apple_id"] = appleId;
|
map["apple_id"] = appleId;
|
||||||
map["last_login_ip"] = lastLoginIp;
|
|
||||||
map["last_login_time"] = lastLoginTime;
|
|
||||||
map["last_used_time"] = lastUsedTime;
|
|
||||||
map["status"] = status;
|
map["status"] = status;
|
||||||
map["created_at"] = createdAt;
|
|
||||||
map["updated_at"] = updatedAt;
|
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -51,19 +36,38 @@ class UserInfo {
|
|||||||
id = json["id"] ?? 0;
|
id = json["id"] ?? 0;
|
||||||
name = json["name"] ?? "";
|
name = json["name"] ?? "";
|
||||||
avatar = json["avatar"];
|
avatar = json["avatar"];
|
||||||
|
description = json["description"] ?? "";
|
||||||
email = json["email"] ?? "";
|
email = json["email"] ?? "";
|
||||||
emailVerifiedAt = json["email_verified_at"];
|
|
||||||
googleId = json["google_id"];
|
googleId = json["google_id"];
|
||||||
appleId = json["apple_id"];
|
appleId = json["apple_id"];
|
||||||
lastLoginIp = json["last_login_ip"] ?? "";
|
|
||||||
lastLoginTime = json["last_login_time"] ?? "";
|
|
||||||
lastUsedTime = json["last_used_time"];
|
|
||||||
status = json["status"] ?? 0;
|
status = json["status"] ?? 0;
|
||||||
createdAt = json["created_at"] ?? "";
|
}
|
||||||
updatedAt = json["updated_at"] ?? "";
|
|
||||||
|
/// copyWith 方法
|
||||||
|
UserInfo copyWith({
|
||||||
|
int? id,
|
||||||
|
String? name,
|
||||||
|
String? avatar,
|
||||||
|
String? description,
|
||||||
|
String? email,
|
||||||
|
String? googleId,
|
||||||
|
String? appleId,
|
||||||
|
int? status,
|
||||||
|
}) {
|
||||||
|
return UserInfo(
|
||||||
|
id: id ?? this.id,
|
||||||
|
name: name ?? this.name,
|
||||||
|
avatar: avatar ?? this.avatar,
|
||||||
|
description: description ?? this.description,
|
||||||
|
email: email ?? this.email,
|
||||||
|
googleId: googleId ?? this.googleId,
|
||||||
|
appleId: appleId ?? this.appleId,
|
||||||
|
status: status ?? this.status,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
class LoginDto {
|
class LoginDto {
|
||||||
String? accessToken;
|
String? accessToken;
|
||||||
UserInfo? userInfo;
|
UserInfo? userInfo;
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import 'package:dio/dio.dart';
|
||||||
|
|
||||||
import '../../data/models/other_login_type.dart';
|
import '../../data/models/other_login_type.dart';
|
||||||
import '../dto/login_dto.dart';
|
import '../dto/login_dto.dart';
|
||||||
@@ -53,3 +54,25 @@ Future<LoginDto> thirdLoginApi(String token, OtherLoginType type) async {
|
|||||||
Future<void> deleteAccountApi() async {
|
Future<void> deleteAccountApi() async {
|
||||||
return Request().get("/delete_account");
|
return Request().get("/delete_account");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
///修改用户资料
|
||||||
|
Future<UserInfo> updateUserInfoApi({
|
||||||
|
String? name,
|
||||||
|
List<int>? avatar,
|
||||||
|
String? description,
|
||||||
|
}) async {
|
||||||
|
FormData formData = FormData.fromMap({
|
||||||
|
"avatar": avatar != null
|
||||||
|
? MultipartFile.fromBytes(
|
||||||
|
avatar,
|
||||||
|
filename: "upload.jpg",
|
||||||
|
contentType: DioMediaType("image", "jpeg"),
|
||||||
|
)
|
||||||
|
: null,
|
||||||
|
"description": description,
|
||||||
|
"name": name,
|
||||||
|
});
|
||||||
|
//请求
|
||||||
|
var res = await Request().post("/user/update_profile", formData);
|
||||||
|
return UserInfo.fromJson(res);
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import 'package:dio/dio.dart';
|
import 'package:dio/dio.dart';
|
||||||
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
||||||
|
|
||||||
|
import '../../providers/app_store.dart';
|
||||||
import '../dto/base_dto.dart';
|
import '../dto/base_dto.dart';
|
||||||
|
|
||||||
///请求拦截器
|
///请求拦截器
|
||||||
@@ -8,8 +9,8 @@ void onRequest(
|
|||||||
RequestOptions options,
|
RequestOptions options,
|
||||||
RequestInterceptorHandler handler,
|
RequestInterceptorHandler handler,
|
||||||
) async {
|
) async {
|
||||||
// String token = await AppStore.getToken();
|
String token = await AppStore.getToken();
|
||||||
// options.headers['Authorization'] = 'Bearer $token';
|
options.headers['Authorization'] = 'Bearer $token';
|
||||||
return handler.next(options);
|
return handler.next(options);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -11,9 +11,9 @@ class Config {
|
|||||||
///获取接口地址
|
///获取接口地址
|
||||||
static String baseUrl() {
|
static String baseUrl() {
|
||||||
if (getEnv() == 'dev') {
|
if (getEnv() == 'dev') {
|
||||||
return 'https://food-api.curain.ai/api';
|
return 'https://plan-api.curain.ai/api';
|
||||||
} else {
|
} else {
|
||||||
return 'https://food-api.curain.ai/api';
|
return 'https://plan-api.curain.ai/api';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,9 +4,9 @@ import 'package:flutter_easyloading/flutter_easyloading.dart';
|
|||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
import 'package:plan/providers/app_store.dart';
|
import 'package:plan/providers/app_store.dart';
|
||||||
import 'package:plan/router/routes.dart';
|
import 'package:plan/router/routes.dart';
|
||||||
|
import 'package:plan/theme/theme.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
import 'config/theme/theme.dart';
|
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
runApp(
|
runApp(
|
||||||
|
|||||||
@@ -1,4 +1,8 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:go_router/go_router.dart';
|
||||||
|
import 'package:plan/theme/decorations/app_shadows.dart';
|
||||||
|
|
||||||
|
import '../../../router/config/route_paths.dart';
|
||||||
|
|
||||||
class PlanFormCard extends StatefulWidget {
|
class PlanFormCard extends StatefulWidget {
|
||||||
const PlanFormCard({super.key});
|
const PlanFormCard({super.key});
|
||||||
@@ -10,6 +14,19 @@ class PlanFormCard extends StatefulWidget {
|
|||||||
class _PlanFormCardState extends State<PlanFormCard> {
|
class _PlanFormCardState extends State<PlanFormCard> {
|
||||||
final TextEditingController _inputController = TextEditingController();
|
final TextEditingController _inputController = TextEditingController();
|
||||||
|
|
||||||
|
void _handSubmit() {
|
||||||
|
if (_inputController.text.isEmpty) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
context.push(
|
||||||
|
RoutePaths.planDetail(),
|
||||||
|
extra: {
|
||||||
|
"name": _inputController.text,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
_inputController.clear();
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Stack(
|
return Stack(
|
||||||
@@ -26,20 +43,7 @@ class _PlanFormCardState extends State<PlanFormCard> {
|
|||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
padding: const EdgeInsets.symmetric(vertical: 20, horizontal: 40),
|
padding: const EdgeInsets.symmetric(vertical: 20, horizontal: 40),
|
||||||
margin: EdgeInsets.only(top: 120),
|
margin: EdgeInsets.only(top: 120),
|
||||||
decoration: BoxDecoration(
|
decoration: shadowDecoration,
|
||||||
border: Border.all(color: Colors.black, width: 2),
|
|
||||||
borderRadius: BorderRadius.circular(5),
|
|
||||||
color: Colors.white,
|
|
||||||
boxShadow: [
|
|
||||||
BoxShadow(
|
|
||||||
color: Color(0xffb5b5b5),
|
|
||||||
blurRadius: 2,
|
|
||||||
offset: Offset(6, 6),
|
|
||||||
spreadRadius: 0,
|
|
||||||
blurStyle: BlurStyle.normal,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
@@ -49,6 +53,7 @@ class _PlanFormCardState extends State<PlanFormCard> {
|
|||||||
TextField(
|
TextField(
|
||||||
controller: _inputController,
|
controller: _inputController,
|
||||||
style: Theme.of(context).textTheme.bodyMedium,
|
style: Theme.of(context).textTheme.bodyMedium,
|
||||||
|
maxLength: 40,
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
hintText: "我躺在床上听歌",
|
hintText: "我躺在床上听歌",
|
||||||
fillColor: Theme.of(context).colorScheme.surfaceContainerLow,
|
fillColor: Theme.of(context).colorScheme.surfaceContainerLow,
|
||||||
@@ -68,19 +73,22 @@ class _PlanFormCardState extends State<PlanFormCard> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Container(
|
InkWell(
|
||||||
margin: EdgeInsets.only(top: 20),
|
onTap: _handSubmit,
|
||||||
padding: EdgeInsets.symmetric(vertical: 8, horizontal: 20),
|
child: Container(
|
||||||
decoration: BoxDecoration(
|
margin: EdgeInsets.only(top: 20),
|
||||||
borderRadius: BorderRadius.circular(5),
|
padding: EdgeInsets.symmetric(vertical: 8, horizontal: 20),
|
||||||
border: Border.all(color: Colors.black, width: 1.5),
|
decoration: BoxDecoration(
|
||||||
),
|
borderRadius: BorderRadius.circular(5),
|
||||||
child: Text(
|
border: Border.all(color: Colors.black, width: 1.5),
|
||||||
"创建计划",
|
),
|
||||||
style: TextStyle(
|
child: Text(
|
||||||
fontSize: 14,
|
"创建计划",
|
||||||
fontWeight: FontWeight.w700,
|
style: TextStyle(
|
||||||
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
fontSize: 14,
|
||||||
|
fontWeight: FontWeight.w700,
|
||||||
|
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -1,7 +1,14 @@
|
|||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
||||||
|
import 'package:go_router/go_router.dart';
|
||||||
|
import 'package:plan/api/dto/login_dto.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
import 'package:remixicon/remixicon.dart';
|
import 'package:remixicon/remixicon.dart';
|
||||||
|
|
||||||
|
import '../../api/endpoints/user_api.dart';
|
||||||
|
import '../../providers/app_store.dart';
|
||||||
|
import '../../router/config/route_paths.dart';
|
||||||
import 'widget/avatar_name.dart';
|
import 'widget/avatar_name.dart';
|
||||||
import 'widget/profile_section.dart';
|
import 'widget/profile_section.dart';
|
||||||
|
|
||||||
@@ -15,6 +22,72 @@ class MyPage extends StatefulWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _MyPageState extends State<MyPage> {
|
class _MyPageState extends State<MyPage> {
|
||||||
|
|
||||||
|
///退出登陆
|
||||||
|
void _handLogout() async {
|
||||||
|
await showCupertinoDialog(
|
||||||
|
context: context,
|
||||||
|
builder: (_) => CupertinoAlertDialog(
|
||||||
|
title: Text("Log Out?"),
|
||||||
|
content: Text("Are you sure you want to log out? You’ll need to sign in again to access your account."),
|
||||||
|
actions: [
|
||||||
|
CupertinoDialogAction(
|
||||||
|
child: Text("Cancel"),
|
||||||
|
onPressed: () {
|
||||||
|
context.pop();
|
||||||
|
},
|
||||||
|
),
|
||||||
|
CupertinoDialogAction(
|
||||||
|
child: Text("Log Out"),
|
||||||
|
onPressed: () {
|
||||||
|
context.pop();
|
||||||
|
var appStore = context.read<AppStore>();
|
||||||
|
appStore.logout();
|
||||||
|
context.go(RoutePaths.login);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
///注销账号
|
||||||
|
void _handDelete() async {
|
||||||
|
await showCupertinoDialog(
|
||||||
|
context: context,
|
||||||
|
builder: (_) => CupertinoAlertDialog(
|
||||||
|
title: Text("Delete Account?"),
|
||||||
|
content: Text("Are you sure you want to delete your account? You won’t be able to recover your account."),
|
||||||
|
actions: [
|
||||||
|
CupertinoDialogAction(
|
||||||
|
onPressed: () {
|
||||||
|
context.pop();
|
||||||
|
},
|
||||||
|
child: Text("Cancel"),
|
||||||
|
),
|
||||||
|
CupertinoDialogAction(
|
||||||
|
child: Text("Delete"),
|
||||||
|
onPressed: () async {
|
||||||
|
context.pop();
|
||||||
|
EasyLoading.show();
|
||||||
|
await deleteAccountApi();
|
||||||
|
EasyLoading.dismiss();
|
||||||
|
var appStore = context.read<AppStore>();
|
||||||
|
appStore.logout();
|
||||||
|
context.go(RoutePaths.login);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
///编辑资料
|
||||||
|
void _updateUserInfo(UserInfo value) {
|
||||||
|
var appStore = context.read<AppStore>();
|
||||||
|
appStore.updateUserInfo(value);
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return CupertinoPageScaffold(
|
return CupertinoPageScaffold(
|
||||||
@@ -32,8 +105,31 @@ class _MyPageState extends State<MyPage> {
|
|||||||
child: ListView(
|
child: ListView(
|
||||||
padding: EdgeInsets.symmetric(horizontal: 30, vertical: 20),
|
padding: EdgeInsets.symmetric(horizontal: 30, vertical: 20),
|
||||||
children: [
|
children: [
|
||||||
AvatarName(),
|
AvatarName(
|
||||||
ProfileSection(),
|
onUpdate: _updateUserInfo,
|
||||||
|
),
|
||||||
|
ProfileSection(
|
||||||
|
onUpdate: _updateUserInfo,
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
margin: EdgeInsets.only(top: 50),
|
||||||
|
child: CupertinoButton(
|
||||||
|
color: CupertinoColors.systemRed,
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 12),
|
||||||
|
onPressed: _handLogout,
|
||||||
|
child: Text(
|
||||||
|
"退出登录",
|
||||||
|
style: TextStyle(color: Colors.white, fontSize: 14),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
CupertinoButton(
|
||||||
|
onPressed: _handDelete,
|
||||||
|
child: const Text(
|
||||||
|
"删除账号",
|
||||||
|
style: TextStyle(color: CupertinoColors.systemRed, fontSize: 14),
|
||||||
|
),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -1,8 +1,18 @@
|
|||||||
|
import 'package:cached_network_image/cached_network_image.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_image_compress/flutter_image_compress.dart';
|
||||||
|
import 'package:plan/api/dto/login_dto.dart';
|
||||||
|
import 'package:plan/api/endpoints/user_api.dart';
|
||||||
|
import 'package:plan/providers/app_store.dart';
|
||||||
|
import 'package:plan/utils/common.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
import 'package:remixicon/remixicon.dart';
|
import 'package:remixicon/remixicon.dart';
|
||||||
|
import 'package:file_picker/file_picker.dart';
|
||||||
|
|
||||||
class AvatarName extends StatefulWidget {
|
class AvatarName extends StatefulWidget {
|
||||||
const AvatarName({super.key});
|
final Function(UserInfo) onUpdate;
|
||||||
|
|
||||||
|
const AvatarName({super.key, required this.onUpdate});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<AvatarName> createState() => _AvatarNameState();
|
State<AvatarName> createState() => _AvatarNameState();
|
||||||
@@ -19,94 +29,150 @@ class _AvatarNameState extends State<AvatarName> {
|
|||||||
setState(() {
|
setState(() {
|
||||||
_isEdit = true;
|
_isEdit = true;
|
||||||
});
|
});
|
||||||
|
AppStore appStore = context.read<AppStore>();
|
||||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||||
|
_inputController.text = appStore.userInfo?.name ?? "";
|
||||||
_focusNode.requestFocus();
|
_focusNode.requestFocus();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
///确定编辑内容
|
///确定编辑名字
|
||||||
void _confirmEdit(String value) {
|
void _confirmEdit(String value) async {
|
||||||
setState(() {
|
setState(() {
|
||||||
_isEdit = false;
|
_isEdit = false;
|
||||||
});
|
});
|
||||||
|
var res = await updateUserInfoApi(name: value);
|
||||||
|
widget.onUpdate(res);
|
||||||
|
}
|
||||||
|
|
||||||
|
///选择图片
|
||||||
|
void _handPickImage() async {
|
||||||
|
var result = await FilePicker.platform.pickFiles(
|
||||||
|
type: FileType.image,
|
||||||
|
allowMultiple: false,
|
||||||
|
);
|
||||||
|
if (result != null) {
|
||||||
|
//压缩文件
|
||||||
|
final compress = await FlutterImageCompress.compressWithFile(
|
||||||
|
result.files[0].path!,
|
||||||
|
minWidth: 500,
|
||||||
|
minHeight: 500,
|
||||||
|
quality: 85,
|
||||||
|
rotate: 0,
|
||||||
|
);
|
||||||
|
|
||||||
|
var res = await updateUserInfoApi(avatar: compress);
|
||||||
|
widget.onUpdate(res);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Row(
|
return Consumer<AppStore>(
|
||||||
spacing: 15,
|
builder: (context, store, __) {
|
||||||
children: [
|
return Row(
|
||||||
Container(
|
spacing: 15,
|
||||||
width: 80,
|
children: [
|
||||||
height: 80,
|
InkWell(
|
||||||
decoration: BoxDecoration(
|
onTap: _handPickImage,
|
||||||
color: Color(0xffcae2fd),
|
child: Container(
|
||||||
border: Border.all(
|
width: 80,
|
||||||
color: Color(0xff797e80),
|
height: 80,
|
||||||
width: 2,
|
decoration: BoxDecoration(
|
||||||
),
|
color: Color(0xffcae2fd),
|
||||||
borderRadius: BorderRadius.circular(5),
|
border: Border.all(
|
||||||
),
|
color: Color(0xff797e80),
|
||||||
alignment: Alignment.center,
|
width: 2,
|
||||||
child: Container(
|
|
||||||
width: 50,
|
|
||||||
padding: EdgeInsets.all(5),
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: Color(0xff8e8d93),
|
|
||||||
borderRadius: BorderRadius.circular(5),
|
|
||||||
),
|
|
||||||
child: Icon(
|
|
||||||
RemixIcons.user_fill,
|
|
||||||
color: Color(0xffcae2fd),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Expanded(
|
|
||||||
child: Visibility(
|
|
||||||
visible: _isEdit,
|
|
||||||
replacement: InkWell(
|
|
||||||
onTap: _handleEdit,
|
|
||||||
child: Row(
|
|
||||||
spacing: 10,
|
|
||||||
children: [
|
|
||||||
Text(
|
|
||||||
"教练如何称呼你?",
|
|
||||||
style: Theme.of(context).textTheme.labelMedium,
|
|
||||||
),
|
|
||||||
Icon(
|
|
||||||
RemixIcons.pencil_fill,
|
|
||||||
size: 18,
|
|
||||||
color: Theme.of(context).textTheme.labelMedium?.color,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
child: TextField(
|
|
||||||
focusNode: _focusNode,
|
|
||||||
controller: _inputController,
|
|
||||||
style: TextStyle(fontSize: 14),
|
|
||||||
decoration: InputDecoration(
|
|
||||||
hintText: "输入你的姓名",
|
|
||||||
isCollapsed: true,
|
|
||||||
contentPadding: EdgeInsets.symmetric(vertical: 8, horizontal: 10),
|
|
||||||
enabledBorder: OutlineInputBorder(
|
|
||||||
borderSide: BorderSide(
|
|
||||||
width: 1,
|
|
||||||
color: Theme.of(context).colorScheme.surfaceContainerHigh,
|
|
||||||
),
|
),
|
||||||
|
borderRadius: BorderRadius.circular(5),
|
||||||
),
|
),
|
||||||
focusedBorder: OutlineInputBorder(
|
alignment: Alignment.center,
|
||||||
borderSide: BorderSide(
|
child: Visibility(
|
||||||
width: 1,
|
visible: getNotEmpty(store.userInfo?.avatar) == null,
|
||||||
color: Theme.of(context).colorScheme.surfaceContainerHigh,
|
replacement: CachedNetworkImage(
|
||||||
|
width: double.infinity,
|
||||||
|
height: double.infinity,
|
||||||
|
fit: BoxFit.cover,
|
||||||
|
imageUrl: store.userInfo?.avatar ?? "",
|
||||||
|
errorWidget: (context, url, error) => Icon(Icons.error),
|
||||||
|
placeholder: (context, url) => Container(
|
||||||
|
width: 30,
|
||||||
|
height: 30,
|
||||||
|
alignment: Alignment.center,
|
||||||
|
child: CircularProgressIndicator(),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: Container(
|
||||||
|
width: 50,
|
||||||
|
padding: EdgeInsets.all(5),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Color(0xff8e8d93),
|
||||||
|
borderRadius: BorderRadius.circular(5),
|
||||||
|
),
|
||||||
|
child: Icon(
|
||||||
|
RemixIcons.user_fill,
|
||||||
|
color: Color(0xffcae2fd),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
onSubmitted: _confirmEdit,
|
|
||||||
),
|
),
|
||||||
),
|
Expanded(
|
||||||
),
|
child: Visibility(
|
||||||
],
|
visible: _isEdit,
|
||||||
|
replacement: InkWell(
|
||||||
|
onTap: _handleEdit,
|
||||||
|
child: Row(
|
||||||
|
spacing: 10,
|
||||||
|
children: [
|
||||||
|
Visibility(
|
||||||
|
visible: getNotEmpty(store.userInfo?.name) == null,
|
||||||
|
replacement: Text(
|
||||||
|
store.userInfo?.name ?? "",
|
||||||
|
style: Theme.of(context).textTheme.titleSmall,
|
||||||
|
),
|
||||||
|
child: Text(
|
||||||
|
"教练如何称呼你?",
|
||||||
|
style: Theme.of(context).textTheme.labelMedium,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Icon(
|
||||||
|
RemixIcons.pencil_fill,
|
||||||
|
size: 18,
|
||||||
|
color: Theme.of(context).textTheme.labelMedium?.color,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: TextField(
|
||||||
|
focusNode: _focusNode,
|
||||||
|
controller: _inputController,
|
||||||
|
style: TextStyle(fontSize: 14),
|
||||||
|
maxLength: 20,
|
||||||
|
decoration: InputDecoration(
|
||||||
|
hintText: "输入你的姓名",
|
||||||
|
isCollapsed: true,
|
||||||
|
contentPadding: EdgeInsets.symmetric(vertical: 8, horizontal: 10),
|
||||||
|
enabledBorder: OutlineInputBorder(
|
||||||
|
borderSide: BorderSide(
|
||||||
|
width: 1,
|
||||||
|
color: Theme.of(context).colorScheme.surfaceContainerHigh,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
focusedBorder: OutlineInputBorder(
|
||||||
|
borderSide: BorderSide(
|
||||||
|
width: 1,
|
||||||
|
color: Theme.of(context).colorScheme.surfaceContainerHigh,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
onSubmitted: _confirmEdit,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,15 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:plan/api/dto/login_dto.dart';
|
||||||
|
import 'package:plan/api/endpoints/user_api.dart';
|
||||||
|
import 'package:plan/providers/app_store.dart';
|
||||||
|
import 'package:plan/utils/debouncer.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
import 'package:remixicon/remixicon.dart';
|
import 'package:remixicon/remixicon.dart';
|
||||||
|
|
||||||
class ProfileSection extends StatefulWidget {
|
class ProfileSection extends StatefulWidget {
|
||||||
const ProfileSection({super.key});
|
final Function(UserInfo) onUpdate;
|
||||||
|
|
||||||
|
const ProfileSection({super.key, required this.onUpdate});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<ProfileSection> createState() => _ProfileSectionState();
|
State<ProfileSection> createState() => _ProfileSectionState();
|
||||||
@@ -12,7 +19,35 @@ class _ProfileSectionState extends State<ProfileSection> {
|
|||||||
//输入框
|
//输入框
|
||||||
final TextEditingController _inputController = TextEditingController();
|
final TextEditingController _inputController = TextEditingController();
|
||||||
|
|
||||||
final List<String> _tips = ["教练每次为你制定计划时,都会首先参考这里的信息", "你分享的背景信息越详细,教练就越能为你量身定制,符合你独特情况的行动步骤", "你可以在这里为教练提需求,比如“我不吃香菜”"];
|
final List<String> _tips = [
|
||||||
|
"教练每次为你制定计划时,都会首先参考这里的信息",
|
||||||
|
"你分享的背景信息越详细,教练就越能为你量身定制,符合你独特情况的行动步骤",
|
||||||
|
"你可以在这里为教练提需求,比如“我不吃香菜”",
|
||||||
|
];
|
||||||
|
|
||||||
|
//防抖
|
||||||
|
Debouncer debouncer = Debouncer(milliseconds: 2000);
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
AppStore appStore = context.read<AppStore>();
|
||||||
|
_inputController.text = appStore.userInfo?.description ?? "";
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void dispose() {
|
||||||
|
super.dispose();
|
||||||
|
debouncer.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
///确定编辑画像
|
||||||
|
void _onTextChanged(String value) {
|
||||||
|
debouncer.run(() async {
|
||||||
|
var res = await updateUserInfoApi(description: value);
|
||||||
|
widget.onUpdate(res);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
@@ -38,9 +73,10 @@ class _ProfileSectionState extends State<ProfileSection> {
|
|||||||
margin: EdgeInsets.only(bottom: 20),
|
margin: EdgeInsets.only(bottom: 20),
|
||||||
child: TextField(
|
child: TextField(
|
||||||
maxLines: 5,
|
maxLines: 5,
|
||||||
maxLength: 200,
|
maxLength: 500,
|
||||||
controller: _inputController,
|
controller: _inputController,
|
||||||
style: TextStyle(fontSize: 14, letterSpacing: 1),
|
style: TextStyle(fontSize: 14, letterSpacing: 1),
|
||||||
|
onChanged: _onTextChanged,
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
hintText: "我是19岁女生,刷碗时用洗碗机,请不要按手洗拆解步骤..",
|
hintText: "我是19岁女生,刷碗时用洗碗机,请不要按手洗拆解步骤..",
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: OutlineInputBorder(
|
||||||
|
|||||||
@@ -1,29 +1,148 @@
|
|||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:plan/page/plan/detail/viewmodel/plan_detail_store.dart';
|
||||||
|
import 'package:plan/theme/decorations/app_shadows.dart';
|
||||||
|
import 'package:plan/widgets/ui_kit/popup/popup_action.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
import 'package:remixicon/remixicon.dart';
|
import 'package:remixicon/remixicon.dart';
|
||||||
|
|
||||||
|
import '../widgets/edit_desc_dialog.dart';
|
||||||
|
import 'widgets/avatar_card.dart';
|
||||||
|
import 'widgets/plan_item.dart';
|
||||||
|
import 'widgets/scroll_box.dart';
|
||||||
|
import 'widgets/suggested.dart';
|
||||||
|
|
||||||
class PlanDetailPage extends StatefulWidget {
|
class PlanDetailPage extends StatefulWidget {
|
||||||
const PlanDetailPage({super.key});
|
final String? id;
|
||||||
|
final String? planName;
|
||||||
|
|
||||||
|
const PlanDetailPage({
|
||||||
|
super.key,
|
||||||
|
this.id,
|
||||||
|
this.planName,
|
||||||
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<PlanDetailPage> createState() => _PlanDetailPageState();
|
State<PlanDetailPage> createState() => _PlanDetailPageState();
|
||||||
}
|
}
|
||||||
|
|
||||||
class _PlanDetailPageState extends State<PlanDetailPage> {
|
class _PlanDetailPageState extends State<PlanDetailPage> {
|
||||||
|
bool _isEdit = false;
|
||||||
|
|
||||||
|
///popup菜单
|
||||||
|
void _onPopupActionSelected(String value) {
|
||||||
|
if (value == 'edit_step') {
|
||||||
|
setState(() {
|
||||||
|
_isEdit = true;
|
||||||
|
});
|
||||||
|
} else if (value == 'edit_desc') {
|
||||||
|
showEditDescDialog(
|
||||||
|
context,
|
||||||
|
value: "你好",
|
||||||
|
onConfirm: (value) {},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
///取消编辑
|
||||||
|
void _cancelEdit() {
|
||||||
|
setState(() {
|
||||||
|
_isEdit = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return CupertinoPageScaffold(
|
return ChangeNotifierProvider<PlanDetailStore>(
|
||||||
backgroundColor: Colors.white,
|
create: (_) {
|
||||||
navigationBar: CupertinoNavigationBar(
|
return PlanDetailStore();
|
||||||
middle: Text('计划详情'),
|
},
|
||||||
trailing: Row(
|
child: CupertinoPageScaffold(
|
||||||
mainAxisSize: MainAxisSize.min, // 关键:Row 只占实际内容宽度
|
backgroundColor: Colors.white,
|
||||||
children: [
|
navigationBar: CupertinoNavigationBar(
|
||||||
Icon(RemixIcons.more_fill),
|
middle: Text('计划详情'),
|
||||||
],
|
trailing: Row(
|
||||||
|
mainAxisSize: MainAxisSize.min, // 关键:Row 只占实际内容宽度
|
||||||
|
children: [
|
||||||
|
AnimatedSwitcher(
|
||||||
|
duration: Duration(milliseconds: 300),
|
||||||
|
transitionBuilder: (child, animation) {
|
||||||
|
// 仅使用渐变动画
|
||||||
|
return FadeTransition(
|
||||||
|
opacity: animation,
|
||||||
|
child: child,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
child: _isEdit
|
||||||
|
? InkWell(
|
||||||
|
onTap: _cancelEdit,
|
||||||
|
child: Icon(RemixIcons.check_fill),
|
||||||
|
)
|
||||||
|
: PopupAction(
|
||||||
|
onSelected: _onPopupActionSelected,
|
||||||
|
items: [
|
||||||
|
PopupMenuItem(
|
||||||
|
value: 'edit_step',
|
||||||
|
child: Text("编辑步骤"),
|
||||||
|
),
|
||||||
|
PopupMenuItem(
|
||||||
|
value: 'edit_desc',
|
||||||
|
child: Text("编辑摘要"),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
child: Icon(RemixIcons.more_fill),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: SafeArea(
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
AvatarCard(),
|
||||||
|
Expanded(
|
||||||
|
child: Padding(
|
||||||
|
padding: EdgeInsets.all(15),
|
||||||
|
child: ScrollBox(
|
||||||
|
child: Container(
|
||||||
|
decoration: shadowDecoration,
|
||||||
|
child: CustomScrollView(
|
||||||
|
slivers: [
|
||||||
|
SliverToBoxAdapter(
|
||||||
|
child: SizedBox(height: 20),
|
||||||
|
),
|
||||||
|
SliverList.builder(
|
||||||
|
itemBuilder: (BuildContext context, int index) {
|
||||||
|
return PlanItem(
|
||||||
|
showEdit: _isEdit,
|
||||||
|
title: "测试 ${index + 1}",
|
||||||
|
desc: "测测 ${index + 1}",
|
||||||
|
onDelete: (id) {},
|
||||||
|
);
|
||||||
|
},
|
||||||
|
itemCount: 10,
|
||||||
|
),
|
||||||
|
SliverToBoxAdapter(
|
||||||
|
child: SuggestedTitle(),
|
||||||
|
),
|
||||||
|
SliverList.builder(
|
||||||
|
itemBuilder: (BuildContext context, int index) {
|
||||||
|
return SuggestedItem(
|
||||||
|
title: "测试",
|
||||||
|
);
|
||||||
|
},
|
||||||
|
itemCount: 5,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
child: Column(),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
13
lib/page/plan/detail/viewmodel/plan_detail_store.dart
Normal file
13
lib/page/plan/detail/viewmodel/plan_detail_store.dart
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
|
|
||||||
|
class PlanDetailStore extends ChangeNotifier {
|
||||||
|
///角色话语是否显示
|
||||||
|
bool _showRoleTalk = true;
|
||||||
|
|
||||||
|
bool get showRoleTalk => _showRoleTalk;
|
||||||
|
|
||||||
|
set showRoleTalk(bool value) {
|
||||||
|
_showRoleTalk = value;
|
||||||
|
notifyListeners();
|
||||||
|
}
|
||||||
|
}
|
||||||
137
lib/page/plan/detail/widgets/avatar_card.dart
Normal file
137
lib/page/plan/detail/widgets/avatar_card.dart
Normal file
@@ -0,0 +1,137 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:remixicon/remixicon.dart';
|
||||||
|
|
||||||
|
class AvatarCard extends StatefulWidget {
|
||||||
|
const AvatarCard({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<AvatarCard> createState() => _AvatarCardState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _AvatarCardState extends State<AvatarCard> with SingleTickerProviderStateMixin {
|
||||||
|
bool _isShow = false;
|
||||||
|
|
||||||
|
late AnimationController _controller;
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
_controller = AnimationController(
|
||||||
|
vsync: this,
|
||||||
|
duration: Duration(milliseconds: 400),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
void _toggleShow() {
|
||||||
|
setState(() {
|
||||||
|
_isShow = !_isShow;
|
||||||
|
if (_isShow) {
|
||||||
|
_controller.forward();
|
||||||
|
} else {
|
||||||
|
_controller.reverse();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Padding(
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 30),
|
||||||
|
child: Transform.translate(
|
||||||
|
offset: Offset(0, 50),
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Transform(
|
||||||
|
alignment: Alignment.center,
|
||||||
|
transform: Matrix4.identity()..translate(40.0, 40.0)..scale(0.2),
|
||||||
|
child: Container(
|
||||||
|
color: Colors.red,
|
||||||
|
padding: EdgeInsets.only(bottom: 10),
|
||||||
|
child: InkWell(
|
||||||
|
onTap: _toggleShow,
|
||||||
|
child: Stack(
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
padding: EdgeInsets.all(4),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(3),
|
||||||
|
border: Border.all(color: Colors.black, width: 1),
|
||||||
|
),
|
||||||
|
child: Text(
|
||||||
|
"好的,让我们把学习软件开发这个目标分解成最简单的小步骤,这样你明天就能轻松开始行动",
|
||||||
|
style: TextStyle(fontSize: 12),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Positioned(
|
||||||
|
bottom: 0,
|
||||||
|
left: 0,
|
||||||
|
right: 0,
|
||||||
|
child: CustomPaint(
|
||||||
|
painter: BubblePainter(),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
width: double.infinity,
|
||||||
|
child: Stack(
|
||||||
|
alignment: Alignment.bottomCenter,
|
||||||
|
children: [
|
||||||
|
Image.asset("assets/image/xiaozhi.png", height: 100),
|
||||||
|
Positioned(
|
||||||
|
top: 20,
|
||||||
|
child: Transform.translate(
|
||||||
|
offset: Offset(50, -10),
|
||||||
|
child: GestureDetector(
|
||||||
|
onTap: _toggleShow,
|
||||||
|
child: Icon(RemixIcons.message_2_line, size: 26),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class BubblePainter extends CustomPainter {
|
||||||
|
@override
|
||||||
|
void paint(Canvas canvas, Size size) {
|
||||||
|
var bottomWidth = 10;
|
||||||
|
//点坐标
|
||||||
|
var start = Offset((size.width - bottomWidth) / 2, 0);
|
||||||
|
//底线
|
||||||
|
final bottomLinePaint = Paint()
|
||||||
|
..color = Colors.white
|
||||||
|
..strokeWidth = 2
|
||||||
|
..style = PaintingStyle.stroke;
|
||||||
|
final bottomLinePath = Path()
|
||||||
|
..moveTo(start.dx, 0)
|
||||||
|
..lineTo(start.dx + bottomWidth, 0);
|
||||||
|
canvas.drawPath(bottomLinePath, bottomLinePaint);
|
||||||
|
|
||||||
|
//边线
|
||||||
|
final sideLinePaint = Paint()
|
||||||
|
..color = Colors.black
|
||||||
|
..strokeWidth = 1
|
||||||
|
..style = bottomLinePaint.style;
|
||||||
|
|
||||||
|
final sideLinePath = Path()
|
||||||
|
..moveTo(start.dx, 0)
|
||||||
|
..lineTo(start.dx + bottomWidth / 2, 5)
|
||||||
|
..lineTo(start.dx + bottomWidth, 0);
|
||||||
|
canvas.drawPath(sideLinePath, sideLinePaint);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool shouldRepaint(covariant CustomPainter oldDelegate) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
71
lib/page/plan/detail/widgets/plan_item.dart
Normal file
71
lib/page/plan/detail/widgets/plan_item.dart
Normal file
@@ -0,0 +1,71 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:plan/widgets/business/delete_row_item.dart';
|
||||||
|
import 'package:remixicon/remixicon.dart';
|
||||||
|
|
||||||
|
class PlanItem extends StatefulWidget {
|
||||||
|
final String title;
|
||||||
|
final String desc;
|
||||||
|
final bool showEdit;
|
||||||
|
final Function(int) onDelete;
|
||||||
|
|
||||||
|
const PlanItem({
|
||||||
|
super.key,
|
||||||
|
required this.title,
|
||||||
|
required this.desc,
|
||||||
|
this.showEdit = false,
|
||||||
|
required this.onDelete,
|
||||||
|
});
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<PlanItem> createState() => _PlanItemState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _PlanItemState extends State<PlanItem> with AutomaticKeepAliveClientMixin {
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
super.build(context);
|
||||||
|
return Container(
|
||||||
|
padding: EdgeInsets.symmetric(horizontal: 20, vertical: 10),
|
||||||
|
child: DeleteRowItem(
|
||||||
|
showDelete: widget.showEdit,
|
||||||
|
onDelete: () {},
|
||||||
|
builder: (_, animate) {
|
||||||
|
return [
|
||||||
|
Expanded(
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
margin: EdgeInsets.only(bottom: 3),
|
||||||
|
child: Text(
|
||||||
|
"完成以上步骤后,给自己倒杯水休息一下。",
|
||||||
|
style: Theme.of(context).textTheme.bodyMedium,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
"就从这里开始,写下基本信息只需要2分钟,这是最简单的一部",
|
||||||
|
style: Theme.of(context).textTheme.labelSmall,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizeTransition(
|
||||||
|
axis: Axis.horizontal,
|
||||||
|
sizeFactor: animate,
|
||||||
|
child: Container(
|
||||||
|
margin: EdgeInsets.only(left: 10),
|
||||||
|
child: Opacity(
|
||||||
|
opacity: 0.4,
|
||||||
|
child: Icon(RemixIcons.menu_line),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
];
|
||||||
|
},
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool get wantKeepAlive => true;
|
||||||
|
}
|
||||||
23
lib/page/plan/detail/widgets/scroll_box.dart
Normal file
23
lib/page/plan/detail/widgets/scroll_box.dart
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class ScrollBox extends StatelessWidget {
|
||||||
|
final Widget child;
|
||||||
|
|
||||||
|
const ScrollBox({super.key, required this.child});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return ScrollbarTheme(
|
||||||
|
data: ScrollbarThemeData(
|
||||||
|
thumbColor: WidgetStateProperty.all(Theme.of(context).colorScheme.surfaceContainerHigh),
|
||||||
|
thickness: WidgetStateProperty.all(3),
|
||||||
|
crossAxisMargin: 3,
|
||||||
|
mainAxisMargin: 2,
|
||||||
|
radius: const Radius.circular(5),
|
||||||
|
),
|
||||||
|
child: Scrollbar(
|
||||||
|
child: child,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
73
lib/page/plan/detail/widgets/suggested.dart
Normal file
73
lib/page/plan/detail/widgets/suggested.dart
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:remixicon/remixicon.dart';
|
||||||
|
|
||||||
|
///模块标题
|
||||||
|
class SuggestedTitle extends StatelessWidget {
|
||||||
|
const SuggestedTitle({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Container(
|
||||||
|
margin: const EdgeInsets.only(top: 20, bottom: 5),
|
||||||
|
child: Opacity(
|
||||||
|
opacity: 0.6,
|
||||||
|
child: Row(
|
||||||
|
spacing: 20,
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
width: 15,
|
||||||
|
height: 1,
|
||||||
|
color: Theme.of(context).colorScheme.surfaceContainerHigh,
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
"额外建议",
|
||||||
|
style: Theme.of(context).textTheme.titleSmall,
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
width: 15,
|
||||||
|
height: 1,
|
||||||
|
color: Theme.of(context).colorScheme.surfaceContainerHigh,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class SuggestedItem extends StatelessWidget {
|
||||||
|
final String title;
|
||||||
|
|
||||||
|
const SuggestedItem({super.key, required this.title});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Padding(
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 10),
|
||||||
|
child: Row(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
spacing: 10,
|
||||||
|
children: [
|
||||||
|
Transform.translate(
|
||||||
|
offset: const Offset(0, 5),
|
||||||
|
child: Icon(
|
||||||
|
RemixIcons.lightbulb_flash_fill,
|
||||||
|
color: Color(0xfff2a529),
|
||||||
|
size: 18,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: Opacity(
|
||||||
|
opacity: 0.5,
|
||||||
|
child: Text(
|
||||||
|
title,
|
||||||
|
style: Theme.of(context).textTheme.bodyMedium,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,8 +1,9 @@
|
|||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:remixicon/remixicon.dart';
|
||||||
|
|
||||||
import 'widgets/history_item.dart';
|
import 'widgets/history_item.dart';
|
||||||
import 'widgets/popup_action.dart';
|
import '../../../widgets/ui_kit/popup/popup_action.dart';
|
||||||
|
|
||||||
class PlanHistoryPage extends StatefulWidget {
|
class PlanHistoryPage extends StatefulWidget {
|
||||||
const PlanHistoryPage({super.key});
|
const PlanHistoryPage({super.key});
|
||||||
@@ -42,22 +43,19 @@ class _PlanHistoryPageState extends State<PlanHistoryPage> {
|
|||||||
return CupertinoPageScaffold(
|
return CupertinoPageScaffold(
|
||||||
backgroundColor: Theme.of(context).colorScheme.surfaceContainer,
|
backgroundColor: Theme.of(context).colorScheme.surfaceContainer,
|
||||||
navigationBar: CupertinoNavigationBar(
|
navigationBar: CupertinoNavigationBar(
|
||||||
middle: Text("计划历史"),
|
middle: const Text("计划历史"),
|
||||||
trailing: CupertinoNavigationBar(
|
trailing: PopupAction(
|
||||||
transitionBetweenRoutes: false,
|
onSelected: _onPopupActionSelected,
|
||||||
middle: const Text("计划历史"),
|
items: [
|
||||||
trailing: PopupAction(
|
PopupMenuItem(
|
||||||
onSelected: _onPopupActionSelected,
|
value: 'edit',
|
||||||
items: [
|
child: Text(
|
||||||
PopupMenuItem(
|
_isDelete ? "完成" : "编辑",
|
||||||
value: 'edit',
|
style: TextStyle(color: Colors.black),
|
||||||
child: Text(
|
|
||||||
_isDelete ? "完成" : "编辑",
|
|
||||||
style: TextStyle(color: Colors.black),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
],
|
),
|
||||||
),
|
],
|
||||||
|
child: Icon(RemixIcons.more_fill),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
child: SafeArea(
|
child: SafeArea(
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import 'package:flutter/cupertino.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:go_router/go_router.dart';
|
import 'package:go_router/go_router.dart';
|
||||||
import 'package:plan/router/config/route_paths.dart';
|
import 'package:plan/router/config/route_paths.dart';
|
||||||
|
import 'package:plan/widgets/business/delete_row_item.dart';
|
||||||
import 'package:remixicon/remixicon.dart';
|
import 'package:remixicon/remixicon.dart';
|
||||||
|
|
||||||
class HistoryItem extends StatefulWidget {
|
class HistoryItem extends StatefulWidget {
|
||||||
@@ -18,76 +18,15 @@ class HistoryItem extends StatefulWidget {
|
|||||||
State<HistoryItem> createState() => _HistoryItemState();
|
State<HistoryItem> createState() => _HistoryItemState();
|
||||||
}
|
}
|
||||||
|
|
||||||
class _HistoryItemState extends State<HistoryItem> with TickerProviderStateMixin {
|
class _HistoryItemState extends State<HistoryItem> {
|
||||||
late AnimationController _controller;
|
|
||||||
late Animation<double> _animation;
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
_controller = AnimationController(
|
|
||||||
vsync: this,
|
|
||||||
duration: Duration(milliseconds: 300),
|
|
||||||
);
|
|
||||||
_animation = CurvedAnimation(
|
|
||||||
parent: _controller,
|
|
||||||
curve: Curves.easeInOut,
|
|
||||||
);
|
|
||||||
|
|
||||||
if (widget.showDelete) {
|
|
||||||
_controller.forward();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
void didUpdateWidget(covariant HistoryItem oldWidget) {
|
|
||||||
super.didUpdateWidget(oldWidget);
|
|
||||||
if (oldWidget.showDelete != widget.showDelete) {
|
|
||||||
if (widget.showDelete) {
|
|
||||||
_controller.forward();
|
|
||||||
} else {
|
|
||||||
_controller.reverse();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
void dispose() {
|
|
||||||
_controller.dispose();
|
|
||||||
super.dispose();
|
|
||||||
}
|
|
||||||
|
|
||||||
///点击删除
|
|
||||||
void _handleDelete() {
|
|
||||||
showCupertinoDialog(
|
|
||||||
context: context,
|
|
||||||
builder: (_) {
|
|
||||||
return CupertinoAlertDialog(
|
|
||||||
title: Text("删除计划"),
|
|
||||||
actions: [
|
|
||||||
CupertinoDialogAction(
|
|
||||||
child: Text("取消"),
|
|
||||||
onPressed: () {
|
|
||||||
context.pop();
|
|
||||||
},
|
|
||||||
),
|
|
||||||
CupertinoDialogAction(
|
|
||||||
isDestructiveAction: true,
|
|
||||||
onPressed: () {
|
|
||||||
context.pop();
|
|
||||||
widget.onDelete(0);
|
|
||||||
},
|
|
||||||
child: Text("确定"),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
///跳转详情
|
///跳转详情
|
||||||
void _goDetail() {
|
void _goDetail() {
|
||||||
context.push(RoutePaths.planDetail);
|
context.push(RoutePaths.planDetail(1));
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -98,62 +37,53 @@ class _HistoryItemState extends State<HistoryItem> with TickerProviderStateMixin
|
|||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
padding: EdgeInsets.symmetric(vertical: 15),
|
padding: EdgeInsets.symmetric(vertical: 15),
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
child: Row(
|
child: DeleteRowItem(
|
||||||
children: [
|
showDelete: widget.showDelete,
|
||||||
SizeTransition(
|
onDelete: () {
|
||||||
axis: Axis.horizontal,
|
widget.onDelete(0);
|
||||||
sizeFactor: _animation,
|
},
|
||||||
axisAlignment: -1, // 从左向右展开
|
builder: (_, __) {
|
||||||
child: InkWell(
|
return [
|
||||||
onTap: _handleDelete,
|
Expanded(
|
||||||
child: Container(
|
child: Column(
|
||||||
margin: EdgeInsets.only(right: 10),
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
child: Icon(
|
children: [
|
||||||
RemixIcons.indeterminate_circle_fill,
|
Container(
|
||||||
color: Colors.red,
|
margin: EdgeInsets.only(bottom: 5),
|
||||||
),
|
child: Text("开始学习软件开发"),
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Expanded(
|
|
||||||
child: Column(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
children: [
|
|
||||||
Container(
|
|
||||||
margin: EdgeInsets.only(bottom: 5),
|
|
||||||
child: Text("开始学习软件开发"),
|
|
||||||
),
|
|
||||||
Container(
|
|
||||||
margin: EdgeInsets.only(bottom: 5),
|
|
||||||
child: Text(
|
|
||||||
"创建于 2025/9/3 9:40:51 教练:W教练",
|
|
||||||
style: Theme.of(context).textTheme.labelSmall,
|
|
||||||
),
|
),
|
||||||
),
|
Container(
|
||||||
Row(
|
margin: EdgeInsets.only(bottom: 5),
|
||||||
spacing: 10,
|
child: Text(
|
||||||
children: [
|
"创建于 2025/9/3 9:40:51 教练:W教练",
|
||||||
Expanded(
|
|
||||||
child: LinearProgressIndicator(
|
|
||||||
value: 0.5,
|
|
||||||
borderRadius: BorderRadius.circular(5),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Text(
|
|
||||||
"0/7",
|
|
||||||
style: Theme.of(context).textTheme.labelSmall,
|
style: Theme.of(context).textTheme.labelSmall,
|
||||||
),
|
),
|
||||||
],
|
),
|
||||||
),
|
Row(
|
||||||
],
|
spacing: 10,
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: LinearProgressIndicator(
|
||||||
|
value: 0.5,
|
||||||
|
borderRadius: BorderRadius.circular(5),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
"0/7",
|
||||||
|
style: Theme.of(context).textTheme.labelSmall,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
Icon(
|
||||||
Icon(
|
RemixIcons.arrow_right_s_line,
|
||||||
RemixIcons.arrow_right_s_line,
|
size: 30,
|
||||||
size: 30,
|
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
||||||
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
),
|
||||||
),
|
];
|
||||||
],
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
48
lib/page/plan/widgets/edit_desc_dialog.dart
Normal file
48
lib/page/plan/widgets/edit_desc_dialog.dart
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
|
import 'package:go_router/go_router.dart';
|
||||||
|
|
||||||
|
void showEditDescDialog(
|
||||||
|
BuildContext context, {
|
||||||
|
String value = "",
|
||||||
|
required void Function(String) onConfirm,
|
||||||
|
}) {
|
||||||
|
final controller = TextEditingController(text: value);
|
||||||
|
final focusNode = FocusNode();
|
||||||
|
showCupertinoDialog(
|
||||||
|
context: context,
|
||||||
|
builder: (_) {
|
||||||
|
// 确保弹窗显示后再获取焦点
|
||||||
|
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||||
|
focusNode.requestFocus();
|
||||||
|
});
|
||||||
|
|
||||||
|
return CupertinoAlertDialog(
|
||||||
|
title: Text("编辑摘要"),
|
||||||
|
content: Padding(
|
||||||
|
padding: EdgeInsets.only(top: 15),
|
||||||
|
child: CupertinoTextField(
|
||||||
|
controller: controller,
|
||||||
|
focusNode: focusNode,
|
||||||
|
placeholder: "edit...",
|
||||||
|
),
|
||||||
|
),
|
||||||
|
actions: [
|
||||||
|
CupertinoDialogAction(
|
||||||
|
onPressed: () {
|
||||||
|
context.pop();
|
||||||
|
},
|
||||||
|
child: Text('取消'),
|
||||||
|
),
|
||||||
|
CupertinoDialogAction(
|
||||||
|
isDefaultAction: true,
|
||||||
|
onPressed: () {
|
||||||
|
context.pop();
|
||||||
|
onConfirm(controller.text);
|
||||||
|
},
|
||||||
|
child: Text('确认'),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -26,9 +26,6 @@ class LoginPage extends StatefulWidget {
|
|||||||
class _LoginPageState extends State<LoginPage> {
|
class _LoginPageState extends State<LoginPage> {
|
||||||
var _subLoading = false;
|
var _subLoading = false;
|
||||||
|
|
||||||
///协议
|
|
||||||
bool _agree = false;
|
|
||||||
|
|
||||||
///谷歌登陆
|
///谷歌登陆
|
||||||
final GoogleSignIn _googleSignIn = GoogleSignIn.instance;
|
final GoogleSignIn _googleSignIn = GoogleSignIn.instance;
|
||||||
|
|
||||||
@@ -80,11 +77,6 @@ class _LoginPageState extends State<LoginPage> {
|
|||||||
|
|
||||||
///谷歌登录
|
///谷歌登录
|
||||||
void _handleGoogleSignIn() async {
|
void _handleGoogleSignIn() async {
|
||||||
if (!_agree) {
|
|
||||||
EasyLoading.showToast('Please read and agree to the terms first.');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// 如果用户未登录,则启动标准的 Google 登录
|
// 如果用户未登录,则启动标准的 Google 登录
|
||||||
if (_googleSignIn.supportsAuthenticate()) {
|
if (_googleSignIn.supportsAuthenticate()) {
|
||||||
@@ -120,11 +112,6 @@ class _LoginPageState extends State<LoginPage> {
|
|||||||
|
|
||||||
///apple登录
|
///apple登录
|
||||||
void _handAppleSignIn() async {
|
void _handAppleSignIn() async {
|
||||||
if (!_agree) {
|
|
||||||
EasyLoading.showToast('Please read and agree to the terms first.');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
final credential = await SignInWithApple.getAppleIDCredential(scopes: [AppleIDAuthorizationScopes.email, AppleIDAuthorizationScopes.fullName]);
|
final credential = await SignInWithApple.getAppleIDCredential(scopes: [AppleIDAuthorizationScopes.email, AppleIDAuthorizationScopes.fullName]);
|
||||||
EasyLoading.show(status: "Logging in...");
|
EasyLoading.show(status: "Logging in...");
|
||||||
@@ -139,10 +126,6 @@ class _LoginPageState extends State<LoginPage> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void _handSubmit() async {
|
void _handSubmit() async {
|
||||||
if (!_agree) {
|
|
||||||
EasyLoading.showToast('Please read and agree to the terms first.');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (_emailController.text.isEmpty) {
|
if (_emailController.text.isEmpty) {
|
||||||
//请输入邮箱
|
//请输入邮箱
|
||||||
EasyLoading.showError("Please enter your email");
|
EasyLoading.showError("Please enter your email");
|
||||||
@@ -238,14 +221,7 @@ class _LoginPageState extends State<LoginPage> {
|
|||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
margin: EdgeInsets.only(top: 40),
|
margin: EdgeInsets.only(top: 40),
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
child: AgreementBox(
|
child: AgreementBox(),
|
||||||
checked: _agree,
|
|
||||||
onChanged: (value) {
|
|
||||||
setState(() {
|
|
||||||
_agree = value;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -6,68 +6,40 @@ import '../../../../router/config/route_paths.dart';
|
|||||||
|
|
||||||
///勾中协议
|
///勾中协议
|
||||||
class AgreementBox extends StatelessWidget {
|
class AgreementBox extends StatelessWidget {
|
||||||
final bool checked;
|
|
||||||
final Function(bool) onChanged;
|
|
||||||
|
|
||||||
const AgreementBox({
|
const AgreementBox({
|
||||||
super.key,
|
super.key,
|
||||||
this.checked = false,
|
|
||||||
required this.onChanged,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Row(
|
return Text.rich(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
textAlign: TextAlign.center,
|
||||||
children: [
|
TextSpan(
|
||||||
SizedBox(
|
style: Theme.of(context).textTheme.labelSmall,
|
||||||
width: 25,
|
children: [
|
||||||
child: Transform.scale(
|
const TextSpan(text: "By logging in, you agree to our "),
|
||||||
scale: 0.8,
|
TextSpan(
|
||||||
child: Checkbox(
|
text: "Terms",
|
||||||
value: checked,
|
style: TextStyle(color: Theme.of(context).primaryColor),
|
||||||
shape: CircleBorder(),
|
recognizer: TapGestureRecognizer()
|
||||||
onChanged: (value) {
|
..onTap = () => context.push(
|
||||||
onChanged(value!);
|
RoutePaths.agreement,
|
||||||
},
|
extra: {"title": "Terms of Service", "url": "https://support.curain.ai/privacy/foodcura/terms_service.html"},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
const TextSpan(text: " and "),
|
||||||
GestureDetector(
|
TextSpan(
|
||||||
onTap: () {
|
text: "Privacy Policy",
|
||||||
onChanged(!checked);
|
style: TextStyle(color: Theme.of(context).primaryColor),
|
||||||
},
|
recognizer: TapGestureRecognizer()
|
||||||
child: RichText(
|
..onTap = () => context.push(
|
||||||
text: TextSpan(
|
RoutePaths.agreement,
|
||||||
style: Theme.of(context).textTheme.labelSmall,
|
extra: {"title": "Privacy", "url": "https://support.curain.ai/privacy/foodcura/privacy_policy.html"},
|
||||||
children: [
|
),
|
||||||
TextSpan(
|
|
||||||
text: "I agree to the ",
|
|
||||||
),
|
|
||||||
TextSpan(
|
|
||||||
text: "Terms",
|
|
||||||
style: TextStyle(color: Theme.of(context).primaryColor),
|
|
||||||
recognizer: TapGestureRecognizer()
|
|
||||||
..onTap = () => context.push(
|
|
||||||
RoutePaths.agreement,
|
|
||||||
extra: {"title": "Terms of Service", "url": "https://support.curain.ai/privacy/foodcura/terms_service.html"},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
TextSpan(text: " & "),
|
|
||||||
TextSpan(
|
|
||||||
text: "Privacy Policy",
|
|
||||||
style: TextStyle(color: Theme.of(context).primaryColor),
|
|
||||||
recognizer: TapGestureRecognizer()
|
|
||||||
..onTap = () => context.push(
|
|
||||||
RoutePaths.agreement,
|
|
||||||
extra: {"title": "Privacy", "url": "https://support.curain.ai/privacy/foodcura/privacy_policy.html"},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
const TextSpan(text: "."),
|
||||||
],
|
],
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,12 +10,15 @@ class LogoBox extends StatelessWidget {
|
|||||||
margin: EdgeInsets.only(bottom: 40),
|
margin: EdgeInsets.only(bottom: 40),
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Image.asset(
|
ClipRRect(
|
||||||
"assets/image/logo.png",
|
borderRadius: BorderRadius.circular(5),
|
||||||
width: 43,
|
child: Image.asset(
|
||||||
|
"assets/image/logo.png",
|
||||||
|
width: 43,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
"FoodCura",
|
"PlanCura",
|
||||||
style: Theme.of(context).textTheme.titleSmall,
|
style: Theme.of(context).textTheme.titleSmall,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ class AppStore with ChangeNotifier {
|
|||||||
notifyListeners();
|
notifyListeners();
|
||||||
}
|
}
|
||||||
|
|
||||||
///设置用户数据
|
///设置数据
|
||||||
Future<void> setInfo(LoginDto data) async {
|
Future<void> setInfo(LoginDto data) async {
|
||||||
token = data.accessToken!;
|
token = data.accessToken!;
|
||||||
userInfo = data.userInfo;
|
userInfo = data.userInfo;
|
||||||
@@ -30,6 +30,17 @@ class AppStore with ChangeNotifier {
|
|||||||
await Storage.set('token', token);
|
await Storage.set('token', token);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
///更新用户信息
|
||||||
|
void updateUserInfo(UserInfo value) async {
|
||||||
|
userInfo = userInfo?.copyWith(
|
||||||
|
name: value.name,
|
||||||
|
avatar: value.avatar,
|
||||||
|
description: value.description,
|
||||||
|
);
|
||||||
|
await Storage.set('userInfo', userInfo?.toJson());
|
||||||
|
notifyListeners();
|
||||||
|
}
|
||||||
|
|
||||||
///获取token
|
///获取token
|
||||||
static Future<String> getToken() async {
|
static Future<String> getToken() async {
|
||||||
return await Storage.get("token") ?? '';
|
return await Storage.get("token") ?? '';
|
||||||
|
|||||||
@@ -20,5 +20,5 @@ class RoutePaths {
|
|||||||
static const planHistory = "/planHistory";
|
static const planHistory = "/planHistory";
|
||||||
|
|
||||||
///计划详情页
|
///计划详情页
|
||||||
static const planDetail = "/planDetail";
|
static String planDetail([int? id]) => id != null ? "/planDetail/$id" : "/planDetail/:id";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,9 +11,15 @@ List<RouteType> planRoutes = [
|
|||||||
},
|
},
|
||||||
),
|
),
|
||||||
RouteType(
|
RouteType(
|
||||||
path: RoutePaths.planDetail,
|
path: RoutePaths.planDetail(),
|
||||||
child: (state) {
|
child: (state) {
|
||||||
return PlanDetailPage();
|
final id = state.pathParameters['id'];
|
||||||
|
final extraMap = state.extra as Map<String, dynamic>?;
|
||||||
|
|
||||||
|
return PlanDetailPage(
|
||||||
|
id: id,
|
||||||
|
planName: extraMap?['name'],
|
||||||
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ List<RouteBase> routes = routeConfigs.map((item) {
|
|||||||
|
|
||||||
//变量命名
|
//变量命名
|
||||||
GoRouter goRouter = GoRouter(
|
GoRouter goRouter = GoRouter(
|
||||||
initialLocation: RoutePaths.layout,
|
initialLocation: RoutePaths.splash,
|
||||||
routes: routes,
|
routes: routes,
|
||||||
navigatorKey: navigatorKey,
|
navigatorKey: navigatorKey,
|
||||||
);
|
);
|
||||||
|
|||||||
18
lib/theme/decorations/app_shadows.dart
Normal file
18
lib/theme/decorations/app_shadows.dart
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
///阴影卡片
|
||||||
|
final shadowDecoration = BoxDecoration(
|
||||||
|
border: Border.all(color: Colors.black, width: 2),
|
||||||
|
borderRadius: BorderRadius.circular(5),
|
||||||
|
color: Colors.white,
|
||||||
|
boxShadow: const [
|
||||||
|
BoxShadow(
|
||||||
|
color: Color(0xffb5b5b5),
|
||||||
|
blurRadius: 2,
|
||||||
|
offset: Offset(6, 6),
|
||||||
|
spreadRadius: 0,
|
||||||
|
blurStyle: BlurStyle.normal,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
20
lib/utils/debouncer.dart
Normal file
20
lib/utils/debouncer.dart
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
import 'dart:async';
|
||||||
|
import 'dart:ui';
|
||||||
|
|
||||||
|
class Debouncer {
|
||||||
|
final int milliseconds;
|
||||||
|
Timer? _timer;
|
||||||
|
|
||||||
|
Debouncer({this.milliseconds = 500});
|
||||||
|
|
||||||
|
/// 调用时会延迟执行,如果期间再次调用会重置计时器
|
||||||
|
void run(VoidCallback action) {
|
||||||
|
_timer?.cancel();
|
||||||
|
_timer = Timer(Duration(milliseconds: milliseconds), action);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 页面销毁时要记得调用
|
||||||
|
void dispose() {
|
||||||
|
_timer?.cancel();
|
||||||
|
}
|
||||||
|
}
|
||||||
113
lib/widgets/business/delete_row_item.dart
Normal file
113
lib/widgets/business/delete_row_item.dart
Normal file
@@ -0,0 +1,113 @@
|
|||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:go_router/go_router.dart';
|
||||||
|
import 'package:remixicon/remixicon.dart';
|
||||||
|
|
||||||
|
class DeleteRowItem extends StatefulWidget {
|
||||||
|
final bool showDelete;
|
||||||
|
final List<Widget> Function(BuildContext context, Animation<double> animation) builder;
|
||||||
|
final Function() onDelete;
|
||||||
|
|
||||||
|
const DeleteRowItem({
|
||||||
|
super.key,
|
||||||
|
this.showDelete = false,
|
||||||
|
required this.builder,
|
||||||
|
required this.onDelete,
|
||||||
|
});
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<DeleteRowItem> createState() => _DeleteRowItemState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _DeleteRowItemState extends State<DeleteRowItem> with TickerProviderStateMixin {
|
||||||
|
late AnimationController _controller;
|
||||||
|
late Animation<double> _animation;
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
_controller = AnimationController(
|
||||||
|
vsync: this,
|
||||||
|
duration: Duration(milliseconds: 300),
|
||||||
|
);
|
||||||
|
_animation = CurvedAnimation(
|
||||||
|
parent: _controller,
|
||||||
|
curve: Curves.easeInOut,
|
||||||
|
);
|
||||||
|
|
||||||
|
if (widget.showDelete) {
|
||||||
|
_controller.forward();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void didUpdateWidget(covariant DeleteRowItem oldWidget) {
|
||||||
|
super.didUpdateWidget(oldWidget);
|
||||||
|
if (oldWidget.showDelete != widget.showDelete) {
|
||||||
|
if (widget.showDelete) {
|
||||||
|
_controller.forward();
|
||||||
|
} else {
|
||||||
|
_controller.reverse();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void dispose() {
|
||||||
|
_controller.dispose();
|
||||||
|
super.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
///点击删除
|
||||||
|
void _handleDelete() {
|
||||||
|
showCupertinoDialog(
|
||||||
|
context: context,
|
||||||
|
builder: (_) {
|
||||||
|
return CupertinoAlertDialog(
|
||||||
|
title: Text("删除计划"),
|
||||||
|
actions: [
|
||||||
|
CupertinoDialogAction(
|
||||||
|
child: Text("取消"),
|
||||||
|
onPressed: () {
|
||||||
|
context.pop();
|
||||||
|
},
|
||||||
|
),
|
||||||
|
CupertinoDialogAction(
|
||||||
|
isDestructiveAction: true,
|
||||||
|
onPressed: () {
|
||||||
|
context.pop();
|
||||||
|
widget.onDelete();
|
||||||
|
},
|
||||||
|
child: Text("确定"),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Row(
|
||||||
|
children: [
|
||||||
|
SizeTransition(
|
||||||
|
axis: Axis.horizontal,
|
||||||
|
sizeFactor: _animation,
|
||||||
|
axisAlignment: -1, // 从左向右展开
|
||||||
|
child: InkWell(
|
||||||
|
onTap: _handleDelete,
|
||||||
|
child: Container(
|
||||||
|
margin: EdgeInsets.only(right: 10),
|
||||||
|
child: Icon(
|
||||||
|
RemixIcons.indeterminate_circle_fill,
|
||||||
|
color: Colors.red,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
...widget.builder(context, _animation),
|
||||||
|
// ...widget.children,
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,13 +1,14 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:remixicon/remixicon.dart';
|
|
||||||
|
|
||||||
class PopupAction extends StatelessWidget {
|
class PopupAction extends StatelessWidget {
|
||||||
final List<PopupMenuEntry<String>> items;
|
final List<PopupMenuEntry<String>> items;
|
||||||
|
final Widget child;
|
||||||
final Function(String) onSelected;
|
final Function(String) onSelected;
|
||||||
|
|
||||||
const PopupAction({
|
const PopupAction({
|
||||||
super.key,
|
super.key,
|
||||||
required this.items,
|
required this.items,
|
||||||
|
required this.child,
|
||||||
required this.onSelected,
|
required this.onSelected,
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -26,7 +27,7 @@ class PopupAction extends StatelessWidget {
|
|||||||
shadowColor: Colors.black87,
|
shadowColor: Colors.black87,
|
||||||
onSelected:onSelected,
|
onSelected:onSelected,
|
||||||
itemBuilder: (context) => items,
|
itemBuilder: (context) => items,
|
||||||
child: const Icon(RemixIcons.more_fill),
|
child:child ,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
200
pubspec.lock
200
pubspec.lock
@@ -25,6 +25,30 @@ packages:
|
|||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.1.2"
|
version: "2.1.2"
|
||||||
|
cached_network_image:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: cached_network_image
|
||||||
|
sha256: "7c1183e361e5c8b0a0f21a28401eecdbde252441106a9816400dd4c2b2424916"
|
||||||
|
url: "https://pub.flutter-io.cn"
|
||||||
|
source: hosted
|
||||||
|
version: "3.4.1"
|
||||||
|
cached_network_image_platform_interface:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: cached_network_image_platform_interface
|
||||||
|
sha256: "35814b016e37fbdc91f7ae18c8caf49ba5c88501813f73ce8a07027a395e2829"
|
||||||
|
url: "https://pub.flutter-io.cn"
|
||||||
|
source: hosted
|
||||||
|
version: "4.1.1"
|
||||||
|
cached_network_image_web:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: cached_network_image_web
|
||||||
|
sha256: "980842f4e8e2535b8dbd3d5ca0b1f0ba66bf61d14cc3a17a9b4788a3685ba062"
|
||||||
|
url: "https://pub.flutter-io.cn"
|
||||||
|
source: hosted
|
||||||
|
version: "1.3.1"
|
||||||
characters:
|
characters:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -57,6 +81,14 @@ packages:
|
|||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.3.4+2"
|
version: "0.3.4+2"
|
||||||
|
crypto:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: crypto
|
||||||
|
sha256: "1e445881f28f22d6140f181e07737b22f1e099a5e1ff94b0af2f9e4a463f4855"
|
||||||
|
url: "https://pub.flutter-io.cn"
|
||||||
|
source: hosted
|
||||||
|
version: "3.0.6"
|
||||||
cupertino_icons:
|
cupertino_icons:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@@ -153,11 +185,27 @@ packages:
|
|||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.9.3+4"
|
version: "0.9.3+4"
|
||||||
|
fixnum:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: fixnum
|
||||||
|
sha256: b6dc7065e46c974bc7c5f143080a6764ec7a4be6da1285ececdc37be96de53be
|
||||||
|
url: "https://pub.flutter-io.cn"
|
||||||
|
source: hosted
|
||||||
|
version: "1.1.1"
|
||||||
flutter:
|
flutter:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description: flutter
|
description: flutter
|
||||||
source: sdk
|
source: sdk
|
||||||
version: "0.0.0"
|
version: "0.0.0"
|
||||||
|
flutter_cache_manager:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: flutter_cache_manager
|
||||||
|
sha256: "400b6592f16a4409a7f2bb929a9a7e38c72cceb8ffb99ee57bbf2cb2cecf8386"
|
||||||
|
url: "https://pub.flutter-io.cn"
|
||||||
|
source: hosted
|
||||||
|
version: "3.4.1"
|
||||||
flutter_easyloading:
|
flutter_easyloading:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@@ -174,6 +222,54 @@ packages:
|
|||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.7.0"
|
version: "0.7.0"
|
||||||
|
flutter_image_compress:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: flutter_image_compress
|
||||||
|
sha256: "51d23be39efc2185e72e290042a0da41aed70b14ef97db362a6b5368d0523b27"
|
||||||
|
url: "https://pub.flutter-io.cn"
|
||||||
|
source: hosted
|
||||||
|
version: "2.4.0"
|
||||||
|
flutter_image_compress_common:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: flutter_image_compress_common
|
||||||
|
sha256: c5c5d50c15e97dd7dc72ff96bd7077b9f791932f2076c5c5b6c43f2c88607bfb
|
||||||
|
url: "https://pub.flutter-io.cn"
|
||||||
|
source: hosted
|
||||||
|
version: "1.0.6"
|
||||||
|
flutter_image_compress_macos:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: flutter_image_compress_macos
|
||||||
|
sha256: "20019719b71b743aba0ef874ed29c50747461e5e8438980dfa5c2031898f7337"
|
||||||
|
url: "https://pub.flutter-io.cn"
|
||||||
|
source: hosted
|
||||||
|
version: "1.0.3"
|
||||||
|
flutter_image_compress_ohos:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: flutter_image_compress_ohos
|
||||||
|
sha256: e76b92bbc830ee08f5b05962fc78a532011fcd2041f620b5400a593e96da3f51
|
||||||
|
url: "https://pub.flutter-io.cn"
|
||||||
|
source: hosted
|
||||||
|
version: "0.0.3"
|
||||||
|
flutter_image_compress_platform_interface:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: flutter_image_compress_platform_interface
|
||||||
|
sha256: "579cb3947fd4309103afe6442a01ca01e1e6f93dc53bb4cbd090e8ce34a41889"
|
||||||
|
url: "https://pub.flutter-io.cn"
|
||||||
|
source: hosted
|
||||||
|
version: "1.0.5"
|
||||||
|
flutter_image_compress_web:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: flutter_image_compress_web
|
||||||
|
sha256: b9b141ac7c686a2ce7bb9a98176321e1182c9074650e47bb140741a44b6f5a96
|
||||||
|
url: "https://pub.flutter-io.cn"
|
||||||
|
source: hosted
|
||||||
|
version: "0.1.5"
|
||||||
flutter_lints:
|
flutter_lints:
|
||||||
dependency: "direct dev"
|
dependency: "direct dev"
|
||||||
description:
|
description:
|
||||||
@@ -464,6 +560,14 @@ packages:
|
|||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.0.0"
|
version: "1.0.0"
|
||||||
|
octo_image:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: octo_image
|
||||||
|
sha256: "34faa6639a78c7e3cbe79be6f9f96535867e879748ade7d17c9b1ae7536293bd"
|
||||||
|
url: "https://pub.flutter-io.cn"
|
||||||
|
source: hosted
|
||||||
|
version: "2.1.0"
|
||||||
path:
|
path:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -472,6 +576,30 @@ packages:
|
|||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.9.1"
|
version: "1.9.1"
|
||||||
|
path_provider:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: path_provider
|
||||||
|
sha256: "50c5dd5b6e1aaf6fb3a78b33f6aa3afca52bf903a8a5298f53101fdaee55bbcd"
|
||||||
|
url: "https://pub.flutter-io.cn"
|
||||||
|
source: hosted
|
||||||
|
version: "2.1.5"
|
||||||
|
path_provider_android:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: path_provider_android
|
||||||
|
sha256: "993381400e94d18469750e5b9dcb8206f15bc09f9da86b9e44a9b0092a0066db"
|
||||||
|
url: "https://pub.flutter-io.cn"
|
||||||
|
source: hosted
|
||||||
|
version: "2.2.18"
|
||||||
|
path_provider_foundation:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: path_provider_foundation
|
||||||
|
sha256: "16eef174aacb07e09c351502740fa6254c165757638eba1e9116b0a781201bbd"
|
||||||
|
url: "https://pub.flutter-io.cn"
|
||||||
|
source: hosted
|
||||||
|
version: "2.4.2"
|
||||||
path_provider_linux:
|
path_provider_linux:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -536,6 +664,14 @@ packages:
|
|||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.4.1"
|
version: "1.4.1"
|
||||||
|
rxdart:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: rxdart
|
||||||
|
sha256: "5c3004a4a8dbb94bd4bf5412a4def4acdaa12e12f269737a5751369e12d1a962"
|
||||||
|
url: "https://pub.flutter-io.cn"
|
||||||
|
source: hosted
|
||||||
|
version: "0.28.0"
|
||||||
scroll_to_index:
|
scroll_to_index:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -645,6 +781,54 @@ packages:
|
|||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.10.1"
|
version: "1.10.1"
|
||||||
|
sprintf:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: sprintf
|
||||||
|
sha256: "1fc9ffe69d4df602376b52949af107d8f5703b77cda567c4d7d86a0693120f23"
|
||||||
|
url: "https://pub.flutter-io.cn"
|
||||||
|
source: hosted
|
||||||
|
version: "7.0.0"
|
||||||
|
sqflite:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: sqflite
|
||||||
|
sha256: e2297b1da52f127bc7a3da11439985d9b536f75070f3325e62ada69a5c585d03
|
||||||
|
url: "https://pub.flutter-io.cn"
|
||||||
|
source: hosted
|
||||||
|
version: "2.4.2"
|
||||||
|
sqflite_android:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: sqflite_android
|
||||||
|
sha256: "2b3070c5fa881839f8b402ee4a39c1b4d561704d4ebbbcfb808a119bc2a1701b"
|
||||||
|
url: "https://pub.flutter-io.cn"
|
||||||
|
source: hosted
|
||||||
|
version: "2.4.1"
|
||||||
|
sqflite_common:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: sqflite_common
|
||||||
|
sha256: "6ef422a4525ecc601db6c0a2233ff448c731307906e92cabc9ba292afaae16a6"
|
||||||
|
url: "https://pub.flutter-io.cn"
|
||||||
|
source: hosted
|
||||||
|
version: "2.5.6"
|
||||||
|
sqflite_darwin:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: sqflite_darwin
|
||||||
|
sha256: "279832e5cde3fe99e8571879498c9211f3ca6391b0d818df4e17d9fff5c6ccb3"
|
||||||
|
url: "https://pub.flutter-io.cn"
|
||||||
|
source: hosted
|
||||||
|
version: "2.4.2"
|
||||||
|
sqflite_platform_interface:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: sqflite_platform_interface
|
||||||
|
sha256: "8dd4515c7bdcae0a785b0062859336de775e8c65db81ae33dd5445f35be61920"
|
||||||
|
url: "https://pub.flutter-io.cn"
|
||||||
|
source: hosted
|
||||||
|
version: "2.4.0"
|
||||||
stack_trace:
|
stack_trace:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -669,6 +853,14 @@ packages:
|
|||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.4.1"
|
version: "1.4.1"
|
||||||
|
synchronized:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: synchronized
|
||||||
|
sha256: c254ade258ec8282947a0acbbc90b9575b4f19673533ee46f2f6e9b3aeefd7c0
|
||||||
|
url: "https://pub.flutter-io.cn"
|
||||||
|
source: hosted
|
||||||
|
version: "3.4.0"
|
||||||
term_glyph:
|
term_glyph:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -757,6 +949,14 @@ packages:
|
|||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.1.4"
|
version: "3.1.4"
|
||||||
|
uuid:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: uuid
|
||||||
|
sha256: a5be9ef6618a7ac1e964353ef476418026db906c4facdedaa299b7a2e71690ff
|
||||||
|
url: "https://pub.flutter-io.cn"
|
||||||
|
source: hosted
|
||||||
|
version: "4.5.1"
|
||||||
vector_math:
|
vector_math:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|||||||
@@ -27,6 +27,8 @@ dependencies:
|
|||||||
image_picker: ^1.2.0
|
image_picker: ^1.2.0
|
||||||
markdown_widget: ^2.3.2+8
|
markdown_widget: ^2.3.2+8
|
||||||
sign_in_with_apple: ^7.0.1
|
sign_in_with_apple: ^7.0.1
|
||||||
|
flutter_image_compress: ^2.4.0
|
||||||
|
cached_network_image: ^3.4.1
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
flutter_test:
|
flutter_test:
|
||||||
|
|||||||
Reference in New Issue
Block a user