Repository: guozhigq/pilipala Branch: main Commit: 06f23f67ca61 Files: 585 Total size: 2.5 MB Directory structure: gitextract_2k6f8qif/ ├── .github/ │ ├── ISSUE_TEMPLATE/ │ │ ├── bug-反馈.md │ │ └── 功能请求.md │ └── workflows/ │ ├── beta_ci.yml │ └── release_ci.yml ├── .gitignore ├── .metadata ├── .vscode/ │ ├── launch.json │ └── settings.json ├── LICENSE ├── README.md ├── analysis_options.yaml ├── android/ │ ├── .gitignore │ ├── app/ │ │ ├── build.gradle │ │ └── src/ │ │ ├── debug/ │ │ │ └── AndroidManifest.xml │ │ ├── main/ │ │ │ ├── AndroidManifest.xml │ │ │ ├── kotlin/ │ │ │ │ └── com/ │ │ │ │ └── guozhigq/ │ │ │ │ └── pilipala/ │ │ │ │ └── MainActivity.kt │ │ │ └── res/ │ │ │ ├── drawable/ │ │ │ │ ├── ic_baseline_forward_10_24.xml │ │ │ │ ├── ic_baseline_replay_10_24.xml │ │ │ │ └── launch_background.xml │ │ │ ├── drawable-v21/ │ │ │ │ └── launch_background.xml │ │ │ ├── mipmap-anydpi-v26/ │ │ │ │ └── ic_launcher.xml │ │ │ ├── raw/ │ │ │ │ └── keep.xml │ │ │ ├── values/ │ │ │ │ ├── colors.xml │ │ │ │ └── styles.xml │ │ │ └── values-night/ │ │ │ └── styles.xml │ │ └── profile/ │ │ └── AndroidManifest.xml │ ├── build.gradle │ ├── gradle/ │ │ └── wrapper/ │ │ └── gradle-wrapper.properties │ ├── gradle.properties │ └── settings.gradle ├── assets/ │ ├── loading.json │ └── trail_loading.json ├── change_log/ │ ├── 1.0.0.0817.md │ ├── 1.0.1.0817.md │ ├── 1.0.10.1016.md │ ├── 1.0.11.1112.md │ ├── 1.0.12.1114.md │ ├── 1.0.13.1217.md │ ├── 1.0.14.1225.md │ ├── 1.0.15.0101.md │ ├── 1.0.16.0102.md │ ├── 1.0.17.0125.md │ ├── 1.0.18.0130.md │ ├── 1.0.19.0131.md │ ├── 1.0.2.0819.md │ ├── 1.0.20.0303.md │ ├── 1.0.21.0306.md │ ├── 1.0.22.0430.md │ ├── 1.0.23.0504.md │ ├── 1.0.23.0505.md │ ├── 1.0.24.0626.md │ ├── 1.0.25.1010.md │ ├── 1.0.3.0821.md │ ├── 1.0.4.0822.md │ ├── 1.0.5.0826.md │ ├── 1.0.6.0902.md │ ├── 1.0.7.0908.md │ ├── 1.0.8.0917.md │ └── 1.0.9.1015.md ├── fastlane/ │ └── metadata/ │ └── android/ │ ├── en-US/ │ │ ├── full_description.txt │ │ ├── short_description.txt │ │ └── title.txt │ └── zh-CN/ │ ├── changelogs/ │ │ └── 2001.txt │ ├── full_description.txt │ ├── short_description.txt │ └── title.txt ├── ios/ │ ├── .gitignore │ ├── Flutter/ │ │ ├── AppFrameworkInfo.plist │ │ ├── Debug.xcconfig │ │ └── Release.xcconfig │ ├── Podfile │ ├── Runner/ │ │ ├── AppDelegate.swift │ │ ├── Assets.xcassets/ │ │ │ ├── AppIcon.appiconset/ │ │ │ │ └── Contents.json │ │ │ └── LaunchImage.imageset/ │ │ │ ├── Contents.json │ │ │ └── README.md │ │ ├── Base.lproj/ │ │ │ ├── LaunchScreen.storyboard │ │ │ └── Main.storyboard │ │ ├── Info.plist │ │ └── Runner-Bridging-Header.h │ ├── Runner.xcodeproj/ │ │ ├── project.pbxproj │ │ ├── project.xcworkspace/ │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcshareddata/ │ │ │ ├── IDEWorkspaceChecks.plist │ │ │ └── WorkspaceSettings.xcsettings │ │ └── xcshareddata/ │ │ └── xcschemes/ │ │ └── Runner.xcscheme │ └── Runner.xcworkspace/ │ ├── contents.xcworkspacedata │ └── xcshareddata/ │ ├── IDEWorkspaceChecks.plist │ └── WorkspaceSettings.xcsettings ├── lib/ │ ├── common/ │ │ ├── constants.dart │ │ ├── pages_bottom_sheet.dart │ │ ├── skeleton/ │ │ │ ├── dynamic_card.dart │ │ │ ├── media_bangumi.dart │ │ │ ├── skeleton.dart │ │ │ ├── video_card_h.dart │ │ │ ├── video_card_v.dart │ │ │ └── video_reply.dart │ │ └── widgets/ │ │ ├── animated_dialog.dart │ │ ├── app_expansion_panel_list.dart │ │ ├── appbar.dart │ │ ├── badge.dart │ │ ├── content_container.dart │ │ ├── custom_toast.dart │ │ ├── html_render.dart │ │ ├── http_error.dart │ │ ├── live_card.dart │ │ ├── network_img_layer.dart │ │ ├── no_data.dart │ │ ├── sliver_header.dart │ │ ├── stat/ │ │ │ ├── danmu.dart │ │ │ └── view.dart │ │ ├── video_card_h.dart │ │ └── video_card_v.dart │ ├── http/ │ │ ├── api.dart │ │ ├── bangumi.dart │ │ ├── black.dart │ │ ├── common.dart │ │ ├── constants.dart │ │ ├── danmaku.dart │ │ ├── dynamics.dart │ │ ├── fan.dart │ │ ├── fav.dart │ │ ├── follow.dart │ │ ├── html.dart │ │ ├── index.dart │ │ ├── init.dart │ │ ├── interceptor.dart │ │ ├── live.dart │ │ ├── login.dart │ │ ├── member.dart │ │ ├── msg.dart │ │ ├── read.dart │ │ ├── reply.dart │ │ ├── search.dart │ │ ├── user.dart │ │ └── video.dart │ ├── main.dart │ ├── models/ │ │ ├── bangumi/ │ │ │ ├── info.dart │ │ │ └── list.dart │ │ ├── common/ │ │ │ ├── action_type.dart │ │ │ ├── business_type.dart │ │ │ ├── color_type.dart │ │ │ ├── dynamic_badge_mode.dart │ │ │ ├── dynamics_type.dart │ │ │ ├── gesture_mode.dart │ │ │ ├── index.dart │ │ │ ├── nav_bar_config.dart │ │ │ ├── rank_type.dart │ │ │ ├── rcmd_type.dart │ │ │ ├── reply_sort_type.dart │ │ │ ├── reply_type.dart │ │ │ ├── search_type.dart │ │ │ ├── tab_type.dart │ │ │ ├── theme_type.dart │ │ │ └── video_episode_type.dart │ │ ├── danmaku/ │ │ │ ├── dm.pb.dart │ │ │ ├── dm.pbenum.dart │ │ │ ├── dm.pbjson.dart │ │ │ ├── dm.pbserver.dart │ │ │ └── dm.proto │ │ ├── dynamics/ │ │ │ ├── result.dart │ │ │ └── up.dart │ │ ├── fans/ │ │ │ └── result.dart │ │ ├── follow/ │ │ │ └── result.dart │ │ ├── github/ │ │ │ └── latest.dart │ │ ├── home/ │ │ │ └── rcmd/ │ │ │ └── result.dart │ │ ├── live/ │ │ │ ├── follow.dart │ │ │ ├── item.dart │ │ │ ├── message.dart │ │ │ ├── quality.dart │ │ │ ├── room_info.dart │ │ │ └── room_info_h5.dart │ │ ├── login/ │ │ │ └── index.dart │ │ ├── member/ │ │ │ ├── archive.dart │ │ │ ├── article.dart │ │ │ ├── coin.dart │ │ │ ├── info.dart │ │ │ ├── like.dart │ │ │ ├── seasons.dart │ │ │ └── tags.dart │ │ ├── model_hot_video_item.dart │ │ ├── model_owner.dart │ │ ├── model_rec_video_item.dart │ │ ├── msg/ │ │ │ ├── account.dart │ │ │ ├── like.dart │ │ │ ├── reply.dart │ │ │ ├── session.dart │ │ │ └── system.dart │ │ ├── read/ │ │ │ ├── opus.dart │ │ │ └── read.dart │ │ ├── search/ │ │ │ ├── all.dart │ │ │ ├── hot.dart │ │ │ ├── result.dart │ │ │ └── suggest.dart │ │ ├── user/ │ │ │ ├── black.dart │ │ │ ├── fav_detail.dart │ │ │ ├── fav_folder.dart │ │ │ ├── history.dart │ │ │ ├── info.dart │ │ │ ├── info.g.dart │ │ │ ├── stat.dart │ │ │ ├── sub_detail.dart │ │ │ └── sub_folder.dart │ │ ├── video/ │ │ │ ├── ai.dart │ │ │ ├── later.dart │ │ │ ├── play/ │ │ │ │ ├── ao_output.dart │ │ │ │ ├── quality.dart │ │ │ │ └── url.dart │ │ │ ├── reply/ │ │ │ │ ├── config.dart │ │ │ │ ├── content.dart │ │ │ │ ├── data.dart │ │ │ │ ├── emote.dart │ │ │ │ ├── item.dart │ │ │ │ ├── member.dart │ │ │ │ ├── page.dart │ │ │ │ ├── top_replies.dart │ │ │ │ └── upper.dart │ │ │ └── subTitile/ │ │ │ ├── content.dart │ │ │ └── result.dart │ │ └── video_detail_res.dart │ ├── pages/ │ │ ├── about/ │ │ │ └── index.dart │ │ ├── bangumi/ │ │ │ ├── controller.dart │ │ │ ├── index.dart │ │ │ ├── introduction/ │ │ │ │ ├── controller.dart │ │ │ │ ├── index.dart │ │ │ │ ├── view.dart │ │ │ │ └── widgets/ │ │ │ │ └── intro_detail.dart │ │ │ ├── view.dart │ │ │ └── widgets/ │ │ │ ├── bangumi_panel.dart │ │ │ └── bangumu_card_v.dart │ │ ├── blacklist/ │ │ │ └── index.dart │ │ ├── danmaku/ │ │ │ ├── controller.dart │ │ │ ├── index.dart │ │ │ └── view.dart │ │ ├── dlna/ │ │ │ └── index.dart │ │ ├── dynamics/ │ │ │ ├── controller.dart │ │ │ ├── detail/ │ │ │ │ ├── controller.dart │ │ │ │ ├── index.dart │ │ │ │ └── view.dart │ │ │ ├── index.dart │ │ │ ├── up_dynamic/ │ │ │ │ ├── controller.dart │ │ │ │ ├── index.dart │ │ │ │ ├── route_panel.dart │ │ │ │ └── view.dart │ │ │ ├── view.dart │ │ │ └── widgets/ │ │ │ ├── action_panel.dart │ │ │ ├── additional_panel.dart │ │ │ ├── article_panel.dart │ │ │ ├── author_panel.dart │ │ │ ├── content_panel.dart │ │ │ ├── dynamic_panel.dart │ │ │ ├── forward_panel.dart │ │ │ ├── live_panel.dart │ │ │ ├── live_rcmd_panel.dart │ │ │ ├── pic_panel.dart │ │ │ ├── rich_node_panel.dart │ │ │ ├── up_panel.dart │ │ │ └── video_panel.dart │ │ ├── emote/ │ │ │ ├── controller.dart │ │ │ ├── index.dart │ │ │ └── view.dart │ │ ├── fan/ │ │ │ ├── controller.dart │ │ │ ├── index.dart │ │ │ ├── view.dart │ │ │ └── widgets/ │ │ │ └── fan_item.dart │ │ ├── fav/ │ │ │ ├── controller.dart │ │ │ ├── index.dart │ │ │ ├── view.dart │ │ │ └── widgets/ │ │ │ └── item.dart │ │ ├── fav_detail/ │ │ │ ├── controller.dart │ │ │ ├── index.dart │ │ │ ├── view.dart │ │ │ └── widget/ │ │ │ └── fav_video_card.dart │ │ ├── fav_edit/ │ │ │ ├── controller.dart │ │ │ ├── index.dart │ │ │ └── view.dart │ │ ├── fav_search/ │ │ │ ├── controller.dart │ │ │ ├── index.dart │ │ │ └── view.dart │ │ ├── follow/ │ │ │ ├── controller.dart │ │ │ ├── index.dart │ │ │ ├── view.dart │ │ │ └── widgets/ │ │ │ ├── follow_item.dart │ │ │ ├── follow_list.dart │ │ │ └── owner_follow_list.dart │ │ ├── follow_search/ │ │ │ ├── controller.dart │ │ │ ├── index.dart │ │ │ └── view.dart │ │ ├── history/ │ │ │ ├── controller.dart │ │ │ ├── index.dart │ │ │ ├── view.dart │ │ │ └── widgets/ │ │ │ └── item.dart │ │ ├── history_search/ │ │ │ ├── controller.dart │ │ │ ├── index.dart │ │ │ └── view.dart │ │ ├── home/ │ │ │ ├── controller.dart │ │ │ ├── index.dart │ │ │ ├── view.dart │ │ │ └── widgets/ │ │ │ └── app_bar.dart │ │ ├── hot/ │ │ │ ├── controller.dart │ │ │ ├── index.dart │ │ │ └── view.dart │ │ ├── html/ │ │ │ ├── controller.dart │ │ │ ├── index.dart │ │ │ └── view.dart │ │ ├── later/ │ │ │ ├── controller.dart │ │ │ ├── index.dart │ │ │ └── view.dart │ │ ├── live/ │ │ │ ├── controller.dart │ │ │ ├── index.dart │ │ │ ├── view.dart │ │ │ └── widgets/ │ │ │ └── live_item.dart │ │ ├── live_room/ │ │ │ ├── controller.dart │ │ │ ├── index.dart │ │ │ ├── view.dart │ │ │ └── widgets/ │ │ │ └── bottom_control.dart │ │ ├── login/ │ │ │ ├── controller.dart │ │ │ ├── index.dart │ │ │ └── view.dart │ │ ├── main/ │ │ │ ├── controller.dart │ │ │ ├── index.dart │ │ │ └── view.dart │ │ ├── media/ │ │ │ ├── controller.dart │ │ │ ├── index.dart │ │ │ └── view.dart │ │ ├── member/ │ │ │ ├── controller.dart │ │ │ ├── index.dart │ │ │ ├── view.dart │ │ │ └── widgets/ │ │ │ ├── conis.dart │ │ │ ├── like.dart │ │ │ ├── profile.dart │ │ │ └── seasons.dart │ │ ├── member_archive/ │ │ │ ├── controller.dart │ │ │ ├── index.dart │ │ │ └── view.dart │ │ ├── member_article/ │ │ │ ├── controller.dart │ │ │ ├── index.dart │ │ │ └── view.dart │ │ ├── member_coin/ │ │ │ ├── controller.dart │ │ │ ├── index.dart │ │ │ ├── view.dart │ │ │ └── widgets/ │ │ │ └── item.dart │ │ ├── member_dynamics/ │ │ │ ├── controller.dart │ │ │ ├── index.dart │ │ │ └── view.dart │ │ ├── member_like/ │ │ │ ├── controller.dart │ │ │ ├── index.dart │ │ │ ├── view.dart │ │ │ └── widgets/ │ │ │ └── item.dart │ │ ├── member_search/ │ │ │ ├── controller.dart │ │ │ ├── index.dart │ │ │ └── view.dart │ │ ├── member_seasons/ │ │ │ ├── controller.dart │ │ │ ├── index.dart │ │ │ ├── view.dart │ │ │ └── widgets/ │ │ │ └── item.dart │ │ ├── message/ │ │ │ ├── at/ │ │ │ │ ├── controller.dart │ │ │ │ ├── index.dart │ │ │ │ └── view.dart │ │ │ ├── like/ │ │ │ │ ├── controller.dart │ │ │ │ ├── index.dart │ │ │ │ └── view.dart │ │ │ ├── reply/ │ │ │ │ ├── controller.dart │ │ │ │ ├── index.dart │ │ │ │ └── view.dart │ │ │ └── system/ │ │ │ ├── controller.dart │ │ │ ├── index.dart │ │ │ └── view.dart │ │ ├── mine/ │ │ │ ├── controller.dart │ │ │ ├── index.dart │ │ │ └── view.dart │ │ ├── opus/ │ │ │ ├── controller.dart │ │ │ ├── index.dart │ │ │ ├── text_helper.dart │ │ │ └── view.dart │ │ ├── rank/ │ │ │ ├── controller.dart │ │ │ ├── index.dart │ │ │ ├── view.dart │ │ │ └── zone/ │ │ │ ├── controller.dart │ │ │ ├── index.dart │ │ │ └── view.dart │ │ ├── rcmd/ │ │ │ ├── controller.dart │ │ │ ├── index.dart │ │ │ └── view.dart │ │ ├── read/ │ │ │ ├── controller.dart │ │ │ ├── index.dart │ │ │ └── view.dart │ │ ├── search/ │ │ │ ├── controller.dart │ │ │ ├── index.dart │ │ │ ├── view.dart │ │ │ └── widgets/ │ │ │ ├── hot_keyword.dart │ │ │ └── search_text.dart │ │ ├── search_panel/ │ │ │ ├── controller.dart │ │ │ ├── index.dart │ │ │ ├── view.dart │ │ │ └── widgets/ │ │ │ ├── article_panel.dart │ │ │ ├── live_panel.dart │ │ │ ├── media_bangumi_panel.dart │ │ │ ├── user_panel.dart │ │ │ └── video_panel.dart │ │ ├── search_result/ │ │ │ ├── controller.dart │ │ │ ├── index.dart │ │ │ └── view.dart │ │ ├── setting/ │ │ │ ├── controller.dart │ │ │ ├── extra_setting.dart │ │ │ ├── index.dart │ │ │ ├── pages/ │ │ │ │ ├── action_menu_set.dart │ │ │ │ ├── color_select.dart │ │ │ │ ├── display_mode.dart │ │ │ │ ├── font_size_select.dart │ │ │ │ ├── home_tabbar_set.dart │ │ │ │ ├── logs.dart │ │ │ │ ├── navigation_bar_set.dart │ │ │ │ ├── play_gesture_set.dart │ │ │ │ └── play_speed_set.dart │ │ │ ├── play_setting.dart │ │ │ ├── privacy_setting.dart │ │ │ ├── recommend_setting.dart │ │ │ ├── style_setting.dart │ │ │ ├── view.dart │ │ │ └── widgets/ │ │ │ ├── select_dialog.dart │ │ │ ├── select_item.dart │ │ │ ├── slide_dialog.dart │ │ │ └── switch_item.dart │ │ ├── subscription/ │ │ │ ├── controller.dart │ │ │ ├── index.dart │ │ │ ├── view.dart │ │ │ └── widgets/ │ │ │ └── item.dart │ │ ├── subscription_detail/ │ │ │ ├── controller.dart │ │ │ ├── index.dart │ │ │ ├── view.dart │ │ │ └── widget/ │ │ │ └── sub_video_card.dart │ │ ├── video/ │ │ │ ├── README.md │ │ │ └── detail/ │ │ │ ├── controller.dart │ │ │ ├── index.dart │ │ │ ├── introduction/ │ │ │ │ ├── controller.dart │ │ │ │ ├── index.dart │ │ │ │ ├── view.dart │ │ │ │ └── widgets/ │ │ │ │ ├── action_item.dart │ │ │ │ ├── action_row_item.dart │ │ │ │ ├── fav_panel.dart │ │ │ │ ├── group_panel.dart │ │ │ │ ├── intro_detail.dart │ │ │ │ ├── menu_row.dart │ │ │ │ ├── page_panel.dart │ │ │ │ ├── season_panel.dart │ │ │ │ └── staff_up_item.dart │ │ │ ├── related/ │ │ │ │ ├── controller.dart │ │ │ │ ├── index.dart │ │ │ │ └── view.dart │ │ │ ├── reply/ │ │ │ │ ├── controller.dart │ │ │ │ ├── index.dart │ │ │ │ ├── view.dart │ │ │ │ └── widgets/ │ │ │ │ ├── reply_item.dart │ │ │ │ ├── reply_save.dart │ │ │ │ └── zan.dart │ │ │ ├── reply_new/ │ │ │ │ ├── index.dart │ │ │ │ ├── toolbar_icon_button.dart │ │ │ │ └── view.dart │ │ │ ├── reply_reply/ │ │ │ │ ├── controller.dart │ │ │ │ ├── index.dart │ │ │ │ └── view.dart │ │ │ ├── view.dart │ │ │ └── widgets/ │ │ │ ├── ai_detail.dart │ │ │ ├── app_bar.dart │ │ │ ├── expandable_section.dart │ │ │ ├── header_control.dart │ │ │ ├── right_drawer.dart │ │ │ └── watch_later_list.dart │ │ ├── webview/ │ │ │ ├── controller.dart │ │ │ ├── index.dart │ │ │ └── view.dart │ │ ├── whisper/ │ │ │ ├── controller.dart │ │ │ ├── index.dart │ │ │ └── view.dart │ │ └── whisper_detail/ │ │ ├── controller.dart │ │ ├── index.dart │ │ ├── view.dart │ │ └── widget/ │ │ └── chat_item.dart │ ├── plugin/ │ │ ├── pl_gallery/ │ │ │ ├── custom_dismissible.dart │ │ │ ├── hero_dialog_route.dart │ │ │ ├── index.dart │ │ │ ├── interactive_viewer_boundary.dart │ │ │ └── interactiveviewer_gallery.dart │ │ ├── pl_player/ │ │ │ ├── controller.dart │ │ │ ├── index.dart │ │ │ ├── models/ │ │ │ │ ├── bottom_control_type.dart │ │ │ │ ├── bottom_progress_behavior.dart │ │ │ │ ├── data_source.dart │ │ │ │ ├── data_status.dart │ │ │ │ ├── duration.dart │ │ │ │ ├── fullscreen_mode.dart │ │ │ │ ├── play_repeat.dart │ │ │ │ ├── play_speed.dart │ │ │ │ └── play_status.dart │ │ │ ├── utils/ │ │ │ │ └── fullscreen.dart │ │ │ ├── utils.dart │ │ │ ├── view.dart │ │ │ └── widgets/ │ │ │ ├── app_bar_ani.dart │ │ │ ├── backward_seek.dart │ │ │ ├── bottom_control.dart │ │ │ ├── common_btn.dart │ │ │ ├── control_bar.dart │ │ │ ├── forward_seek.dart │ │ │ └── play_pause_btn.dart │ │ ├── pl_popup/ │ │ │ └── index.dart │ │ └── pl_socket/ │ │ └── index.dart │ ├── router/ │ │ └── app_pages.dart │ ├── scripts/ │ │ └── build.sh │ ├── services/ │ │ ├── audio_handler.dart │ │ ├── audio_session.dart │ │ ├── disable_battery_opt.dart │ │ ├── loggeer.dart │ │ ├── service_locator.dart │ │ └── shutdown_timer_service.dart │ └── utils/ │ ├── app_scheme.dart │ ├── binary_writer.dart │ ├── cache_manage.dart │ ├── cookie.dart │ ├── danmaku.dart │ ├── data.dart │ ├── download.dart │ ├── drawer.dart │ ├── em.dart │ ├── event_bus.dart │ ├── extension.dart │ ├── feed_back.dart │ ├── global_data_cache.dart │ ├── highlight.dart │ ├── id_utils.dart │ ├── image_save.dart │ ├── live.dart │ ├── login.dart │ ├── main_stream.dart │ ├── proxy.dart │ ├── recommend_filter.dart │ ├── route_push.dart │ ├── storage.dart │ ├── subtitle.dart │ ├── url_utils.dart │ ├── utils.dart │ ├── video_utils.dart │ └── wbi_sign.dart ├── linux/ │ ├── .gitignore │ ├── CMakeLists.txt │ ├── flutter/ │ │ └── CMakeLists.txt │ ├── main.cc │ ├── my_application.cc │ └── my_application.h ├── macos/ │ ├── .gitignore │ ├── Flutter/ │ │ ├── Flutter-Debug.xcconfig │ │ └── Flutter-Release.xcconfig │ ├── Podfile │ ├── Runner/ │ │ ├── AppDelegate.swift │ │ ├── Assets.xcassets/ │ │ │ └── AppIcon.appiconset/ │ │ │ └── Contents.json │ │ ├── Base.lproj/ │ │ │ └── MainMenu.xib │ │ ├── Configs/ │ │ │ ├── AppInfo.xcconfig │ │ │ ├── Debug.xcconfig │ │ │ ├── Release.xcconfig │ │ │ └── Warnings.xcconfig │ │ ├── DebugProfile.entitlements │ │ ├── Info.plist │ │ ├── MainFlutterWindow.swift │ │ └── Release.entitlements │ ├── Runner.xcodeproj/ │ │ ├── project.pbxproj │ │ ├── project.xcworkspace/ │ │ │ └── xcshareddata/ │ │ │ └── IDEWorkspaceChecks.plist │ │ └── xcshareddata/ │ │ └── xcschemes/ │ │ └── Runner.xcscheme │ └── Runner.xcworkspace/ │ ├── contents.xcworkspacedata │ └── xcshareddata/ │ └── IDEWorkspaceChecks.plist ├── pubspec.yaml ├── test/ │ └── widget_test.dart ├── web/ │ ├── index.html │ └── manifest.json └── windows/ ├── .gitignore ├── CMakeLists.txt ├── flutter/ │ └── CMakeLists.txt └── runner/ ├── CMakeLists.txt ├── Runner.rc ├── flutter_window.cpp ├── flutter_window.h ├── main.cpp ├── resource.h ├── runner.exe.manifest ├── utils.cpp ├── utils.h ├── win32_window.cpp └── win32_window.h ================================================ FILE CONTENTS ================================================ ================================================ FILE: .github/ISSUE_TEMPLATE/bug-反馈.md ================================================ --- name: Bug 反馈 about: 描述你所遇到的bug title: '' labels: 问题反馈 assignees: guozhigq --- ### 问题描述 请提供一个清晰而简明的问题描述。 ### 复现步骤 请提供复现该问题所需的具体步骤。 ### 预期行为 请描述你期望的正确行为或结果。 ### 系统信息 请提供关于您的环境的详细信息,包括操作系统、浏览器版本等。 ### 相关截图或日志 如果有的话,请提供相关的截图、错误日志或其他有助于解决问题的信息。 ================================================ FILE: .github/ISSUE_TEMPLATE/功能请求.md ================================================ --- name: 功能请求 about: 对于功能的一些建议 title: '' labels: 功能 assignees: guozhigq --- ### 功能描述 请提供对所请求功能的清晰描述。 ### 目标 请描述你希望通过这个功能实现的目标。 ### 解决方案 如果你有任何关于如何实现这个功能的想法或建议,请在这里提供。 ### 其他 请提供已实现该功能或类似功能的应用 ================================================ FILE: .github/workflows/beta_ci.yml ================================================ name: Pilipala Beta on: workflow_dispatch: push: branches: - "x-main" paths-ignore: - "**.md" - "**.txt" - ".github/**" - ".idea/**" - "!.github/workflows/**" jobs: update_version: name: Read and update version runs-on: ubuntu-latest outputs: # 定义输出变量 version,以便在其他job中引用 new_version: ${{ steps.version.outputs.new_version }} last_commit: ${{ steps.get-last-commit.outputs.last_commit }} steps: - name: Checkout code uses: actions/checkout@v4 with: ref: ${{ github.ref_name }} fetch-depth: 0 - name: 获取first parent commit次数 id: get-first-parent-commit-count run: | version=$(yq e .version pubspec.yaml | cut -d "+" -f 1) recent_release_tag=$(git tag -l | grep $version | egrep -v "[-|+]" || true) if [[ "x$recent_release_tag" == "x" ]]; then echo "当前版本tag不存在,请手动生成tag." exit 1 fi git log --oneline --first-parent $recent_release_tag..HEAD first_parent_commit_count=$(git rev-list --first-parent --count $recent_release_tag..HEAD) echo "count=$first_parent_commit_count" >> $GITHUB_OUTPUT - name: 获取最后一次提交 id: get-last-commit run: | last_commit=$(git log -1 --pretty="%h %s" --first-parent) echo "last_commit=$last_commit" >> $GITHUB_OUTPUT - name: 更新版本号 id: version run: | # 读取版本号 VERSION=$(yq e .version pubspec.yaml | cut -d "+" -f 1) # 获取GitHub Actions的run_number #RUN_NUMBER=${{ github.run_number }} # 构建新版本号 NEW_VERSION=$VERSION-beta.${{ steps.get-first-parent-commit-count.outputs.count }} # 输出新版本号 echo "New version: $NEW_VERSION" # 设置新版本号为输出变量 echo "new_version=$NEW_VERSION" >>$GITHUB_OUTPUT android: name: Build CI (Android) needs: update_version runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v4 with: ref: ${{ github.ref_name }} - name: 构建Java环境 uses: actions/setup-java@v3 with: distribution: "zulu" java-version: "17" token: ${{secrets.GIT_TOKEN}} - name: 检查缓存 uses: actions/cache@v2 id: cache-flutter with: path: /root/flutter-sdk key: ${{ runner.os }}-flutter-${{ hashFiles('**/pubspec.lock') }} - name: 安装Flutter if: steps.cache-flutter.outputs.cache-hit != 'true' uses: subosito/flutter-action@v2 with: flutter-version: 3.19.6 channel: any - name: 下载项目依赖 run: flutter pub get - name: 解码生成 jks run: echo $KEYSTORE_BASE64 | base64 -di > android/app/vvex.jks env: KEYSTORE_BASE64: ${{ secrets.KEYSTORE_BASE64 }} - name: 更新版本号 id: version run: | # 更新pubspec.yaml文件中的版本号 sed -i "s/version: .*+/version: ${{ needs.update_version.outputs.new_version }}+/g" pubspec.yaml - name: flutter build apk run: flutter build apk --release --split-per-abi env: KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }} KEY_ALIAS: ${{ secrets.KEY_ALIAS }} KEY_PASSWORD: ${{ secrets.KEY_PASSWORD}} - name: 重命名应用 run: | for file in build/app/outputs/flutter-apk/app-*.apk; do if [[ $file =~ app-(.?*)release.apk ]]; then new_file_name="build/app/outputs/flutter-apk/Pili-${BASH_REMATCH[1]}v${{ needs.update_version.outputs.new_version }}.apk" mv "$file" "$new_file_name" fi done - name: 上传 uses: actions/upload-artifact@v3 with: name: Pilipala-Beta path: | build/app/outputs/flutter-apk/Pili-*.apk iOS: name: Build CI (iOS) needs: update_version runs-on: macos-latest steps: - name: Checkout code uses: actions/checkout@v4 with: ref: ${{ github.ref_name }} - name: 安装Flutter if: steps.cache-flutter.outputs.cache-hit != 'true' uses: subosito/flutter-action@v2.10.0 with: cache: true flutter-version: 3.16.5 - name: 更新版本号 id: version run: | # 更新pubspec.yaml文件中的版本号 sed -i "" "s/version: .*+/version: ${{ needs.update_version.outputs.new_version }}+/g" pubspec.yaml - name: flutter build ipa run: | flutter build ios --release --no-codesign ln -sf ./build/ios/iphoneos Payload zip -r9 app.ipa Payload/runner.app - name: 重命名应用 run: | DATE=${{ steps.date.outputs.date }} for file in app.ipa; do new_file_name="build/Pili-v${{ needs.update_version.outputs.new_version }}.ipa" mv "$file" "$new_file_name" done - name: 上传 uses: actions/upload-artifact@v3 with: if-no-files-found: error name: Pilipala-Beta path: | build/Pili-*.ipa upload: runs-on: ubuntu-latest needs: - update_version - android - iOS steps: - uses: actions/download-artifact@v3 with: name: Pilipala-Beta path: ./Pilipala-Beta - name: 发送到Telegram频道 uses: xireiki/channel-post@v1.0.7 with: bot_token: ${{ secrets.BOT_TOKEN }} chat_id: ${{ secrets.CHAT_ID }} large_file: true api_id: ${{ secrets.TELEGRAM_API_ID }} api_hash: ${{ secrets.TELEGRAM_API_HASH }} method: sendFile path: Pilipala-Beta/* parse_mode: Markdown context: "*Beta版本: v${{ needs.update_version.outputs.new_version }}*\n更新内容: [${{ needs.update_version.outputs.last_commit }}]" ================================================ FILE: .github/workflows/release_ci.yml ================================================ name: Pilipala Release # action事件触发 on: push: # push tag时触发 tags: - "v*.*.*" # 可以有多个jobs jobs: android: # 运行环境 ubuntu-latest window-latest mac-latest runs-on: ubuntu-latest # 每个jobs中可以有多个steps steps: - name: 代码迁出 uses: actions/checkout@v3 - name: 构建Java环境 uses: actions/setup-java@v3 with: distribution: "zulu" java-version: "17" token: ${{secrets.GIT_TOKEN}} - name: 检查缓存 uses: actions/cache@v2 id: cache-flutter with: path: /root/flutter-sdk # Flutter SDK 的路径 key: ${{ runner.os }}-flutter-${{ hashFiles('**/pubspec.lock') }} - name: 安装Flutter if: steps.cache-flutter.outputs.cache-hit != 'true' uses: subosito/flutter-action@v2 with: flutter-version: 3.19.6 channel: any - name: 下载项目依赖 run: flutter pub get - name: 解码生成 jks run: echo $KEYSTORE_BASE64 | base64 -di > android/app/vvex.jks env: KEYSTORE_BASE64: ${{ secrets.KEYSTORE_BASE64 }} - name: flutter build apk run: flutter build apk --release --split-per-abi env: KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }} KEY_ALIAS: ${{ secrets.KEY_ALIAS }} KEY_PASSWORD: ${{ secrets.KEY_PASSWORD}} - name: flutter build apk run: flutter build apk --release env: KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }} KEY_ALIAS: ${{ secrets.KEY_ALIAS }} KEY_PASSWORD: ${{ secrets.KEY_PASSWORD}} - name: 获取版本号 id: version run: echo "version=${GITHUB_REF#refs/tags/v}" >>$GITHUB_OUTPUT # - name: 获取当前日期 # id: date # run: echo "date=$(date +'%m%d')" >>$GITHUB_OUTPUT - name: 重命名应用 run: | # DATE=${{ steps.date.outputs.date }} for file in build/app/outputs/flutter-apk/app-*.apk; do if [[ $file =~ app-(.?*)release.apk ]]; then new_file_name="build/app/outputs/flutter-apk/Pili-${BASH_REMATCH[1]}${{ steps.version.outputs.version }}.apk" mv "$file" "$new_file_name" fi done - name: 上传 uses: actions/upload-artifact@v3 with: name: Pilipala-Release path: | build/app/outputs/flutter-apk/Pili-*.apk iOS: runs-on: macos-latest steps: - name: 代码迁出 uses: actions/checkout@v4 - name: 安装Flutter if: steps.cache-flutter.outputs.cache-hit != 'true' uses: subosito/flutter-action@v2.10.0 with: cache: true flutter-version: 3.19.6 - name: flutter build ipa run: | flutter build ios --release --no-codesign ln -sf ./build/ios/iphoneos Payload zip -r9 app.ipa Payload/runner.app - name: 获取版本号 id: version run: echo "version=${GITHUB_REF#refs/tags/v}" >>$GITHUB_OUTPUT - name: 重命名应用 run: | DATE=${{ steps.date.outputs.date }} for file in app.ipa; do new_file_name="build/Pili-${{ steps.version.outputs.version }}.ipa" mv "$file" "$new_file_name" done - name: 上传 uses: actions/upload-artifact@v3 with: if-no-files-found: error name: Pilipala-Release path: | build/Pili-*.ipa upload: runs-on: ubuntu-latest needs: - android - iOS steps: - uses: actions/download-artifact@v3 with: name: Pilipala-Release path: ./Pilipala-Release - name: Install dependencies run: sudo apt-get install tree -y - name: Get version id: version run: echo "version=${GITHUB_REF#refs/tags/v}" >>$GITHUB_OUTPUT - name: Upload Release uses: ncipollo/release-action@v1 with: name: v${{ steps.version.outputs.version }} token: ${{ secrets.GIT_TOKEN }} omitBodyDuringUpdate: true omitNameDuringUpdate: true omitPrereleaseDuringUpdate: true allowUpdates: true artifacts: Pilipala-Release/* ================================================ FILE: .gitignore ================================================ # Miscellaneous *.class *.log *.pyc *.swp .DS_Store .atom/ .buildlog/ .history .svn/ migrate_working_dir/ # IntelliJ related *.iml *.ipr *.iws .idea/ # The .vscode folder contains launch configuration and tasks you configure in # VS Code which you may wish to be included in version control, so this line # is commented out by default. #.vscode/ # Flutter repo-specific /bin/cache/ /bin/internal/bootstrap.bat /bin/internal/bootstrap.sh /bin/mingit/ /dev/benchmarks/mega_gallery/ /dev/bots/.recipe_deps /dev/bots/android_tools/ /dev/devicelab/ABresults*.json /dev/docs/doc/ /dev/docs/api_docs.zip /dev/docs/flutter.docs.zip /dev/docs/lib/ /dev/docs/pubspec.yaml /dev/integration_tests/**/xcuserdata /dev/integration_tests/**/Pods /packages/flutter/coverage/ version analysis_benchmark.json # packages file containing multi-root paths .packages.generated # Flutter/Dart/Pub related **/doc/api/ **/ios/Flutter/.last_build_id .dart_tool/ .flutter-plugins .flutter-plugins-dependencies .packages .pub-cache/ .pub/ /build/ flutter_*.png linked_*.ds unlinked.ds unlinked_spec.ds # Obfuscation related app.*.map.json # Android related **/android/**/gradle-wrapper.jar .gradle/ **/android/captures/ **/android/gradlew **/android/gradlew.bat **/android/local.properties **/android/**/GeneratedPluginRegistrant.java **/android/key.properties *.jks # iOS/XCode related **/ios/**/*.mode1v3 **/ios/**/*.mode2v3 **/ios/**/*.moved-aside **/ios/**/*.pbxuser **/ios/**/*.perspectivev3 **/ios/**/*sync/ **/ios/**/.sconsign.dblite **/ios/**/.tags* **/ios/**/.vagrant/ **/ios/**/DerivedData/ **/ios/**/Icon? **/ios/**/Pods/ **/ios/**/.symlinks/ **/ios/**/profile **/ios/**/xcuserdata **/ios/.generated/ **/ios/Flutter/.last_build_id **/ios/Flutter/App.framework **/ios/Flutter/Flutter.framework **/ios/Flutter/Flutter.podspec **/ios/Flutter/Generated.xcconfig **/ios/Flutter/ephemeral **/ios/Flutter/app.flx **/ios/Flutter/app.zip **/ios/Flutter/flutter_assets/ **/ios/Flutter/flutter_export_environment.sh **/ios/ServiceDefinitions.json **/ios/Runner/GeneratedPluginRegistrant.* # macOS **/Flutter/ephemeral/ **/Pods/ **/macos/Flutter/GeneratedPluginRegistrant.swift **/macos/Flutter/ephemeral **/xcuserdata/ # Windows **/windows/flutter/generated_plugin_registrant.cc **/windows/flutter/generated_plugin_registrant.h **/windows/flutter/generated_plugins.cmake # Linux **/linux/flutter/generated_plugin_registrant.cc **/linux/flutter/generated_plugin_registrant.h **/linux/flutter/generated_plugins.cmake # Coverage coverage/ # Symbols app.*.symbols # Exceptions to above rules. !**/ios/**/default.mode1v3 !**/ios/**/default.mode2v3 !**/ios/**/default.pbxuser !**/ios/**/default.perspectivev3 !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages !/dev/ci/**/Gemfile.lock !.vscode/settings.json ================================================ FILE: .metadata ================================================ # This file tracks properties of this Flutter project. # Used by Flutter tool to assess capabilities and perform upgrades etc. # # This file should be version controlled. version: revision: 4b12645012342076800eb701bcdfe18f87da21cf channel: stable project_type: app # Tracks metadata for the flutter migrate command migration: platforms: - platform: root create_revision: 4b12645012342076800eb701bcdfe18f87da21cf base_revision: 4b12645012342076800eb701bcdfe18f87da21cf - platform: android create_revision: 4b12645012342076800eb701bcdfe18f87da21cf base_revision: 4b12645012342076800eb701bcdfe18f87da21cf - platform: ios create_revision: 4b12645012342076800eb701bcdfe18f87da21cf base_revision: 4b12645012342076800eb701bcdfe18f87da21cf - platform: linux create_revision: 4b12645012342076800eb701bcdfe18f87da21cf base_revision: 4b12645012342076800eb701bcdfe18f87da21cf - platform: macos create_revision: 4b12645012342076800eb701bcdfe18f87da21cf base_revision: 4b12645012342076800eb701bcdfe18f87da21cf - platform: web create_revision: 4b12645012342076800eb701bcdfe18f87da21cf base_revision: 4b12645012342076800eb701bcdfe18f87da21cf - platform: windows create_revision: 4b12645012342076800eb701bcdfe18f87da21cf base_revision: 4b12645012342076800eb701bcdfe18f87da21cf # User provided section # List of Local paths (relative to this file) that should be # ignored by the migrate tool. # # Files that are not part of the templates will be ignored by default. unmanaged_files: - 'lib/main.dart' - 'ios/Runner.xcodeproj/project.pbxproj' ================================================ FILE: .vscode/launch.json ================================================ { // 使用 IntelliSense 了解相关属性。 // 悬停以查看现有属性的描述。 // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ { "name": "pilipala", "request": "launch", "type": "dart" }, { "name": "pilipala (profile mode)", "request": "launch", "type": "dart", "flutterMode": "profile" }, { "name": "pilipala (release mode)", "request": "launch", "type": "dart", "flutterMode": "release" } ] } ================================================ FILE: .vscode/settings.json ================================================ { "editor.formatOnSave": true, "[dart]": { "editor.formatOnType": true } } ================================================ FILE: LICENSE ================================================ GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: Copyright (C) This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . ================================================ FILE: README.md ================================================

PiliPala

![GitHub repo size](https://img.shields.io/github/repo-size/guozhigq/pilipala) ![GitHub Repo stars](https://img.shields.io/github/stars/guozhigq/pilipala) ![GitHub all releases](https://img.shields.io/github/downloads/guozhigq/pilipala/total)

使用 Flutter 开发的 BiliBili 第三方客户端

home home home
home
## 开发环境 Xcode 13.4 不支持 ```auto_orientation```,请注释相关代码 ```bash [✓] Flutter (Channel stable, 3.19.6, on macOS 14.1.2 23B92 darwin-arm64, locale zh-Hans-CN) [✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0) [✓] Xcode - develop for iOS and macOS (Xcode 15.1) [✓] Chrome - develop for the web [✓] Android Studio (version 2022.3) [✓] VS Code (version 1.87.2) [✓] Connected device (3 available) [✓] Network resources ``` ## 技术交流 Telegram: [https://t.me/+1DFtqS6usUM5MDNl](https://t.me/+1DFtqS6usUM5MDNl) Telegram Beta 版本:@PiliPala_Beta QQ 频道: https://pd.qq.com/s/365esodk3 ## 功能 目前着重移动端 (Android、iOS),暂时没有适配桌面端、Pad 端、手表端等 现有功能及[开发计划](https://github.com/users/guozhigq/projects/5) - [x] 推荐视频列表 (app 端) - [x] 最热视频列表 - [x] 热门直播 - [x] 番剧列表 - [x] 屏蔽黑名单内用户视频 - [x] 排行榜 - [x] 用户相关 - [x] 粉丝、关注用户、拉黑用户查看 - [x] 用户主页查看 - [x] 关注/取关用户 - [ ] 离线缓存 - [x] 稍后再看 - [x] 观看记录 - [x] 我的收藏 - [x] 黑名单管理 - [x] 动态相关 - [x] 全部、投稿、番剧分类查看 - [x] 动态评论查看 - [x] 动态评论回复功能 - [x] 动态未读标记 - [x] 视频播放相关 - [x] 双击快进/快退 - [x] 双击播放/暂停 - [x] 垂直方向调节亮度/音量 - [x] 垂直方向上滑全屏、下滑退出全屏 - [x] 水平方向手势快进/快退 - [x] 全屏方向设置 - [x] 倍速选择/长按 2 倍速 - [x] 硬件加速 (视机型而定) - [x] 画质选择 (高清画质未解锁) - [x] 音质选择 (视视频而定) - [x] 解码格式选择 (视视频而定) - [x] 弹幕 - [x] 字幕 - [x] 记忆播放 - [x] 视频比例:高度/宽度适应、填充、包含等 - [x] 视频快照 - [x] 直播弹幕 - [x] 搜索相关 - [x] 热搜 - [x] 搜索历史 - [x] 默认搜索词 - [x] 投稿、番剧、直播间、用户搜索 - [x] 视频搜索排序、按时长筛选 - [x] 视频详情页相关 - [x] 视频选集 (分 p) 切换 - [x] 点赞、投币、收藏/取消收藏 - [x] 相关视频查看 - [x] 评论用户身份标识 - [x] 评论 (排序) 查看、二楼评论查看 - [x] 主楼、二楼评论/表情回复功能 - [x] 评论点赞 - [x] 评论笔记图片查看、保存 - [x] 设置相关 - [x] 画质、音质、解码方式预设 - [x] 图片质量设定 - [x] 主题模式:亮色/暗色/跟随系统 - [x] 震动反馈 (可选) - [x] 高帧率 - [x] 自动全屏 - [ ] 等等 ## 下载 可以通过右侧 Releases 进行下载或拉取代码到本地进行编译 ### 从 F-Droid 安装 Get it on F-Droid ## 声明 此项目 (PiliPala) 是个人为了兴趣而开发, 仅用于学习和测试。 所用 API 皆从官方网站收集, 不提供任何破解内容。 感谢使用 ## 致谢 - [bilibili-API-collect](https://github.com/SocialSisterYi/bilibili-API-collect) - [flutter_meedu_videoplayer](https://github.com/zezo357/flutter_meedu_videoplayer) - [media-kit](https://github.com/media-kit/media-kit) - [dio](https://pub.dev/packages/dio) - 等等 ================================================ FILE: analysis_options.yaml ================================================ # This file configures the analyzer, which statically analyzes Dart code to # check for errors, warnings, and lints. # # The issues identified by the analyzer are surfaced in the UI of Dart-enabled # IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be # invoked from the command line by running `flutter analyze`. # The following line activates a set of recommended lints for Flutter apps, # packages, and plugins designed to encourage good coding practices. include: package:flutter_lints/flutter.yaml linter: # The lint rules applied to this project can be customized in the # section below to disable rules from the `package:flutter_lints/flutter.yaml` # included above or to enable additional rules. A list of all available lints # and their documentation is published at # https://dart-lang.github.io/linter/lints/index.html. # # Instead of disabling a lint rule for the entire project in the # section below, it can also be suppressed for a single line of code # or a specific dart file by using the `// ignore: name_of_lint` and # `// ignore_for_file: name_of_lint` syntax on the line or in the file # producing the lint. rules: # avoid_print: false # Uncomment to disable the `avoid_print` rule # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule # Additional information about this file can be found at # https://dart.dev/guides/language/analysis-options ================================================ FILE: android/.gitignore ================================================ gradle-wrapper.jar /.gradle /captures/ /gradlew /gradlew.bat /local.properties GeneratedPluginRegistrant.java # Remember to never publicly share your keystore. # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app key.properties **/*.keystore **/*.jks ================================================ FILE: android/app/build.gradle ================================================ def localProperties = new Properties() def localPropertiesFile = rootProject.file('local.properties') if (localPropertiesFile.exists()) { localPropertiesFile.withReader('UTF-8') { reader -> localProperties.load(reader) } } def flutterRoot = localProperties.getProperty('flutter.sdk') if (flutterRoot == null) { throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") } def flutterVersionCode = localProperties.getProperty('flutter.versionCode') if (flutterVersionCode == null) { flutterVersionCode = '1' } def flutterVersionName = localProperties.getProperty('flutter.versionName') if (flutterVersionName == null) { flutterVersionName = '1.0' } apply plugin: 'com.android.application' apply plugin: 'kotlin-android' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" def keystorePropertiesFile = rootProject.file('key.properties') def keystoreProperties = new Properties() if (keystorePropertiesFile.exists()) { keystoreProperties.load(new FileInputStream(keystorePropertiesFile)) } def _storeFile = file(System.getenv("KEYSTORE") ?: keystoreProperties["storeFile"] ?: "vvex.jks") def _storePassword = System.getenv("KEYSTORE_PASSWORD") ?: keystoreProperties["storePassword"] def _keyAlias = System.getenv("KEY_ALIAS") ?: keystoreProperties["keyAlias"] def _keyPassword = System.getenv("KEY_PASSWORD") ?: keystoreProperties["keyPassword"] android { compileSdkVersion flutter.compileSdkVersion ndkVersion flutter.ndkVersion compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } kotlinOptions { jvmTarget = '1.8' } sourceSets { main.java.srcDirs += 'src/main/kotlin' } defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "com.guozhigq.pilipala" // You can update the following values to match your application needs. // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. targetSdkVersion flutter.targetSdkVersion versionCode flutterVersionCode.toInteger() versionName flutterVersionName minSdkVersion 21 multiDexEnabled true } signingConfigs { // 添加签名配置 release { // 配置密钥库文件的位置、别名、密码等信息 storeFile _storeFile storePassword _storePassword keyAlias _keyAlias keyPassword _keyPassword v1SigningEnabled true v2SigningEnabled true } } buildTypes { release { // TODO: Add your own signing config for the release build. // Signing with the debug keys for now, so `flutter run --release` works. signingConfig signingConfigs.release } } } flutter { source '../..' } dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" } ext.abiCodes = ["x86_64": 1, "armeabi-v7a": 2, "arm64-v8a": 3] import com.android.build.OutputFile android.applicationVariants.all { variant -> variant.outputs.each { output -> def abiVersionCode = project.ext.abiCodes.get(output.getFilter(OutputFile.ABI)) if (abiVersionCode != null) { output.versionCodeOverride = variant.versionCode * 10 + abiVersionCode } } } ================================================ FILE: android/app/src/debug/AndroidManifest.xml ================================================ ================================================ FILE: android/app/src/main/AndroidManifest.xml ================================================ ================================================ FILE: android/app/src/main/kotlin/com/guozhigq/pilipala/MainActivity.kt ================================================ package com.guozhigq.pilipala // import io.flutter.embedding.android.FlutterActivity import com.ryanheise.audioservice.AudioServiceActivity; class MainActivity: AudioServiceActivity() { } ================================================ FILE: android/app/src/main/res/drawable/ic_baseline_forward_10_24.xml ================================================ ================================================ FILE: android/app/src/main/res/drawable/ic_baseline_replay_10_24.xml ================================================ ================================================ FILE: android/app/src/main/res/drawable/launch_background.xml ================================================ ================================================ FILE: android/app/src/main/res/drawable-v21/launch_background.xml ================================================ ================================================ FILE: android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml ================================================ ================================================ FILE: android/app/src/main/res/raw/keep.xml ================================================ ================================================ FILE: android/app/src/main/res/values/colors.xml ================================================ #ffffff ================================================ FILE: android/app/src/main/res/values/styles.xml ================================================ ================================================ FILE: android/app/src/main/res/values-night/styles.xml ================================================ ================================================ FILE: android/app/src/profile/AndroidManifest.xml ================================================ ================================================ FILE: android/build.gradle ================================================ buildscript { ext.kotlin_version = '1.9.0' repositories { google() mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:7.2.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } allprojects { repositories { google() mavenCentral() } } rootProject.buildDir = '../build' subprojects { project.buildDir = "${rootProject.buildDir}/${project.name}" } subprojects { project.evaluationDependsOn(':app') } tasks.register("clean", Delete) { delete rootProject.buildDir } ================================================ FILE: android/gradle/wrapper/gradle-wrapper.properties ================================================ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip ================================================ FILE: android/gradle.properties ================================================ org.gradle.jvmargs=-Xmx1536M android.useAndroidX=true android.enableJetifier=true ================================================ FILE: android/settings.gradle ================================================ include ':app' def localPropertiesFile = new File(rootProject.projectDir, "local.properties") def properties = new Properties() assert localPropertiesFile.exists() localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } def flutterSdkPath = properties.getProperty("flutter.sdk") assert flutterSdkPath != null, "flutter.sdk not set in local.properties" apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" ================================================ FILE: assets/loading.json ================================================ {"v":"5.7.11","fr":60,"ip":0,"op":81,"w":1920,"h":1080,"nm":"Loading Dots","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Dot4","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":25,"s":[25]},{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":39,"s":[100]},{"t":55,"s":[25]}],"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":1,"k":[{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"t":25,"s":[1142,540,0],"to":[0,-6.667,0],"ti":[0,0,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"t":39,"s":[1142,500,0],"to":[0,0,0],"ti":[0,-6.667,0]},{"t":55,"s":[1142,540,0]}],"ix":2,"l":2},"a":{"a":0,"k":[-284,92,0],"ix":1,"l":2},"s":{"a":1,"k":[{"i":{"x":[0.667,0.667,0.667],"y":[1,1,1]},"o":{"x":[0.333,0.333,0.333],"y":[0,0,0]},"t":25,"s":[50,50,100]},{"i":{"x":[0.667,0.667,0.667],"y":[1,1,1]},"o":{"x":[0.333,0.333,0.333],"y":[0,0,0]},"t":39,"s":[75,75,100]},{"t":55,"s":[50,50,100]}],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[120,120],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"fl","c":{"a":0,"k":[0.0039,0.6157,0.5686,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[-284,92],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Ellipse 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":360,"st":0,"bm":0},{"ddd":0,"ind":2,"ty":4,"nm":"Dot3","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":17,"s":[25]},{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":31,"s":[100]},{"t":47,"s":[25]}],"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":1,"k":[{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"t":17,"s":[1022,540,0],"to":[0,-6.667,0],"ti":[0,0,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"t":31,"s":[1022,500,0],"to":[0,0,0],"ti":[0,-6.667,0]},{"t":47,"s":[1022,540,0]}],"ix":2,"l":2},"a":{"a":0,"k":[-284,92,0],"ix":1,"l":2},"s":{"a":1,"k":[{"i":{"x":[0.667,0.667,0.667],"y":[1,1,1]},"o":{"x":[0.333,0.333,0.333],"y":[0,0,0]},"t":17,"s":[50,50,100]},{"i":{"x":[0.667,0.667,0.667],"y":[1,1,1]},"o":{"x":[0.333,0.333,0.333],"y":[0,0,0]},"t":31,"s":[75,75,100]},{"t":47,"s":[50,50,100]}],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[120,120],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"fl","c":{"a":0,"k":[0.0039,0.6157,0.5686,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[-284,92],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Ellipse 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":360,"st":0,"bm":0},{"ddd":0,"ind":3,"ty":4,"nm":"Dot2","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":9,"s":[25]},{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":23,"s":[100]},{"t":39,"s":[25]}],"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":1,"k":[{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"t":9,"s":[902,540,0],"to":[0,-6.667,0],"ti":[0,0,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"t":23,"s":[902,500,0],"to":[0,0,0],"ti":[0,0,0]},{"t":39,"s":[902,540,0]}],"ix":2,"l":2},"a":{"a":0,"k":[-284,92,0],"ix":1,"l":2},"s":{"a":1,"k":[{"i":{"x":[0.667,0.667,0.667],"y":[1,1,1]},"o":{"x":[0.333,0.333,0.333],"y":[0,0,0]},"t":9,"s":[50,50,100]},{"i":{"x":[0.667,0.667,0.667],"y":[1,1,1]},"o":{"x":[0.333,0.333,0.333],"y":[0,0,0]},"t":23,"s":[75,75,100]},{"t":39,"s":[50,50,100]}],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[120,120],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"fl","c":{"a":0,"k":[0.0039,0.6157,0.5686,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[-284,92],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Ellipse 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":360,"st":0,"bm":0},{"ddd":0,"ind":4,"ty":4,"nm":"Dot1","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":0,"s":[25]},{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":14,"s":[100]},{"t":30,"s":[25]}],"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":1,"k":[{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"t":0,"s":[782,540,0],"to":[0,-6.667,0],"ti":[0,0,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"t":14,"s":[782,500,0],"to":[0,0,0],"ti":[0,-6.667,0]},{"t":30,"s":[782,540,0]}],"ix":2,"l":2},"a":{"a":0,"k":[-284,92,0],"ix":1,"l":2},"s":{"a":1,"k":[{"i":{"x":[0.667,0.667,0.667],"y":[1,1,1]},"o":{"x":[0.333,0.333,0.333],"y":[0,0,0]},"t":0,"s":[50,50,100]},{"i":{"x":[0.667,0.667,0.667],"y":[1,1,1]},"o":{"x":[0.333,0.333,0.333],"y":[0,0,0]},"t":14,"s":[75,75,100]},{"t":30,"s":[50,50,100]}],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[120,120],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"fl","c":{"a":0,"k":[0.0039,0.6157,0.5686,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[-284,92],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Ellipse 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":360,"st":0,"bm":0}],"markers":[]} ================================================ FILE: assets/trail_loading.json ================================================ {"v":"4.6.8","fr":60,"ip":0,"op":106,"w":500,"h":500,"nm":"Comp 1","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":2,"ty":4,"nm":"Shape Layer 5","ks":{"o":{"a":0,"k":100},"r":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"n":["0p667_1_0p333_0"],"t":20,"s":[0],"e":[360]},{"t":110}]},"p":{"a":0,"k":[251,250,0]},"a":{"a":0,"k":[0,0,0]},"s":{"a":0,"k":[100,100,100]}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[10,10]},"p":{"a":0,"k":[0,-100]},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse"},{"ty":"st","c":{"a":0,"k":[0,0,0,1]},"o":{"a":0,"k":100},"w":{"a":0,"k":0},"lc":1,"lj":1,"ml":4,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke"},{"ty":"fl","c":{"a":0,"k":[0,0.7294118,1,1]},"o":{"a":0,"k":100},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill"},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Ellipse 1","np":3,"cix":2,"ix":1,"mn":"ADBE Vector Group"}],"ip":20,"op":620,"st":20,"bm":0,"sr":1},{"ddd":0,"ind":3,"ty":4,"nm":"Shape Layer 4","ks":{"o":{"a":0,"k":100},"r":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"n":["0p667_1_0p333_0"],"t":15,"s":[0],"e":[360]},{"t":105}]},"p":{"a":0,"k":[251,250,0]},"a":{"a":0,"k":[0,0,0]},"s":{"a":0,"k":[100,100,100]}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[20,20]},"p":{"a":0,"k":[0,-100]},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse"},{"ty":"st","c":{"a":0,"k":[0,0,0,1]},"o":{"a":0,"k":100},"w":{"a":0,"k":0},"lc":1,"lj":1,"ml":4,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke"},{"ty":"fl","c":{"a":0,"k":[0,0.7294118,1,1]},"o":{"a":0,"k":100},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill"},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Ellipse 1","np":3,"cix":2,"ix":1,"mn":"ADBE Vector Group"}],"ip":15,"op":615,"st":15,"bm":0,"sr":1},{"ddd":0,"ind":4,"ty":4,"nm":"Shape Layer 3","ks":{"o":{"a":0,"k":100},"r":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"n":["0p667_1_0p333_0"],"t":10,"s":[0],"e":[360]},{"t":100}]},"p":{"a":0,"k":[251,250,0]},"a":{"a":0,"k":[0,0,0]},"s":{"a":0,"k":[100,100,100]}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[30,30]},"p":{"a":0,"k":[0,-100]},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse"},{"ty":"st","c":{"a":0,"k":[0,0,0,1]},"o":{"a":0,"k":100},"w":{"a":0,"k":0},"lc":1,"lj":1,"ml":4,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke"},{"ty":"fl","c":{"a":0,"k":[0,0.7294118,1,1]},"o":{"a":0,"k":100},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill"},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Ellipse 1","np":3,"cix":2,"ix":1,"mn":"ADBE Vector Group"}],"ip":10,"op":610,"st":10,"bm":0,"sr":1},{"ddd":0,"ind":5,"ty":4,"nm":"Shape Layer 2","ks":{"o":{"a":0,"k":100},"r":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"n":["0p667_1_0p333_0"],"t":5,"s":[0],"e":[360]},{"t":95}]},"p":{"a":0,"k":[251,250,0]},"a":{"a":0,"k":[0,0,0]},"s":{"a":0,"k":[100,100,100]}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[40,40]},"p":{"a":0,"k":[0,-100]},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse"},{"ty":"st","c":{"a":0,"k":[0,0,0,1]},"o":{"a":0,"k":100},"w":{"a":0,"k":0},"lc":1,"lj":1,"ml":4,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke"},{"ty":"fl","c":{"a":0,"k":[0,0.7294118,1,1]},"o":{"a":0,"k":100},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill"},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Ellipse 1","np":3,"cix":2,"ix":1,"mn":"ADBE Vector Group"}],"ip":5,"op":605,"st":5,"bm":0,"sr":1},{"ddd":0,"ind":6,"ty":4,"nm":"Shape Layer 1","ks":{"o":{"a":0,"k":100},"r":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"n":["0p667_1_0p333_0"],"t":0,"s":[0],"e":[360]},{"t":90}]},"p":{"a":0,"k":[250,250,0]},"a":{"a":0,"k":[0,0,0]},"s":{"a":0,"k":[100,100,100]}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":1,"k":[{"i":{"x":[0.667,0.667],"y":[1,1]},"o":{"x":[0.333,0.333],"y":[0,0]},"n":["0p667_1_0p333_0","0p667_1_0p333_0"],"t":0,"s":[50,50],"e":[40,40]},{"i":{"x":[0.667,0.667],"y":[1,1]},"o":{"x":[0.333,0.333],"y":[0,0]},"n":["0p667_1_0p333_0","0p667_1_0p333_0"],"t":84,"s":[40,40],"e":[50,50]},{"t":100}]},"p":{"a":0,"k":[0,-100]},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse"},{"ty":"st","c":{"a":0,"k":[0,0,0,1]},"o":{"a":0,"k":100},"w":{"a":0,"k":0},"lc":1,"lj":1,"ml":4,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke"},{"ty":"fl","c":{"a":0,"k":[0,0.7294118,1,1]},"o":{"a":0,"k":100},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill"},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Ellipse 1","np":3,"cix":2,"ix":1,"mn":"ADBE Vector Group"}],"ip":0,"op":600,"st":0,"bm":0,"sr":1}]} ================================================ FILE: change_log/1.0.0.0817.md ================================================ ## 1.0.0 ### 初始版本 + 直播、推荐、动态功能 + 投稿、番剧播放功能 + 播放器手势支持 + 画质、音质、解码格式支持 + 点赞、投币、收藏功能 + 关注/取关、用户主页功能 + 评论功能 + 历史记录、稍后再看功能 ================================================ FILE: change_log/1.0.1.0817.md ================================================ ## 1.0.1 ### 修复 + 升级播放器依赖 + android平台 AV1格式视频支持 + 视频全屏功能 ================================================ FILE: change_log/1.0.10.1016.md ================================================ ## 1.0.10 ### 修复 + 长按倍速抬起后未恢复默认倍速 ================================================ FILE: change_log/1.0.11.1112.md ================================================ ## 1.0.11 ### 新功能 + 适配了原生媒体通知栏 @Daydreamer-riri + 视频主题图标 @Daydreamer-riri + 关闭软件后自动画中画播放 + UP主分组管理 + md2样式底栏 + ### 修复 + 历史记录记忆播放 + 部分类型视频连播 + 播放速度选择框不支持返回手势 + 播放速度选择框不支持返回手势 + 视频播放速度总是显示1.0X + 评论页面计数错误 + 退出视频还有声音 ### 优化 + 视频加载速度 更多更新日志可在Github上查看 问题反馈、功能建议请查看「关于」页面。 ================================================ FILE: change_log/1.0.12.1114.md ================================================ ## 1.0.12 ### 修复 + iOS端视频播放时没有声音 + 超过6分钟弹幕不显示 + 视频详情页网络异常 更多更新日志可在Github上查看 问题反馈、功能建议请查看「关于」页面。 ================================================ FILE: change_log/1.0.13.1217.md ================================================ ## 1.0.13 ### 新功能 + 视频详情页稍后再看 + 发送弹幕 感谢@orz12 + 消息展示 + up主页显示获赞数 + up主页显示合集 + 视频详情页「ai总结」增加开关 ### 修复 + 首页推荐问题(需要重新登录) + 长按倍速逻辑 + 视频详情页网络异常 ### 优化 + 设置面板样式 感谢@GuMengYu @KoolShow 更多更新日志可在Github上查看 问题反馈、功能建议请查看「关于」页面。 ================================================ FILE: change_log/1.0.14.1225.md ================================================ ## 1.0.14 圣诞节快乐~ 🎉 大部分内容由@orz12提供,感谢👏 ### 修复 + 全屏弹幕消失 + iOS全屏/退出全屏视频暂停 + 个人主页关注状态 + 视频合集向下滑动UI问题 + 媒体库滑动底栏不隐藏 + 个人主页动态加载问题 * 2 + 未登录状态访问个人主页异常 + 视频搜索标题特殊字符转义 + iOS闪退 + 消息页面夜间模式异常 + 消息页面含有撤回消息时异常 + 弹幕速度 ### 优化 + 全屏播放方案优化 + 弹幕加载逻辑优化 + 点赞、投币逻辑优化 + 进度条及播放时间渲染优化 更多更新日志可在Github上查看 问题反馈、功能建议请查看「关于」页面。 ================================================ FILE: change_log/1.0.15.0101.md ================================================ ## 1.0.15 元旦快乐~ 🎉 ### 功能 + 转发动态评论展示 + 推荐、最热、收藏视频增肌日期显示 ### 修复 + 全屏播放相关问题 + 评论区@用户展示问题 + 登录状态闪退问题 + pip意外触发问题 + 动态页tab切换样式问题 ### 优化 + 首页默认使用web端推荐 + 取消iOS路由切换效果 + 视频分享中添加Up主 更多更新日志可在Github上查看 问题反馈、功能建议请查看「关于」页面。 ================================================ FILE: change_log/1.0.16.0102.md ================================================ ## 1.0.16 ### 功能 + toast 背景支持透明度调节 ### 修复 + web端推荐未展示【已关注】 + up主动态页异常 + 未打开自动播放时,视频详情页异常 + 视频暂停状态取消自动ip 更多更新日志可在Github上查看 问题反馈、功能建议请查看「关于」页面。 ================================================ FILE: change_log/1.0.17.0125.md ================================================ ## 1.0.17 ### 功能 + 视频全屏时隐藏进度条 + 动态内容增加投稿跳转 + 未开启自动播放时点击封面播放 + 弹幕发送标识 + 定时关闭 + 推荐视频卡片拉黑up功能 + 首页tabbar编辑排序 ### 修复 + 连续跳转搜索页未刷新 + 搜索结果为空时页面异常 + 评论区链接解析 + 视频全屏状态栏背景色 + 私信对话气泡位置 + 设置up关注分组样式 + 每次推荐请求数据相同 + iOS代理网络异常 + 双击切换播放状态无声 + 设置自定义倍速白屏 + 免登录查看1080p ### 优化 + 首页web端推荐观看数展示 + 首页web端推荐接口更新 + 首页样式 + 搜索页跳转 + 弹幕资源优化 + 图片渲染占用内存优化(部分) + 两次返回退出应用 + schame 补充 更多更新日志可在Github上查看 问题反馈、功能建议请查看「关于」页面。 ================================================ FILE: change_log/1.0.18.0130.md ================================================ ## 1.0.18 ### 功能 ### 修复 ### 优化 更多更新日志可在Github上查看 问题反馈、功能建议请查看「关于」页面。 ================================================ FILE: change_log/1.0.19.0131.md ================================================ ## 1.0.19 ### 修复 + 视频404、评论加载错误 + bvav转换 ### 优化 + 视频详情页内存占用 更多更新日志可在Github上查看 问题反馈、功能建议请查看「关于」页面。 ================================================ FILE: change_log/1.0.2.0819.md ================================================ ## 1.0.2 ### 新功能 + 自动检查更新 + 封面图片保存 + 动态跳转番剧 + 历史记录番剧记忆播放 + 一键清空稍后再看 ### 修复 + 切换分P cid未切换 + cookie存储问题 + 登录/退出登录问题 ### 优化 + 页面空/异常状态样式 + 退出登录提示 + 请求节流 + 全屏播放 ================================================ FILE: change_log/1.0.20.0303.md ================================================ ## 1.0.20 ### 功能 + 评论区增加表情 + 首页渐变背景开关 + 媒体库显示「我的订阅」 + 评论区链接解析 + 默认启动页设置 ### 修复 + 评论区内容重复 + pip相关问题 + 播放多p视频评论不刷新 + 视频评论翻页重复 ### 优化 + url scheme优化 + 图片预览放大 + 图片加载速度 + 视频评论区复制 + 全屏显示视频标题 + 网络异常处理 更多更新日志可在Github上查看 问题反馈、功能建议请查看「关于」页面。 ================================================ FILE: change_log/1.0.21.0306.md ================================================ ## 1.0.21 ### 修复 + 推荐视频全屏问题 + 番剧全屏播放时灰屏问题 + 评论回调导致页面卡死问题 更多更新日志可在Github上查看 问题反馈、功能建议请查看「关于」页面。 ================================================ FILE: change_log/1.0.22.0430.md ================================================ ## 1.0.22 ### 功能 + 字幕 + 全屏时选集 + 动态转发 + 评论视频并转发 + 收藏夹删除 + 合集显示封面 + 底部导航栏编辑、排序功能 + 历史记录进度条展示 + 直播画质切换 + 排行榜功能 + 视频详情页推荐视频开关 + 显示联合投稿up ### 修复 + 收藏夹个数错误 + 封面保存权限问题 + 合集最后1p未展示 + up主页关注按钮触发灰屏 ### 优化 + 视频简介查看逻辑 更多更新日志可在Github上查看 问题反馈、功能建议请查看「关于」页面。 ================================================ FILE: change_log/1.0.23.0504.md ================================================ ## 1.0.23 ### 功能 + 封面下载 ### 修复 + 全屏问题 + 视频播放器灰屏问题 + 评论区点击区域问题 更多更新日志可在Github上查看 问题反馈、功能建议请查看「关于」页面。 ================================================ FILE: change_log/1.0.23.0505.md ================================================ ## 1.0.23 ### 功能 + 封面下载 ### 修复 + 全屏问题 + 视频播放器灰屏问题 + 评论区点击区域问题 + 动态详情跳转异常问题 更多更新日志可在Github上查看 问题反馈、功能建议请查看「关于」页面。 ================================================ FILE: change_log/1.0.24.0626.md ================================================ ## 1.0.24 ### 功能 + 私信功能 + 回复我的、收到的赞查看 + 新的登录方式 + 全屏选集 + 一键三连 + 按分区搜索 ### 优化 + 页面跳转动画 + 评论区跳转 ### 修复 + 音画不同步问题 + 分集字幕未同步 + 多语言字幕 + 弹幕设置未生效 更多更新日志可在Github上查看 问题反馈、功能建议请查看「关于」页面。 ================================================ FILE: change_log/1.0.25.1010.md ================================================ ## 1.0.25 ### 功能 + 直播弹幕 + 稍后再看、收藏夹播放全部 + 收藏夹新建、编辑 + 评论删除 + 评论保存为图片 + 动态页滑动切换up + up投稿筛选充电视频 + 直播tab展示关注up + up主页专栏展示 ### 优化 + 视频详情页一键三连 + 动态页标识充电视频 + 播放器亮度、音量调整百分比展示 + 封面预览时视频标题可复制 + 竖屏直播布局 + 图片预览 + 专栏渲染优化 + 私信图片查看 ### 修复 + 收藏夹点击异常 + 搜索up异常 + 系统通知已读异常 + [赞了我的]展示错误 + 部分up合集无法打开 + 切换合集视频投币个数未重置 + 搜索条件筛选面板无法滚动 + 部分机型导航条未沉浸 + 专栏图片渲染问题 + 专栏浏览历史记录 + 直播间历史记录 更多更新日志可在Github上查看 问题反馈、功能建议请查看「关于」页面。 ================================================ FILE: change_log/1.0.3.0821.md ================================================ ## 1.0.3 建议卸载1.0.2版本,重新安装 ### 新功能 + 底部播放进度条设置 + 复制图片链接 ### 修复 + 用户数据格式修改 + video Fit + 没有audio 资源的视频异常 + 评论区域图片无法点击 + 视频进度条拖动问题 ### 优化 + 页面空/异常状态样式 + 部分页面样式 + 图片预览页面样式 ================================================ FILE: change_log/1.0.4.0822.md ================================================ ## 1.0.4 ### 新功能 + 热搜刷新 + 视频搜索排序、筛选 + app字体大小自定义 + app主题色自定义 + 「课堂」类动态渲染 ### 修复 + 搜索词联想richText渲染异常 + 部分动态点赞异常 + 默认视频解码格式 + 搜索页面返回搜索词未清空 + 动态详情评论加载异常 + 动态页面下拉刷新数据异常 ### 优化 + 一些样式修改 + 取消热搜词缓存 ================================================ FILE: change_log/1.0.5.0826.md ================================================ ## 1.0.5 主要是bug修复跟一部分小功能,弹幕功能需要下一版。 问题反馈请前往QQ频道或提交issues。 感谢🙏酷友「无力感*」「斤斤计较呀」「Pseudopamine」 ### 新功能 + 高帧率支持 + 默认评论排序设置 + 默认动态类别设置 + 动态合集查看 + 同时观看人数 + iOS路由切换效果 ### 修复 + 收藏夹翻页 + 首页搜索框频繁点击消失 + 评论排序切换空白 + 快速返回首页 + 重复进入个人中心页面数据未刷新 + 动态goods数据异常 + 大会员切换番剧 + 高画质codes匹配 ### 优化 + 倍速选择 + 播放器亮度记忆 + 下载对应版本apk ================================================ FILE: change_log/1.0.6.0902.md ================================================ ## 1.0.6 问题反馈、功能建议请查看「关于」页面。 ### 新功能 + 首页单列布局 + 首页推荐展示播放量、弹幕数 + 简单弹幕功能实现(持续开发中...) + 评论区搜索关键词开关 issues#46 + 热搜榜隐藏功能 issues#35 + 自动全屏 issues#37 + 快速收藏功能 + 双击快进/快退开关 + 评论链接跳转视频 + 支持移除单个稍后再看 + app scheme外链跳转 ### 修复 + 杜比、无损音频切换 + 收藏夹展示 issues#42 + 搜索建议次 issues#47 ### 优化 + 倍速选择优化 + 导航条沉浸 + 取消Hero动画 + 视频锁定逻辑 + 登录逻辑优化 + 图片预览样式 + +评论区用户点击范围 + 关注、粉丝页面优化 + 关闭自动播放时播放器初始化逻辑 ================================================ FILE: change_log/1.0.7.0908.md ================================================ ## 1.0.7 默认倍速、直播弹幕、专栏等功能开发中 ### 新功能 + 弹幕设置、屏蔽功能 + 不是很完美的后台播放功能 + 不是很完美的画中画(pip)功能(Android端) ### 修复 + 动态页面加载异常 + 网络异常时页面空白 + 竖屏全屏状态栏问题 + iOS端代理请求异常 ### 优化 + 图片预览 + 全屏播放时自动旋转 + 转发内容增加视频标题 更多更新日志可在Github上查看 问题反馈、功能建议请查看「关于」页面。 ================================================ FILE: change_log/1.0.8.0917.md ================================================ ## 1.0.8 直播弹幕、循环播放等功能开发中 ### 新功能 + 用户拉黑功能 + gif图片保存 + 删除已看历史记录 ### 修复 + 弹幕数量较少 + 弹幕屏蔽设置自动记忆 + 动态页面渲染 + 用户主页数据错乱 + 大家都在搜空白 + 默认自动全屏,顶部操作栏丢失 ### 优化 + 全屏状态栏区域显示优化 + 图片保存至PiliPala文件夹 更多更新日志可在Github上查看 问题反馈、功能建议请查看「关于」页面。 ================================================ FILE: change_log/1.0.9.1015.md ================================================ ## 1.0.9 ### 新功能 + 自定义倍速、默认倍速 + 历史记录搜索 + 收藏夹搜索 + 历史记录多选删除 + 视频循环播放 + 免登录看1080P + 评论区视频链接跳转 + up主分组 + up主投稿搜索 ### 修复 + 搜索视频标题乱码 + 屏幕帧率 + 动态页面渲染 ### 优化 + 快进手势 + 视频简介链接匹配 + 视频全屏时安全区域 更多更新日志可在Github上查看 问题反馈、功能建议请查看「关于」页面。 ================================================ FILE: fastlane/metadata/android/en-US/full_description.txt ================================================ PiliPala is a third-party Bilibili client developed in Flutter. Top Features: * List of recommended videos * List of hottest videos * Popular live streams * List of bangumis * Block videos from blacklisted users ================================================ FILE: fastlane/metadata/android/en-US/short_description.txt ================================================ A third-party Bilibili client developed in Flutter ================================================ FILE: fastlane/metadata/android/en-US/title.txt ================================================ PiliPala ================================================ FILE: fastlane/metadata/android/zh-CN/changelogs/2001.txt ================================================ 修复 * 全屏弹幕消失 * iOS 全屏/退出全屏视频暂停 * 个人主页关注状态 * 视频合集向下滑动UI问题 * 媒体库滑动底栏不隐藏 * 个人主页动态加载问题 * 2 * 未登录状态访问个人主页异常 * 视频搜索标题特殊字符转义 * iOS 闪退 * 消息页面夜间模式异常 * 消息页面含有撤回消息时异常 * 弹幕速度 优化 * 全屏播放方案优化 * 弹幕加载逻辑优化 * 点赞、投币逻辑优化 * 进度条及播放时间渲染优化 ================================================ FILE: fastlane/metadata/android/zh-CN/full_description.txt ================================================ PiliPala 是使用 Flutter 开发的 BiliBili 第三方客户端。 主要功能: * 推荐视频列表 (app 端) * 最热视频列表 * 热门直播 * 番剧列表 * 屏蔽黑名单内用户视频 ================================================ FILE: fastlane/metadata/android/zh-CN/short_description.txt ================================================ 使用 Flutter 开发的 BiliBili 第三方客户端 ================================================ FILE: fastlane/metadata/android/zh-CN/title.txt ================================================ PiliPala ================================================ FILE: ios/.gitignore ================================================ **/dgph *.mode1v3 *.mode2v3 *.moved-aside *.pbxuser *.perspectivev3 **/*sync/ .sconsign.dblite .tags* **/.vagrant/ **/DerivedData/ Icon? **/Pods/ **/.symlinks/ profile xcuserdata **/.generated/ Flutter/App.framework Flutter/Flutter.framework Flutter/Flutter.podspec Flutter/Generated.xcconfig Flutter/ephemeral/ Flutter/app.flx Flutter/app.zip Flutter/flutter_assets/ Flutter/flutter_export_environment.sh ServiceDefinitions.json Runner/GeneratedPluginRegistrant.* # Exceptions to above rules. !default.mode1v3 !default.mode2v3 !default.pbxuser !default.perspectivev3 ================================================ FILE: ios/Flutter/AppFrameworkInfo.plist ================================================ CFBundleDevelopmentRegion en CFBundleExecutable App CFBundleIdentifier io.flutter.flutter.app CFBundleInfoDictionaryVersion 6.0 CFBundleName App CFBundlePackageType FMWK CFBundleShortVersionString 1.0 CFBundleSignature ???? CFBundleVersion 1.0 MinimumOSVersion 12.0 ================================================ FILE: ios/Flutter/Debug.xcconfig ================================================ #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" #include "Generated.xcconfig" ================================================ FILE: ios/Flutter/Release.xcconfig ================================================ #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" #include "Generated.xcconfig" ================================================ FILE: ios/Podfile ================================================ # Uncomment this line to define a global platform for your project platform :ios, '13.0' # CocoaPods analytics sends network stats synchronously affecting flutter build latency. ENV['COCOAPODS_DISABLE_STATS'] = 'true' project 'Runner', { 'Debug' => :debug, 'Profile' => :release, 'Release' => :release, } def flutter_root generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) unless File.exist?(generated_xcode_build_settings_path) raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" end File.foreach(generated_xcode_build_settings_path) do |line| matches = line.match(/FLUTTER_ROOT\=(.*)/) return matches[1].strip if matches end raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" end require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) flutter_ios_podfile_setup target 'Runner' do use_frameworks! use_modular_headers! flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) end post_install do |installer| installer.pods_project.targets.each do |target| flutter_additional_ios_build_settings(target) target.build_configurations.each do |config| deployment_target = config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] if !deployment_target.nil? && !deployment_target.empty? && deployment_target.to_f < 12.0 config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '12.0' end end end end ================================================ FILE: ios/Runner/AppDelegate.swift ================================================ import UIKit import Flutter import AVFoundation @UIApplicationMain @objc class AppDelegate: FlutterAppDelegate { override func application( _ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? ) -> Bool { GeneratedPluginRegistrant.register(with: self) // 设置音频会话类别,确保在静音模式下播放音频 do { try AVAudioSession.sharedInstance().setCategory(.playback, options: [.duckOthers]) } catch { print("Failed to set audio session category: \(error)") } return super.application(application, didFinishLaunchingWithOptions: launchOptions) } } ================================================ FILE: ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json ================================================ { "images" : [ { "size" : "20x20", "idiom" : "iphone", "filename" : "Icon-App-20x20@2x.png", "scale" : "2x" }, { "size" : "20x20", "idiom" : "iphone", "filename" : "Icon-App-20x20@3x.png", "scale" : "3x" }, { "size" : "29x29", "idiom" : "iphone", "filename" : "Icon-App-29x29@1x.png", "scale" : "1x" }, { "size" : "29x29", "idiom" : "iphone", "filename" : "Icon-App-29x29@2x.png", "scale" : "2x" }, { "size" : "29x29", "idiom" : "iphone", "filename" : "Icon-App-29x29@3x.png", "scale" : "3x" }, { "size" : "40x40", "idiom" : "iphone", "filename" : "Icon-App-40x40@2x.png", "scale" : "2x" }, { "size" : "40x40", "idiom" : "iphone", "filename" : "Icon-App-40x40@3x.png", "scale" : "3x" }, { "size" : "60x60", "idiom" : "iphone", "filename" : "Icon-App-60x60@2x.png", "scale" : "2x" }, { "size" : "60x60", "idiom" : "iphone", "filename" : "Icon-App-60x60@3x.png", "scale" : "3x" }, { "size" : "20x20", "idiom" : "ipad", "filename" : "Icon-App-20x20@1x.png", "scale" : "1x" }, { "size" : "20x20", "idiom" : "ipad", "filename" : "Icon-App-20x20@2x.png", "scale" : "2x" }, { "size" : "29x29", "idiom" : "ipad", "filename" : "Icon-App-29x29@1x.png", "scale" : "1x" }, { "size" : "29x29", "idiom" : "ipad", "filename" : "Icon-App-29x29@2x.png", "scale" : "2x" }, { "size" : "40x40", "idiom" : "ipad", "filename" : "Icon-App-40x40@1x.png", "scale" : "1x" }, { "size" : "40x40", "idiom" : "ipad", "filename" : "Icon-App-40x40@2x.png", "scale" : "2x" }, { "size" : "76x76", "idiom" : "ipad", "filename" : "Icon-App-76x76@1x.png", "scale" : "1x" }, { "size" : "76x76", "idiom" : "ipad", "filename" : "Icon-App-76x76@2x.png", "scale" : "2x" }, { "size" : "83.5x83.5", "idiom" : "ipad", "filename" : "Icon-App-83.5x83.5@2x.png", "scale" : "2x" }, { "size" : "1024x1024", "idiom" : "ios-marketing", "filename" : "Icon-App-1024x1024@1x.png", "scale" : "1x" } ], "info" : { "version" : 1, "author" : "xcode" } } ================================================ FILE: ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json ================================================ { "images" : [ { "idiom" : "universal", "filename" : "LaunchImage.png", "scale" : "1x" }, { "idiom" : "universal", "filename" : "LaunchImage@2x.png", "scale" : "2x" }, { "idiom" : "universal", "filename" : "LaunchImage@3x.png", "scale" : "3x" } ], "info" : { "version" : 1, "author" : "xcode" } } ================================================ FILE: ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md ================================================ # Launch Screen Assets You can customize the launch screen with your own desired assets by replacing the image files in this directory. You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. ================================================ FILE: ios/Runner/Base.lproj/LaunchScreen.storyboard ================================================ ================================================ FILE: ios/Runner/Base.lproj/Main.storyboard ================================================ ================================================ FILE: ios/Runner/Info.plist ================================================ CFBundleDevelopmentRegion $(DEVELOPMENT_LANGUAGE) CFBundleDisplayName PiliPala CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName PiliPala CFBundlePackageType APPL CFBundleShortVersionString $(FLUTTER_BUILD_NAME) CFBundleSignature ???? CFBundleVersion $(FLUTTER_BUILD_NUMBER) LSRequiresIPhoneOS UILaunchStoryboardName LaunchScreen UIMainStoryboardFile Main UISupportedInterfaceOrientations UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UISupportedInterfaceOrientations~ipad UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIViewControllerBasedStatusBarAppearance CADisableMinimumFrameDurationOnPhone UIApplicationSupportsIndirectInputEvents NSPhotoLibraryAddUsageDescription 请允许APP保存图片到相册 NSPhotoLibraryUsageDescription 请允许APP保存图片到相册 NSCameraUsageDescription App需要您的同意,才能访问相册 NSAppleMusicUsageDescription App需要您的同意,才能访问媒体资料库 LSApplicationQueriesSchemes https http CFBundleURLTypes CFBundleURLName CFBundleURLSchemes http https CFBundleURLTypes CFBundleURLName CFBundleURLSchemes m.bilibili.com bilibili.com www.bilibili.com bangumi.bilibili.com bilibili.cn www.bilibili.cn bangumi.bilibili.cn bilibili.tv www.bilibili.tv bangumi.bilibili.tv miniapp.bilibili.com live.bilibili.com CFBundleURLName bilibili CFBundleURLSchemes bilibili UIBackgroundModes audio ================================================ FILE: ios/Runner/Runner-Bridging-Header.h ================================================ #import "GeneratedPluginRegistrant.h" ================================================ FILE: ios/Runner.xcodeproj/project.pbxproj ================================================ // !$*UTF8*$! { archiveVersion = 1; classes = { }; objectVersion = 54; objects = { /* Begin PBXBuildFile section */ 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 2431C9E3151C7449D0D1C0F4 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 63F2789C7C1DF3CD2B80A936 /* Pods_Runner.framework */; }; 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ 9705A1C41CF9048500538489 /* Embed Frameworks */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = ""; dstSubfolderSpec = 10; files = ( ); name = "Embed Frameworks"; runOnlyForDeploymentPostprocessing = 0; }; /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 32E2926120A1A8DC0E629BC6 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 3DA6FBBC55FDD1E3261D6D67 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; 51DB54E5BB66F8608325A082 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; 63F2789C7C1DF3CD2B80A936 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ 97C146EB1CF9000F007C117D /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( 2431C9E3151C7449D0D1C0F4 /* Pods_Runner.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ 31399C6148E878051E614578 /* Frameworks */ = { isa = PBXGroup; children = ( 63F2789C7C1DF3CD2B80A936 /* Pods_Runner.framework */, ); name = Frameworks; sourceTree = ""; }; 9740EEB11CF90186004384FC /* Flutter */ = { isa = PBXGroup; children = ( 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 9740EEB21CF90195004384FC /* Debug.xcconfig */, 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 9740EEB31CF90195004384FC /* Generated.xcconfig */, ); name = Flutter; sourceTree = ""; }; 97C146E51CF9000F007C117D = { isa = PBXGroup; children = ( 9740EEB11CF90186004384FC /* Flutter */, 97C146F01CF9000F007C117D /* Runner */, 97C146EF1CF9000F007C117D /* Products */, EFBDDDF3F822865E6D1BB6D7 /* Pods */, 31399C6148E878051E614578 /* Frameworks */, ); sourceTree = ""; }; 97C146EF1CF9000F007C117D /* Products */ = { isa = PBXGroup; children = ( 97C146EE1CF9000F007C117D /* Runner.app */, ); name = Products; sourceTree = ""; }; 97C146F01CF9000F007C117D /* Runner */ = { isa = PBXGroup; children = ( 97C146FA1CF9000F007C117D /* Main.storyboard */, 97C146FD1CF9000F007C117D /* Assets.xcassets */, 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 97C147021CF9000F007C117D /* Info.plist */, 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, ); path = Runner; sourceTree = ""; }; EFBDDDF3F822865E6D1BB6D7 /* Pods */ = { isa = PBXGroup; children = ( 51DB54E5BB66F8608325A082 /* Pods-Runner.debug.xcconfig */, 3DA6FBBC55FDD1E3261D6D67 /* Pods-Runner.release.xcconfig */, 32E2926120A1A8DC0E629BC6 /* Pods-Runner.profile.xcconfig */, ); path = Pods; sourceTree = ""; }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ 97C146ED1CF9000F007C117D /* Runner */ = { isa = PBXNativeTarget; buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; buildPhases = ( 67CCBB29D5A20A144E2BDF7D /* [CP] Check Pods Manifest.lock */, 9740EEB61CF901F6004384FC /* Run Script */, 97C146EA1CF9000F007C117D /* Sources */, 97C146EB1CF9000F007C117D /* Frameworks */, 97C146EC1CF9000F007C117D /* Resources */, 9705A1C41CF9048500538489 /* Embed Frameworks */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */, 5A372F23F3CF0118D6526BAC /* [CP] Embed Pods Frameworks */, B78851E7B29A4C3961AC483C /* [CP] Copy Pods Resources */, ); buildRules = ( ); dependencies = ( ); name = Runner; productName = Runner; productReference = 97C146EE1CF9000F007C117D /* Runner.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ 97C146E61CF9000F007C117D /* Project object */ = { isa = PBXProject; attributes = { LastUpgradeCheck = 1510; ORGANIZATIONNAME = ""; TargetAttributes = { 97C146ED1CF9000F007C117D = { CreatedOnToolsVersion = 7.3.1; LastSwiftMigration = 1100; }; }; }; buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; compatibilityVersion = "Xcode 9.3"; developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( en, Base, ); mainGroup = 97C146E51CF9000F007C117D; productRefGroup = 97C146EF1CF9000F007C117D /* Products */; projectDirPath = ""; projectRoot = ""; targets = ( 97C146ED1CF9000F007C117D /* Runner */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ 97C146EC1CF9000F007C117D /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { isa = PBXShellScriptBuildPhase; alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); inputPaths = ( "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}", ); name = "Thin Binary"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; }; 5A372F23F3CF0118D6526BAC /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputFileListPaths = ( "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", ); name = "[CP] Embed Pods Frameworks"; outputFileListPaths = ( "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; 67CCBB29D5A20A144E2BDF7D /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputFileListPaths = ( ); inputPaths = ( "${PODS_PODFILE_DIR_PATH}/Podfile.lock", "${PODS_ROOT}/Manifest.lock", ); name = "[CP] Check Pods Manifest.lock"; outputFileListPaths = ( ); outputPaths = ( "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; 9740EEB61CF901F6004384FC /* Run Script */ = { isa = PBXShellScriptBuildPhase; alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); name = "Run Script"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; }; B78851E7B29A4C3961AC483C /* [CP] Copy Pods Resources */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputFileListPaths = ( "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-input-files.xcfilelist", ); name = "[CP] Copy Pods Resources"; outputFileListPaths = ( "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-output-files.xcfilelist", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n"; showEnvVarsInLog = 0; }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ 97C146EA1CF9000F007C117D /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXVariantGroup section */ 97C146FA1CF9000F007C117D /* Main.storyboard */ = { isa = PBXVariantGroup; children = ( 97C146FB1CF9000F007C117D /* Base */, ); name = Main.storyboard; sourceTree = ""; }; 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { isa = PBXVariantGroup; children = ( 97C147001CF9000F007C117D /* Base */, ); name = LaunchScreen.storyboard; sourceTree = ""; }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ 249021D3217E4FDB00AE95B9 /* Profile */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 13.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; }; name = Profile; }; 249021D4217E4FDB00AE95B9 /* Profile */ = { isa = XCBuildConfiguration; baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; DEVELOPMENT_TEAM = ""; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); PRODUCT_BUNDLE_IDENTIFIER = com.guozhigq.pilipala; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_VERSION = 5.0; VERSIONING_SYSTEM = "apple-generic"; }; name = Profile; }; 97C147031CF9000F007C117D /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", ); GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 13.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; }; 97C147041CF9000F007C117D /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 13.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; SWIFT_COMPILATION_MODE = wholemodule; SWIFT_OPTIMIZATION_LEVEL = "-O"; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; }; name = Release; }; 97C147061CF9000F007C117D /* Debug */ = { isa = XCBuildConfiguration; baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; DEVELOPMENT_TEAM = ""; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); PRODUCT_BUNDLE_IDENTIFIER = com.guozhigq.pilipala; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; VERSIONING_SYSTEM = "apple-generic"; }; name = Debug; }; 97C147071CF9000F007C117D /* Release */ = { isa = XCBuildConfiguration; baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; DEVELOPMENT_TEAM = ""; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); PRODUCT_BUNDLE_IDENTIFIER = com.guozhigq.pilipala; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_VERSION = 5.0; VERSIONING_SYSTEM = "apple-generic"; }; name = Release; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { isa = XCConfigurationList; buildConfigurations = ( 97C147031CF9000F007C117D /* Debug */, 97C147041CF9000F007C117D /* Release */, 249021D3217E4FDB00AE95B9 /* Profile */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { isa = XCConfigurationList; buildConfigurations = ( 97C147061CF9000F007C117D /* Debug */, 97C147071CF9000F007C117D /* Release */, 249021D4217E4FDB00AE95B9 /* Profile */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; rootObject = 97C146E61CF9000F007C117D /* Project object */; } ================================================ FILE: ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata ================================================ ================================================ FILE: ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist ================================================ IDEDidComputeMac32BitWarning ================================================ FILE: ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings ================================================ PreviewsEnabled ================================================ FILE: ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme ================================================ ================================================ FILE: ios/Runner.xcworkspace/contents.xcworkspacedata ================================================ ================================================ FILE: ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist ================================================ IDEDidComputeMac32BitWarning ================================================ FILE: ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings ================================================ PreviewsEnabled ================================================ FILE: lib/common/constants.dart ================================================ import 'package:flutter/material.dart'; class StyleString { static const double cardSpace = 8; static const double safeSpace = 12; static BorderRadius mdRadius = BorderRadius.circular(10); static const Radius imgRadius = Radius.circular(10); static const double aspectRatio = 16 / 10; } class Constants { // 27eb53fc9058f8c3 移动端 Android // 4409e2ce8ffd12b8 TV端 static const String appKey = '4409e2ce8ffd12b8'; // 59b43e04ad6965f34319062b478f83dd TV端 static const String appSec = '59b43e04ad6965f34319062b478f83dd'; static const String thirdSign = '04224646d1fea004e79606d3b038c84a'; static const String thirdApi = 'https://www.mcbbs.net/template/mcbbs/image/special_photo_bg.png'; } ================================================ FILE: lib/common/pages_bottom_sheet.dart ================================================ import 'package:flutter/material.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:pilipala/common/widgets/network_img_layer.dart'; import 'package:scrollable_positioned_list/scrollable_positioned_list.dart'; import '../models/common/video_episode_type.dart'; class EpisodeBottomSheet { final List episodes; final int currentCid; final dynamic dataType; final BuildContext context; final Function changeFucCall; final int? cid; final double? sheetHeight; bool isFullScreen = false; EpisodeBottomSheet({ required this.episodes, required this.currentCid, required this.dataType, required this.context, required this.changeFucCall, this.cid, this.sheetHeight, this.isFullScreen = false, }); Widget buildEpisodeListItem( dynamic episode, int index, bool isCurrentIndex, ) { Color primary = Theme.of(context).colorScheme.primary; Color onSurface = Theme.of(context).colorScheme.onSurface; String title = ''; switch (dataType) { case VideoEpidoesType.videoEpisode: title = episode.title; break; case VideoEpidoesType.videoPart: title = episode.pagePart; break; case VideoEpidoesType.bangumiEpisode: title = '第${episode.title}话 ${episode.longTitle!}'; break; } return isFullScreen || episode?.cover == null || episode?.cover == '' ? ListTile( onTap: () { SmartDialog.showToast('切换至「$title」'); changeFucCall.call(episode, index); }, dense: false, leading: isCurrentIndex ? Image.asset( 'assets/images/live.gif', color: primary, height: 12, ) : null, title: Text(title, style: TextStyle( fontSize: 14, color: isCurrentIndex ? primary : onSurface, ))) : InkWell( onTap: () { SmartDialog.showToast('切换至「$title」'); changeFucCall.call(episode, index); }, child: Padding( padding: const EdgeInsets.only(left: 14, right: 14, top: 8, bottom: 8), child: Row( children: [ NetworkImgLayer( width: 130, height: 75, src: episode?.cover ?? ''), const SizedBox(width: 10), Expanded( child: Text( title, maxLines: 2, style: TextStyle( fontSize: 14, color: isCurrentIndex ? primary : onSurface, ), ), ), ], ), ), ); } Widget buildTitle() { return AppBar( toolbarHeight: 45, automaticallyImplyLeading: false, centerTitle: false, title: Text( '合集(${episodes.length})', style: Theme.of(context).textTheme.titleMedium, ), actions: !isFullScreen ? [ IconButton( icon: const Icon(Icons.close, size: 20), onPressed: () => Navigator.pop(context), ), const SizedBox(width: 14), ] : null, ); } Widget buildShowContent(BuildContext context) { final ItemScrollController itemScrollController = ItemScrollController(); int currentIndex = episodes.indexWhere((dynamic e) => e.cid == currentCid); return StatefulBuilder( builder: (BuildContext context, StateSetter setState) { WidgetsBinding.instance.addPostFrameCallback((_) { itemScrollController.jumpTo(index: currentIndex); }); return Container( height: sheetHeight, color: Theme.of(context).colorScheme.surface, child: Column( children: [ buildTitle(), Expanded( child: Material( child: PageStorage( bucket: PageStorageBucket(), child: ScrollablePositionedList.builder( itemScrollController: itemScrollController, itemCount: episodes.length + 1, itemBuilder: (BuildContext context, int index) { bool isLastItem = index == episodes.length; bool isCurrentIndex = currentIndex == index; return isLastItem ? SizedBox( height: MediaQuery.of(context).padding.bottom + 20, ) : buildEpisodeListItem( episodes[index], index, isCurrentIndex, ); }, ), ), ), ), ], ), ); }); } /// The [BuildContext] of the widget that calls the bottom sheet. PersistentBottomSheetController show(BuildContext context) { final PersistentBottomSheetController btmSheetCtr = showBottomSheet( context: context, builder: (BuildContext context) { return buildShowContent(context); }, ); return btmSheetCtr; } } ================================================ FILE: lib/common/skeleton/dynamic_card.dart ================================================ import 'package:flutter/material.dart'; import 'skeleton.dart'; class DynamicCardSkeleton extends StatelessWidget { const DynamicCardSkeleton({super.key}); @override Widget build(BuildContext context) { return Skeleton( child: Container( padding: const EdgeInsets.only(left: 12, right: 12, top: 12), decoration: BoxDecoration( border: Border( bottom: BorderSide( width: 8, color: Theme.of(context).dividerColor.withOpacity(0.05), ), ), ), child: Column( children: [ Row( children: [ Container( width: 40, height: 40, decoration: BoxDecoration( color: Theme.of(context).colorScheme.onInverseSurface, borderRadius: BorderRadius.circular(20), ), ), const SizedBox(width: 10), Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( color: Theme.of(context).colorScheme.onInverseSurface, width: 100, height: 13, margin: const EdgeInsets.only(bottom: 5), ), Container( color: Theme.of(context).colorScheme.onInverseSurface, width: 50, height: 11, ), ], ) ], ), Container( width: double.infinity, margin: const EdgeInsets.only(top: 10), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( color: Theme.of(context).colorScheme.onInverseSurface, width: double.infinity, height: 13, margin: const EdgeInsets.only(bottom: 7), ), Container( color: Theme.of(context).colorScheme.onInverseSurface, width: double.infinity, height: 13, margin: const EdgeInsets.only(bottom: 7), ), Container( color: Theme.of(context).colorScheme.onInverseSurface, width: 300, height: 13, margin: const EdgeInsets.only(bottom: 7), ), Container( color: Theme.of(context).colorScheme.onInverseSurface, width: 250, height: 13, margin: const EdgeInsets.only(bottom: 7), ), Container( color: Theme.of(context).colorScheme.onInverseSurface, width: 100, height: 13, margin: const EdgeInsets.only(bottom: 7), ), ], ), ), Row( mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ for (var i = 0; i < 3; i++) TextButton.icon( onPressed: () {}, icon: const Icon( Icons.radio_button_unchecked_outlined, size: 20, ), style: TextButton.styleFrom( padding: const EdgeInsets.fromLTRB(15, 0, 15, 0), foregroundColor: Theme.of(context) .colorScheme .outline .withOpacity(0.2), ), label: Text( i == 0 ? '转发' : i == 1 ? '评论' : '点赞', ), ) ], ) ], ), ), ); } } ================================================ FILE: lib/common/skeleton/media_bangumi.dart ================================================ import 'package:flutter/material.dart'; import 'package:pilipala/common/constants.dart'; import 'skeleton.dart'; class MediaBangumiSkeleton extends StatefulWidget { const MediaBangumiSkeleton({super.key}); @override State createState() => _MediaBangumiSkeletonState(); } class _MediaBangumiSkeletonState extends State { @override Widget build(BuildContext context) { Color bgColor = Theme.of(context).colorScheme.onInverseSurface; return Skeleton( child: Padding( padding: const EdgeInsets.fromLTRB( StyleString.safeSpace, 7, StyleString.safeSpace, 7), child: Row( children: [ Container( width: 111, height: 148, decoration: BoxDecoration( borderRadius: const BorderRadius.all(Radius.circular(6)), color: bgColor), ), const SizedBox(width: 10), Expanded( child: SizedBox( height: 148, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( color: Theme.of(context).colorScheme.onInverseSurface, width: 200, height: 20, margin: const EdgeInsets.only(bottom: 15), ), Container( color: Theme.of(context).colorScheme.onInverseSurface, width: 150, height: 13, margin: const EdgeInsets.only(bottom: 5), ), Container( color: Theme.of(context).colorScheme.onInverseSurface, width: 150, height: 13, margin: const EdgeInsets.only(bottom: 5), ), Container( color: Theme.of(context).colorScheme.onInverseSurface, width: 150, height: 13, ), const Spacer(), Container( width: 90, height: 35, decoration: BoxDecoration( borderRadius: const BorderRadius.all(Radius.circular(20)), color: Theme.of(context).colorScheme.onInverseSurface, ), ), ], ), ), ), ], ), ), ); } } ================================================ FILE: lib/common/skeleton/skeleton.dart ================================================ import 'package:flutter/material.dart'; class Skeleton extends StatelessWidget { final Widget child; const Skeleton({ required this.child, super.key, }); @override Widget build(BuildContext context) { var shimmerGradient = LinearGradient( colors: [ Colors.transparent, Theme.of(context).colorScheme.surface.withAlpha(10), Theme.of(context).colorScheme.surface.withAlpha(10), Colors.transparent, ], stops: const [ 0.1, 0.3, 0.5, 0.7, ], begin: const Alignment(-1.0, -0.3), end: const Alignment(1.0, 0.9), tileMode: TileMode.clamp, ); return Shimmer( linearGradient: shimmerGradient, child: ShimmerLoading( isLoading: true, child: child, ), ); } } class Shimmer extends StatefulWidget { static ShimmerState? of(BuildContext context) { return context.findAncestorStateOfType(); } const Shimmer({ super.key, required this.linearGradient, this.child, }); final LinearGradient linearGradient; final Widget? child; @override ShimmerState createState() => ShimmerState(); } class ShimmerState extends State with SingleTickerProviderStateMixin { late AnimationController _shimmerController; @override void initState() { super.initState(); _shimmerController = AnimationController.unbounded(vsync: this) ..repeat(min: -0.5, max: 1.5, period: const Duration(milliseconds: 1000)); } @override void dispose() { _shimmerController.dispose(); super.dispose(); } LinearGradient get gradient => LinearGradient( colors: widget.linearGradient.colors, stops: widget.linearGradient.stops, begin: widget.linearGradient.begin, end: widget.linearGradient.end, transform: _SlidingGradientTransform( slidePercent: _shimmerController.value, ), ); bool get isSized => (context.findRenderObject() as RenderBox?)?.hasSize ?? false; Size get size => (context.findRenderObject() as RenderBox).size; Offset getDescendantOffset({ required RenderBox descendant, Offset offset = Offset.zero, }) { final shimmerBox = context.findRenderObject() as RenderBox; return descendant.localToGlobal(offset, ancestor: shimmerBox); } Listenable get shimmerChanges => _shimmerController; @override Widget build(BuildContext context) { return widget.child ?? const SizedBox(); } } class _SlidingGradientTransform extends GradientTransform { const _SlidingGradientTransform({ required this.slidePercent, }); final double slidePercent; @override Matrix4? transform(Rect bounds, {TextDirection? textDirection}) { return Matrix4.translationValues(bounds.width * slidePercent, 0.0, 0.0); } } class ShimmerLoading extends StatefulWidget { const ShimmerLoading({ super.key, required this.isLoading, required this.child, }); final bool isLoading; final Widget child; @override State createState() => _ShimmerLoadingState(); } class _ShimmerLoadingState extends State { Listenable? _shimmerChanges; @override void didChangeDependencies() { super.didChangeDependencies(); if (_shimmerChanges != null) { _shimmerChanges!.removeListener(_onShimmerChange); } _shimmerChanges = Shimmer.of(context)?.shimmerChanges; if (_shimmerChanges != null) { _shimmerChanges!.addListener(_onShimmerChange); } } @override void dispose() { _shimmerChanges?.removeListener(_onShimmerChange); super.dispose(); } void _onShimmerChange() { if (widget.isLoading) { setState(() {}); } } @override Widget build(BuildContext context) { if (!widget.isLoading) { return widget.child; } final shimmer = Shimmer.of(context)!; if (!shimmer.isSized) { return const SizedBox(); } final shimmerSize = shimmer.size; final gradient = shimmer.gradient; final offsetWithinShimmer = shimmer.getDescendantOffset( descendant: context.findRenderObject() as RenderBox, ); return ShaderMask( blendMode: BlendMode.srcATop, shaderCallback: (bounds) { return gradient.createShader( Rect.fromLTWH( -offsetWithinShimmer.dx, -offsetWithinShimmer.dy, shimmerSize.width, shimmerSize.height, ), ); }, child: widget.child, ); } } ================================================ FILE: lib/common/skeleton/video_card_h.dart ================================================ import 'package:pilipala/common/constants.dart'; import 'package:flutter/material.dart'; import 'skeleton.dart'; class VideoCardHSkeleton extends StatelessWidget { const VideoCardHSkeleton({super.key}); @override Widget build(BuildContext context) { return Skeleton( child: Padding( padding: const EdgeInsets.fromLTRB( StyleString.safeSpace, 7, StyleString.safeSpace, 7), child: LayoutBuilder( builder: (context, boxConstraints) { double width = (boxConstraints.maxWidth - StyleString.cardSpace * 6) / 2; return SizedBox( height: width / StyleString.aspectRatio, child: Row( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ AspectRatio( aspectRatio: StyleString.aspectRatio, child: LayoutBuilder( builder: (context, boxConstraints) { return Container( decoration: BoxDecoration( color: Theme.of(context).colorScheme.onInverseSurface, borderRadius: BorderRadius.circular(StyleString.imgRadius.x), ), ); }, ), ), // VideoContent(videoItem: videoItem) Expanded( child: Padding( padding: const EdgeInsets.fromLTRB(10, 4, 6, 4), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( color: Theme.of(context).colorScheme.onInverseSurface, width: 200, height: 11, margin: const EdgeInsets.only(bottom: 5), ), Container( color: Theme.of(context).colorScheme.onInverseSurface, width: 150, height: 13, ), const Spacer(), Container( color: Theme.of(context).colorScheme.onInverseSurface, width: 100, height: 13, margin: const EdgeInsets.only(bottom: 5), ), Row( children: [ Container( color: Theme.of(context) .colorScheme .onInverseSurface, width: 40, height: 13, margin: const EdgeInsets.only(right: 8), ), Container( color: Theme.of(context) .colorScheme .onInverseSurface, width: 40, height: 13, ), ], ) ], ), )), ], ), ); }, ), ), ); } } ================================================ FILE: lib/common/skeleton/video_card_v.dart ================================================ import 'package:pilipala/common/constants.dart'; import 'package:flutter/material.dart'; import 'skeleton.dart'; class VideoCardVSkeleton extends StatelessWidget { const VideoCardVSkeleton({Key? key}) : super(key: key); @override Widget build(BuildContext context) { return Skeleton( child: Column( children: [ AspectRatio( aspectRatio: StyleString.aspectRatio, child: LayoutBuilder( builder: (context, boxConstraints) { return Container( decoration: BoxDecoration( color: Theme.of(context).colorScheme.onInverseSurface, borderRadius: BorderRadius.circular(StyleString.imgRadius.x)), ); }, ), ), Padding( // 多列 padding: const EdgeInsets.fromLTRB(4, 5, 6, 6), // 单列 // padding: const EdgeInsets.fromLTRB(14, 10, 4, 8), child: Column( crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ // const SizedBox(height: 6), Container( width: 200, height: 13, margin: const EdgeInsets.only(bottom: 5), color: Theme.of(context).colorScheme.onInverseSurface, ), Container( width: 150, height: 13, margin: const EdgeInsets.only(bottom: 12), color: Theme.of(context).colorScheme.onInverseSurface, ), ], ), ), ], ), ); } } ================================================ FILE: lib/common/skeleton/video_reply.dart ================================================ import 'package:flutter/material.dart'; import 'skeleton.dart'; class VideoReplySkeleton extends StatelessWidget { const VideoReplySkeleton({Key? key}) : super(key: key); @override Widget build(BuildContext context) { Color bgColor = Theme.of(context).colorScheme.onInverseSurface; return Skeleton( child: Column( children: [ Padding( padding: const EdgeInsets.fromLTRB(12, 8, 8, 2), child: Row( children: [ ClipOval( child: Container( width: 34, height: 34, color: bgColor, ), ), const SizedBox(width: 12), Container( width: 80, height: 13, color: bgColor, ) ], ), ), Container( width: double.infinity, margin: const EdgeInsets.only(top: 4, left: 57, right: 6, bottom: 6), child: Column( crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start, children: [ Container( width: 300, height: 14, margin: const EdgeInsets.only(bottom: 4), color: bgColor, ), Container( width: 180, height: 14, margin: const EdgeInsets.only(bottom: 10), color: bgColor, ), Row( children: [ Container( width: 40, height: 14, margin: const EdgeInsets.only(bottom: 4), color: bgColor, ), const Spacer(), Container( width: 30, height: 14, margin: const EdgeInsets.only(bottom: 4), color: bgColor, ), const SizedBox(width: 8), Container( width: 30, height: 14, margin: const EdgeInsets.only(bottom: 4), color: bgColor, ), const SizedBox(width: 8) ], ) ], ), ), ], ), ); } } ================================================ FILE: lib/common/widgets/animated_dialog.dart ================================================ import 'package:flutter/material.dart'; class AnimatedDialog extends StatefulWidget { const AnimatedDialog({Key? key, required this.child, this.closeFn}) : super(key: key); final Widget child; final Function? closeFn; @override State createState() => AnimatedDialogState(); } class AnimatedDialogState extends State with SingleTickerProviderStateMixin { late AnimationController? controller; late Animation? opacityAnimation; late Animation? scaleAnimation; @override void initState() { super.initState(); controller = AnimationController( vsync: this, duration: const Duration(milliseconds: 800)); opacityAnimation = Tween(begin: 0.0, end: 0.6).animate( CurvedAnimation(parent: controller!, curve: Curves.easeOutExpo)); scaleAnimation = CurvedAnimation(parent: controller!, curve: Curves.easeOutExpo); controller!.addListener(() => setState(() {})); controller!.forward(); } @override void dispose() { controller!.dispose(); super.dispose(); } @override Widget build(BuildContext context) { return Material( color: Colors.black.withOpacity(opacityAnimation!.value), child: InkWell( splashColor: Colors.transparent, onTap: () => widget.closeFn!(), child: Center( child: FadeTransition( opacity: scaleAnimation!, child: ScaleTransition( scale: scaleAnimation!, child: widget.child, ), ), ), ), ); } } ================================================ FILE: lib/common/widgets/app_expansion_panel_list.dart ================================================ import 'package:flutter/material.dart'; const double _kPanelHeaderCollapsedHeight = kMinInteractiveDimension; class _SaltedKey extends LocalKey { const _SaltedKey(this.salt, this.value); final S salt; final V value; @override bool operator ==(Object other) { if (other.runtimeType != runtimeType) return false; return other is _SaltedKey && other.salt == salt && other.value == value; } @override int get hashCode => Object.hash(runtimeType, salt, value); @override String toString() { final String saltString = S == String ? "<'$salt'>" : '<$salt>'; final String valueString = V == String ? "<'$value'>" : '<$value>'; return '[$saltString $valueString]'; } } class AppExpansionPanelList extends StatefulWidget { /// Creates an expansion panel list widget. The [expansionCallback] is /// triggered when an expansion panel expand/collapse button is pushed. /// /// The [children] and [animationDuration] arguments must not be null. const AppExpansionPanelList({ super.key, required this.children, this.expansionCallback, this.animationDuration = kThemeAnimationDuration, this.expandedHeaderPadding = EdgeInsets.zero, this.dividerColor, this.elevation = 2, }) : _allowOnlyOnePanelOpen = false, initialOpenPanelValue = null; /// The children of the expansion panel list. They are laid out in a similar /// fashion to [ListBody]. final List children; /// The callback that gets called whenever one of the expand/collapse buttons /// is pressed. The arguments passed to the callback are the index of the /// pressed panel and whether the panel is currently expanded or not. /// /// If AppExpansionPanelList.radio is used, the callback may be called a /// second time if a different panel was previously open. The arguments /// passed to the second callback are the index of the panel that will close /// and false, marking that it will be closed. /// /// For AppExpansionPanelList, the callback needs to setState when it's notified /// about the closing/opening panel. On the other hand, the callback for /// AppExpansionPanelList.radio is simply meant to inform the parent widget of /// changes, as the radio panels' open/close states are managed internally. /// /// This callback is useful in order to keep track of the expanded/collapsed /// panels in a parent widget that may need to react to these changes. final ExpansionPanelCallback? expansionCallback; /// The duration of the expansion animation. final Duration animationDuration; // Whether multiple panels can be open simultaneously final bool _allowOnlyOnePanelOpen; /// The value of the panel that initially begins open. (This value is /// only used when initializing with the [AppExpansionPanelList.radio] /// constructor.) final Object? initialOpenPanelValue; /// The padding that surrounds the panel header when expanded. /// /// By default, 16px of space is added to the header vertically (above and below) /// during expansion. final EdgeInsets expandedHeaderPadding; /// Defines color for the divider when [AppExpansionPanel.isExpanded] is false. /// /// If `dividerColor` is null, then [DividerThemeData.color] is used. If that /// is null, then [ThemeData.dividerColor] is used. final Color? dividerColor; /// Defines elevation for the [AppExpansionPanel] while it's expanded. /// /// By default, the value of elevation is 2. final double elevation; @override State createState() => _AppExpansionPanelListState(); } class _AppExpansionPanelListState extends State { ExpansionPanelRadio? _currentOpenPanel; @override void initState() { super.initState(); if (widget._allowOnlyOnePanelOpen) { assert(_allIdentifiersUnique(), 'All ExpansionPanelRadio identifier values must be unique.'); if (widget.initialOpenPanelValue != null) { _currentOpenPanel = searchPanelByValue( widget.children.cast(), widget.initialOpenPanelValue); } } } @override void didUpdateWidget(AppExpansionPanelList oldWidget) { super.didUpdateWidget(oldWidget); if (widget._allowOnlyOnePanelOpen) { assert(_allIdentifiersUnique(), 'All ExpansionPanelRadio identifier values must be unique.'); // If the previous widget was non-radio AppExpansionPanelList, initialize the // open panel to widget.initialOpenPanelValue if (!oldWidget._allowOnlyOnePanelOpen) { _currentOpenPanel = searchPanelByValue( widget.children.cast(), widget.initialOpenPanelValue); } } else { _currentOpenPanel = null; } } bool _allIdentifiersUnique() { final Map identifierMap = {}; for (final ExpansionPanelRadio child in widget.children.cast()) { identifierMap[child.value] = true; } return identifierMap.length == widget.children.length; } bool _isChildExpanded(int index) { if (widget._allowOnlyOnePanelOpen) { final ExpansionPanelRadio radioWidget = widget.children[index] as ExpansionPanelRadio; return _currentOpenPanel?.value == radioWidget.value; } return widget.children[index].isExpanded; } void _handlePressed(bool isExpanded, int index) { widget.expansionCallback?.call(index, isExpanded); if (widget._allowOnlyOnePanelOpen) { final ExpansionPanelRadio pressedChild = widget.children[index] as ExpansionPanelRadio; // If another ExpansionPanelRadio was already open, apply its // expansionCallback (if any) to false, because it's closing. for (int childIndex = 0; childIndex < widget.children.length; childIndex += 1) { final ExpansionPanelRadio child = widget.children[childIndex] as ExpansionPanelRadio; if (widget.expansionCallback != null && childIndex != index && child.value == _currentOpenPanel?.value) { widget.expansionCallback!(childIndex, false); } } setState(() { _currentOpenPanel = isExpanded ? null : pressedChild; }); } } ExpansionPanelRadio? searchPanelByValue( List panels, Object? value) { for (final ExpansionPanelRadio panel in panels) { if (panel.value == value) return panel; } return null; } @override Widget build(BuildContext context) { assert( kElevationToShadow.containsKey(widget.elevation), 'Invalid value for elevation. See the kElevationToShadow constant for' ' possible elevation values.', ); final List items = []; for (int index = 0; index < widget.children.length; index += 1) { //todo: Uncomment to add gap between selected panels /*if (_isChildExpanded(index) && index != 0 && !_isChildExpanded(index - 1)) items.add(MaterialGap(key: _SaltedKey(context, index * 2 - 1)));*/ final AppExpansionPanel child = widget.children[index]; final Widget headerWidget = child.headerBuilder( context, _isChildExpanded(index), ); Widget? expandIconContainer = ExpandIcon( isExpanded: _isChildExpanded(index), onPressed: !child.canTapOnHeader ? (bool isExpanded) => _handlePressed(isExpanded, index) : null, ); if (!child.canTapOnHeader) { final MaterialLocalizations localizations = MaterialLocalizations.of(context); expandIconContainer = Semantics( label: _isChildExpanded(index) ? localizations.expandedIconTapHint : localizations.collapsedIconTapHint, container: true, child: expandIconContainer, ); } final iconContainer = child.iconBuilder; if (iconContainer != null) { expandIconContainer = iconContainer( expandIconContainer, _isChildExpanded(index), ); } Widget header = Row( children: [ Expanded( child: AnimatedContainer( duration: widget.animationDuration, curve: Curves.fastOutSlowIn, margin: _isChildExpanded(index) ? widget.expandedHeaderPadding : EdgeInsets.zero, child: ConstrainedBox( constraints: const BoxConstraints( minHeight: _kPanelHeaderCollapsedHeight), child: headerWidget, ), ), ), if (expandIconContainer != null) expandIconContainer, ], ); if (child.canTapOnHeader) { header = MergeSemantics( child: InkWell( onTap: () => _handlePressed(_isChildExpanded(index), index), child: header, ), ); } items.add( MaterialSlice( key: _SaltedKey(context, index * 2), color: child.backgroundColor, child: Column( children: [ header, AnimatedCrossFade( firstChild: Container(height: 0.0), secondChild: child.body, firstCurve: const Interval(0.0, 0.6, curve: Curves.fastOutSlowIn), secondCurve: const Interval(0.4, 1.0, curve: Curves.fastOutSlowIn), sizeCurve: Curves.fastOutSlowIn, crossFadeState: _isChildExpanded(index) ? CrossFadeState.showSecond : CrossFadeState.showFirst, duration: widget.animationDuration, ), ], ), ), ); if (_isChildExpanded(index) && index != widget.children.length - 1) { items.add(MaterialGap( key: _SaltedKey(context, index * 2 + 1))); } } return MergeableMaterial( hasDividers: true, dividerColor: widget.dividerColor, elevation: widget.elevation, children: items, ); } } typedef ExpansionPanelIconBuilder = Widget? Function( Widget child, bool isExpanded, ); class AppExpansionPanel { /// Creates an expansion panel to be used as a child for [ExpansionPanelList]. /// See [ExpansionPanelList] for an example on how to use this widget. /// /// The [headerBuilder], [body], and [isExpanded] arguments must not be null. AppExpansionPanel({ required this.headerBuilder, required this.body, this.iconBuilder, this.isExpanded = false, this.canTapOnHeader = false, this.backgroundColor, }); /// The widget builder that builds the expansion panels' header. final ExpansionPanelHeaderBuilder headerBuilder; /// The widget builder that builds the expansion panels' icon. /// /// If not pass any function, then default icon will be displayed. /// /// If builder function return null, then icon will not displayed. final ExpansionPanelIconBuilder? iconBuilder; /// The body of the expansion panel that's displayed below the header. /// /// This widget is visible only when the panel is expanded. final Widget body; /// Whether the panel is expanded. /// /// Defaults to false. final bool isExpanded; /// Whether tapping on the panel's header will expand/collapse it. /// /// Defaults to false. final bool canTapOnHeader; /// Defines the background color of the panel. /// /// Defaults to [ThemeData.cardColor]. final Color? backgroundColor; } ================================================ FILE: lib/common/widgets/appbar.dart ================================================ import 'package:flutter/material.dart'; class AppBarWidget extends StatelessWidget implements PreferredSizeWidget { const AppBarWidget({ required this.child, required this.controller, required this.visible, Key? key, }) : super(key: key); final PreferredSizeWidget child; final AnimationController controller; final bool visible; @override Size get preferredSize => child.preferredSize; @override Widget build(BuildContext context) { visible ? controller.reverse() : controller.forward(); return SlideTransition( position: Tween( begin: Offset.zero, end: const Offset(0, -1), ).animate(CurvedAnimation( parent: controller, curve: Curves.easeInOutBack, )), child: child, ); } } ================================================ FILE: lib/common/widgets/badge.dart ================================================ import 'package:flutter/material.dart'; class PBadge extends StatelessWidget { final String? text; final double? top; final double? right; final double? bottom; final double? left; final String? type; final String? size; final String? stack; final double? fs; const PBadge({ super.key, this.text, this.top, this.right, this.bottom, this.left, this.type = 'primary', this.size = 'medium', this.stack = 'position', this.fs = 11, }); @override Widget build(BuildContext context) { ColorScheme t = Theme.of(context).colorScheme; // 背景色 Color bgColor = t.primary; // 前景色 Color color = t.onPrimary; // 边框色 Color borderColor = Colors.transparent; if (type == 'gray') { bgColor = Colors.black54.withOpacity(0.4); color = Colors.white; } if (type == 'color') { bgColor = t.primaryContainer.withOpacity(0.6); color = t.primary; } if (type == 'line') { bgColor = Colors.transparent; color = t.primary; borderColor = t.primary; } EdgeInsets paddingStyle = const EdgeInsets.symmetric(vertical: 1, horizontal: 6); double fontSize = 11; BorderRadius br = BorderRadius.circular(4); if (size == 'small') { paddingStyle = const EdgeInsets.symmetric(vertical: 0, horizontal: 3); fontSize = 11; br = BorderRadius.circular(3); } Widget content = Container( padding: paddingStyle, decoration: BoxDecoration( borderRadius: br, color: bgColor, border: Border.all(color: borderColor), ), child: Text( text ?? '', style: TextStyle(fontSize: fs ?? fontSize, color: color), ), ); if (stack == 'position') { return Positioned( top: top, left: left, right: right, bottom: bottom, child: content, ); } else { return Padding( padding: const EdgeInsets.only(right: 5), child: content, ); } } } ================================================ FILE: lib/common/widgets/content_container.dart ================================================ import 'package:flutter/material.dart'; class ContentContainer extends StatelessWidget { final Widget? contentWidget; final Widget? bottomWidget; final bool isScrollable; final Clip? childClipBehavior; const ContentContainer( {Key? key, this.contentWidget, this.bottomWidget, this.isScrollable = true, this.childClipBehavior}) : super(key: key); @override Widget build(BuildContext context) { return LayoutBuilder( builder: (BuildContext context, BoxConstraints constraints) { return SingleChildScrollView( clipBehavior: childClipBehavior ?? Clip.hardEdge, physics: isScrollable ? null : const NeverScrollableScrollPhysics(), child: ConstrainedBox( constraints: constraints.copyWith( minHeight: constraints.maxHeight, maxHeight: double.infinity, ), child: IntrinsicHeight( child: Column( children: [ if (contentWidget != null) Expanded( child: contentWidget!, ) else const Spacer(), if (bottomWidget != null) bottomWidget!, ], ), ), ), ); }, ); } } ================================================ FILE: lib/common/widgets/custom_toast.dart ================================================ import 'package:flutter/material.dart'; import 'package:hive/hive.dart'; import 'package:pilipala/utils/storage.dart'; Box setting = GStrorage.setting; class CustomToast extends StatelessWidget { const CustomToast({super.key, required this.msg}); final String msg; @override Widget build(BuildContext context) { final double toastOpacity = setting.get(SettingBoxKey.defaultToastOp, defaultValue: 1.0) as double; return Container( margin: EdgeInsets.only(bottom: MediaQuery.of(context).padding.bottom + 30), padding: const EdgeInsets.symmetric(horizontal: 17, vertical: 10), decoration: BoxDecoration( color: Theme.of(context) .colorScheme .primaryContainer .withOpacity(toastOpacity), borderRadius: BorderRadius.circular(20), ), child: Text( msg, style: TextStyle( fontSize: 13, color: Theme.of(context).colorScheme.primary, ), ), ); } } ================================================ FILE: lib/common/widgets/html_render.dart ================================================ import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; import 'package:flutter_html/flutter_html.dart'; import 'package:pilipala/plugin/pl_gallery/hero_dialog_route.dart'; import 'package:pilipala/plugin/pl_gallery/interactiveviewer_gallery.dart'; import 'package:pilipala/utils/highlight.dart'; // ignore: must_be_immutable class HtmlRender extends StatelessWidget { const HtmlRender({ this.htmlContent, this.imgCount, this.imgList, super.key, }); final String? htmlContent; final int? imgCount; final List? imgList; @override Widget build(BuildContext context) { return Html( data: htmlContent, onLinkTap: (String? url, Map buildContext, attributes) {}, extensions: [ TagExtension( tagsToExtend: {'pre'}, builder: (ExtensionContext extensionContext) { final Map attributes = extensionContext.attributes; final String lang = attributes['data-lang'] as String; final String code = attributes['codecontent'] as String; List selectedLanguages = [lang.split('@').first]; TextSpan? result = highlightExistingText(code, selectedLanguages); if (result == null) { return const Center(child: Text('代码块渲染失败')); } return SelectableText.rich(result); }, ), TagExtension( tagsToExtend: {'img'}, builder: (ExtensionContext extensionContext) { try { final Map attributes = extensionContext.attributes; final List key = attributes.keys.toList(); String imgUrl = key.contains('src') ? attributes['src'] as String : attributes['data-src'] as String; if (imgUrl.startsWith('//')) { imgUrl = 'https:$imgUrl'; } if (imgUrl.startsWith('http://')) { imgUrl = imgUrl.replaceAll('http://', 'https://'); } imgUrl = imgUrl.contains('@') ? imgUrl.split('@').first : imgUrl; final bool isEmote = imgUrl.contains('/emote/'); final bool isMall = imgUrl.contains('/mall/'); if (isMall) { return const SizedBox(); } return InkWell( onTap: () { Navigator.of(context).push( HeroDialogRoute( builder: (BuildContext context) => InteractiveviewerGallery( sources: imgList ?? [imgUrl], initIndex: imgList?.indexOf(imgUrl) ?? 0, itemBuilder: ( BuildContext context, int index, bool isFocus, bool enablePageView, ) { return GestureDetector( behavior: HitTestBehavior.opaque, onTap: () { if (enablePageView) { Navigator.of(context).pop(); } }, child: Center( child: Hero( tag: imgList?[index] ?? imgUrl, child: CachedNetworkImage( fadeInDuration: const Duration(milliseconds: 0), imageUrl: imgList?[index] ?? imgUrl, fit: BoxFit.contain, ), ), ), ); }, onPageChanged: (int pageIndex) {}, ), ), ); }, child: CachedNetworkImage(imageUrl: imgUrl), ); // return NetworkImgLayer( // width: isEmote ? 22 : Get.size.width - 24, // height: isEmote ? 22 : 200, // src: imgUrl, // ); } catch (err) { return const SizedBox(); } }, ), ], style: { 'html': Style( fontSize: FontSize.large, lineHeight: LineHeight.percent(140), ), 'body': Style(margin: Margins.zero, padding: HtmlPaddings.zero), 'a': Style( color: Theme.of(context).colorScheme.primary, textDecoration: TextDecoration.none, ), 'p': Style( margin: Margins.only(bottom: 10), ), 'span': Style( fontSize: FontSize.large, height: Height(1.65), ), 'div': Style(height: Height.auto()), 'li > p': Style( display: Display.inline, ), 'li': Style( padding: HtmlPaddings.only(bottom: 4), textAlign: TextAlign.justify, ), 'img': Style(margin: Margins.only(top: 4, bottom: 4)), }, ); } } ================================================ FILE: lib/common/widgets/http_error.dart ================================================ import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; class HttpError extends StatelessWidget { const HttpError({ required this.errMsg, required this.fn, this.btnText, this.isShowBtn = true, super.key, }); final String? errMsg; final Function()? fn; final String? btnText; final bool isShowBtn; @override Widget build(BuildContext context) { return SliverToBoxAdapter( child: SizedBox( height: 400, child: Column( crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center, children: [ SvgPicture.asset( "assets/images/error.svg", height: 200, ), const SizedBox(height: 30), Text( errMsg ?? '请求异常', textAlign: TextAlign.center, style: Theme.of(context).textTheme.titleSmall, ), const SizedBox(height: 20), if (isShowBtn) FilledButton.tonal( onPressed: () { fn!(); }, style: ButtonStyle( backgroundColor: MaterialStateProperty.resolveWith((states) { return Theme.of(context).colorScheme.primary.withAlpha(20); }), ), child: Text( btnText ?? '点击重试', style: TextStyle(color: Theme.of(context).colorScheme.primary), ), ), ], ), ), ); } } ================================================ FILE: lib/common/widgets/live_card.dart ================================================ import 'package:flutter/material.dart'; import '../../utils/utils.dart'; import '../constants.dart'; import 'network_img_layer.dart'; class LiveCard extends StatelessWidget { // ignore: prefer_typing_uninitialized_variables final dynamic liveItem; const LiveCard({ Key? key, required this.liveItem, }) : super(key: key); @override Widget build(BuildContext context) { final String heroTag = Utils.makeHeroTag(liveItem.roomid); return Card( elevation: 0, clipBehavior: Clip.hardEdge, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(0), side: BorderSide( color: Theme.of(context).dividerColor.withOpacity(0.08), ), ), margin: EdgeInsets.zero, child: InkWell( onTap: () {}, child: Column( children: [ AspectRatio( aspectRatio: StyleString.aspectRatio, child: LayoutBuilder(builder: (BuildContext context, BoxConstraints boxConstraints) { final double maxWidth = boxConstraints.maxWidth; final double maxHeight = boxConstraints.maxHeight; return Stack( children: [ Hero( tag: heroTag, child: NetworkImgLayer( src: liveItem.cover as String, type: 'emote', width: maxWidth, height: maxHeight, ), ), Positioned( left: 0, right: 0, bottom: 0, child: AnimatedOpacity( opacity: 1, duration: const Duration(milliseconds: 200), child: LiveStat( // view: liveItem.stat.view, // danmaku: liveItem.stat.danmaku, // duration: liveItem.duration, online: liveItem.online as int, ), ), ), ], ); }), ), LiveContent(liveItem: liveItem) ], ), ), ); } } class LiveContent extends StatelessWidget { // ignore: prefer_typing_uninitialized_variables final liveItem; const LiveContent({Key? key, required this.liveItem}) : super(key: key); @override Widget build(BuildContext context) { return Padding( // 多列 padding: const EdgeInsets.fromLTRB(8, 8, 6, 7), // 单列 // padding: const EdgeInsets.fromLTRB(14, 10, 4, 8), child: Column( crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text( liveItem.title as String, textAlign: TextAlign.start, style: const TextStyle(fontSize: 13, fontWeight: FontWeight.w500), maxLines: 2, overflow: TextOverflow.ellipsis, ), SizedBox( width: double.infinity, child: Text( liveItem.uname as String, maxLines: 1, style: TextStyle( fontSize: Theme.of(context).textTheme.labelMedium!.fontSize, color: Theme.of(context).colorScheme.outline, ), ), ), ], ), ); } } class LiveStat extends StatelessWidget { const LiveStat({super.key, required this.online}); final int? online; @override Widget build(BuildContext context) { return Container( height: 45, padding: const EdgeInsets.only(top: 22, left: 8, right: 8), decoration: const BoxDecoration( gradient: LinearGradient( begin: Alignment.topCenter, end: Alignment.bottomCenter, colors: [ Colors.transparent, Colors.black54, ], tileMode: TileMode.mirror, ), ), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ // Row( // children: [ // StatView( // theme: 'white', // view: view, // ), // const SizedBox(width: 8), // StatDanMu( // theme: 'white', // danmu: danmaku, // ), // ], // ), Text( online.toString(), style: const TextStyle(fontSize: 11, color: Colors.white), ) ], ), ); } } ================================================ FILE: lib/common/widgets/network_img_layer.dart ================================================ import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; import 'package:hive/hive.dart'; import 'package:pilipala/utils/extension.dart'; import 'package:pilipala/utils/global_data_cache.dart'; import '../../utils/storage.dart'; import '../constants.dart'; Box setting = GStrorage.setting; class NetworkImgLayer extends StatelessWidget { const NetworkImgLayer({ super.key, this.src, required this.width, required this.height, this.type, this.fadeOutDuration, this.fadeInDuration, // 图片质量 默认1% this.quality, this.origAspectRatio, }); final String? src; final double width; final double height; final String? type; final Duration? fadeOutDuration; final Duration? fadeInDuration; final int? quality; final double? origAspectRatio; @override Widget build(BuildContext context) { final int defaultImgQuality = GlobalDataCache().imgQuality; if (src == '' || src == null) { return placeholder(context); } final String imageUrl = '${src!.startsWith('//') ? 'https:${src!}' : src!}@${quality ?? defaultImgQuality}q.webp'; int? memCacheWidth, memCacheHeight; double aspectRatio = (width / height).toDouble(); void setMemCacheSizes() { if (aspectRatio > 1) { memCacheHeight = height.cacheSize(context); } else if (aspectRatio < 1) { memCacheWidth = width.cacheSize(context); } else { if (origAspectRatio != null && origAspectRatio! > 1) { memCacheWidth = width.cacheSize(context); } else if (origAspectRatio != null && origAspectRatio! < 1) { memCacheHeight = height.cacheSize(context); } else { memCacheWidth = width.cacheSize(context); memCacheHeight = height.cacheSize(context); } } } setMemCacheSizes(); if (memCacheWidth == null && memCacheHeight == null) { memCacheWidth = width.toInt(); } return src != '' && src != null ? ClipRRect( clipBehavior: Clip.antiAlias, borderRadius: BorderRadius.circular( type == 'avatar' ? 50 : type == 'emote' ? 0 : StyleString.imgRadius.x, ), child: CachedNetworkImage( imageUrl: imageUrl, width: width, height: height, memCacheWidth: memCacheWidth, memCacheHeight: memCacheHeight, fit: BoxFit.cover, fadeOutDuration: fadeOutDuration ?? const Duration(milliseconds: 120), fadeInDuration: fadeInDuration ?? const Duration(milliseconds: 120), filterQuality: FilterQuality.low, errorWidget: (BuildContext context, String url, Object error) => placeholder(context), placeholder: (BuildContext context, String url) => placeholder(context), ), ) : placeholder(context); } Widget placeholder(BuildContext context) { return Container( width: width, height: height, clipBehavior: Clip.antiAlias, decoration: BoxDecoration( color: Theme.of(context).colorScheme.onInverseSurface.withOpacity(0.4), borderRadius: BorderRadius.circular(type == 'avatar' ? 50 : type == 'emote' ? 0 : StyleString.imgRadius.x), ), child: type == 'bg' ? const SizedBox() : Center( child: Image.asset( type == 'avatar' ? 'assets/images/noface.jpeg' : 'assets/images/loading.png', width: width, height: height, cacheWidth: width.cacheSize(context), cacheHeight: height.cacheSize(context), ), ), ); } } ================================================ FILE: lib/common/widgets/no_data.dart ================================================ import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; class NoData extends StatelessWidget { const NoData({super.key}); @override Widget build(BuildContext context) { return SliverToBoxAdapter( child: SizedBox( height: 400, child: Column( crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center, children: [ SvgPicture.asset( "assets/images/error.svg", height: 200, ), const SizedBox(height: 20), Text( '没有数据', textAlign: TextAlign.center, style: Theme.of(context).textTheme.titleSmall, ), ], ), ), ); } } ================================================ FILE: lib/common/widgets/sliver_header.dart ================================================ import 'package:flutter/material.dart'; class SliverHeaderDelegate extends SliverPersistentHeaderDelegate { SliverHeaderDelegate({required this.height, required this.child}); final double height; final Widget child; @override Widget build( BuildContext context, double shrinkOffset, bool overlapsContent) { return child; } @override double get maxExtent => height; @override double get minExtent => height; @override bool shouldRebuild(covariant SliverPersistentHeaderDelegate oldDelegate) => true; } ================================================ FILE: lib/common/widgets/stat/danmu.dart ================================================ import 'package:flutter/material.dart'; import 'package:pilipala/utils/utils.dart'; class StatDanMu extends StatelessWidget { final String? theme; final dynamic danmu; final String? size; const StatDanMu({Key? key, this.theme = 'gray', this.danmu, this.size}) : super(key: key); @override Widget build(BuildContext context) { Map colorObject = { 'white': Colors.white, 'gray': Theme.of(context).colorScheme.outline, 'black': Theme.of(context).colorScheme.onSurface.withOpacity(0.8), }; Color color = colorObject[theme]!; return StatIconText( icon: Icons.subtitles_outlined, text: Utils.numFormat(danmu!), color: color, size: size, ); } } class StatIconText extends StatelessWidget { final IconData icon; final String text; final Color color; final String? size; const StatIconText({ Key? key, required this.icon, required this.text, required this.color, this.size, }) : super(key: key); @override Widget build(BuildContext context) { return Row( children: [ Icon( icon, size: 14, color: color, ), const SizedBox(width: 2), Text( text, style: TextStyle( fontSize: size == 'medium' ? 12 : 11, color: color, ), ), ], ); } } ================================================ FILE: lib/common/widgets/stat/view.dart ================================================ import 'package:flutter/material.dart'; import 'package:pilipala/utils/utils.dart'; class StatView extends StatelessWidget { final String? theme; final dynamic view; final String? size; const StatView({ Key? key, this.theme = 'gray', this.view, this.size, }) : super(key: key); @override Widget build(BuildContext context) { Map colorObject = { 'white': Colors.white, 'gray': Theme.of(context).colorScheme.outline, 'black': Theme.of(context).colorScheme.onSurface.withOpacity(0.8), }; Color color = colorObject[theme]!; return StatIconText( icon: Icons.play_circle_outlined, text: Utils.numFormat(view!), color: color, size: size, ); } } class StatIconText extends StatelessWidget { final IconData icon; final String text; final Color color; final String? size; const StatIconText({ Key? key, required this.icon, required this.text, required this.color, this.size, }) : super(key: key); @override Widget build(BuildContext context) { return Row( children: [ Icon( icon, size: 13, color: color, ), const SizedBox(width: 2), Text( text, style: TextStyle( fontSize: size == 'medium' ? 12 : 11, color: color, ), ), ], ); } } ================================================ FILE: lib/common/widgets/video_card_h.dart ================================================ import 'package:flutter/material.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:get/get.dart'; import 'package:pilipala/http/constants.dart'; import 'package:pilipala/utils/feed_back.dart'; import 'package:pilipala/utils/image_save.dart'; import 'package:pilipala/utils/route_push.dart'; import 'package:pilipala/utils/url_utils.dart'; import '../../http/search.dart'; import '../../http/user.dart'; import '../../http/video.dart'; import '../../utils/utils.dart'; import '../constants.dart'; import 'badge.dart'; import 'network_img_layer.dart'; import 'stat/danmu.dart'; import 'stat/view.dart'; // 视频卡片 - 水平布局 class VideoCardH extends StatelessWidget { const VideoCardH({ super.key, required this.videoItem, this.onPressedFn, this.source = 'normal', this.showOwner = true, this.showView = true, this.showDanmaku = true, this.showPubdate = false, this.showCharge = false, }); // ignore: prefer_typing_uninitialized_variables final videoItem; final Function()? onPressedFn; // normal 推荐, later 稍后再看, search 搜索 final String source; final bool showOwner; final bool showView; final bool showDanmaku; final bool showPubdate; final bool showCharge; @override Widget build(BuildContext context) { final int aid = videoItem.aid; final String bvid = videoItem.bvid; String type = 'video'; try { type = videoItem.type; } catch (_) {} final String heroTag = Utils.makeHeroTag(aid); return InkWell( onTap: () async { try { if (type == 'ketang') { SmartDialog.showToast('课堂视频暂不支持播放'); return; } if (showCharge && videoItem?.typeid == 33) { final String redirectUrl = await UrlUtils.parseRedirectUrl( '${HttpString.baseUrl}/video/$bvid/'); final String lastPathSegment = redirectUrl.split('/').last; if (lastPathSegment.contains('ss')) { RoutePush.bangumiPush( Utils.matchNum(lastPathSegment).first, null); } if (lastPathSegment.contains('ep')) { RoutePush.bangumiPush( null, Utils.matchNum(lastPathSegment).first); } return; } final int cid = videoItem.cid ?? await SearchHttp.ab2c(aid: aid, bvid: bvid); Get.toNamed('/video?bvid=$bvid&cid=$cid', arguments: {'videoItem': videoItem, 'heroTag': heroTag}); } catch (err) { SmartDialog.showToast(err.toString()); } }, onLongPress: () => imageSaveDialog( context, videoItem, SmartDialog.dismiss, ), child: Padding( padding: const EdgeInsets.fromLTRB( StyleString.safeSpace, 5, StyleString.safeSpace, 5), child: LayoutBuilder( builder: (BuildContext context, BoxConstraints boxConstraints) { final double width = (boxConstraints.maxWidth - StyleString.cardSpace * 6 / MediaQuery.textScalerOf(context).scale(1.0)) / 2; return Container( constraints: const BoxConstraints(minHeight: 88), height: width / StyleString.aspectRatio, child: Row( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ AspectRatio( aspectRatio: StyleString.aspectRatio, child: LayoutBuilder( builder: (BuildContext context, BoxConstraints boxConstraints) { final double maxWidth = boxConstraints.maxWidth; final double maxHeight = boxConstraints.maxHeight; return Stack( children: [ Hero( tag: heroTag, child: NetworkImgLayer( src: videoItem.pic as String, width: maxWidth, height: maxHeight, ), ), if (videoItem.duration != 0) PBadge( text: Utils.timeFormat(videoItem.duration!), right: 6.0, bottom: 6.0, type: 'gray', ), if (type != 'video') PBadge( text: type, left: 6.0, bottom: 6.0, type: 'primary', ), // if (videoItem.rcmdReason != null && // videoItem.rcmdReason.content != '') // pBadge(videoItem.rcmdReason.content, context, // 6.0, 6.0, null, null), if (showCharge && videoItem?.isChargingSrc) const PBadge( text: '充电专属', right: 6.0, top: 6.0, type: 'primary', ), ], ); }, ), ), VideoContent( videoItem: videoItem, source: source, showOwner: showOwner, showView: showView, showDanmaku: showDanmaku, showPubdate: showPubdate, onPressedFn: onPressedFn, ) ], ), ); }, ), ), ); } } class VideoContent extends StatelessWidget { // ignore: prefer_typing_uninitialized_variables final videoItem; final String source; final bool showOwner; final bool showView; final bool showDanmaku; final bool showPubdate; final Function()? onPressedFn; const VideoContent({ super.key, required this.videoItem, this.source = 'normal', this.showOwner = true, this.showView = true, this.showDanmaku = true, this.showPubdate = false, this.onPressedFn, }); @override Widget build(BuildContext context) { return Expanded( child: Padding( padding: const EdgeInsets.fromLTRB(10, 0, 6, 0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ if (source == 'normal' || source == 'later') ...[ Text( videoItem.title as String, textAlign: TextAlign.start, style: const TextStyle( fontWeight: FontWeight.w500, ), maxLines: 2, overflow: TextOverflow.ellipsis, ), ] else ...[ RichText( maxLines: 2, text: TextSpan( children: [ for (final i in videoItem.titleList) ...[ TextSpan( text: i['text'] as String, style: TextStyle( fontWeight: FontWeight.w500, letterSpacing: 0.3, color: i['type'] == 'em' ? Theme.of(context).colorScheme.primary : Theme.of(context).colorScheme.onSurface, ), ), ] ], ), ), ], const Spacer(), // if (videoItem.rcmdReason != null && // videoItem.rcmdReason.content != '') // Container( // padding: const EdgeInsets.symmetric(vertical: 2, horizontal: 5), // decoration: BoxDecoration( // borderRadius: BorderRadius.circular(4), // border: Border.all( // color: Theme.of(context).colorScheme.surfaceTint), // ), // child: Text( // videoItem.rcmdReason.content, // style: TextStyle( // fontSize: 9, // color: Theme.of(context).colorScheme.surfaceTint), // ), // ), // const SizedBox(height: 4), if (showPubdate) Text( Utils.dateFormat(videoItem.pubdate!), style: TextStyle( fontSize: 11, color: Theme.of(context).colorScheme.outline), ), if (showOwner) Row( children: [ Text( videoItem.owner.name as String, style: TextStyle( fontSize: Theme.of(context).textTheme.labelMedium!.fontSize, color: Theme.of(context).colorScheme.outline, ), ), ], ), Row( children: [ if (showView) ...[ StatView(view: videoItem.stat.view as int), const SizedBox(width: 8), ], if (showDanmaku) StatDanMu(danmu: videoItem.stat.danmaku as int), const Spacer(), if (source == 'normal') SizedBox( width: 24, height: 24, child: IconButton( padding: EdgeInsets.zero, onPressed: () { feedBack(); showModalBottomSheet( context: context, useRootNavigator: true, isScrollControlled: true, builder: (context) { return MorePanel(videoItem: videoItem); }, ); }, icon: Icon( Icons.more_vert_outlined, color: Theme.of(context).colorScheme.outline, size: 14, ), ), ), if (source == 'later') ...[ IconButton( style: ButtonStyle( padding: MaterialStateProperty.all(EdgeInsets.zero), ), onPressed: () => onPressedFn?.call(), icon: Icon( Icons.clear_outlined, color: Theme.of(context).colorScheme.outline, size: 18, ), ) ], ], ), ], ), ), ); } } class MorePanel extends StatelessWidget { final dynamic videoItem; const MorePanel({super.key, required this.videoItem}); Future menuActionHandler(String type) async { switch (type) { case 'block': blockUser(); break; case 'watchLater': var res = await UserHttp.toViewLater(bvid: videoItem.bvid as String); SmartDialog.showToast(res['msg']); Get.back(); break; default: } } void blockUser() async { SmartDialog.show( useSystem: true, animationType: SmartAnimationType.centerFade_otherSlide, builder: (BuildContext context) { return AlertDialog( title: const Text('提示'), content: Text('确定拉黑:${videoItem.owner.name}(${videoItem.owner.mid})?' '\n\n注:被拉黑的Up可以在隐私设置-黑名单管理中解除'), actions: [ TextButton( onPressed: () => SmartDialog.dismiss(), child: Text( '点错了', style: TextStyle(color: Theme.of(context).colorScheme.outline), ), ), TextButton( onPressed: () async { var res = await VideoHttp.relationMod( mid: videoItem.owner.mid, act: 5, reSrc: 11, ); SmartDialog.dismiss(); SmartDialog.showToast(res['msg'] ?? '成功'); }, child: const Text('确认'), ) ], ); }, ); } @override Widget build(BuildContext context) { return Container( padding: EdgeInsets.only(bottom: MediaQuery.of(context).padding.bottom), child: Column( mainAxisSize: MainAxisSize.min, children: [ InkWell( onTap: () => Get.back(), child: Container( height: 35, padding: const EdgeInsets.only(bottom: 2), child: Center( child: Container( width: 32, height: 3, decoration: BoxDecoration( color: Theme.of(context).colorScheme.outline, borderRadius: const BorderRadius.all(Radius.circular(3))), ), ), ), ), ListTile( onTap: () async => await menuActionHandler('block'), minLeadingWidth: 0, leading: const Icon(Icons.block, size: 19), title: Text( '拉黑up主 「${videoItem.owner.name}」', style: Theme.of(context).textTheme.titleSmall, ), ), ListTile( onTap: () async => await menuActionHandler('watchLater'), minLeadingWidth: 0, leading: const Icon(Icons.watch_later_outlined, size: 19), title: Text('添加至稍后再看', style: Theme.of(context).textTheme.titleSmall), ), ListTile( onTap: () => imageSaveDialog(context, videoItem, SmartDialog.dismiss), minLeadingWidth: 0, leading: const Icon(Icons.photo_outlined, size: 19), title: Text('查看视频封面', style: Theme.of(context).textTheme.titleSmall), ), const SizedBox(height: 20), ], ), ); } } ================================================ FILE: lib/common/widgets/video_card_v.dart ================================================ import 'package:flutter/material.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:get/get.dart'; import 'package:pilipala/utils/feed_back.dart'; import 'package:pilipala/utils/image_save.dart'; import 'package:pilipala/utils/route_push.dart'; import '../../models/model_rec_video_item.dart'; import 'stat/danmu.dart'; import 'stat/view.dart'; import '../../http/dynamics.dart'; import '../../http/user.dart'; import '../../http/video.dart'; import '../../utils/id_utils.dart'; import '../../utils/utils.dart'; import '../constants.dart'; import 'badge.dart'; import 'network_img_layer.dart'; // 视频卡片 - 垂直布局 class VideoCardV extends StatelessWidget { final dynamic videoItem; final int crossAxisCount; final Function? blockUserCb; const VideoCardV({ Key? key, required this.videoItem, required this.crossAxisCount, this.blockUserCb, }) : super(key: key); bool isStringNumeric(String str) { RegExp numericRegex = RegExp(r'^\d+$'); return numericRegex.hasMatch(str); } void onPushDetail(heroTag) async { String goto = videoItem.goto; switch (goto) { case 'bangumi': if (videoItem.bangumiBadge == '电影') { SmartDialog.showToast('暂不支持电影观看'); return; } int epId = videoItem.param; RoutePush.bangumiPush( null, epId, heroTag: heroTag, ); break; case 'av': String bvid = videoItem.bvid ?? IdUtils.av2bv(videoItem.aid); Get.toNamed('/video?bvid=$bvid&cid=${videoItem.cid}', arguments: { // 'videoItem': videoItem, 'pic': videoItem.pic, 'heroTag': heroTag, }); break; // 动态 case 'picture': try { String uri = videoItem.uri; if (videoItem.uri.startsWith('bilibili://article/')) { // https://www.bilibili.com/read/cv27063554 RegExp regex = RegExp(r'\d+'); Match match = regex.firstMatch(videoItem.uri)!; String matchedNumber = match.group(0)!; videoItem.param = int.parse(matchedNumber); } if (uri.startsWith('http')) { String path = Uri.parse(uri).path; if (isStringNumeric(path.split('/')[1])) { // 请求接口 var res = await DynamicsHttp.dynamicDetail(id: path.split('/')[1]); if (res['status']) { Get.toNamed('/dynamicDetail', arguments: { 'item': res['data'], 'floor': 1, 'action': 'detail' }); } return; } } Get.toNamed('/read', parameters: { 'title': videoItem.title, 'id': videoItem.param, 'articleType': 'read' }); } catch (err) { SmartDialog.showToast(err.toString()); } break; default: SmartDialog.showToast(videoItem.goto); Get.toNamed( '/webview', parameters: { 'url': videoItem.uri, 'type': 'url', 'pageTitle': videoItem.title, }, ); } } @override Widget build(BuildContext context) { String heroTag = Utils.makeHeroTag(videoItem.id); return InkWell( onTap: () async => onPushDetail(heroTag), onLongPress: () => imageSaveDialog( context, videoItem, SmartDialog.dismiss, ), borderRadius: BorderRadius.circular(16), child: Column( children: [ AspectRatio( aspectRatio: StyleString.aspectRatio, child: LayoutBuilder(builder: (context, boxConstraints) { double maxWidth = boxConstraints.maxWidth; double maxHeight = boxConstraints.maxHeight; return Stack( children: [ Hero( tag: heroTag, child: NetworkImgLayer( src: videoItem.pic, width: maxWidth, height: maxHeight, ), ), if (videoItem.duration > 0) if (crossAxisCount == 1) ...[ PBadge( bottom: 10, right: 10, text: Utils.timeFormat(videoItem.duration), ) ] else ...[ PBadge( bottom: 6, right: 7, size: 'small', type: 'gray', text: Utils.timeFormat(videoItem.duration), ) ], ], ); }), ), VideoContent( videoItem: videoItem, crossAxisCount: crossAxisCount, blockUserCb: blockUserCb, ) ], ), ); } } class VideoContent extends StatelessWidget { final dynamic videoItem; final int crossAxisCount; final Function? blockUserCb; const VideoContent({ Key? key, required this.videoItem, required this.crossAxisCount, this.blockUserCb, }) : super(key: key); Widget _buildBadge(String text, String type, [double fs = 12]) { return PBadge( text: text, stack: 'normal', size: 'small', type: type, fs: fs, ); } @override Widget build(BuildContext context) { return Padding( padding: crossAxisCount == 1 ? const EdgeInsets.fromLTRB(9, 9, 9, 4) : const EdgeInsets.fromLTRB(5, 8, 5, 4), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( videoItem.title, maxLines: 2, overflow: TextOverflow.ellipsis, ), if (crossAxisCount > 1) ...[ const SizedBox(height: 2), VideoStat(videoItem: videoItem, crossAxisCount: crossAxisCount), ], if (crossAxisCount == 1) const SizedBox(height: 4), Row( children: [ if (videoItem.goto == 'bangumi') _buildBadge(videoItem.bangumiBadge, 'line', 9), if (videoItem.rcmdReason != null) _buildBadge(videoItem.rcmdReason, 'color'), if (videoItem.goto == 'picture') _buildBadge('动态', 'line', 9), if (videoItem.isFollowed == 1) _buildBadge('已关注', 'color'), Expanded( flex: crossAxisCount == 1 ? 0 : 1, child: Text( videoItem.owner.name, maxLines: 1, style: TextStyle( fontSize: Theme.of(context).textTheme.labelMedium!.fontSize, color: Theme.of(context).colorScheme.outline, ), ), ), if (crossAxisCount == 1) ...[ const SizedBox(width: 10), VideoStat( videoItem: videoItem, crossAxisCount: crossAxisCount, ), const Spacer(), ], if (videoItem.goto == 'av') SizedBox( width: 24, height: 24, child: IconButton( padding: EdgeInsets.zero, onPressed: () { feedBack(); showModalBottomSheet( context: context, useRootNavigator: true, isScrollControlled: true, builder: (context) { return MorePanel( videoItem: videoItem, blockUserCb: blockUserCb, ); }, ); }, icon: Icon( Icons.more_vert_outlined, color: Theme.of(context).colorScheme.outline, size: 14, ), ), ) ], ), ], ), ); } } class VideoStat extends StatelessWidget { final dynamic videoItem; final int crossAxisCount; const VideoStat({ Key? key, required this.videoItem, required this.crossAxisCount, }) : super(key: key); @override Widget build(BuildContext context) { return Row( children: [ StatView(view: videoItem.stat.view), const SizedBox(width: 8), StatDanMu(danmu: videoItem.stat.danmu), if (videoItem is RecVideoItemModel) ...[ crossAxisCount > 1 ? const Spacer() : const SizedBox(width: 8), RichText( maxLines: 1, text: TextSpan( style: TextStyle( fontSize: Theme.of(context).textTheme.labelSmall!.fontSize, color: Theme.of(context).colorScheme.outline, ), text: Utils.formatTimestampToRelativeTime(videoItem.pubdate)), ), const SizedBox(width: 4), ] ], ); } } class MorePanel extends StatelessWidget { final dynamic videoItem; final Function? blockUserCb; const MorePanel({ super.key, required this.videoItem, this.blockUserCb, }); Future menuActionHandler(String type) async { switch (type) { case 'block': Get.back(); blockUser(); break; case 'watchLater': var res = await UserHttp.toViewLater(bvid: videoItem.bvid as String); SmartDialog.showToast(res['msg']); Get.back(); break; default: } } void blockUser() async { SmartDialog.show( useSystem: true, animationType: SmartAnimationType.centerFade_otherSlide, builder: (BuildContext context) { return AlertDialog( title: const Text('提示'), content: Text('确定拉黑:${videoItem.owner.name}(${videoItem.owner.mid})?' '\n\n注:被拉黑的Up可以在隐私设置-黑名单管理中解除'), actions: [ TextButton( onPressed: () => SmartDialog.dismiss(), child: Text( '点错了', style: TextStyle(color: Theme.of(context).colorScheme.outline), ), ), TextButton( onPressed: () async { var res = await VideoHttp.relationMod( mid: videoItem.owner.mid, act: 5, reSrc: 11, ); SmartDialog.dismiss(); if (res['status']) { blockUserCb?.call(videoItem.owner.mid); } SmartDialog.showToast(res['msg']); }, child: const Text('确认'), ) ], ); }, ); } @override Widget build(BuildContext context) { return Container( padding: EdgeInsets.only(bottom: MediaQuery.of(context).padding.bottom), child: Column( mainAxisSize: MainAxisSize.min, children: [ InkWell( onTap: () => Get.back(), child: Container( height: 35, padding: const EdgeInsets.only(bottom: 2), child: Center( child: Container( width: 32, height: 3, decoration: BoxDecoration( color: Theme.of(context).colorScheme.outline, borderRadius: const BorderRadius.all(Radius.circular(3))), ), ), ), ), ListTile( onTap: () async => await menuActionHandler('block'), minLeadingWidth: 0, leading: const Icon(Icons.block, size: 19), title: Text( '拉黑up主 「${videoItem.owner.name}」', style: Theme.of(context).textTheme.titleSmall, ), ), ListTile( onTap: () async => await menuActionHandler('watchLater'), minLeadingWidth: 0, leading: const Icon(Icons.watch_later_outlined, size: 19), title: Text('添加至稍后再看', style: Theme.of(context).textTheme.titleSmall), ), ListTile( onTap: () => imageSaveDialog(context, videoItem, SmartDialog.dismiss), minLeadingWidth: 0, leading: const Icon(Icons.photo_outlined, size: 19), title: Text('查看视频封面', style: Theme.of(context).textTheme.titleSmall), ), const SizedBox(height: 20), ], ), ); } } ================================================ FILE: lib/http/api.dart ================================================ import 'constants.dart'; class Api { // 推荐视频 static const String recommendListApp = '${HttpString.appBaseUrl}/x/v2/feed/index'; static const String recommendListWeb = '/x/web-interface/index/top/feed/rcmd'; // 热门视频 static const String hotList = '/x/web-interface/popular'; // 视频流 // https://github.com/SocialSisterYi/bilibili-API-collect/blob/master/docs/video/videostream_url.md static const String videoUrl = '/x/player/wbi/playurl'; // 视频详情 // 竖屏 https://api.bilibili.com/x/web-interface/view?aid=527403921 // https://api.bilibili.com/x/web-interface/view/detail 获取视频超详细信息(web端) static const String videoIntro = '/x/web-interface/view'; // 视频详情 超详细 // https://api.bilibili.com/x/web-interface/view/detail?aid=527403921 /// https://github.com/SocialSisterYi/bilibili-API-collect/blob/master/docs/video/action.md // 点赞 Post /// aid num 稿件avid 必要(可选) avid与bvid任选一个 /// bvid str 稿件bvid 必要(可选) avid与bvid任选一个 /// like num 操作方式 必要 1:点赞 2:取消赞 // csrf str CSRF Token(位于cookie) 必要 // https://api.bilibili.com/x/web-interface/archive/like static const String likeVideo = '/x/web-interface/archive/like'; //判断视频是否被点赞(双端)Get // access_key str APP登录Token APP方式必要 /// aid num 稿件avid 必要(可选) avid与bvid任选一个 /// bvid str 稿件bvid 必要(可选) avid与bvid任选一个 // https://api.bilibili.com/x/web-interface/archive/has/like static const String hasLikeVideo = '/x/web-interface/archive/has/like'; // 视频点踩 web端不支持 // 投币视频(web端)POST /// aid num 稿件avid 必要(可选) avid与bvid任选一个 /// bvid str 稿件bvid 必要(可选) avid与bvid任选一个 /// multiply num 投币数量 必要 上限为2 /// select_like num 是否附加点赞 非必要 0:不点赞 1:同时点赞 默认为0 // csrf str CSRF Token(位于cookie) 必要 // https://api.bilibili.com/x/web-interface/coin/add static const String coinVideo = '/x/web-interface/coin/add'; // 判断视频是否被投币(双端)GET // access_key str APP登录Token APP方式必要 /// aid num 稿件avid 必要(可选) avid与bvid任选一个 /// bvid str 稿件bvid 必要(可选) avid与bvid任选一个 /// https://api.bilibili.com/x/web-interface/archive/coins static const String hasCoinVideo = '/x/web-interface/archive/coins'; // 收藏视频(双端)POST // access_key str APP登录Token APP方式必要 /// rid num 稿件avid 必要 /// type num 必须为2 必要 /// add_media_ids nums 需要加入的收藏夹mlid 非必要 同时添加多个,用,(%2C)分隔 /// del_media_ids nums 需要取消的收藏夹mlid 非必要 同时取消多个,用,(%2C)分隔 // csrf str CSRF Token(位于cookie) Cookie方式必要 // https://api.bilibili.com/medialist/gateway/coll/resource/deal // https://api.bilibili.com/x/v3/fav/resource/deal static const String favVideo = '/x/v3/fav/resource/deal'; // 判断视频是否被收藏(双端)GET /// aid // https://api.bilibili.com/x/v2/fav/video/favoured static const String hasFavVideo = '/x/v2/fav/video/favoured'; // 分享视频 (Web端) POST // https://api.bilibili.com/x/web-interface/share/add // aid num 稿件avid 必要(可选) avid与bvid任选一个 // bvid str 稿件bvid 必要(可选) avid与bvid任选一个 // csrf str CSRF Token(位于cookie) 必要 // 一键三连 // https://api.bilibili.com/x/web-interface/archive/like/triple // aid num 稿件avid 必要(可选) avid与bvid任选一个 // bvid str 稿件bvid 必要(可选) avid与bvid任选一个 // csrf str CSRF Token(位于cookie) 必要 static const String oneThree = '/x/web-interface/archive/like/triple'; // 获取指定用户创建的所有收藏夹信息 // 该接口也能查询目标内容id存在于那些收藏夹中 // up_mid num 目标用户mid 必要 // type num 目标内容属性 非必要 默认为全部 0:全部 2:视频稿件 // rid num 目标 视频稿件avid static const String videoInFolder = '/x/v3/fav/folder/created/list-all'; // 视频详情页 相关视频 static const String relatedList = '/x/web-interface/archive/related'; // 查询用户与自己关系_仅查关注 static const String hasFollow = '/x/relation'; // 操作用户关系 static const String relationMod = '/x/relation/modify'; // 相互关系查询 // 失效 // static const String relationSearch = '/x/space/wbi/acc/relation'; // 评论列表 // https://api.bilibili.com/x/v2/reply/main?csrf=6e22efc1a47225ea25f901f922b5cfdd&mode=3&oid=254175381&pagination_str=%7B%22offset%22:%22%22%7D&plat=1&seek_rpid=0&type=11 static const String replyList = '/x/v2/reply'; // 楼中楼 static const String replyReplyList = '/x/v2/reply/reply'; // 评论点赞 static const String likeReply = '/x/v2/reply/action'; // 发表评论 // https://github.com/SocialSisterYi/bilibili-API-collect/blob/master/docs/comment/action.md static const String replyAdd = '/x/v2/reply/add'; // 用户(被)关注数、投稿数 // https://api.bilibili.com/x/relation/stat?vmid=697166795 static const String userStat = '/x/relation/stat'; // 获取用户信息 static const String userInfo = '/x/web-interface/nav'; // 获取当前用户状态 static const String userStatOwner = '/x/web-interface/nav/stat'; // 收藏夹 // https://api.bilibili.com/x/v3/fav/folder/created/list?pn=1&ps=10&up_mid=17340771 static const String userFavFolder = '/x/v3/fav/folder/created/list'; /// 收藏夹 详情 /// media_id 当前收藏夹id 搜索全部时为默认收藏夹id /// pn int 当前页 /// ps int pageSize /// keyword String 搜索词 /// order String 排序方式 view 最多播放 mtime 最近收藏 pubtime 最近投稿 /// tid int 分区id /// platform web /// type 0 当前收藏夹 1 全部收藏夹 // https://api.bilibili.com/x/v3/fav/resource/list?media_id=76614671&pn=1&ps=20&keyword=&order=mtime&type=0&tid=0 static const String userFavFolderDetail = '/x/v3/fav/resource/list'; // 正在直播的up & 关注的up // https://api.bilibili.com/x/polymer/web-dynamic/v1/portal static const String followUp = '/x/polymer/web-dynamic/v1/portal'; // 关注的up动态 // https://api.bilibili.com/x/polymer/web-dynamic/v1/feed/all // https://api.bilibili.com/x/polymer/web-dynamic/v1/feed/all?timezone_offset=-480&type=video&page=1&features=itemOpusStyle // https://api.bilibili.com/x/polymer/web-dynamic/v1/feed/all?host_mid=548196587&offset=&page=1&features=itemOpusStyle static const String followDynamic = '/x/polymer/web-dynamic/v1/feed/all'; // 动态点赞 static const String likeDynamic = '${HttpString.tUrl}/dynamic_like/v1/dynamic_like/thumb'; // 获取稍后再看 static const String seeYouLater = '/x/v2/history/toview'; // 获取历史记录 static const String historyList = '/x/web-interface/history/cursor'; // 暂停历史记录 static const String pauseHistory = '/x/v2/history/shadow/set'; // 查询历史记录暂停状态 static const String historyStatus = '/x/v2/history/shadow?jsonp=jsonp'; // 清空历史记录 static const String clearHistory = '/x/v2/history/clear'; // 删除某条历史记录 static const String delHistory = '/x/v2/history/delete'; // 搜索历史记录 static const String searchHistory = '/x/web-goblin/history/search'; // 热搜 static const String hotSearchList = 'https://s.search.bilibili.com/main/hotword'; // 默认搜索词 static const String searchDefault = '/x/web-interface/wbi/search/default'; // 搜索关键词 static const String searchSuggest = 'https://s.search.bilibili.com/main/suggest'; // 分类搜索 static const String searchByType = '/x/web-interface/wbi/search/type'; // 记录视频播放进度 // https://github.com/SocialSisterYi/bilibili-API-collect/blob/master/docs/video/report.md static const String heartBeat = '/x/click-interface/web/heartbeat'; // 查询视频分P列表 (avid/bvid转cid) static const String ab2c = '/x/player/pagelist'; // 番剧/剧集明细 static const String bangumiInfo = '/pgc/view/web/season'; // 全部关注的up // vmid 用户id pn 页码 ps 每页个数,最大50 order: desc // order_type 排序规则 最近访问传空,最常访问传 attention static const String followings = '/x/relation/followings'; // 指定分类的关注 // https://api.bilibili.com/x/relation/tag?mid=17340771&tagid=-10&pn=1&ps=20 static const String tagFollowings = '/x/relation/tag'; // 关注分类 // https://api.bilibili.com/x/relation/tags static const String followingsClass = '/x/relation/tags'; // 搜索follow static const followSearch = '/x/relation/followings/search'; // 粉丝 // vmid 用户id pn 页码 ps 每页个数,最大50 order: desc // order_type 排序规则 最近访问传空,最常访问传 attention static const String fans = '/x/relation/fans'; // 直播 // ?page=1&page_size=30&platform=web static const String liveList = '${HttpString.liveBaseUrl}/xlive/web-interface/v1/second/getUserRecommend'; // 直播间详情 // cid roomId // qn 80:流畅,150:高清,400:蓝光,10000:原画,20000:4K, 30000:杜比 static const String liveRoomInfo = '${HttpString.liveBaseUrl}/xlive/web-room/v2/index/getRoomPlayInfo'; // 直播间详情 H5 static const String liveRoomInfoH5 = '${HttpString.liveBaseUrl}/xlive/web-room/v1/index/getH5InfoByRoom'; // 用户信息 需要Wbi签名 // https://api.bilibili.com/x/space/wbi/acc/info?mid=503427686&token=&platform=web&web_location=1550101&w_rid=d709892496ce93e3d94d6d37c95bde91&wts=1689301482 static const String memberInfo = '/x/space/wbi/acc/info'; // 用户名片信息 static const String memberCardInfo = '/x/web-interface/card'; // 用户投稿 // https://api.bilibili.com/x/space/wbi/arc/search? // mid=85754245& // ps=30& // tid=0& // pn=1& // keyword=& // order=pubdate& // platform=web& // web_location=1550101& // order_avoided=true& // w_rid=d893cf98a4e010cf326373194a648360& // wts=1689767832 static const String memberArchive = '/x/space/wbi/arc/search'; // 用户动态搜索 static const String memberDynamicSearch = '/x/space/dynamic/search'; // 用户动态 static const String memberDynamic = '/x/polymer/web-dynamic/v1/feed/space'; // 稍后再看 static const String toViewLater = '/x/v2/history/toview/add'; // 移除已观看 static const String toViewDel = '/x/v2/history/toview/del'; // 清空稍后再看 static const String toViewClear = '/x/v2/history/toview/clear'; // 追番 static const String bangumiAdd = '/pgc/web/follow/add'; // 取消追番 static const String bangumiDel = '/pgc/web/follow/del'; // 番剧列表 // https://api.bilibili.com/pgc/season/index/result? // st=1& // order=3 // season_version=-1 全部-1 正片1 电影2 其他3 // spoken_language_type=-1 全部-1 原生1 中文配音2 // area=-1& // is_finish=-1& // copyright=-1& // season_status=-1& // season_month=-1& // year=-1& // style_id=-1& // sort=0& // page=1& // season_type=1& // pagesize=20& // type=1 static const String bangumiList = '/pgc/season/index/result?st=1&order=3&season_version=-1&spoken_language_type=-1&area=-1&is_finish=-1©right=-1&season_status=-1&season_month=-1&year=-1&style_id=-1&sort=0&season_type=1&pagesize=20&type=1'; // 我的订阅 static const String bangumiFollow = '/x/space/bangumi/follow/list?type=1&follow_status=0&pn=1&ps=15&ts=1691544359969'; // 黑名单 static const String blackLst = '/x/relation/blacks'; // 移除黑名单 static const String removeBlack = '/x/relation/modify'; // github 获取最新版 static const String latestApp = 'https://api.github.com/repos/guozhigq/pilipala/releases/latest'; // 多少人在看 // https://api.bilibili.com/x/player/online/total?aid=913663681&cid=1203559746&bvid=BV1MM4y1s7NZ&ts=56427838 static const String onlineTotal = '/x/player/online/total'; static const String webDanmaku = '/x/v2/dm/web/seg.so'; //发送视频弹幕 //https://github.com/SocialSisterYi/bilibili-API-collect/blob/master/docs/danmaku/action.md static const String shootDanmaku = '/x/v2/dm/post'; // up主分组 static const String followUpTag = '/x/relation/tags'; // 设置Up主分组 // 0 添加至默认分组 否则使用,分割tagid static const String addUsers = '/x/relation/tags/addUsers'; // 获取指定分组下的up static const String followUpGroup = '/x/relation/tag'; /// 私聊 /// 'https://api.vc.bilibili.com/session_svr/v1/session_svr/get_sessions? /// session_type=1& /// group_fold=1& /// unfollow_fold=0& /// sort_rule=2& /// build=0& /// mobi_app=web& /// w_rid=8641d157fb9a9255eb2159f316ee39e2& /// wts=1697305010 static const String sessionList = '${HttpString.tUrl}/session_svr/v1/session_svr/get_sessions'; /// 私聊用户信息 /// uids /// build=0&mobi_app=web static const String sessionAccountList = '${HttpString.tUrl}/account/v1/user/cards'; /// https://api.vc.bilibili.com/svr_sync/v1/svr_sync/fetch_session_msgs? /// talker_id=400787461& /// session_type=1& /// size=20& /// sender_device_id=1& /// build=0& /// mobi_app=web& /// web_location=333.1296& /// w_rid=cfe3bf58c9fe181bbf4dd6c75175e6b0& /// wts=1697350697 static const String sessionMsg = '${HttpString.tUrl}/svr_sync/v1/svr_sync/fetch_session_msgs'; /// 标记已读 POST /// talker_id: /// session_type: 1 /// ack_seqno: 920224140918926 /// build: 0 /// mobi_app: web /// csrf_token: /// csrf: static const String updateAck = '${HttpString.tUrl}/session_svr/v1/session_svr/update_ack'; // 获取某个动态详情 // timezone_offset=-480 // id=849312409672744983 // features=itemOpusStyle static const String dynamicDetail = '/x/polymer/web-dynamic/v1/detail'; // AI总结 /// https://api.bilibili.com/x/web-interface/view/conclusion/get? /// bvid=BV1ju4y1s7kn& /// cid=1296086601& /// up_mid=4641697& /// w_rid=1607c6c5a4a35a1297e31992220900ae& /// wts=1697033079 static const String aiConclusion = '/x/web-interface/view/conclusion/get'; // captcha验证码 static const String getCaptcha = '${HttpString.passBaseUrl}/x/passport-login/captcha?source=main_web'; // web端短信验证码 static const String webSmsCode = '${HttpString.passBaseUrl}/x/passport-login/web/sms/send'; // web端验证码登录 static const String webSmsLogin = '${HttpString.passBaseUrl}/x/passport-login/web/login/sms'; // web端密码登录 static const String loginInByWebPwd = '${HttpString.passBaseUrl}/x/passport-login/web/login'; // web端二维码 static const String qrCodeApi = '${HttpString.passBaseUrl}/x/passport-login/web/qrcode/generate'; // 扫码登录 static const String loginInByQrcode = '${HttpString.passBaseUrl}/x/passport-login/web/qrcode/poll'; // app端短信验证码 static const String appSmsCode = '${HttpString.passBaseUrl}/x/passport-login/sms/send'; // app端验证码登录 // 获取短信验证码 // static const String appSafeSmsCode = // 'https://passport.bilibili.com/x/safecenter/common/sms/send'; /// app端密码登录 /// username /// password /// key /// rhash static const String loginInByPwdApi = '${HttpString.passBaseUrl}/x/passport-login/oauth2/login'; /// 密码加密密钥 /// disable_rcmd /// local_id static const getWebKey = '${HttpString.passBaseUrl}/x/passport-login/web/key'; /// cookie转access_key static const cookieToKey = '${HttpString.passBaseUrl}/x/passport-tv-login/h5/qrcode/confirm'; /// 申请二维码(TV端) static const getTVCode = 'https://passport.snm0516.aisee.tv/x/passport-tv-login/qrcode/auth_code'; ///扫码登录(TV端) static const qrcodePoll = '${HttpString.passBaseUrl}/x/passport-tv-login/qrcode/poll'; /// 置顶视频 static const getTopVideoApi = '/x/space/top/arc'; /// 主页 - 最近投币的视频 /// vmid /// gaia_source = main_web /// web_location /// w_rid /// wts static const getRecentCoinVideoApi = '/x/space/coin/video'; /// 最近点赞的视频 static const getRecentLikeVideoApi = '/x/space/like/video'; /// 最近追番 static const getRecentBangumiApi = '/x/space/bangumi/follow/list'; /// 用户专栏 static const getMemberSeasonsApi = '/x/polymer/web-space/home/seasons_series'; /// 获赞数 播放数 /// mid static const getMemberViewApi = '/x/space/upstat'; /// 查询某个专栏 /// mid /// season_id /// sort_reverse /// page_num /// page_size static const getSeasonDetailApi = '/x/polymer/web-space/seasons_archives_list'; static const getSeriesDetailApi = '/x/series/archives'; /// 获取未读动态数 static const getUnreadDynamic = '/x/web-interface/dynamic/entrance'; /// 用户动态主页 static const dynamicSpmPrefix = 'https://space.bilibili.com/1/dynamic'; /// 激活buvid3 static const activateBuvidApi = '/x/internal/gaia-gateway/ExClimbWuzhi'; /// 获取字幕配置 static const getSubtitleConfig = '/x/player/v2'; /// 我的订阅 static const userSubFolder = '/x/v3/fav/folder/collected/list'; /// 我的订阅详情 type 21 static const userSeasonList = '/x/space/fav/season/list'; /// 我的订阅详情 type 11 static const userResourceList = '/x/v3/fav/resource/list'; /// 表情 static const emojiList = '/x/emote/user/panel/web'; /// 已读标记 static const String ackSessionMsg = '${HttpString.tUrl}/session_svr/v1/session_svr/update_ack'; /// 发送私信 static const String sendMsg = '${HttpString.tUrl}/web_im/v1/web_im/send_msg'; /// 排行榜 static const String getRankApi = "/x/web-interface/ranking/v2"; /// 取消订阅 static const String cancelSub = '/x/v3/fav/season/unfav'; /// 动态转发 static const String dynamicForwardUrl = '/x/dynamic/feed/create/submit_check'; /// 创建动态 static const String dynamicCreate = '/x/dynamic/feed/create/dyn'; /// 删除收藏夹 static const String delFavFolder = '/x/v3/fav/folder/del'; /// 搜索结果计数 static const String searchCount = '/x/web-interface/wbi/search/all/v2'; /// 关闭会话 static const String removeSession = '${HttpString.tUrl}/session_svr/v1/session_svr/remove_session'; /// 消息未读数 static const String unread = '${HttpString.tUrl}/x/im/web/msgfeed/unread'; /// 回复我的 static const String messageReplyAPi = '/x/msgfeed/reply'; /// 收到的赞 static const String messageLikeAPi = '/x/msgfeed/like'; /// 系统通知 static const String messageSystemAPi = '${HttpString.messageBaseUrl}/x/sys-msg/query_unified_notify'; /// 系统通知 个人 static const String userMessageSystemAPi = '${HttpString.messageBaseUrl}/x/sys-msg/query_user_notify'; /// 系统通知标记已读 static const String systemMarkRead = '${HttpString.messageBaseUrl}/x/sys-msg/update_cursor'; /// 编辑收藏夹 static const String editFavFolder = '/x/v3/fav/folder/edit'; /// 新建收藏夹 static const String addFavFolder = '/x/v3/fav/folder/add'; /// 直播间弹幕信息 static const String getDanmuInfo = '${HttpString.liveBaseUrl}/xlive/web-room/v1/index/getDanmuInfo'; /// 直播间发送弹幕 static const String sendLiveMsg = '${HttpString.liveBaseUrl}/msg/send'; /// 我的关注 - 正在直播 static const String getFollowingLive = '${HttpString.liveBaseUrl}/xlive/web-ucenter/user/following'; /// 稍后再看&收藏夹视频列表 static const String mediaList = '/x/v2/medialist/resource/list'; /// 用户专栏 static const String opusList = '/x/polymer/web-dynamic/v1/opus/feed/space'; /// static const String getViewInfo = '/x/article/viewinfo'; /// 直播间记录 static const String liveRoomEntry = '${HttpString.liveBaseUrl}/xlive/web-room/v1/index/roomEntryAction'; /// 删除评论 static const String replyDel = '/x/v2/reply/del'; } ================================================ FILE: lib/http/bangumi.dart ================================================ import '../models/bangumi/list.dart'; import 'index.dart'; class BangumiHttp { static Future bangumiList({int? page}) async { var res = await Request().get(Api.bangumiList, data: {'page': page}); if (res.data['code'] == 0) { return { 'status': true, 'data': BangumiListDataModel.fromJson(res.data['data']) }; } else { return { 'status': false, 'data': [], 'msg': res.data['message'], }; } } static Future bangumiFollow({int? mid}) async { var res = await Request().get(Api.bangumiFollow, data: {'vmid': mid}); if (res.data['code'] == 0) { return { 'status': true, 'data': BangumiListDataModel.fromJson(res.data['data']) }; } else { return { 'status': false, 'data': [], 'msg': res.data['message'], }; } } } ================================================ FILE: lib/http/black.dart ================================================ import '../models/user/black.dart'; import 'index.dart'; class BlackHttp { static Future blackList({required int pn, int? ps}) async { var res = await Request().get(Api.blackLst, data: { 'pn': pn, 'ps': ps ?? 50, 're_version': 0, 'jsonp': 'jsonp', 'csrf': await Request.getCsrf(), }); if (res.data['code'] == 0) { return { 'status': true, 'data': BlackListDataModel.fromJson(res.data['data']) }; } else { return { 'status': false, 'data': [], 'msg': res.data['message'], }; } } // 移除黑名单 static Future removeBlack({required int fid}) async { var res = await Request().post( Api.removeBlack, data: { 'act': 6, 'csrf': await Request.getCsrf(), 'fid': fid, 'jsonp': 'jsonp', 're_src': 116, }, ); if (res.data['code'] == 0) { return { 'status': true, 'data': [], 'msg': '操作成功', }; } else { return { 'status': false, 'data': [], 'msg': res.data['message'], }; } } } ================================================ FILE: lib/http/common.dart ================================================ import 'index.dart'; class CommonHttp { static Future unReadDynamic() async { var res = await Request().get(Api.getUnreadDynamic, data: {'alltype_offset': 0, 'video_offset': '', 'article_offset': 0}); if (res.data['code'] == 0) { return {'status': true, 'data': res.data['data']['dyn_basic_infos']}; } else { return { 'status': false, 'data': [], 'msg': res.data['message'], }; } } } ================================================ FILE: lib/http/constants.dart ================================================ class HttpString { static const String baseUrl = 'https://www.bilibili.com'; static const String apiBaseUrl = 'https://api.bilibili.com'; static const String tUrl = 'https://api.vc.bilibili.com'; static const String appBaseUrl = 'https://app.bilibili.com'; static const String liveBaseUrl = 'https://api.live.bilibili.com'; static const String passBaseUrl = 'https://passport.bilibili.com'; static const String messageBaseUrl = 'https://message.bilibili.com'; static const String bangumiBaseUrl = 'https://bili.meark.me'; static const List validateStatusCodes = [ 302, 304, 307, 400, 401, 403, 404, 405, 409, 412, 500, 503, 504, 509, 616, 617, 625, 626, 628, 629, 632, 643, 650, 652, 658, 662, 688, 689, 701, 799, 8888 ]; } ================================================ FILE: lib/http/danmaku.dart ================================================ import 'package:dio/dio.dart'; import '../models/danmaku/dm.pb.dart'; import 'index.dart'; class DanmakaHttp { // 获取视频弹幕 static Future queryDanmaku({ required int cid, required int segmentIndex, }) async { // 构建参数对象 Map params = { 'type': 1, 'oid': cid, 'segment_index': segmentIndex, }; var response = await Request().get( Api.webDanmaku, data: params, extra: {'resType': ResponseType.bytes}, ); return DmSegMobileReply.fromBuffer(response.data); } static Future shootDanmaku({ int type = 1, //弹幕类选择(1:视频弹幕 2:漫画弹幕) required int oid, // 视频cid required String msg, //弹幕文本(长度小于 100 字符) int mode = 1, // 弹幕类型(1:滚动弹幕 4:底端弹幕 5:顶端弹幕 6:逆向弹幕(不能使用) 7:高级弹幕 8:代码弹幕(不能使用) 9:BAS弹幕(pool必须为2)) // String? aid,// 稿件avid // String? bvid,// bvid与aid必须有一个 required String bvid, int? progress, // 弹幕出现在视频内的时间(单位为毫秒,默认为0) int? color, // 弹幕颜色(默认白色,16777215) int? fontsize, // 弹幕字号(默认25) int? pool, // 弹幕池选择(0:普通池 1:字幕池 2:特殊池(代码/BAS弹幕)默认普通池,0) //int? rnd,// 当前时间戳*1000000(若无此项,则发送弹幕冷却时间限制为90s;若有此项,则发送弹幕冷却时间限制为5s) int? colorful, //60001:专属渐变彩色(需要会员) int? checkbox_type, //是否带 UP 身份标识(0:普通;4:带有标识) // String? csrf,//CSRF Token(位于 Cookie) Cookie 方式必要 // String? access_key,// APP 登录 Token APP 方式必要 }) async { // 构建参数对象 // assert(aid != null || bvid != null); // assert(csrf != null || access_key != null); assert(msg.length < 100); // 构建参数对象 var params = { 'type': type, 'oid': oid, 'msg': msg, 'mode': mode, //'aid': aid, 'bvid': bvid, 'progress': progress, 'color': color, 'fontsize': fontsize, 'pool': pool, 'rnd': DateTime.now().microsecondsSinceEpoch, 'colorful': colorful, 'checkbox_type': checkbox_type, 'csrf': await Request.getCsrf(), // 'access_key': access_key, }..removeWhere((key, value) => value == null); var response = await Request().post( Api.shootDanmaku, data: params, ); if (response.statusCode != 200) { return { 'status': false, 'data': [], 'msg': '弹幕发送失败,状态码:${response.statusCode}', }; } if (response.data['code'] == 0) { return { 'status': true, 'data': response.data['data'], }; } else { return { 'status': false, 'data': [], 'msg': "${response.data['code']}: ${response.data['message']}", }; } } } ================================================ FILE: lib/http/dynamics.dart ================================================ import 'dart:math'; import 'package:dio/dio.dart'; import '../models/dynamics/result.dart'; import '../models/dynamics/up.dart'; import 'index.dart'; class DynamicsHttp { static Future followDynamic({ String? type, int? page, String? offset, int? mid, }) async { Map data = { 'type': type ?? 'all', 'page': page ?? 1, 'timezone_offset': '-480', 'offset': page == 1 ? '' : offset, 'features': 'itemOpusStyle' }; if (mid != -1) { data['host_mid'] = mid; data.remove('timezone_offset'); } var res = await Request().get(Api.followDynamic, data: data); if (res.data['code'] == 0) { try { return { 'status': true, 'data': DynamicsDataModel.fromJson(res.data['data']), }; } catch (err) { print(err); return { 'status': false, 'data': [], 'msg': err.toString(), }; } } else { return { 'status': false, 'data': [], 'msg': res.data['message'], 'code': res.data['code'], }; } } static Future followUp() async { var res = await Request().get(Api.followUp); if (res.data['code'] == 0) { return { 'status': true, 'data': FollowUpModel.fromJson(res.data['data']), }; } else { return { 'status': false, 'data': [], 'msg': res.data['message'], }; } } // 动态点赞 static Future likeDynamic({ required String? dynamicId, required int? up, }) async { var res = await Request().post( Api.likeDynamic, data: { 'dynamic_id': dynamicId, 'up': up, 'csrf': await Request.getCsrf(), }, ); if (res.data['code'] == 0) { return { 'status': true, 'data': res.data['data'], }; } else { return { 'status': false, 'data': [], 'msg': res.data['message'], }; } } // static Future dynamicDetail({ String? id, }) async { var res = await Request().get(Api.dynamicDetail, data: { 'timezone_offset': -480, 'id': id, 'features': 'itemOpusStyle', }); if (res.data['code'] == 0) { try { return { 'status': true, 'data': DynamicItemModel.fromJson(res.data['data']['item']), }; } catch (err) { return { 'status': false, 'data': [], 'msg': err.toString(), }; } } else { return { 'status': false, 'data': [], 'msg': res.data['message'], }; } } static Future dynamicForward() async { var res = await Request().post( Api.dynamicForwardUrl, queryParameters: { 'csrf': await Request.getCsrf(), 'x-bili-device-req-json': {'platform': 'web', 'device': 'pc'}, 'x-bili-web-req-json': {'spm_id': '333.999'}, }, data: { 'attach_card': null, 'scene': 4, 'content': { 'conetents': [ {'raw_text': "2", 'type': 1, 'biz_id': ""} ] } }, ); if (res.data['code'] == 0) { return { 'status': true, 'data': res.data['data'], }; } else { return { 'status': false, 'data': [], 'msg': res.data['message'], }; } } static Future dynamicCreate({ required int mid, required int scene, int? oid, String? dynIdStr, String? rawText, }) async { DateTime now = DateTime.now(); int timestamp = now.millisecondsSinceEpoch ~/ 1000; Random random = Random(); int randomNumber = random.nextInt(9000) + 1000; String uploadId = '${mid}_${timestamp}_$randomNumber'; Map webRepostSrc = { 'dyn_id_str': dynIdStr ?? '', }; /// 投稿转发 if (scene == 5) { webRepostSrc = { 'revs_id': {'dyn_type': 8, 'rid': oid} }; } var res = await Request().post( Api.dynamicCreate, queryParameters: { 'platform': 'web', 'csrf': await Request.getCsrf(), 'x-bili-device-req-json': {'platform': 'web', 'device': 'pc'}, 'x-bili-web-req-json': {'spm_id': '333.999'}, }, data: { 'dyn_req': { 'content': { 'contents': [ {'raw_text': rawText ?? '', 'type': 1, 'biz_id': ''} ] }, 'scene': scene, 'attach_card': null, 'upload_id': uploadId, 'meta': { 'app_meta': {'from': 'create.dynamic.web', 'mobi_app': 'web'} } }, 'web_repost_src': webRepostSrc }, options: Options(contentType: 'application/json'), ); if (res.data['code'] == 0) { return { 'status': true, 'data': res.data['data'], }; } else { return { 'status': false, 'data': [], 'msg': res.data['message'], }; } } } ================================================ FILE: lib/http/fan.dart ================================================ import '../models/fans/result.dart'; import 'index.dart'; class FanHttp { static Future fans({int? vmid, int? pn, int? ps, String? orderType}) async { var res = await Request().get(Api.fans, data: { 'vmid': vmid, 'pn': pn, 'ps': ps, 'order': 'desc', 'order_type': orderType, }); if (res.data['code'] == 0) { return {'status': true, 'data': FansDataModel.fromJson(res.data['data'])}; } else { return { 'status': false, 'data': [], 'msg': res.data['message'], }; } } } ================================================ FILE: lib/http/fav.dart ================================================ import 'index.dart'; class FavHttp { /// 编辑收藏夹 static Future editFolder({ required String title, required String intro, required String mediaId, String? cover, int? privacy, }) async { var res = await Request().post( Api.editFavFolder, data: { 'title': title, 'intro': intro, 'media_id': mediaId, 'cover': cover ?? '', 'privacy': privacy ?? 0, 'csrf': await Request.getCsrf(), }, ); if (res.data['code'] == 0) { return { 'status': true, 'data': res.data['data'], }; } else { return { 'status': false, 'data': [], 'msg': res.data['message'], }; } } /// 新建收藏夹 static Future addFolder({ required String title, required String intro, String? cover, int? privacy, }) async { var res = await Request().post( Api.addFavFolder, data: { 'title': title, 'intro': intro, 'cover': cover ?? '', 'privacy': privacy ?? 0, 'csrf': await Request.getCsrf(), }, ); if (res.data['code'] == 0) { return { 'status': true, 'data': res.data['data'], }; } else { return { 'status': false, 'data': [], 'msg': res.data['message'], }; } } } ================================================ FILE: lib/http/follow.dart ================================================ import '../models/follow/result.dart'; import 'index.dart'; class FollowHttp { static Future followings( {int? vmid, int? pn, int? ps, String? orderType}) async { var res = await Request().get(Api.followings, data: { 'vmid': vmid, 'pn': pn, 'ps': ps, 'order': 'desc', 'order_type': orderType, }); if (res.data['code'] == 0) { return { 'status': true, 'data': FollowDataModel.fromJson(res.data['data']) }; } else { return { 'status': false, 'data': [], 'msg': res.data['message'], }; } } } ================================================ FILE: lib/http/html.dart ================================================ import 'package:html/dom.dart'; import 'package:html/parser.dart'; import 'index.dart'; class HtmlHttp { // article static Future reqHtml(id, dynamicType) async { var response = await Request().get( "https://www.bilibili.com/opus/$id", extra: {'ua': 'pc'}, ); if (response.data.contains('Redirecting to')) { RegExp regex = RegExp(r'//([\w\.]+)/(\w+)/(\w+)'); Match match = regex.firstMatch(response.data)!; String matchedString = match.group(0)!; response = await Request().get( 'https:$matchedString/', extra: {'ua': 'pc'}, ); } try { Document rootTree = parse(response.data); // log(response.data.body.toString()); Element body = rootTree.body!; Element appDom = body.querySelector('#app')!; Element authorHeader = appDom.querySelector('.fixed-author-header')!; // 头像 String avatar = authorHeader.querySelector('img')!.attributes['src']!; avatar = 'https:${avatar.split('@')[0]}'; String uname = authorHeader .querySelector('.fixed-author-header__author__name')! .text; // 动态详情 Element opusDetail = appDom.querySelector('.opus-detail')!; // 发布时间 String updateTime = opusDetail.querySelector('.opus-module-author__pub__text')!.text; // String opusContent = opusDetail.querySelector('.opus-module-content')!.innerHtml; String? test; try { test = opusDetail .querySelector('.horizontal-scroll-album__pic__img')! .innerHtml; } catch (_) {} String commentId = opusDetail .querySelector('.bili-comment-container')! .className .split(' ')[1] .split('-')[2]; // List imgList = opusDetail.querySelectorAll('bili-album__preview__picture__img'); return { 'status': true, 'avatar': avatar, 'uname': uname, 'updateTime': updateTime, 'content': (test ?? '') + opusContent, 'commentId': int.parse(commentId) }; } catch (err) { print('err: $err'); } } // read static Future reqReadHtml(id, dynamicType) async { var response = await Request().get( "https://www.bilibili.com/$dynamicType/$id/", extra: {'ua': 'pc'}, ); Document rootTree = parse(response.data); Element body = rootTree.body!; Element appDom = body.querySelector('#app')!; Element authorHeader = appDom.querySelector('.up-left')!; // 头像 // String avatar = // authorHeader.querySelector('.bili-avatar-img')!.attributes['data-src']!; // print(avatar); // avatar = 'https:${avatar.split('@')[0]}'; String uname = authorHeader.querySelector('.up-name')!.text.trim(); // 动态详情 Element opusDetail = appDom.querySelector('.article-content')!; // 发布时间 // String updateTime = // opusDetail.querySelector('.opus-module-author__pub__text')!.text; // print(updateTime); // String opusContent = opusDetail.querySelector('#read-article-holder')!.innerHtml; RegExp digitRegExp = RegExp(r'\d+'); Iterable matches = digitRegExp.allMatches(id); String number = matches.first.group(0)!; return { 'status': true, 'avatar': '', 'uname': uname, 'updateTime': '', 'content': opusContent, 'commentId': int.parse(number) }; } } ================================================ FILE: lib/http/index.dart ================================================ export 'api.dart'; export 'init.dart'; ================================================ FILE: lib/http/init.dart ================================================ // ignore_for_file: avoid_print import 'dart:async'; import 'dart:convert'; import 'dart:developer'; import 'dart:io'; import 'dart:math' show Random; import 'package:cookie_jar/cookie_jar.dart'; import 'package:dio/dio.dart'; import 'package:dio/io.dart'; import 'package:dio_cookie_manager/dio_cookie_manager.dart'; // import 'package:dio_http2_adapter/dio_http2_adapter.dart'; import 'package:hive/hive.dart'; import 'package:pilipala/utils/id_utils.dart'; import '../utils/storage.dart'; import '../utils/utils.dart'; import 'api.dart'; import 'constants.dart'; import 'interceptor.dart'; class Request { static final Request _instance = Request._internal(); static late CookieManager cookieManager; static late final Dio dio; factory Request() => _instance; Box setting = GStrorage.setting; static Box localCache = GStrorage.localCache; late bool enableSystemProxy; late String systemProxyHost; late String systemProxyPort; static final RegExp spmPrefixExp = RegExp(r''); static String? buvid; /// 设置cookie static setCookie() async { Box userInfoCache = GStrorage.userInfo; Box setting = GStrorage.setting; final String cookiePath = await Utils.getCookiePath(); final PersistCookieJar cookieJar = PersistCookieJar( ignoreExpires: true, storage: FileStorage(cookiePath), ); cookieManager = CookieManager(cookieJar); dio.interceptors.add(cookieManager); final List cookie = await cookieManager.cookieJar .loadForRequest(Uri.parse(HttpString.baseUrl)); final userInfo = userInfoCache.get('userInfoCache'); if (userInfo != null && userInfo.mid != null) { final List cookie2 = await cookieManager.cookieJar .loadForRequest(Uri.parse(HttpString.tUrl)); if (cookie2.isEmpty) { try { await Request().get(HttpString.tUrl); } catch (e) { log("setCookie, ${e.toString()}"); } } } setOptionsHeaders(userInfo, userInfo != null && userInfo.mid != null); String baseUrlType = 'default'; if (setting.get(SettingBoxKey.enableGATMode, defaultValue: false)) { baseUrlType = 'bangumi'; } setBaseUrl(type: baseUrlType); try { await buvidActivate(); } catch (e) { log("setCookie, ${e.toString()}"); } final String cookieString = cookie .map((Cookie cookie) => '${cookie.name}=${cookie.value}') .join('; '); dio.options.headers['cookie'] = cookieString; } // 从cookie中获取 csrf token static Future getCsrf() async { List cookies = await cookieManager.cookieJar .loadForRequest(Uri.parse(HttpString.apiBaseUrl)); String token = ''; if (cookies.where((e) => e.name == 'bili_jct').isNotEmpty) { token = cookies.firstWhere((e) => e.name == 'bili_jct').value; } return token; } static Future getBuvid() async { if (buvid != null) { return buvid!; } final List cookies = await cookieManager.cookieJar .loadForRequest(Uri.parse(HttpString.baseUrl)); buvid = cookies.firstWhere((cookie) => cookie.name == 'buvid3').value; if (buvid == null) { try { var result = await Request().get( "${HttpString.apiBaseUrl}/x/frontend/finger/spi", ); buvid = result["data"]["b_3"].toString(); } catch (e) { // 处理请求错误 buvid = ''; print("Error fetching buvid: $e"); } } return buvid!; } static setOptionsHeaders(userInfo, bool status) { if (status) { dio.options.headers['x-bili-mid'] = userInfo.mid.toString(); dio.options.headers['x-bili-aurora-eid'] = IdUtils.genAuroraEid(userInfo.mid); } dio.options.headers['env'] = 'prod'; dio.options.headers['app-key'] = 'android64'; dio.options.headers['x-bili-aurora-zone'] = 'sh001'; dio.options.headers['referer'] = 'https://www.bilibili.com/'; } static Future buvidActivate() async { var html = await Request().get(Api.dynamicSpmPrefix); String spmPrefix = spmPrefixExp.firstMatch(html.data)!.group(1)!; Random rand = Random(); String rand_png_end = base64.encode( List.generate(32, (_) => rand.nextInt(256)) + List.filled(4, 0) + [73, 69, 78, 68] + List.generate(4, (_) => rand.nextInt(256))); String jsonData = json.encode({ '3064': 1, '39c8': '${spmPrefix}.fp.risk', '3c43': { 'adca': 'Linux', 'bfe9': rand_png_end.substring(rand_png_end.length - 50), }, }); await Request().post(Api.activateBuvidApi, data: {'payload': jsonData}, options: Options(contentType: 'application/json')); } /* * config it and create */ Request._internal() { //BaseOptions、Options、RequestOptions 都可以配置参数,优先级别依次递增,且可以根据优先级别覆盖参数 BaseOptions options = BaseOptions( //请求基地址,可以包含子路径 baseUrl: HttpString.apiBaseUrl, //连接服务器超时时间,单位是毫秒. connectTimeout: const Duration(milliseconds: 12000), //响应流上前后两次接受到数据的间隔,单位为毫秒。 receiveTimeout: const Duration(milliseconds: 12000), //Http请求头. headers: {}, ); enableSystemProxy = setting.get(SettingBoxKey.enableSystemProxy, defaultValue: false) as bool; systemProxyHost = localCache.get(LocalCacheKey.systemProxyHost, defaultValue: ''); systemProxyPort = localCache.get(LocalCacheKey.systemProxyPort, defaultValue: ''); dio = Dio(options); /// fix 第三方登录 302重定向 跟iOS代理问题冲突 // ..httpClientAdapter = Http2Adapter( // ConnectionManager( // idleTimeout: const Duration(milliseconds: 10000), // onClientCreate: (_, ClientSetting config) => // config.onBadCertificate = (_) => true, // ), // ); /// 设置代理 if (enableSystemProxy) { dio.httpClientAdapter = IOHttpClientAdapter( createHttpClient: () { final HttpClient client = HttpClient(); // Config the client. client.findProxy = (Uri uri) { // return 'PROXY host:port'; return 'PROXY $systemProxyHost:$systemProxyPort'; }; client.badCertificateCallback = (X509Certificate cert, String host, int port) => true; return client; }, ); } //添加拦截器 dio.interceptors.add(ApiInterceptor()); // 日志拦截器 输出请求、响应内容 dio.interceptors.add(LogInterceptor( request: false, requestHeader: false, responseHeader: false, )); dio.transformer = BackgroundTransformer(); dio.options.validateStatus = (int? status) { return status! >= 200 && status < 300 || HttpString.validateStatusCodes.contains(status); }; } /* * get请求 */ get(url, {data, options, cancelToken, extra}) async { Response response; final Options options = Options(); ResponseType resType = ResponseType.json; if (extra != null) { resType = extra!['resType'] ?? ResponseType.json; if (extra['ua'] != null) { options.headers = {'user-agent': headerUa(type: extra['ua'])}; } } options.responseType = resType; try { response = await dio.get( url, queryParameters: data, options: options, cancelToken: cancelToken, ); return response; } on DioException catch (e) { Response errResponse = Response( data: { 'message': await ApiInterceptor.dioError(e) }, // 将自定义 Map 数据赋值给 Response 的 data 属性 statusCode: 200, requestOptions: RequestOptions(), ); return errResponse; } } /* * post请求 */ post(url, {data, queryParameters, options, cancelToken, extra}) async { // print('post-data: $data'); Response response; try { response = await dio.post( url, data: data, queryParameters: queryParameters, options: options ?? Options(contentType: Headers.formUrlEncodedContentType), cancelToken: cancelToken, ); // print('post success: ${response.data}'); return response; } on DioException catch (e) { Response errResponse = Response( data: { 'message': await ApiInterceptor.dioError(e) }, // 将自定义 Map 数据赋值给 Response 的 data 属性 statusCode: 200, requestOptions: RequestOptions(), ); return errResponse; } } /* * 下载文件 */ downloadFile(urlPath, savePath) async { Response response; try { response = await dio.download(urlPath, savePath, onReceiveProgress: (int count, int total) { //进度 // print("$count $total"); }); print('downloadFile success: ${response.data}'); return response.data; } on DioException catch (e) { print('downloadFile error: $e'); return Future.error(ApiInterceptor.dioError(e)); } } /* * 取消请求 * * 同一个cancel token 可以用于多个请求,当一个cancel token取消时,所有使用该cancel token的请求都会被取消。 * 所以参数可选 */ void cancelRequests(CancelToken token) { token.cancel("cancelled"); } String headerUa({type = 'mob'}) { String headerUa = ''; if (type == 'mob') { if (Platform.isIOS) { headerUa = 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1 Mobile/15E148 Safari/604.1'; } else { headerUa = 'Mozilla/5.0 (Linux; Android 10; SM-G975F) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.101 Mobile Safari/537.36'; } } else { headerUa = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.2 Safari/605.1.15'; } return headerUa; } static setBaseUrl({String type = 'default'}) { switch (type) { case 'default': dio.options.baseUrl = HttpString.apiBaseUrl; break; case 'bangumi': dio.options.baseUrl = HttpString.bangumiBaseUrl; break; default: dio.options.baseUrl = HttpString.apiBaseUrl; } } } ================================================ FILE: lib/http/interceptor.dart ================================================ // ignore_for_file: avoid_print import 'package:connectivity_plus/connectivity_plus.dart'; import 'package:dio/dio.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:hive/hive.dart'; import '../utils/storage.dart'; class ApiInterceptor extends Interceptor { @override void onRequest(RequestOptions options, RequestInterceptorHandler handler) { // print("请求之前"); // 在请求之前添加头部或认证信息 // options.headers['Authorization'] = 'Bearer token'; // options.headers['Content-Type'] = 'application/json'; handler.next(options); } @override void onResponse(Response response, ResponseInterceptorHandler handler) { try { if (response.statusCode == 302) { final List locations = response.headers['location']!; if (locations.isNotEmpty) { if (locations.first.startsWith('https://www.mcbbs.net')) { final Uri uri = Uri.parse(locations.first); final String? accessKey = uri.queryParameters['access_key']; final String? mid = uri.queryParameters['mid']; try { Box localCache = GStrorage.localCache; localCache.put(LocalCacheKey.accessKey, {'mid': mid, 'value': accessKey}); } catch (_) {} } } } } catch (err) { print('ApiInterceptor: $err'); } handler.next(response); } @override void onError(DioException err, ErrorInterceptorHandler handler) async { // 处理网络请求错误 // handler.next(err); String url = err.requestOptions.uri.toString(); final excludedPatterns = RegExp(r'heartbeat|seg\.so|online/total'); if (!excludedPatterns.hasMatch(url)) { SmartDialog.showToast( await dioError(err), displayType: SmartToastType.onlyRefresh, ); } super.onError(err, handler); } static Future dioError(DioException error) async { switch (error.type) { case DioExceptionType.badCertificate: return '证书有误!'; case DioExceptionType.badResponse: return '服务器异常,请稍后重试!'; case DioExceptionType.cancel: return '请求已被取消,请重新请求'; case DioExceptionType.connectionError: return '连接错误,请检查网络设置'; case DioExceptionType.connectionTimeout: return '网络连接超时,请检查网络设置'; case DioExceptionType.receiveTimeout: return '响应超时,请稍后重试!'; case DioExceptionType.sendTimeout: return '发送请求超时,请检查网络设置'; case DioExceptionType.unknown: final String res = await checkConnect(); return '$res,网络异常!'; } } static Future checkConnect() async { final List connectivityResult = await Connectivity().checkConnectivity(); if (connectivityResult.contains(ConnectivityResult.mobile)) { return '正在使用移动流量'; } else if (connectivityResult.contains(ConnectivityResult.wifi)) { return '正在使用wifi'; } else if (connectivityResult.contains(ConnectivityResult.ethernet)) { return '正在使用局域网'; } else if (connectivityResult.contains(ConnectivityResult.vpn)) { return '正在使用代理网络'; } else if (connectivityResult.contains(ConnectivityResult.bluetooth)) { return '正在使用蓝牙网络'; } else if (connectivityResult.contains(ConnectivityResult.other)) { return '正在使用其他网络'; } else if (connectivityResult.contains(ConnectivityResult.none)) { return '未连接到任何网络'; } else { return ''; } } } ================================================ FILE: lib/http/live.dart ================================================ import 'package:pilipala/models/live/follow.dart'; import '../models/live/item.dart'; import '../models/live/room_info.dart'; import '../models/live/room_info_h5.dart'; import 'api.dart'; import 'init.dart'; class LiveHttp { static Future liveList( {int? vmid, int? pn, int? ps, String? orderType}) async { var res = await Request().get(Api.liveList, data: {'page': pn, 'page_size': 30, 'platform': 'web'}); if (res.data['code'] == 0) { return { 'status': true, 'data': res.data['data']['list'] .map((e) => LiveItemModel.fromJson(e)) .toList() }; } else { return { 'status': false, 'data': [], 'msg': res.data['message'], }; } } static Future liveRoomInfo({roomId, qn}) async { var res = await Request().get(Api.liveRoomInfo, data: { 'room_id': roomId, 'protocol': '0, 1', 'format': '0, 1, 2', 'codec': '0, 1', 'qn': qn, 'platform': 'web', 'ptype': 8, 'dolby': 5, 'panorama': 1, }); if (res.data['code'] == 0) { return {'status': true, 'data': RoomInfoModel.fromJson(res.data['data'])}; } else { return { 'status': false, 'data': [], 'msg': res.data['message'], }; } } static Future liveRoomInfoH5({roomId, qn}) async { var res = await Request().get(Api.liveRoomInfoH5, data: { 'room_id': roomId, }); if (res.data['code'] == 0) { return { 'status': true, 'data': RoomInfoH5Model.fromJson(res.data['data']) }; } else { return { 'status': false, 'data': [], 'msg': res.data['message'], }; } } // 获取弹幕信息 static Future liveDanmakuInfo({roomId}) async { var res = await Request().get(Api.getDanmuInfo, data: { 'id': roomId, }); if (res.data['code'] == 0) { return { 'status': true, 'data': res.data['data'], }; } else { return { 'status': false, 'data': [], 'msg': res.data['message'], }; } } // 发送弹幕 static Future sendDanmaku({roomId, msg}) async { var res = await Request().post( Api.sendLiveMsg, data: { 'bubble': 0, 'msg': msg, 'color': 16777215, // 颜色 'mode': 1, // 模式 'room_type': 0, 'jumpfrom': 71001, // 直播间来源 'reply_mid': 0, 'reply_attr': 0, 'replay_dmid': '', 'statistics': {"appId": 100, "platform": 5}, 'fontsize': 25, // 字体大小 'rnd': DateTime.now().millisecondsSinceEpoch ~/ 1000, // 时间戳 'roomid': roomId, 'csrf': await Request.getCsrf(), 'csrf_token': await Request.getCsrf(), }, ); if (res.data['code'] == 0) { return { 'status': true, 'data': res.data['data'], }; } else { return { 'status': false, 'data': [], 'msg': res.data['message'], }; } } // 我的关注 正在直播 static Future liveFollowing({int? pn, int? ps}) async { var res = await Request().get(Api.getFollowingLive, data: { 'page': pn, 'page_size': ps, 'platform': 'web', 'ignoreRecord': 1, 'hit_ab': true, }); if (res.data['code'] == 0) { return { 'status': true, 'data': LiveFollowingModel.fromJson(res.data['data']) }; } else { return { 'status': false, 'data': [], 'msg': res.data['message'], }; } } // 直播历史记录 static Future liveRoomEntry({required int roomId}) async { await Request().post( Api.liveRoomEntry, data: { 'room_id': roomId, 'platform': 'pc', 'csrf_token': await Request.getCsrf(), 'csrf': await Request.getCsrf(), 'visit_id': '', }, ); } } ================================================ FILE: lib/http/login.dart ================================================ import 'dart:convert'; import 'dart:math'; import 'package:crypto/crypto.dart'; import 'package:dio/dio.dart'; import 'package:encrypt/encrypt.dart'; import 'package:pilipala/http/constants.dart'; import 'package:uuid/uuid.dart'; import '../models/login/index.dart'; import '../utils/login.dart'; import 'index.dart'; class LoginHttp { static Future queryCaptcha() async { var res = await Request().get(Api.getCaptcha); if (res.data['code'] == 0) { return { 'status': true, 'data': CaptchaDataModel.fromJson(res.data['data']), }; } else { return {'status': false, 'data': res.message}; } } // static Future sendSmsCode({ // int? cid, // required int tel, // required String token, // required String challenge, // required String validate, // required String seccode, // }) async { // var res = await Request().post( // Api.appSmsCode, // data: { // 'cid': cid, // 'tel': tel, // "source": "main_web", // 'token': token, // 'challenge': challenge, // 'validate': validate, // 'seccode': seccode, // }, // options: Options( // contentType: Headers.formUrlEncodedContentType, // // headers: {'user-agent': ApiConstants.userAgent} // ), // ); // print(res); // } // web端验证码 static Future sendWebSmsCode({ int? cid, required int tel, required String token, required String challenge, required String validate, required String seccode, }) async { Map data = { 'cid': cid, 'tel': tel, "source": "main_web", 'token': token, 'challenge': challenge, 'validate': validate, 'seccode': seccode, }; FormData formData = FormData.fromMap({...data}); var res = await Request().post( Api.webSmsCode, data: formData, ); if (res.data['code'] == 0) { return { 'status': true, 'data': res.data['data'], }; } else { return {'status': false, 'data': [], 'msg': res.data['message']}; } } // web端验证码登录 static Future loginInByWebSmsCode({ int? cid, required int tel, required int code, required String captchaKey, }) async { // webSmsLogin Map data = { "cid": cid, "tel": tel, "code": code, "source": "main_mini", "keep": 0, "captcha_key": captchaKey, "go_url": HttpString.baseUrl }; FormData formData = FormData.fromMap({...data}); var res = await Request().post( Api.webSmsLogin, data: formData, ); if (res.data['code'] == 0) { return { 'status': true, 'data': res.data['data'], }; } else { return {'status': false, 'data': [], 'msg': res.data['message']}; } } // web端密码登录 static Future liginInByWebPwd() async {} // app端验证码 static Future sendAppSmsCode({ int? cid, required int tel, required String token, required String challenge, required String validate, required String seccode, }) async { Map data = { 'cid': cid, 'tel': tel, 'login_session_id': const Uuid().v4().replaceAll('-', ''), 'recaptcha_token': token, 'gee_challenge': challenge, 'gee_validate': validate, 'gee_seccode': seccode, 'channel': 'bili', 'buvid': buvid(), 'local_id': buvid(), // 'ts': DateTime.now().millisecondsSinceEpoch ~/ 1000, 'statistics': { "appId": 1, "platform": 3, "version": "7.52.0", "abtest": "" }, }; // FormData formData = FormData.fromMap({...data}); var res = await Request().post( Api.appSmsCode, data: data, ); print(res); } static String buvid() { var mac = []; var random = Random(); for (var i = 0; i < 6; i++) { var min = 0; var max = 0xff; var num = (random.nextInt(max - min + 1) + min).toRadixString(16); mac.add(num); } var md5Str = md5.convert(utf8.encode(mac.join(':'))).toString(); var md5Arr = md5Str.split(''); return 'XY${md5Arr[2]}${md5Arr[12]}${md5Arr[22]}$md5Str'; } // 获取盐hash跟PubKey static Future getWebKey() async { var res = await Request().get(Api.getWebKey, data: {'disable_rcmd': 0, 'local_id': LoginUtils.generateBuvid()}); if (res.data['code'] == 0) { return {'status': true, 'data': res.data['data']}; } else { return {'status': false, 'data': {}, 'msg': res.data['message']}; } } // app端密码登录 static Future loginInByMobPwd({ required String tel, required String password, required String key, required String rhash, }) async { dynamic publicKey = RSAKeyParser().parse(key); String passwordEncryptyed = Encrypter(RSA(publicKey: publicKey)).encrypt(rhash + password).base64; Map data = { 'username': tel, 'password': passwordEncryptyed, 'local_id': LoginUtils.generateBuvid(), 'disable_rcmd': "0", }; var res = await Request().post( Api.loginInByPwdApi, data: data, ); print(res); } // web端密码登录 static Future loginInByWebPwd({ required int username, required String password, required String token, required String challenge, required String validate, required String seccode, }) async { Map data = { 'username': username, 'password': password, 'keep': 0, 'token': token, 'challenge': challenge, 'validate': validate, 'seccode': seccode, 'source': 'main-fe-header', "go_url": HttpString.baseUrl }; FormData formData = FormData.fromMap({...data}); var res = await Request().post( Api.loginInByWebPwd, data: formData, ); if (res.data['code'] == 0) { if (res.data['data']['status'] == 0) { return { 'status': true, 'data': res.data['data'], }; } else { return { 'status': false, 'code': 1, 'data': res.data['data'], 'msg': res.data['data']['message'], }; } } else { return { 'status': false, 'data': [], 'msg': res.data['message'], }; } } // web端登录二维码 static Future getWebQrcode() async { var res = await Request().get(Api.qrCodeApi); if (res.data['code'] == 0) { return { 'status': true, 'data': res.data['data'], }; } else { return {'status': false, 'data': [], 'msg': res.data['message']}; } } // web端二维码轮询登录状态 static Future queryWebQrcodeStatus(String qrcodeKey) async { var res = await Request() .get(Api.loginInByQrcode, data: {'qrcode_key': qrcodeKey}); if (res.data['data']['code'] == 0) { return { 'status': true, 'data': res.data['data'], }; } else { return {'status': false, 'data': [], 'msg': res.data['message']}; } } } ================================================ FILE: lib/http/member.dart ================================================ import 'dart:convert'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:hive/hive.dart'; import 'package:html/parser.dart'; import 'package:pilipala/models/member/article.dart'; import 'package:pilipala/models/member/like.dart'; import '../common/constants.dart'; import '../models/dynamics/result.dart'; import '../models/follow/result.dart'; import '../models/member/archive.dart'; import '../models/member/coin.dart'; import '../models/member/info.dart'; import '../models/member/seasons.dart'; import '../models/member/tags.dart'; import '../utils/storage.dart'; import '../utils/utils.dart'; import '../utils/wbi_sign.dart'; import 'index.dart'; class MemberHttp { static Future memberInfo({ int? mid, String token = '', }) async { Map params = await WbiSign().makSign({ 'mid': mid, 'token': token, 'platform': 'web', 'web_location': 1550101, }); var res = await Request().get( Api.memberInfo, data: params, extra: {'ua': 'pc'}, ); if (res.data['code'] == 0) { return { 'status': true, 'data': MemberInfoModel.fromJson(res.data['data']) }; } else { return { 'status': false, 'data': [], 'msg': res.data['message'], }; } } static Future memberStat({int? mid}) async { var res = await Request().get(Api.userStat, data: {'vmid': mid}); if (res.data['code'] == 0) { return {'status': true, 'data': res.data['data']}; } else { return { 'status': false, 'data': [], 'msg': res.data['message'], }; } } static Future memberCardInfo({int? mid}) async { var res = await Request() .get(Api.memberCardInfo, data: {'mid': mid, 'photo': true}); if (res.data['code'] == 0) { return {'status': true, 'data': res.data['data']}; } else { return { 'status': false, 'data': [], 'msg': res.data['message'], }; } } static Future memberArchive({ int? mid, int ps = 30, int tid = 0, int? pn, String? keyword, String order = 'pubdate', bool orderAvoided = true, }) async { String dmImgStr = Utils.base64EncodeRandomString(16, 64); String dmCoverImgStr = Utils.base64EncodeRandomString(32, 128); Map params = await WbiSign().makSign({ 'mid': mid, 'ps': ps, 'tid': tid, 'pn': pn, 'keyword': keyword ?? '', 'order': order, 'platform': 'web', 'web_location': 1550101, 'order_avoided': orderAvoided, 'dm_img_list': '[]', 'dm_img_str': dmImgStr.substring(0, dmImgStr.length - 2), 'dm_cover_img_str': dmCoverImgStr.substring(0, dmCoverImgStr.length - 2), 'dm_img_inter': '{"ds":[],"wh":[0,0,0],"of":[0,0,0]}', ...order == 'charge' ? { 'order': 'pubdate', 'special_type': 'charging', } : {} }); var res = await Request().get( Api.memberArchive, data: params, extra: {'ua': 'pc'}, ); if (res.data['code'] == 0) { return { 'status': true, 'data': MemberArchiveDataModel.fromJson(res.data['data']) }; } else { Map errMap = { -352: '风控校验失败,请检查登录状态', }; return { 'status': false, 'data': [], 'msg': errMap[res.data['code']] ?? res.data['message'], }; } } // 用户动态 static Future memberDynamic({String? offset, int? mid}) async { var res = await Request().get(Api.memberDynamic, data: { 'offset': offset ?? '', 'host_mid': mid, 'timezone_offset': '-480', 'features': 'itemOpusStyle', }); if (res.data['code'] == 0) { return { 'status': true, 'data': DynamicsDataModel.fromJson(res.data['data']), }; } else { Map errMap = { -352: '风控校验失败,请检查登录状态', }; return { 'status': false, 'data': [], 'msg': errMap[res.data['code']] ?? res.data['message'], }; } } // 搜索用户动态 static Future memberDynamicSearch({int? pn, int? ps, int? mid}) async { var res = await Request().get(Api.memberDynamic, data: { 'keyword': '海拔', 'mid': mid, 'pn': pn, 'ps': ps, 'platform': 'web' }); if (res.data['code'] == 0) { return { 'status': true, 'data': DynamicsDataModel.fromJson(res.data['data']), }; } else { return { 'status': false, 'data': [], 'msg': res.data['message'], }; } } // 查询分组 static Future followUpTags() async { var res = await Request().get(Api.followUpTag); if (res.data['code'] == 0) { return { 'status': true, 'data': res.data['data'] .map((e) => MemberTagItemModel.fromJson(e)) .toList() }; } else { return { 'status': false, 'data': [], 'msg': res.data['message'], }; } } // 设置分组 static Future addUsers(int? fids, String? tagids) async { var res = await Request().post( Api.addUsers, data: { 'fids': fids, 'tagids': tagids ?? '0', 'csrf': await Request.getCsrf(), }, queryParameters: {'cross_domain': true}, ); if (res.data['code'] == 0) { return {'status': true, 'data': [], 'msg': '操作成功'}; } else { return { 'status': false, 'data': [], 'msg': res.data['message'], }; } } // 获取某分组下的up static Future followUpGroup( int? mid, int? tagid, int? pn, int? ps, ) async { var res = await Request().get(Api.followUpGroup, data: { 'mid': mid, 'tagid': tagid, 'pn': pn, 'ps': ps, }); if (res.data['code'] == 0) { // FollowItemModel return { 'status': true, 'data': res.data['data'] .map((e) => FollowItemModel.fromJson(e)) .toList() }; } else { return { 'status': false, 'data': [], 'msg': res.data['message'], }; } } // 获取up置顶 static Future getTopVideo(String? vmid) async { var res = await Request().get(Api.getTopVideoApi); if (res.data['code'] == 0) { return { 'status': true, 'data': res.data['data'] .map((e) => MemberTagItemModel.fromJson(e)) .toList() }; } else { return { 'status': false, 'data': [], 'msg': res.data['message'], }; } } // 获取uo专栏 static Future getMemberSeasons(int? mid, int? pn, int? ps) async { var res = await Request().get(Api.getMemberSeasonsApi, data: { 'mid': mid, 'page_num': pn, 'page_size': ps, }); if (res.data['code'] == 0) { return { 'status': true, 'data': MemberSeasonsDataModel.fromJson(res.data['data']['items_lists']) }; } else { return { 'status': false, 'data': [], 'msg': res.data['message'], }; } } // 最近投币 static Future getRecentCoinVideo({required int mid}) async { Map params = await WbiSign().makSign({ 'mid': mid, 'gaia_source': 'main_web', 'web_location': 333.999, }); var res = await Request().get( Api.getRecentCoinVideoApi, data: { 'vmid': mid, 'gaia_source': 'main_web', 'web_location': 333.999, 'w_rid': params['w_rid'], 'wts': params['wts'], }, ); if (res.data['code'] == 0) { return { 'status': true, 'data': res.data['data'] .map((e) => MemberCoinsDataModel.fromJson(e)) .toList(), }; } else { return { 'status': false, 'data': [], 'msg': res.data['message'], }; } } // 最近点赞 static Future getRecentLikeVideo({required int mid}) async { Map params = await WbiSign().makSign({ 'mid': mid, 'gaia_source': 'main_web', 'web_location': 333.999, }); var res = await Request().get( Api.getRecentLikeVideoApi, data: { 'vmid': mid, 'gaia_source': 'main_web', 'web_location': 333.999, 'w_rid': params['w_rid'], 'wts': params['wts'], }, ); if (res.data['code'] == 0) { return { 'status': true, 'data': res.data['data']['list'] .map((e) => MemberLikeDataModel.fromJson(e)) .toList(), }; } else { return { 'status': false, 'data': [], 'msg': res.data['message'], }; } } // 查看某个专栏 static Future getSeasonDetail({ required int mid, required int seasonId, bool sortReverse = false, required int pn, required int ps, }) async { var res = await Request().get( Api.getSeasonDetailApi, data: { 'mid': mid, 'season_id': seasonId, 'sort_reverse': sortReverse, 'page_num': pn, 'page_size': ps, }, ); if (res.data['code'] == 0) { try { return { 'status': true, 'data': MemberSeasonsList.fromJson(res.data['data']) }; } catch (err) { print(err); } } else { return { 'status': false, 'data': [], 'msg': res.data['message'], }; } } // 获取TV authCode static Future getTVCode() async { SmartDialog.showLoading(); var params = { 'appkey': Constants.appKey, 'local_id': '0', 'ts': (DateTime.now().millisecondsSinceEpoch ~/ 1000).toString(), }; String sign = Utils.appSign( params, Constants.appKey, Constants.appSec, ); var res = await Request() .post(Api.getTVCode, queryParameters: {...params, 'sign': sign}); if (res.data['code'] == 0) { return { 'status': true, 'data': res.data['data']['auth_code'], 'msg': '操作成功' }; } else { return { 'status': false, 'data': [], 'msg': res.data['message'], }; } } // 获取access_key static Future cookieToKey() async { var authCodeRes = await getTVCode(); if (authCodeRes['status']) { var res = await Request().post( Api.cookieToKey, data: { 'auth_code': authCodeRes['data'], 'build': 708200, 'csrf': await Request.getCsrf(), }, ); await Future.delayed(const Duration(milliseconds: 300)); await qrcodePoll(authCodeRes['data']); if (res.data['code'] == 0) { return {'status': true, 'data': [], 'msg': '操作成功'}; } else { return { 'status': false, 'data': [], 'msg': res.data['message'], }; } } } static Future qrcodePoll(authCode) async { var params = { 'appkey': Constants.appKey, 'auth_code': authCode.toString(), 'local_id': '0', 'ts': (DateTime.now().millisecondsSinceEpoch ~/ 1000).toString(), }; String sign = Utils.appSign( params, Constants.appKey, Constants.appSec, ); var res = await Request() .post(Api.qrcodePoll, queryParameters: {...params, 'sign': sign}); SmartDialog.dismiss(); if (res.data['code'] == 0) { String accessKey = res.data['data']['access_token']; Box localCache = GStrorage.localCache; Box userInfoCache = GStrorage.userInfo; var userInfo = userInfoCache.get('userInfoCache'); localCache.put( LocalCacheKey.accessKey, {'mid': userInfo.mid, 'value': accessKey}); return {'status': true, 'data': [], 'msg': '操作成功'}; } else { return { 'status': false, 'data': [], 'msg': res.data['message'], }; } } // 获取up播放数、点赞数 static Future memberView({required int mid}) async { var res = await Request().get(Api.getMemberViewApi, data: {'mid': mid}); if (res.data['code'] == 0) { return {'status': true, 'data': res.data['data']}; } else { return { 'status': false, 'data': [], 'msg': res.data['message'], }; } } // 搜索follow static Future getfollowSearch({ required int mid, required int ps, required int pn, required String name, }) async { Map data = { 'vmid': mid, 'pn': pn, 'ps': ps, 'order': 'desc', 'order_type': 'attention', 'gaia_source': 'main_web', 'name': name, 'web_location': 333.999, }; Map params = await WbiSign().makSign(data); var res = await Request().get(Api.followSearch, data: { ...data, 'w_rid': params['w_rid'], 'wts': params['wts'], }); if (res.data['code'] == 0) { return { 'status': true, 'data': FollowDataModel.fromJson(res.data['data']) }; } else { return { 'status': false, 'data': [], 'msg': res.data['message'], }; } } static Future getSeriesDetail({ required int mid, required int currentMid, required int seriesId, required int pn, }) async { var res = await Request().get( Api.getSeriesDetailApi, data: { 'mid': mid, 'series_id': seriesId, 'only_normal': true, 'sort': 'desc', 'pn': pn, 'ps': 30, 'current_mid': currentMid, }, ); if (res.data['code'] == 0) { try { return { 'status': true, 'data': MemberSeasonsDataModel.fromJson(res.data['data']) }; } catch (err) { print(err); } } else { return { 'status': false, 'data': [], 'msg': res.data['message'], }; } } static Future getWWebid({required int mid}) async { var res = await Request().get('https://space.bilibili.com/$mid/article'); String? headContent = parse(res.data).head?.outerHtml; final regex = RegExp( r''); if (headContent != null) { final match = regex.firstMatch(headContent); if (match != null && match.groupCount >= 1) { final content = match.group(1); String decodedString = Uri.decodeComponent(content!); Map map = jsonDecode(decodedString); return {'status': true, 'data': map['access_id']}; } else { return {'status': false, 'data': '请检查登录状态'}; } } return {'status': false, 'data': '请检查登录状态'}; } // 获取用户专栏 static Future getMemberArticle({ required int mid, required int pn, required String wWebid, String? offset, }) async { Map params = await WbiSign().makSign({ 'host_mid': mid, 'page': pn, 'offset': offset, 'web_location': 333.999, 'w_webid': wWebid, }); var res = await Request().get(Api.opusList, data: { 'host_mid': mid, 'page': pn, 'offset': offset, 'web_location': 333.999, 'w_webid': wWebid, 'w_rid': params['w_rid'], 'wts': params['wts'], }); if (res.data['code'] == 0) { return { 'status': true, 'data': MemberArticleDataModel.fromJson(res.data['data']) }; } else { return { 'status': false, 'data': [], 'msg': res.data['message'] ?? '请求异常', }; } } } ================================================ FILE: lib/http/msg.dart ================================================ import 'dart:convert'; import 'dart:math'; import 'package:pilipala/models/msg/like.dart'; import 'package:pilipala/models/msg/reply.dart'; import 'package:pilipala/models/msg/system.dart'; import '../models/msg/account.dart'; import '../models/msg/session.dart'; import '../utils/wbi_sign.dart'; import 'api.dart'; import 'init.dart'; class MsgHttp { // 会话列表 static Future sessionList({int? endTs}) async { Map params = { 'session_type': 1, 'group_fold': 1, 'unfollow_fold': 0, 'sort_rule': 2, 'build': 0, 'mobi_app': 'web', }; if (endTs != null) { params['end_ts'] = endTs; } Map signParams = await WbiSign().makSign(params); var res = await Request().get(Api.sessionList, data: signParams); if (res.data['code'] == 0) { try { return { 'status': true, 'data': SessionDataModel.fromJson(res.data['data']), }; } catch (err) { return { 'status': false, 'data': [], 'msg': err.toString(), }; } } else { return { 'status': false, 'data': [], 'msg': res.data['message'], }; } } static Future accountList(uids) async { var res = await Request().get(Api.sessionAccountList, data: { 'uids': uids, 'build': 0, 'mobi_app': 'web', }); if (res.data['code'] == 0) { try { return { 'status': true, 'data': res.data['data'] .map((e) => AccountListModel.fromJson(e)) .toList(), }; } catch (err) { print('err🔟: $err'); } } else { return { 'status': false, 'date': [], 'msg': res.data['message'], }; } } static Future sessionMsg({ int? talkerId, }) async { Map params = await WbiSign().makSign({ 'talker_id': talkerId, 'session_type': 1, 'size': 20, 'sender_device_id': 1, 'build': 0, 'mobi_app': 'web', }); var res = await Request().get(Api.sessionMsg, data: params); if (res.data['code'] == 0) { try { return { 'status': true, 'data': SessionMsgDataModel.fromJson(res.data['data']), }; } catch (err) { print(err); } } else { return { 'status': false, 'date': [], 'msg': res.data['message'], }; } } // 消息标记已读 static Future ackSessionMsg({ int? talkerId, int? ackSeqno, }) async { String csrf = await Request.getCsrf(); Map params = await WbiSign().makSign({ 'talker_id': talkerId, 'session_type': 1, 'ack_seqno': ackSeqno, 'build': 0, 'mobi_app': 'web', 'csrf_token': csrf, 'csrf': csrf }); var res = await Request().get(Api.ackSessionMsg, data: params); if (res.data['code'] == 0) { return { 'status': true, 'data': res.data['data'], }; } else { return {'status': false, 'date': [], 'msg': res.data['message']}; } } // 发送私信 static Future sendMsg({ required int senderUid, required int receiverId, int? receiverType, int? msgType, dynamic content, }) async { String csrf = await Request.getCsrf(); var res = await Request().post( Api.sendMsg, data: { 'msg[sender_uid]': senderUid, 'msg[receiver_id]': receiverId, 'msg[receiver_type]': 1, 'msg[msg_type]': 1, 'msg[msg_status]': 0, 'msg[content]': jsonEncode(content), 'msg[timestamp]': DateTime.now().millisecondsSinceEpoch ~/ 1000, 'msg[new_face_version]': 1, 'msg[dev_id]': getDevId(), 'from_firework': 0, 'build': 0, 'mobi_app': 'web', 'csrf_token': csrf, 'csrf': csrf, }, ); if (res.data['code'] == 0) { return { 'status': true, 'data': res.data['data'], }; } else { return {'status': false, 'date': [], 'msg': res.data['message']}; } } static String getDevId() { final List b = [ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' ]; final List s = "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".split(''); for (int i = 0; i < s.length; i++) { if ('-' == s[i] || '4' == s[i]) { continue; } final int randomInt = Random().nextInt(16); if ('x' == s[i]) { s[i] = b[randomInt]; } else { s[i] = b[3 & randomInt | 8]; } } return s.join(); } static Future removeSession({ int? talkerId, }) async { String csrf = await Request.getCsrf(); Map params = await WbiSign().makSign({ 'talker_id': talkerId, 'session_type': 1, 'build': 0, 'mobi_app': 'web', 'csrf_token': csrf, 'csrf': csrf }); var res = await Request().get(Api.removeSession, data: params); if (res.data['code'] == 0) { return { 'status': true, 'data': res.data['data'], }; } else { return {'status': false, 'date': [], 'msg': res.data['message']}; } } static Future unread() async { var res = await Request().get(Api.unread); if (res.data['code'] == 0) { return { 'status': true, 'data': res.data['data'], }; } else { return {'status': false, 'date': [], 'msg': res.data['message']}; } } // 回复我的 static Future messageReply({ int? id, int? replyTime, }) async { var params = { if (id != null) 'id': id, if (replyTime != null) 'reply_time': replyTime, }; var res = await Request().get(Api.messageReplyAPi, data: params); if (res.data['code'] == 0) { try { return { 'status': true, 'data': MessageReplyModel.fromJson(res.data['data']), }; } catch (err) { return {'status': false, 'date': [], 'msg': err.toString()}; } } else { return {'status': false, 'date': [], 'msg': res.data['message']}; } } // 收到的赞 static Future messageLike({ int? id, int? likeTime, }) async { var params = { if (id != null) 'id': id, if (likeTime != null) 'like_time': likeTime, }; var res = await Request().get(Api.messageLikeAPi, data: params); if (res.data['code'] == 0) { try { return { 'status': true, 'data': MessageLikeModel.fromJson(res.data['data']), }; } catch (err) { return {'status': false, 'date': [], 'msg': err.toString()}; } } else { return {'status': false, 'date': [], 'msg': res.data['message']}; } } static Future messageSystem() async { var res = await Request().get(Api.messageSystemAPi, data: { 'csrf': await Request.getCsrf(), 'page_size': 20, 'build': 0, 'mobi_app': 'web', }); if (res.data['code'] == 0) { try { return { 'status': true, 'data': res.data['data']['system_notify_list'] .map((e) => MessageSystemModel.fromJson(e)) .toList(), }; } catch (err) { return {'status': false, 'date': [], 'msg': err.toString()}; } } else { return {'status': false, 'date': [], 'msg': res.data['message']}; } } // 系统消息标记已读 static Future systemMarkRead(int cursor) async { String csrf = await Request.getCsrf(); var res = await Request().get(Api.systemMarkRead, data: { 'csrf': csrf, 'cursor': cursor, }); if (res.data['code'] == 0) { return { 'status': true, }; } else { return { 'status': false, 'msg': res.data['message'], }; } } static Future messageSystemAccount() async { var res = await Request().get(Api.userMessageSystemAPi, data: { 'csrf': await Request.getCsrf(), 'page_size': 20, 'build': 0, 'mobi_app': 'web', }); if (res.data['code'] == 0) { try { return { 'status': true, 'data': res.data['data']['system_notify_list'] .map((e) => MessageSystemModel.fromJson(e)) .toList(), }; } catch (err) { return {'status': false, 'date': [], 'msg': err.toString()}; } } else { return {'status': false, 'date': [], 'msg': res.data['message']}; } } } ================================================ FILE: lib/http/read.dart ================================================ import 'dart:convert'; import 'package:html/parser.dart'; import 'package:pilipala/models/read/opus.dart'; import 'package:pilipala/models/read/read.dart'; import 'package:pilipala/utils/wbi_sign.dart'; import 'index.dart'; class ReadHttp { static List extractScriptContents(String htmlContent) { RegExp scriptRegExp = RegExp(r' ================================================ FILE: web/manifest.json ================================================ { "name": "pilipala", "short_name": "pilipala", "start_url": ".", "display": "standalone", "background_color": "#0175C2", "theme_color": "#0175C2", "description": "A new Flutter project.", "orientation": "portrait-primary", "prefer_related_applications": false, "icons": [ { "src": "icons/Icon-192.png", "sizes": "192x192", "type": "image/png" }, { "src": "icons/Icon-512.png", "sizes": "512x512", "type": "image/png" }, { "src": "icons/Icon-maskable-192.png", "sizes": "192x192", "type": "image/png", "purpose": "maskable" }, { "src": "icons/Icon-maskable-512.png", "sizes": "512x512", "type": "image/png", "purpose": "maskable" } ] } ================================================ FILE: windows/.gitignore ================================================ flutter/ephemeral/ # Visual Studio user-specific files. *.suo *.user *.userosscache *.sln.docstates # Visual Studio build-related files. x64/ x86/ # Visual Studio cache files # files ending in .cache can be ignored *.[Cc]ache # but keep track of directories ending in .cache !*.[Cc]ache/ ================================================ FILE: windows/CMakeLists.txt ================================================ # Project-level configuration. cmake_minimum_required(VERSION 3.14) project(pilipala LANGUAGES CXX) # The name of the executable created for the application. Change this to change # the on-disk name of your application. set(BINARY_NAME "pilipala") # Explicitly opt in to modern CMake behaviors to avoid warnings with recent # versions of CMake. cmake_policy(SET CMP0063 NEW) # Define build configuration option. get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) if(IS_MULTICONFIG) set(CMAKE_CONFIGURATION_TYPES "Debug;Profile;Release" CACHE STRING "" FORCE) else() if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Flutter build mode" FORCE) set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Profile" "Release") endif() endif() # Define settings for the Profile build mode. set(CMAKE_EXE_LINKER_FLAGS_PROFILE "${CMAKE_EXE_LINKER_FLAGS_RELEASE}") set(CMAKE_SHARED_LINKER_FLAGS_PROFILE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE}") set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_RELEASE}") set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_RELEASE}") # Use Unicode for all projects. add_definitions(-DUNICODE -D_UNICODE) # Compilation settings that should be applied to most targets. # # Be cautious about adding new options here, as plugins use this function by # default. In most cases, you should add new options to specific targets instead # of modifying this function. function(APPLY_STANDARD_SETTINGS TARGET) target_compile_features(${TARGET} PUBLIC cxx_std_17) target_compile_options(${TARGET} PRIVATE /W4 /WX /wd"4100") target_compile_options(${TARGET} PRIVATE /EHsc) target_compile_definitions(${TARGET} PRIVATE "_HAS_EXCEPTIONS=0") target_compile_definitions(${TARGET} PRIVATE "$<$:_DEBUG>") endfunction() # Flutter library and tool build rules. set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") add_subdirectory(${FLUTTER_MANAGED_DIR}) # Application build; see runner/CMakeLists.txt. add_subdirectory("runner") # Generated plugin build rules, which manage building the plugins and adding # them to the application. include(flutter/generated_plugins.cmake) # === Installation === # Support files are copied into place next to the executable, so that it can # run in place. This is done instead of making a separate bundle (as on Linux) # so that building and running from within Visual Studio will work. set(BUILD_BUNDLE_DIR "$") # Make the "install" step default, as it's required to run. set(CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD 1) if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) endif() set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}") install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" COMPONENT Runtime) install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) if(PLUGIN_BUNDLED_LIBRARIES) install(FILES "${PLUGIN_BUNDLED_LIBRARIES}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) endif() # Fully re-copy the assets directory on each build to avoid having stale files # from a previous install. set(FLUTTER_ASSET_DIR_NAME "flutter_assets") install(CODE " file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") " COMPONENT Runtime) install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) # Install the AOT library on non-Debug builds only. install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" CONFIGURATIONS Profile;Release COMPONENT Runtime) ================================================ FILE: windows/flutter/CMakeLists.txt ================================================ # This file controls Flutter-level build steps. It should not be edited. cmake_minimum_required(VERSION 3.14) set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") # Configuration provided via flutter tool. include(${EPHEMERAL_DIR}/generated_config.cmake) # TODO: Move the rest of this into files in ephemeral. See # https://github.com/flutter/flutter/issues/57146. set(WRAPPER_ROOT "${EPHEMERAL_DIR}/cpp_client_wrapper") # === Flutter Library === set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/flutter_windows.dll") # Published to parent scope for install step. set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) set(AOT_LIBRARY "${PROJECT_DIR}/build/windows/app.so" PARENT_SCOPE) list(APPEND FLUTTER_LIBRARY_HEADERS "flutter_export.h" "flutter_windows.h" "flutter_messenger.h" "flutter_plugin_registrar.h" "flutter_texture_registrar.h" ) list(TRANSFORM FLUTTER_LIBRARY_HEADERS PREPEND "${EPHEMERAL_DIR}/") add_library(flutter INTERFACE) target_include_directories(flutter INTERFACE "${EPHEMERAL_DIR}" ) target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}.lib") add_dependencies(flutter flutter_assemble) # === Wrapper === list(APPEND CPP_WRAPPER_SOURCES_CORE "core_implementations.cc" "standard_codec.cc" ) list(TRANSFORM CPP_WRAPPER_SOURCES_CORE PREPEND "${WRAPPER_ROOT}/") list(APPEND CPP_WRAPPER_SOURCES_PLUGIN "plugin_registrar.cc" ) list(TRANSFORM CPP_WRAPPER_SOURCES_PLUGIN PREPEND "${WRAPPER_ROOT}/") list(APPEND CPP_WRAPPER_SOURCES_APP "flutter_engine.cc" "flutter_view_controller.cc" ) list(TRANSFORM CPP_WRAPPER_SOURCES_APP PREPEND "${WRAPPER_ROOT}/") # Wrapper sources needed for a plugin. add_library(flutter_wrapper_plugin STATIC ${CPP_WRAPPER_SOURCES_CORE} ${CPP_WRAPPER_SOURCES_PLUGIN} ) apply_standard_settings(flutter_wrapper_plugin) set_target_properties(flutter_wrapper_plugin PROPERTIES POSITION_INDEPENDENT_CODE ON) set_target_properties(flutter_wrapper_plugin PROPERTIES CXX_VISIBILITY_PRESET hidden) target_link_libraries(flutter_wrapper_plugin PUBLIC flutter) target_include_directories(flutter_wrapper_plugin PUBLIC "${WRAPPER_ROOT}/include" ) add_dependencies(flutter_wrapper_plugin flutter_assemble) # Wrapper sources needed for the runner. add_library(flutter_wrapper_app STATIC ${CPP_WRAPPER_SOURCES_CORE} ${CPP_WRAPPER_SOURCES_APP} ) apply_standard_settings(flutter_wrapper_app) target_link_libraries(flutter_wrapper_app PUBLIC flutter) target_include_directories(flutter_wrapper_app PUBLIC "${WRAPPER_ROOT}/include" ) add_dependencies(flutter_wrapper_app flutter_assemble) # === Flutter tool backend === # _phony_ is a non-existent file to force this command to run every time, # since currently there's no way to get a full input/output list from the # flutter tool. set(PHONY_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/_phony_") set_source_files_properties("${PHONY_OUTPUT}" PROPERTIES SYMBOLIC TRUE) add_custom_command( OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} ${CPP_WRAPPER_SOURCES_CORE} ${CPP_WRAPPER_SOURCES_PLUGIN} ${CPP_WRAPPER_SOURCES_APP} ${PHONY_OUTPUT} COMMAND ${CMAKE_COMMAND} -E env ${FLUTTER_TOOL_ENVIRONMENT} "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.bat" windows-x64 $ VERBATIM ) add_custom_target(flutter_assemble DEPENDS "${FLUTTER_LIBRARY}" ${FLUTTER_LIBRARY_HEADERS} ${CPP_WRAPPER_SOURCES_CORE} ${CPP_WRAPPER_SOURCES_PLUGIN} ${CPP_WRAPPER_SOURCES_APP} ) ================================================ FILE: windows/runner/CMakeLists.txt ================================================ cmake_minimum_required(VERSION 3.14) project(runner LANGUAGES CXX) # Define the application target. To change its name, change BINARY_NAME in the # top-level CMakeLists.txt, not the value here, or `flutter run` will no longer # work. # # Any new source files that you add to the application should be added here. add_executable(${BINARY_NAME} WIN32 "flutter_window.cpp" "main.cpp" "utils.cpp" "win32_window.cpp" "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" "Runner.rc" "runner.exe.manifest" ) # Apply the standard set of build settings. This can be removed for applications # that need different build settings. apply_standard_settings(${BINARY_NAME}) # Add preprocessor definitions for the build version. target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION=\"${FLUTTER_VERSION}\"") target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MAJOR=${FLUTTER_VERSION_MAJOR}") target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MINOR=${FLUTTER_VERSION_MINOR}") target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_PATCH=${FLUTTER_VERSION_PATCH}") target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_BUILD=${FLUTTER_VERSION_BUILD}") # Disable Windows macros that collide with C++ standard library functions. target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX") # Add dependency libraries and include directories. Add any application-specific # dependencies here. target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app) target_link_libraries(${BINARY_NAME} PRIVATE "dwmapi.lib") target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") # Run the Flutter tool portions of the build. This must not be removed. add_dependencies(${BINARY_NAME} flutter_assemble) ================================================ FILE: windows/runner/Runner.rc ================================================ // Microsoft Visual C++ generated resource script. // #pragma code_page(65001) #include "resource.h" #define APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// // // Generated from the TEXTINCLUDE 2 resource. // #include "winres.h" ///////////////////////////////////////////////////////////////////////////// #undef APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// // English (United States) resources #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US #ifdef APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// // // TEXTINCLUDE // 1 TEXTINCLUDE BEGIN "resource.h\0" END 2 TEXTINCLUDE BEGIN "#include ""winres.h""\r\n" "\0" END 3 TEXTINCLUDE BEGIN "\r\n" "\0" END #endif // APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// // // Icon // // Icon with lowest ID value placed first to ensure application icon // remains consistent on all systems. IDI_APP_ICON ICON "resources\\app_icon.ico" ///////////////////////////////////////////////////////////////////////////// // // Version // #if defined(FLUTTER_VERSION_MAJOR) && defined(FLUTTER_VERSION_MINOR) && defined(FLUTTER_VERSION_PATCH) && defined(FLUTTER_VERSION_BUILD) #define VERSION_AS_NUMBER FLUTTER_VERSION_MAJOR,FLUTTER_VERSION_MINOR,FLUTTER_VERSION_PATCH,FLUTTER_VERSION_BUILD #else #define VERSION_AS_NUMBER 1,0,0,0 #endif #if defined(FLUTTER_VERSION) #define VERSION_AS_STRING FLUTTER_VERSION #else #define VERSION_AS_STRING "1.0.0" #endif VS_VERSION_INFO VERSIONINFO FILEVERSION VERSION_AS_NUMBER PRODUCTVERSION VERSION_AS_NUMBER FILEFLAGSMASK VS_FFI_FILEFLAGSMASK #ifdef _DEBUG FILEFLAGS VS_FF_DEBUG #else FILEFLAGS 0x0L #endif FILEOS VOS__WINDOWS32 FILETYPE VFT_APP FILESUBTYPE 0x0L BEGIN BLOCK "StringFileInfo" BEGIN BLOCK "040904e4" BEGIN VALUE "CompanyName", "com.example" "\0" VALUE "FileDescription", "pilipala" "\0" VALUE "FileVersion", VERSION_AS_STRING "\0" VALUE "InternalName", "pilipala" "\0" VALUE "LegalCopyright", "Copyright (C) 2023 com.example. All rights reserved." "\0" VALUE "OriginalFilename", "pilipala.exe" "\0" VALUE "ProductName", "pilipala" "\0" VALUE "ProductVersion", VERSION_AS_STRING "\0" END END BLOCK "VarFileInfo" BEGIN VALUE "Translation", 0x409, 1252 END END #endif // English (United States) resources ///////////////////////////////////////////////////////////////////////////// #ifndef APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// // // Generated from the TEXTINCLUDE 3 resource. // ///////////////////////////////////////////////////////////////////////////// #endif // not APSTUDIO_INVOKED ================================================ FILE: windows/runner/flutter_window.cpp ================================================ #include "flutter_window.h" #include #include "flutter/generated_plugin_registrant.h" FlutterWindow::FlutterWindow(const flutter::DartProject& project) : project_(project) {} FlutterWindow::~FlutterWindow() {} bool FlutterWindow::OnCreate() { if (!Win32Window::OnCreate()) { return false; } RECT frame = GetClientArea(); // The size here must match the window dimensions to avoid unnecessary surface // creation / destruction in the startup path. flutter_controller_ = std::make_unique( frame.right - frame.left, frame.bottom - frame.top, project_); // Ensure that basic setup of the controller was successful. if (!flutter_controller_->engine() || !flutter_controller_->view()) { return false; } RegisterPlugins(flutter_controller_->engine()); SetChildContent(flutter_controller_->view()->GetNativeWindow()); flutter_controller_->engine()->SetNextFrameCallback([&]() { this->Show(); }); return true; } void FlutterWindow::OnDestroy() { if (flutter_controller_) { flutter_controller_ = nullptr; } Win32Window::OnDestroy(); } LRESULT FlutterWindow::MessageHandler(HWND hwnd, UINT const message, WPARAM const wparam, LPARAM const lparam) noexcept { // Give Flutter, including plugins, an opportunity to handle window messages. if (flutter_controller_) { std::optional result = flutter_controller_->HandleTopLevelWindowProc(hwnd, message, wparam, lparam); if (result) { return *result; } } switch (message) { case WM_FONTCHANGE: flutter_controller_->engine()->ReloadSystemFonts(); break; } return Win32Window::MessageHandler(hwnd, message, wparam, lparam); } ================================================ FILE: windows/runner/flutter_window.h ================================================ #ifndef RUNNER_FLUTTER_WINDOW_H_ #define RUNNER_FLUTTER_WINDOW_H_ #include #include #include #include "win32_window.h" // A window that does nothing but host a Flutter view. class FlutterWindow : public Win32Window { public: // Creates a new FlutterWindow hosting a Flutter view running |project|. explicit FlutterWindow(const flutter::DartProject& project); virtual ~FlutterWindow(); protected: // Win32Window: bool OnCreate() override; void OnDestroy() override; LRESULT MessageHandler(HWND window, UINT const message, WPARAM const wparam, LPARAM const lparam) noexcept override; private: // The project to run. flutter::DartProject project_; // The Flutter instance hosted by this window. std::unique_ptr flutter_controller_; }; #endif // RUNNER_FLUTTER_WINDOW_H_ ================================================ FILE: windows/runner/main.cpp ================================================ #include #include #include #include "flutter_window.h" #include "utils.h" int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev, _In_ wchar_t *command_line, _In_ int show_command) { // Attach to console when present (e.g., 'flutter run') or create a // new console when running with a debugger. if (!::AttachConsole(ATTACH_PARENT_PROCESS) && ::IsDebuggerPresent()) { CreateAndAttachConsole(); } // Initialize COM, so that it is available for use in the library and/or // plugins. ::CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED); flutter::DartProject project(L"data"); std::vector command_line_arguments = GetCommandLineArguments(); project.set_dart_entrypoint_arguments(std::move(command_line_arguments)); FlutterWindow window(project); Win32Window::Point origin(10, 10); Win32Window::Size size(1280, 720); if (!window.Create(L"pilipala", origin, size)) { return EXIT_FAILURE; } window.SetQuitOnClose(true); ::MSG msg; while (::GetMessage(&msg, nullptr, 0, 0)) { ::TranslateMessage(&msg); ::DispatchMessage(&msg); } ::CoUninitialize(); return EXIT_SUCCESS; } ================================================ FILE: windows/runner/resource.h ================================================ //{{NO_DEPENDENCIES}} // Microsoft Visual C++ generated include file. // Used by Runner.rc // #define IDI_APP_ICON 101 // Next default values for new objects // #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 102 #define _APS_NEXT_COMMAND_VALUE 40001 #define _APS_NEXT_CONTROL_VALUE 1001 #define _APS_NEXT_SYMED_VALUE 101 #endif #endif ================================================ FILE: windows/runner/runner.exe.manifest ================================================ PerMonitorV2 ================================================ FILE: windows/runner/utils.cpp ================================================ #include "utils.h" #include #include #include #include #include void CreateAndAttachConsole() { if (::AllocConsole()) { FILE *unused; if (freopen_s(&unused, "CONOUT$", "w", stdout)) { _dup2(_fileno(stdout), 1); } if (freopen_s(&unused, "CONOUT$", "w", stderr)) { _dup2(_fileno(stdout), 2); } std::ios::sync_with_stdio(); FlutterDesktopResyncOutputStreams(); } } std::vector GetCommandLineArguments() { // Convert the UTF-16 command line arguments to UTF-8 for the Engine to use. int argc; wchar_t** argv = ::CommandLineToArgvW(::GetCommandLineW(), &argc); if (argv == nullptr) { return std::vector(); } std::vector command_line_arguments; // Skip the first argument as it's the binary name. for (int i = 1; i < argc; i++) { command_line_arguments.push_back(Utf8FromUtf16(argv[i])); } ::LocalFree(argv); return command_line_arguments; } std::string Utf8FromUtf16(const wchar_t* utf16_string) { if (utf16_string == nullptr) { return std::string(); } int target_length = ::WideCharToMultiByte( CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, -1, nullptr, 0, nullptr, nullptr); std::string utf8_string; if (target_length == 0 || target_length > utf8_string.max_size()) { return utf8_string; } utf8_string.resize(target_length); int converted_length = ::WideCharToMultiByte( CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, -1, utf8_string.data(), target_length, nullptr, nullptr); if (converted_length == 0) { return std::string(); } return utf8_string; } ================================================ FILE: windows/runner/utils.h ================================================ #ifndef RUNNER_UTILS_H_ #define RUNNER_UTILS_H_ #include #include // Creates a console for the process, and redirects stdout and stderr to // it for both the runner and the Flutter library. void CreateAndAttachConsole(); // Takes a null-terminated wchar_t* encoded in UTF-16 and returns a std::string // encoded in UTF-8. Returns an empty std::string on failure. std::string Utf8FromUtf16(const wchar_t* utf16_string); // Gets the command line arguments passed in as a std::vector, // encoded in UTF-8. Returns an empty std::vector on failure. std::vector GetCommandLineArguments(); #endif // RUNNER_UTILS_H_ ================================================ FILE: windows/runner/win32_window.cpp ================================================ #include "win32_window.h" #include #include #include "resource.h" namespace { /// Window attribute that enables dark mode window decorations. /// /// Redefined in case the developer's machine has a Windows SDK older than /// version 10.0.22000.0. /// See: https://docs.microsoft.com/windows/win32/api/dwmapi/ne-dwmapi-dwmwindowattribute #ifndef DWMWA_USE_IMMERSIVE_DARK_MODE #define DWMWA_USE_IMMERSIVE_DARK_MODE 20 #endif constexpr const wchar_t kWindowClassName[] = L"FLUTTER_RUNNER_WIN32_WINDOW"; /// Registry key for app theme preference. /// /// A value of 0 indicates apps should use dark mode. A non-zero or missing /// value indicates apps should use light mode. constexpr const wchar_t kGetPreferredBrightnessRegKey[] = L"Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize"; constexpr const wchar_t kGetPreferredBrightnessRegValue[] = L"AppsUseLightTheme"; // The number of Win32Window objects that currently exist. static int g_active_window_count = 0; using EnableNonClientDpiScaling = BOOL __stdcall(HWND hwnd); // Scale helper to convert logical scaler values to physical using passed in // scale factor int Scale(int source, double scale_factor) { return static_cast(source * scale_factor); } // Dynamically loads the |EnableNonClientDpiScaling| from the User32 module. // This API is only needed for PerMonitor V1 awareness mode. void EnableFullDpiSupportIfAvailable(HWND hwnd) { HMODULE user32_module = LoadLibraryA("User32.dll"); if (!user32_module) { return; } auto enable_non_client_dpi_scaling = reinterpret_cast( GetProcAddress(user32_module, "EnableNonClientDpiScaling")); if (enable_non_client_dpi_scaling != nullptr) { enable_non_client_dpi_scaling(hwnd); } FreeLibrary(user32_module); } } // namespace // Manages the Win32Window's window class registration. class WindowClassRegistrar { public: ~WindowClassRegistrar() = default; // Returns the singleton registar instance. static WindowClassRegistrar* GetInstance() { if (!instance_) { instance_ = new WindowClassRegistrar(); } return instance_; } // Returns the name of the window class, registering the class if it hasn't // previously been registered. const wchar_t* GetWindowClass(); // Unregisters the window class. Should only be called if there are no // instances of the window. void UnregisterWindowClass(); private: WindowClassRegistrar() = default; static WindowClassRegistrar* instance_; bool class_registered_ = false; }; WindowClassRegistrar* WindowClassRegistrar::instance_ = nullptr; const wchar_t* WindowClassRegistrar::GetWindowClass() { if (!class_registered_) { WNDCLASS window_class{}; window_class.hCursor = LoadCursor(nullptr, IDC_ARROW); window_class.lpszClassName = kWindowClassName; window_class.style = CS_HREDRAW | CS_VREDRAW; window_class.cbClsExtra = 0; window_class.cbWndExtra = 0; window_class.hInstance = GetModuleHandle(nullptr); window_class.hIcon = LoadIcon(window_class.hInstance, MAKEINTRESOURCE(IDI_APP_ICON)); window_class.hbrBackground = 0; window_class.lpszMenuName = nullptr; window_class.lpfnWndProc = Win32Window::WndProc; RegisterClass(&window_class); class_registered_ = true; } return kWindowClassName; } void WindowClassRegistrar::UnregisterWindowClass() { UnregisterClass(kWindowClassName, nullptr); class_registered_ = false; } Win32Window::Win32Window() { ++g_active_window_count; } Win32Window::~Win32Window() { --g_active_window_count; Destroy(); } bool Win32Window::Create(const std::wstring& title, const Point& origin, const Size& size) { Destroy(); const wchar_t* window_class = WindowClassRegistrar::GetInstance()->GetWindowClass(); const POINT target_point = {static_cast(origin.x), static_cast(origin.y)}; HMONITOR monitor = MonitorFromPoint(target_point, MONITOR_DEFAULTTONEAREST); UINT dpi = FlutterDesktopGetDpiForMonitor(monitor); double scale_factor = dpi / 96.0; HWND window = CreateWindow( window_class, title.c_str(), WS_OVERLAPPEDWINDOW, Scale(origin.x, scale_factor), Scale(origin.y, scale_factor), Scale(size.width, scale_factor), Scale(size.height, scale_factor), nullptr, nullptr, GetModuleHandle(nullptr), this); if (!window) { return false; } UpdateTheme(window); return OnCreate(); } bool Win32Window::Show() { return ShowWindow(window_handle_, SW_SHOWNORMAL); } // static LRESULT CALLBACK Win32Window::WndProc(HWND const window, UINT const message, WPARAM const wparam, LPARAM const lparam) noexcept { if (message == WM_NCCREATE) { auto window_struct = reinterpret_cast(lparam); SetWindowLongPtr(window, GWLP_USERDATA, reinterpret_cast(window_struct->lpCreateParams)); auto that = static_cast(window_struct->lpCreateParams); EnableFullDpiSupportIfAvailable(window); that->window_handle_ = window; } else if (Win32Window* that = GetThisFromHandle(window)) { return that->MessageHandler(window, message, wparam, lparam); } return DefWindowProc(window, message, wparam, lparam); } LRESULT Win32Window::MessageHandler(HWND hwnd, UINT const message, WPARAM const wparam, LPARAM const lparam) noexcept { switch (message) { case WM_DESTROY: window_handle_ = nullptr; Destroy(); if (quit_on_close_) { PostQuitMessage(0); } return 0; case WM_DPICHANGED: { auto newRectSize = reinterpret_cast(lparam); LONG newWidth = newRectSize->right - newRectSize->left; LONG newHeight = newRectSize->bottom - newRectSize->top; SetWindowPos(hwnd, nullptr, newRectSize->left, newRectSize->top, newWidth, newHeight, SWP_NOZORDER | SWP_NOACTIVATE); return 0; } case WM_SIZE: { RECT rect = GetClientArea(); if (child_content_ != nullptr) { // Size and position the child window. MoveWindow(child_content_, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, TRUE); } return 0; } case WM_ACTIVATE: if (child_content_ != nullptr) { SetFocus(child_content_); } return 0; case WM_DWMCOLORIZATIONCOLORCHANGED: UpdateTheme(hwnd); return 0; } return DefWindowProc(window_handle_, message, wparam, lparam); } void Win32Window::Destroy() { OnDestroy(); if (window_handle_) { DestroyWindow(window_handle_); window_handle_ = nullptr; } if (g_active_window_count == 0) { WindowClassRegistrar::GetInstance()->UnregisterWindowClass(); } } Win32Window* Win32Window::GetThisFromHandle(HWND const window) noexcept { return reinterpret_cast( GetWindowLongPtr(window, GWLP_USERDATA)); } void Win32Window::SetChildContent(HWND content) { child_content_ = content; SetParent(content, window_handle_); RECT frame = GetClientArea(); MoveWindow(content, frame.left, frame.top, frame.right - frame.left, frame.bottom - frame.top, true); SetFocus(child_content_); } RECT Win32Window::GetClientArea() { RECT frame; GetClientRect(window_handle_, &frame); return frame; } HWND Win32Window::GetHandle() { return window_handle_; } void Win32Window::SetQuitOnClose(bool quit_on_close) { quit_on_close_ = quit_on_close; } bool Win32Window::OnCreate() { // No-op; provided for subclasses. return true; } void Win32Window::OnDestroy() { // No-op; provided for subclasses. } void Win32Window::UpdateTheme(HWND const window) { DWORD light_mode; DWORD light_mode_size = sizeof(light_mode); LSTATUS result = RegGetValue(HKEY_CURRENT_USER, kGetPreferredBrightnessRegKey, kGetPreferredBrightnessRegValue, RRF_RT_REG_DWORD, nullptr, &light_mode, &light_mode_size); if (result == ERROR_SUCCESS) { BOOL enable_dark_mode = light_mode == 0; DwmSetWindowAttribute(window, DWMWA_USE_IMMERSIVE_DARK_MODE, &enable_dark_mode, sizeof(enable_dark_mode)); } } ================================================ FILE: windows/runner/win32_window.h ================================================ #ifndef RUNNER_WIN32_WINDOW_H_ #define RUNNER_WIN32_WINDOW_H_ #include #include #include #include // A class abstraction for a high DPI-aware Win32 Window. Intended to be // inherited from by classes that wish to specialize with custom // rendering and input handling class Win32Window { public: struct Point { unsigned int x; unsigned int y; Point(unsigned int x, unsigned int y) : x(x), y(y) {} }; struct Size { unsigned int width; unsigned int height; Size(unsigned int width, unsigned int height) : width(width), height(height) {} }; Win32Window(); virtual ~Win32Window(); // Creates a win32 window with |title| that is positioned and sized using // |origin| and |size|. New windows are created on the default monitor. Window // sizes are specified to the OS in physical pixels, hence to ensure a // consistent size this function will scale the inputted width and height as // as appropriate for the default monitor. The window is invisible until // |Show| is called. Returns true if the window was created successfully. bool Create(const std::wstring& title, const Point& origin, const Size& size); // Show the current window. Returns true if the window was successfully shown. bool Show(); // Release OS resources associated with window. void Destroy(); // Inserts |content| into the window tree. void SetChildContent(HWND content); // Returns the backing Window handle to enable clients to set icon and other // window properties. Returns nullptr if the window has been destroyed. HWND GetHandle(); // If true, closing this window will quit the application. void SetQuitOnClose(bool quit_on_close); // Return a RECT representing the bounds of the current client area. RECT GetClientArea(); protected: // Processes and route salient window messages for mouse handling, // size change and DPI. Delegates handling of these to member overloads that // inheriting classes can handle. virtual LRESULT MessageHandler(HWND window, UINT const message, WPARAM const wparam, LPARAM const lparam) noexcept; // Called when CreateAndShow is called, allowing subclass window-related // setup. Subclasses should return false if setup fails. virtual bool OnCreate(); // Called when Destroy is called. virtual void OnDestroy(); private: friend class WindowClassRegistrar; // OS callback called by message pump. Handles the WM_NCCREATE message which // is passed when the non-client area is being created and enables automatic // non-client DPI scaling so that the non-client area automatically // responsponds to changes in DPI. All other messages are handled by // MessageHandler. static LRESULT CALLBACK WndProc(HWND const window, UINT const message, WPARAM const wparam, LPARAM const lparam) noexcept; // Retrieves a class instance pointer for |window| static Win32Window* GetThisFromHandle(HWND const window) noexcept; // Update the window frame's theme to match the system theme. static void UpdateTheme(HWND const window); bool quit_on_close_ = false; // window handle for top level window. HWND window_handle_ = nullptr; // window handle for hosted content. HWND child_content_ = nullptr; }; #endif // RUNNER_WIN32_WINDOW_H_