From 0b31d32217d76b8181e0c044d86bf76fcefe7014 Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Sat, 15 Feb 2025 13:06:25 +0800 Subject: [PATCH 1/4] :lipstick: Fix some designs issue :bug: Fix web some pages error --- lib/main.dart | 13 +++++++++++-- lib/screens/home.dart | 8 ++++++++ lib/screens/post/post_editor.dart | 4 +--- lib/widgets/chat/chat_message_input.dart | 2 +- pubspec.lock | 2 +- pubspec.yaml | 1 + 6 files changed, 23 insertions(+), 7 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index 6a35709..13acd0d 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -47,6 +47,8 @@ import 'package:tray_manager/tray_manager.dart'; import 'package:version/version.dart'; import 'package:workmanager/workmanager.dart'; import 'package:in_app_review/in_app_review.dart'; +import 'package:image_picker_android/image_picker_android.dart'; +import 'package:image_picker_platform_interface/image_picker_platform_interface.dart'; @pragma('vm:entry-point') void appBackgroundDispatcher() { @@ -107,6 +109,13 @@ void main() async { } } + if (!kIsWeb && Platform.isAndroid) { + final ImagePickerPlatform imagePickerImplementation = ImagePickerPlatform.instance; + if (imagePickerImplementation is ImagePickerAndroid) { + imagePickerImplementation.useAndroidPhotoPicker = true; + } + } + runApp(const SolianApp()); } @@ -160,8 +169,8 @@ class SolianApp extends StatelessWidget { ), ), breakpoints: [ - const Breakpoint(start: 0, end: 450, name: MOBILE), - const Breakpoint(start: 451, end: 800, name: TABLET), + const Breakpoint(start: 0, end: 600, name: MOBILE), + const Breakpoint(start: 601, end: 800, name: TABLET), const Breakpoint(start: 801, end: 1920, name: DESKTOP), ], ); diff --git a/lib/screens/home.dart b/lib/screens/home.dart index 9352821..32e897e 100644 --- a/lib/screens/home.dart +++ b/lib/screens/home.dart @@ -131,6 +131,7 @@ class _HomeDashUpdateWidget extends StatelessWidget { return Container( padding: padding, child: Card( + margin: EdgeInsets.zero, child: ListTile( leading: Icon(Symbols.update), title: Text('updateAvailable').tr(), @@ -180,6 +181,7 @@ class _HomeDashSpecialDayWidgetState extends State<_HomeDashSpecialDayWidget> { return Column( children: days.map((ele) { return Card( + margin: EdgeInsets.zero, child: ListTile( leading: Text(kSpecialDaysSymbol[ele] ?? '🎉').fontSize(24), title: Text('celebrate$ele').tr(args: [ua.user?.nick ?? 'user']), @@ -203,6 +205,7 @@ class _HomeDashSpecialDayWidgetState extends State<_HomeDashSpecialDayWidget> { final progress = dayz.getSpecialDayProgress(lastOne.$2, date); final diff = nextOne.$2.difference(DateTime.now()); return Card( + margin: EdgeInsets.zero, child: ListTile( leading: Text(kSpecialDaysSymbol[name] ?? '🎉').fontSize(24), title: Text('pending$name').tr(args: [RelativeTime(context).format(date).replaceFirst('in', '').trim()]), @@ -270,6 +273,7 @@ class _HomeDashTodayNewsState extends State<_HomeDashTodayNews> { @override Widget build(BuildContext context) { return Card( + margin: EdgeInsets.zero, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -469,6 +473,7 @@ class _HomeDashCheckInWidgetState extends State<_HomeDashCheckInWidget> { @override Widget build(BuildContext context) { return Card( + margin: EdgeInsets.zero, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -594,6 +599,7 @@ class _HomeDashNotificationWidgetState extends State<_HomeDashNotificationWidget @override Widget build(BuildContext context) { return Card( + margin: EdgeInsets.zero, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -667,11 +673,13 @@ class _HomeDashRecommendationPostWidgetState extends State<_HomeDashRecommendati Widget build(BuildContext context) { if (_isBusy) { return Card( + margin: EdgeInsets.zero, child: CircularProgressIndicator().center(), ); } return Card( + margin: EdgeInsets.zero, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ diff --git a/lib/screens/post/post_editor.dart b/lib/screens/post/post_editor.dart index fd55915..b74db26 100644 --- a/lib/screens/post/post_editor.dart +++ b/lib/screens/post/post_editor.dart @@ -112,9 +112,7 @@ class _PostEditorScreenState extends State { final HotKey _pasteHotKey = HotKey( key: PhysicalKeyboardKey.keyV, - modifiers: [ - Platform.isMacOS ? HotKeyModifier.meta : HotKeyModifier.control - ], + modifiers: [(!kIsWeb && Platform.isMacOS) ? HotKeyModifier.meta : HotKeyModifier.control], scope: HotKeyScope.inapp, ); diff --git a/lib/widgets/chat/chat_message_input.dart b/lib/widgets/chat/chat_message_input.dart index df4c1cc..4e43c3e 100644 --- a/lib/widgets/chat/chat_message_input.dart +++ b/lib/widgets/chat/chat_message_input.dart @@ -45,7 +45,7 @@ class ChatMessageInputState extends State { final HotKey _pasteHotKey = HotKey( key: PhysicalKeyboardKey.keyV, - modifiers: [Platform.isMacOS ? HotKeyModifier.meta : HotKeyModifier.control], + modifiers: [(!kIsWeb && Platform.isMacOS) ? HotKeyModifier.meta : HotKeyModifier.control], scope: HotKeyScope.inapp, ); diff --git a/pubspec.lock b/pubspec.lock index 06b6faa..9362a39 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1043,7 +1043,7 @@ packages: source: hosted version: "1.1.2" image_picker_android: - dependency: transitive + dependency: "direct main" description: name: image_picker_android sha256: b62d34a506e12bb965e824b6db4fbf709ee4589cf5d3e99b45ab2287b008ee0c diff --git a/pubspec.yaml b/pubspec.yaml index a44dea3..a326847 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -120,6 +120,7 @@ dependencies: xml: ^6.5.0 tray_manager: ^0.3.2 hotkey_manager: ^0.2.3 + image_picker_android: ^0.8.12+20 dev_dependencies: flutter_test: From 251fbb2503828446c1b61ef4bc6c25a268e0eedd Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Sat, 15 Feb 2025 13:34:23 +0800 Subject: [PATCH 2/4] :bug: Try to fix github action build error --- lib/screens/abuse_report.dart | 5 ++++- lib/screens/album.dart | 6 ++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/screens/abuse_report.dart b/lib/screens/abuse_report.dart index 49746c4..098bbec 100644 --- a/lib/screens/abuse_report.dart +++ b/lib/screens/abuse_report.dart @@ -74,7 +74,10 @@ class _AbuseReportScreenState extends State { ), const Divider(height: 1), if (_isBusy) - const CircularProgressIndicator().padding(all: 24).center() + Padding( + padding: const EdgeInsets.all(24), + child: const CircularProgressIndicator(), + ).center() else Expanded( child: ListView.builder( diff --git a/lib/screens/album.dart b/lib/screens/album.dart index 6215e41..95aaa10 100644 --- a/lib/screens/album.dart +++ b/lib/screens/album.dart @@ -123,8 +123,10 @@ class _AlbumScreenState extends State { ), if (_isBusy) SliverToBoxAdapter( - child: - const CircularProgressIndicator().padding(all: 24).center(), + child: Padding( + padding: const EdgeInsets.all(24), + child: const CircularProgressIndicator(), + ).center(), ), ], ), From 5d3cadefef13a4f87b76663b37f772882014f87d Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Sat, 15 Feb 2025 13:39:00 +0800 Subject: [PATCH 3/4] :hammer: Add linux build pipeline --- .github/workflows/nightly.yml | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index e2b4752..65b665a 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -38,4 +38,26 @@ jobs: uses: actions/upload-artifact@v4 with: name: build-output-windows - path: build/windows/x64/runner/Release \ No newline at end of file + path: build/windows/x64/runner/Release + build-linux: + runs-on: ubuntu-latest + steps: + - name: Clone repository + uses: actions/checkout@v4 + - name: Set up Flutter + uses: subosito/flutter-action@v2 + with: + channel: stable + cache: true + - run: | + sudo apt-get update -y + sudo apt-get install -y ninja-build libgtk-3-dev + sudo apt-get install libmpv-dev mpv + sudo apt-get install libayatana-appindicator3-dev + - run: flutter pub get + - run: flutter build linux + - name: Archive production artifacts + uses: actions/upload-artifact@v4 + with: + name: build-output-windows + path: build/linux/x64/release \ No newline at end of file From 63567bf708e51adc02089223112a0e224e148cb6 Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Sat, 15 Feb 2025 13:43:21 +0800 Subject: [PATCH 4/4] :hammer: Fix linux build missing deps --- .github/workflows/nightly.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 65b665a..3950675 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -54,6 +54,7 @@ jobs: sudo apt-get install -y ninja-build libgtk-3-dev sudo apt-get install libmpv-dev mpv sudo apt-get install libayatana-appindicator3-dev + sudo apt-get install keybinder-3.0 - run: flutter pub get - run: flutter build linux - name: Archive production artifacts