Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve ui #92

Merged
merged 3 commits into from
Jan 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<application
android:name="${applicationName}"
android:icon="@mipmap/launcher_icon"
android:label="@string/appName"
android:label="Moodiary"
android:enableOnBackInvokedCallback="true"
android:networkSecurityConfig="@xml/network_security_config"
android:requestLegacyExternalStorage="true"
Expand Down
4 changes: 0 additions & 4 deletions android/app/src/main/res/values-en/appname.xml

This file was deleted.

4 changes: 0 additions & 4 deletions android/app/src/main/res/values-zh/appname.xml

This file was deleted.

4 changes: 0 additions & 4 deletions android/app/src/main/res/values/appname.xml

This file was deleted.

72 changes: 36 additions & 36 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -292,54 +292,54 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/wakelock_plus/ios"

SPEC CHECKSUMS:
app_links: e7a6750a915a9e161c58d91bc610e8cd1d4d0ad0
audioplayers_darwin: 877d9a4d06331c5c374595e46e16453ac7eafa40
connectivity_plus: 18382e7311ba19efcaee94442b23b32507b20695
device_info_plus: bf2e3232933866d73fe290f2942f2156cdd10342
app_links: 3da4c36b46cac3bf24eb897f1a6ce80bda109874
audioplayers_darwin: ccf9c770ee768abb07e26d90af093f7bab1c12ab
connectivity_plus: 2256d3e20624a7749ed21653aafe291a46446fee
device_info_plus: 21fcca2080fbcd348be798aa36c3e5ed849eefbe
DKImagePickerController: 946cec48c7873164274ecc4624d19e3da4c1ef3c
DKPhotoGallery: b3834fecb755ee09a593d7c9e389d8b5d6deed60
fc_native_video_thumbnail: 927d4dcfd4c7e9f2cc1a20bb52dfee83de3792c2
file_picker: 09aa5ec1ab24135ccd7a1621c46c84134bfd6655
fc_native_video_thumbnail: b511cec81fad66be9b28dd54b9adb39d40fcd6cc
file_picker: 9b3292d7c8bc68c8a7bf8eb78f730e49c8efc517
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
flutter_image_compress_common: ec1d45c362c9d30a3f6a0426c297f47c52007e3e
flutter_keyboard_visibility_temp_fork: 8a8809c4129e31d25fca77446e0f3fd548122ced
flutter_native_splash: e8a1e01082d97a8099d973f919f57904c925008a
fluttertoast: e9a18c7be5413da53898f660530c56f35edfba9c
gal: 6a522c75909f1244732d4596d11d6a2f86ff37a5
geolocator_apple: 9bcea1918ff7f0062d98345d238ae12718acfbc1
image_picker_ios: c560581cceedb403a6ff17f2f816d7fea1421fc1
isar_flutter_libs: b69f437aeab9c521821c3f376198c4371fa21073
flutter_image_compress_common: 1697a328fd72bfb335507c6bca1a65fa5ad87df1
flutter_keyboard_visibility_temp_fork: 95b2d534bacf6ac62e7fcbe5c2a9e2c2a17ce06f
flutter_native_splash: 6cad9122ea0fad137d23137dd14b937f3e90b145
fluttertoast: 76fea30fcf04176325f6864c87306927bd7d2038
gal: baecd024ebfd13c441269ca7404792a7152fde89
geolocator_apple: 1560c3c875af2a412242c7a923e15d0d401966ff
image_picker_ios: 7fe1ff8e34c1790d6fff70a32484959f563a928a
isar_flutter_libs: 9fc2cfb928c539e1b76c481ba5d143d556d94920
libwebp: 1786c9f4ff8a279e4dac1e8f385004d5fc253009
local_auth_darwin: 66e40372f1c29f383a314c738c7446e2f7fdadc3
local_auth_darwin: 553ce4f9b16d3fdfeafce9cf042e7c9f77c1c391
Mantle: c5aa8794a29a022dfbbfc9799af95f477a69b62d
media_kit_libs_ios_video: a5fe24bc7875ccd6378a0978c13185e1344651c1
media_kit_native_event_loop: e6b2ab20cf0746eb1c33be961fcf79667304fa2a
media_kit_video: 5da63f157170e5bf303bf85453b7ef6971218a2e
network_info_plus: 6613d9d7cdeb0e6f366ed4dbe4b3c51c52d567a9
media_kit_libs_ios_video: 5a18affdb97d1f5d466dc79988b13eff6c5e2854
media_kit_native_event_loop: 5fba1a849a6c87a34985f1e178a0de5bd444a0cf
media_kit_video: 1746e198cb697d1ffb734b1d05ec429d1fcd1474
network_info_plus: cf61925ab5205dce05a4f0895989afdb6aade5fc
ObjectBox: 0bc4bb75eea85f6af06b369148b334c2056bbc29
objectbox_flutter_libs: 2ce0da386c780878687c736b528ceaf371573efb
package_info_plus: c0502532a26c7662a62a356cebe2692ec5fe4ec4
path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46
permission_handler_apple: 9878588469a2b0d0fc1e048d9f43605f92e6cec2
quill_native_bridge_ios: 2b01d585fcc73d0f5eed78c0bd244ee564b06f5a
record_darwin: 3b1a8e7d5c0cbf45ad6165b4d83a6ca643d929c3
rive_common: 4743dbfd2911c99066547a3c6454681e0fa907df
rust_lib_mood_diary: 38a92354760d3409ebc859f812193e7c69e184ef
screen_brightness_ios: 715ca807df953bf676d339f11464e438143ee625
objectbox_flutter_libs: 3af037f7cc35e687acca01f1f6da6cb6c2abc22b
package_info_plus: af8e2ca6888548050f16fa2f1938db7b5a5df499
path_provider_foundation: 080d55be775b7414fd5a5ef3ac137b97b097e564
permission_handler_apple: 4ed2196e43d0651e8ff7ca3483a069d469701f2d
quill_native_bridge_ios: f47af4b14e7757968486641656c5d23250cee521
record_darwin: fb1f375f1d9603714f55b8708a903bbb91ffdb0a
rive_common: dd421daaf9ae69f0125aa761dd96abd278399952
rust_lib_mood_diary: ea9f784d50426d5994e53cecee71cd23d965542a
screen_brightness_ios: 5ed898fa50fa82a26171c086ca5e28228f932576
SDWebImage: 8a6b7b160b4d710e2a22b6900e25301075c34cb3
SDWebImageWebPCoder: e38c0a70396191361d60c092933e22c20d5b1380
share_plus: 8b6f8b3447e494cca5317c8c3073de39b3600d1f
shared_preferences_foundation: fcdcbc04712aee1108ac7fda236f363274528f78
sqflite_darwin: 5a7236e3b501866c1c9befc6771dfd73ffb8702d
share_plus: 50da8cb520a8f0f65671c6c6a99b3617ed10a58a
shared_preferences_foundation: 9e1978ff2562383bd5676f64ec4e9aa8fa06a6f7
sqflite_darwin: 20b2a3a3b70e43edae938624ce550a3cbf66a3d0
SwiftyGif: 706c60cf65fa2bc5ee0313beece843c8eb8194d4
TensorFlowLiteC: 20785a69299185a379ba9852b6625f00afd7984a
TensorFlowLiteSwift: 3a4928286e9e35bdd3e17970f48e53c80d25e793
tflite_flutter: 9433d086a3060431bbc9f3c7c20d017db0e72d08
tflite_flutter: 64b192e11352fe36943ab6656e1d49207f1a5595
Toast: 1f5ea13423a1e6674c4abdac5be53587ae481c4e
url_launcher_ios: 5334b05cef931de560670eeae103fd3e431ac3fe
video_player_avfoundation: 7c6c11d8470e1675df7397027218274b6d2360b3
volume_controller: 531ddf792994285c9b17f9d8a7e4dcdd29b3eae9
wakelock_plus: 78ec7c5b202cab7761af8e2b2b3d0671be6c4ae1
url_launcher_ios: 694010445543906933d732453a59da0a173ae33d
video_player_avfoundation: 2cef49524dd1f16c5300b9cd6efd9611ce03639b
volume_controller: ca1cde542ee70fad77d388f82e9616488110942b
wakelock_plus: 04623e3f525556020ebd4034310f20fe7fda8b49

PODFILE CHECKSUM: 9752b5340b4d3f9618318fcd530d907790e2a9f5

Expand Down
44 changes: 28 additions & 16 deletions ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -489,9 +489,11 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 3XA29H789G;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.lifestyle";
Expand All @@ -500,9 +502,10 @@
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = cn.yooss.moodDiary;
PRODUCT_BUNDLE_IDENTIFIER = cn.yooss.moodiary;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "moodiary-ios-dev";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_VERSION = 5.0;
VERSIONING_SYSTEM = "apple-generic";
Expand All @@ -514,13 +517,14 @@
baseConfigurationReference = D73569CF22DB2A16EAE0220D /* Pods-RunnerTests.debug.xcconfig */;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
CODE_SIGN_STYLE = Automatic;
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = 3XA29H789G;
DEVELOPMENT_TEAM = "";
GENERATE_INFOPLIST_FILE = YES;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = cn.yooss.moodDiary.RunnerTests;
PRODUCT_BUNDLE_IDENTIFIER = cn.yooss.moodiary;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
Expand All @@ -533,13 +537,14 @@
baseConfigurationReference = E7AEAE59248BEA6C8378B114 /* Pods-RunnerTests.release.xcconfig */;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
CODE_SIGN_STYLE = Automatic;
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = 3XA29H789G;
DEVELOPMENT_TEAM = "";
GENERATE_INFOPLIST_FILE = YES;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = cn.yooss.moodDiary.RunnerTests;
PRODUCT_BUNDLE_IDENTIFIER = cn.yooss.moodiary;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_VERSION = 5.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner";
};
Expand All @@ -550,13 +555,14 @@
baseConfigurationReference = E231F0C855BB3DD103DA44E9 /* Pods-RunnerTests.profile.xcconfig */;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
CODE_SIGN_STYLE = Automatic;
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = 3XA29H789G;
DEVELOPMENT_TEAM = "";
GENERATE_INFOPLIST_FILE = YES;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = cn.yooss.moodDiary.RunnerTests;
PRODUCT_BUNDLE_IDENTIFIER = cn.yooss.moodiary;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_VERSION = 5.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner";
};
Expand Down Expand Up @@ -682,9 +688,11 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = 3XA29H789G;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 3XA29H789G;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.lifestyle";
Expand All @@ -693,9 +701,10 @@
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = cn.yooss.moodDiary;
PRODUCT_BUNDLE_IDENTIFIER = cn.yooss.moodiary;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "moodiary-ios-dev";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
Expand All @@ -710,9 +719,11 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = 3XA29H789G;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 3XA29H789G;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.lifestyle";
Expand All @@ -721,9 +732,10 @@
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = cn.yooss.moodDiary;
PRODUCT_BUNDLE_IDENTIFIER = cn.yooss.moodiary;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "moodiary-ios-dev";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_VERSION = 5.0;
VERSIONING_SYSTEM = "apple-generic";
Expand Down
4 changes: 2 additions & 2 deletions ios/Runner/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key>
<string>心绪日记</string>
<string>Moodiary</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>心绪日记</string>
<string>Moodiary</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
Expand Down
17 changes: 3 additions & 14 deletions lib/components/category_add/category_add_logic.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:mood_diary/common/models/isar/category.dart';
import 'package:mood_diary/pages/edit/edit_logic.dart';
Expand All @@ -10,7 +9,6 @@ import 'category_add_state.dart';

class CategoryAddLogic extends GetxController {
final CategoryAddState state = CategoryAddState();
late TextEditingController textEditingController = TextEditingController();
late final EditLogic editLogic = Bind.find<EditLogic>();
late final DiaryLogic diaryLogic = Bind.find<DiaryLogic>();

Expand All @@ -22,33 +20,24 @@ class CategoryAddLogic extends GetxController {

@override
void onClose() {
textEditingController.dispose();
super.onClose();
}

void getCategory() {
state.categoryList.value = IsarUtil.getAllCategory();
}

Future<void> addCategory() async {
if (textEditingController.text.isNotEmpty) {
var res = await IsarUtil.insertACategory(
Category()..categoryName = textEditingController.text);
Get.backLegacy();
Future<void> addCategory({required String text}) async {
if (text.isNotEmpty) {
var res = await IsarUtil.insertACategory(Category()..categoryName = text);
if (res == false) {
NoticeUtil.showToast('已经存在同名分类,已自动重命名');
}
textEditingController.clear();
getCategory();
await diaryLogic.updateCategory();
}
}

void cancelAdd() {
textEditingController.clear();
Get.backLegacy();
}

void selectCategory(int index) {
Get.backLegacy();
editLogic.selectCategory(state.categoryList.value[index].id);
Expand Down
46 changes: 12 additions & 34 deletions lib/components/category_add/category_add_view.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import 'package:adaptive_dialog/adaptive_dialog.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:mood_diary/common/values/border.dart';

import '../../main.dart';
import 'category_add_logic.dart';

class CategoryAddComponent extends StatelessWidget {
Expand Down Expand Up @@ -32,39 +31,18 @@ class CategoryAddComponent extends StatelessWidget {
FilledButton.icon(
icon: const Icon(Icons.add),
label: const Text('添加'),
onPressed: () {
showDialog(
onPressed: () async {
var res = await showTextInputDialog(
context: context,
builder: (context) {
return AlertDialog(
content: TextField(
maxLines: 1,
controller: logic.textEditingController,
decoration: InputDecoration(
fillColor: colorScheme.secondaryContainer,
border: const UnderlineInputBorder(
borderRadius:
AppBorderRadius.smallBorderRadius,
borderSide: BorderSide.none,
),
filled: true,
labelText: '标签',
),
),
actions: [
TextButton(
onPressed: () {
logic.cancelAdd();
},
child: Text(l10n.cancel)),
TextButton(
onPressed: () async {
await logic.addCategory();
},
child: Text(l10n.ok))
],
);
});
title: '输入分类名称',
textFields: [
const DialogTextField(
hintText: '分类名称',
)
]);
if (res != null) {
logic.addCategory(text: res.first);
}
},
),
Text(state.categoryList.length.toString())
Expand Down
Loading