Image preview method, device, equipment and readable storage medium based on Flutter
By using the native platform's face recognition function on the Flutter platform to cut and store the pictures in a sandbox, the problem of slow display of preview images is solved, and faster loading efficiency is achieved.
Patent Information
- Application Number
- CN202211442504.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-16
- Publication Date
- 2025-09-02
- Estimated Expiration
- 2042-11-16
AI Technical Summary
In the prior art, the preview picture display speed is slow, mainly due to the high memory usage rate.
Use the face recognition function of the native platform to cut and store the pictures in the sandbox to avoid taking up too much memory and obtain preview pictures through the sandbox address.
It improves the display speed of preview pictures, reduces memory usage, and improves loading efficiency.
Smart Images

Figure CN115842956B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and more specifically, to a Flutter-based image preview method, apparatus, device, and readable storage medium. Background Art
[0002] As more and more users choose to take photos to record their beautiful lives, the number of photos per user is increasing. To streamline their photos, users generally choose to clean up photos they are not satisfied with. In the process of identifying unsatisfactory photos, users generally choose to preview each photo to improve efficiency. In the prior art, when providing preview images to users, the generated preview images need to be converted into byte data and loaded. However, this method consumes a large amount of memory resources. Due to the high memory usage, the preview images will display too slowly. Therefore, how to improve the display speed of preview images has become a focus of attention. Summary of the Invention
[0003] In view of this, the present application provides a Flutter-based image preview method, apparatus, device, and readable storage medium for improving the display speed of preview images.
[0004] In order to achieve the above objectives, the following solutions are proposed:
[0005] A Flutter-based image preview method includes:
[0006] When a picture needs to be displayed, a display request is generated, wherein the display request includes the address of the picture, and the picture includes a face image;
[0007] Sending the display request to the native platform, so that the native platform performs face recognition on the image based on the display request to obtain a recognition result, and cutting the image according to the recognition result and the display request to obtain a preview image, and storing the preview image in a sandbox;
[0008] Receive the sandbox address corresponding to the preview image returned by the native platform;
[0009] According to the sandbox address, the preview image is obtained and displayed.
[0010] Optionally, when the display request includes addresses of multiple pictures, the display request also includes the priority of each picture;
[0011] When an image needs to be displayed, a display request is generated, including:
[0012] When multiple pictures need to be displayed in sequence, determine the priority of each picture;
[0013] Get the address of each picture and map the address of each picture to the priority of the picture;
[0014] Based on the address and priority of each picture, a display request is generated.
[0015] Optionally, the display request further includes a urlKey identifier corresponding to the address of the image;
[0016] When an image needs to be displayed, a display request is generated, including:
[0017] When a picture needs to be displayed, obtain the address of the picture and the unique identifier of the picture;
[0018] Generate a urlKey identifier corresponding to the image according to the address of the image and the unique identifier;
[0019] Based on the address of the picture and the urlKey identifier, a display request is generated so that the native platform sends the urlKey identifier of the picture corresponding to the preview picture and the sandbox address in correspondence.
[0020] Optionally, obtaining the preview image and displaying the preview image according to the sandbox address includes:
[0021] Determine the target urlKey identifier of the image that needs to be displayed;
[0022] According to the target sandbox address corresponding to the target urlKey identifier, the target preview image corresponding to the image currently to be displayed is obtained and displayed.
[0023] Optionally, obtaining and displaying a target preview image corresponding to the image currently to be displayed according to the target sandbox address corresponding to the target urlKey identifier includes:
[0024] Use Image Provider to create an image loading framework;
[0025] The target preview image is displayed and cached using the image loading framework and the target sandbox address corresponding to the target urlKey identifier.
[0026] Optionally, sending the display request to the native platform includes:
[0027] Sending the display request to the native platform through a pre-created processing channel;
[0028] Receiving the sandbox address corresponding to the preview image returned by the native platform includes:
[0029] The sandbox address corresponding to the preview image returned by the native platform is received through the processing channel.
[0030] A Flutter-based image preview device, comprising:
[0031] a generating unit, configured to generate a display request when a picture needs to be displayed, wherein the display request includes an address of the picture, and the picture includes a face image;
[0032] a sending unit, configured to send the display request to the native platform, so that the native platform performs face recognition on the image based on the display request to obtain a recognition result, and cuts the image according to the recognition result and the display request to obtain a preview image, and stores the preview image in a sandbox;
[0033] A receiving unit, configured to receive a sandbox address corresponding to the preview image returned by the native platform;
[0034] An acquiring unit is configured to acquire the preview image according to the sandbox address and display the preview image.
[0035] A Flutter-based image preview device, comprising a memory and a processor;
[0036] The memory is used to store programs;
[0037] The processor is used to execute the program to implement the above-mentioned steps of the Flutter-based image preview method.
[0038] A readable storage medium stores a computer program thereon. When the computer program is executed by a processor, the computer program implements the steps of the above-mentioned Flutter-based image preview method.
[0039] From the above technical solution, it can be seen that the image preview method based on Flutter provided in this application needs to be applied to the Flutter platform. When a picture needs to be displayed, a display request is generated, and the display request includes the address of the picture, and the picture contains a face image. In this way, Flutter, as a cross-platform development technology, can obtain the address of the local picture and the address of the cloud picture; the display request is sent to the native platform for the native platform to perform face recognition on the picture based on the display request, obtain the recognition result, and cut the picture according to the recognition result and the display request to obtain a preview picture, and store the preview picture in a sandbox; receive the sandbox address corresponding to the preview picture returned by the native platform; in this way, the face recognition function of the native platform itself can be used to perform face recognition on the picture, so as to better obtain the preview picture; according to the sandbox address, the preview picture is obtained and displayed, and the preview picture is stored in the sandbox, which does not take up too much memory, and by storing the preview picture in the sandbox, the process of loading the picture data stream is omitted, which can speed up the picture loading efficiency. It can be seen that this application can improve the display speed of the preview picture. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are merely embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without any creative work.
[0041] Figure 1 This is a flowchart of a Flutter-based image preview method disclosed in an embodiment of the present application;
[0042] Figure 2 This is a structural diagram of a Flutter-based image preview device disclosed in an embodiment of the present application;
[0043] Figure 3 This is a hardware structure block diagram of a Flutter-based image preview device disclosed in an embodiment of the present application. DETAILED DESCRIPTION
[0044] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0045] The Flutter-based image preview method provided in this application can be applied to the Flutter platform, which can be deployed in a variety of general-purpose or specialized computing device environments or configurations equipped with a sandbox mechanism. For example, personal computers, server computers, handheld or portable devices, tablet devices, multi-processor devices, and distributed computing environments that include any of the above devices or devices.
[0046] Among them, Flutter is Google's mobile UI framework, which can quickly build high-quality native user interfaces on native platforms.
[0047] The native platform can be iOS or Android.
[0048] Next, combine Figure 1 This application's Flutter-based image preview method is described in detail, including the following steps:
[0049] Step S1: When a picture needs to be displayed, a display request is generated.
[0050] Specifically, when the user needs to preview each picture, a display request is generated. The display request may include the address of each picture that needs to be previewed, and may also include the configuration information required by the native platform in the process of generating preview pictures. The configuration information may include information such as face recognition range and picture recognition range.
[0051] Each image can be stored in the cloud, and the address of each image in the cloud server can be obtained.
[0052] The pictures may be pictures of tourists, people, or other people, including pictures containing facial images.
[0053] Step S2: Send the display request to the native platform.
[0054] Specifically, a display request can be sent to the native platform so that the native platform can obtain the picture corresponding to each address in the display request, and perform face recognition on each picture to obtain a recognition result. The recognition result may include a face range. According to the face range corresponding to each picture and the configuration information in the display request, the picture cutting area of each picture is determined, and the picture is cut according to the picture cutting area corresponding to the picture. The cut picture is the preview picture corresponding to the picture. After obtaining the preview picture, the preview picture can be stored in the sandbox.
[0055] Among them, you can use VN Detect Face Rectangles Request for face recognition and use CGImage Create With Image In Rect for cutting.
[0056] The sandbox is located locally on the client. It is a defense mechanism. Each application has a corresponding sandbox, and each sandbox is isolated from each other.
[0057] Step S3: Receive the sandbox address corresponding to the preview image returned by the native platform.
[0058] Specifically, after sending a display request, a sandbox address returned by the native platform can be received. The image corresponding to the sandbox address is a preview image, which corresponds to the image to be displayed and is obtained by cutting the image to be displayed.
[0059] Step S4: According to the sandbox address, obtain the preview image and display the preview image.
[0060] Specifically, the sandbox address can be used as a key to read the preview image in the sandbox, and the preview image can be displayed after reading.
[0061] As can be seen from the above technical solutions, the embodiment of the present application provides a Flutter-based image preview method that can use the native platform's own face recognition function to perform face recognition on images, thereby better obtaining preview images and storing preview images in a sandbox without taking up too much memory. Moreover, by storing preview images in a sandbox, the process of loading the image data stream is omitted, which can speed up the image loading efficiency. It can be seen that the present application can improve the display speed of preview images.
[0062] Moreover, the application can send a display request and receive the sandbox address corresponding to the previous display request at the same time, and the generation of the preview image and the sending of the request and the receiving of the sandbox address are performed asynchronously, thereby further accelerating the loading speed of the preview image.
[0063] In some embodiments of the present application, taking into account that pictures that users are more concerned about can be processed first to improve the flexibility of the present application, based on this, step S1, the process of generating a display request when a picture needs to be displayed, is described in detail. The steps are as follows:
[0064] S10: When multiple pictures need to be displayed in sequence, determine the priority of each picture.
[0065] Specifically, the user may need to preview multiple pictures. At this time, the display request can include the addresses of multiple pictures. Considering that the pictures that the user is more concerned about or views first can be loaded and processed first, the priority of each picture can be determined, thereby improving the flexibility of this application.
[0066] The priority of each picture can be determined based on the order of the pictures in the album, the possibility of the user selecting the picture, and whether the picture is the picture currently selected for preview by the user, thereby obtaining the priority of each picture.
[0067] S11. Obtain the address of each picture, and associate the address of each picture with the priority of the picture.
[0068] Specifically, the address of each picture can be obtained, each address corresponds to each picture one-to-one, and each address corresponds to each priority one-to-one. According to the correspondence between the address and the picture and the correspondence between the address and the priority, the correspondence between each address and the priority is established.
[0069] S12: Generate a display request based on the address and priority of each picture.
[0070] Specifically, a display request can be generated based on each address and its corresponding priority in a variety of ways. For example, the display request may include each address and its corresponding priority, so that the native platform can compare the priorities and determine the processing order of the images corresponding to each address based on the comparison results, thereby giving priority to the images corresponding to the addresses with higher priorities. For another example, the display request can also sort the addresses in order of priority. The higher the priority, the higher the ranking in the display request, so that the native platform can give priority to the images corresponding to the addresses with higher priorities according to the ranking in the display request.
[0071] It can be seen from the above technical solution that this embodiment provides an optional method for generating a display request. Through the above method, pictures with higher priority can be processed first according to actual conditions, thereby giving priority to displaying preview pictures corresponding to pictures with higher priority, thereby increasing the flexibility and practicality of this application and improving the smoothness of loading preview pictures.
[0072] In some embodiments of the present application, considering the need to ensure the correspondence between each image and the preview image during the display of preview images, an identifier can be added to the display request to ensure a one-to-one correspondence between each image and each preview image. Next, the process of adding an identifier to the display request will be described in detail, that is, the process of generating a display request in step S1 when a picture needs to be displayed will be described in detail. The steps are as follows:
[0073] S10. When a picture needs to be displayed, the address of the picture and the unique identifier of the picture are obtained.
[0074] Specifically, the address of each image and the unique identifier of the image on the cloud server can be obtained.
[0075] S11. Generate a urlKey identifier corresponding to the image according to the address of the image and the unique identifier.
[0076] Specifically, the urlKey identifier corresponding to each image can be generated according to the address of the image and its corresponding identifier.
[0077] S12: Based on the address of the picture and the urlKey identifier, generate a display request so that the native platform sends the urlKey identifier of the picture corresponding to the preview picture and the sandbox address in correspondence.
[0078] Specifically, a display request can be generated corresponding to the address of each image and its corresponding urlKey identifier, so that the display request contains a one-to-one correspondence between the address of each image and each urlKey identifier, so that the native platform can determine the correspondence between each address and each urlKey identifier from the display request, and establish a correspondence between the sandbox address and the urlKey identifier based on the correspondence.
[0079] It can be seen from the above technical solution that this embodiment provides another optional method for generating a display request. Through the above method, the generated display request can indicate the urlKey identifier corresponding to the address of each picture, so that when the native platform returns the sandbox address, the sandbox address and the corresponding urlKey identifier can be returned in correspondence, ensuring the correspondence between each picture and the preview picture, thereby improving the reliability of this application.
[0080] In some embodiments of the present application, the process of obtaining the preview image and displaying the preview image according to the sandbox address in step S4 is described in detail, and the steps are as follows:
[0081] S40: Determine the target urlKey identifier of the picture currently to be displayed.
[0082] Specifically, in response to the user's operation of selecting a picture, the picture selected by the user can be used as the picture currently to be displayed, and the address and identifier of the picture can be obtained, the urlKey identifier of the picture can be generated, and the urlKey identifier of the picture can be used as the target urlKey identifier.
[0083] S41. According to the target sandbox address corresponding to the target urlKey identifier, obtain and display the target preview image corresponding to the image currently to be displayed.
[0084] Specifically, the information returned by the native platform can be analyzed to determine the sandbox address returned corresponding to the target urlKey identifier, and the sandbox address can be used as the target sandbox address. Using the target sandbox address as the key, a preview image can be obtained from the sandbox, and the obtained preview image can be used as the target preview image.
[0085] A preview image of the target may be displayed on the display interface.
[0086] It can be seen from the above technical solution that this embodiment provides an optional method for displaying preview pictures. Through the above method, the pictures that currently need to be displayed can be further displayed on the interface, thereby improving the reliability of this application.
[0087] In some embodiments of the present application, the process of obtaining and displaying the target preview image corresponding to the image currently to be displayed according to the target sandbox address corresponding to the target urlKey identifier in step S41 is described in detail, and the steps are as follows:
[0088] S410. Use Image Provider to create an image loading framework.
[0089] Specifically, Image Provider is an abstract class that can be used to create an image data stream, which is the image loading framework.
[0090] S411: Display and cache a target preview image using the image loading framework and the target sandbox address corresponding to the target urlKey identifier.
[0091] Specifically, the target sandbox address can be used as a key to read the preview image corresponding to the target sandbox address in the sandbox and displayed through the image data stream. The preview image corresponding to the target sandbox address can also be cached by generating a key through Image Provider.
[0092] It can be seen from the above technical solution that this embodiment provides an optional method of displaying preview images using a sandbox address. Through the above method, the preview images can be cached or displayed, further reducing the loading time of the preview images and improving the efficiency of this application.
[0093] In some embodiments of the present application, the process of step S2, sending the display request to the native platform, is described in detail, and the steps are as follows:
[0094] S20: Send the display request to the native platform through a pre-created processing channel.
[0095] Specifically, a unique identifier can be determined in advance, and a channel corresponding to the identifier can be created. The channel is used as a processing channel, and the processing channel is used to implement information interaction between the Flutter platform and the native platform.
[0096] Through the above processing channel, the Flutter platform can send display requests to the native platform in real time.
[0097] On this basis, the process of step S3, receiving the sandbox address corresponding to the preview image returned by the native platform, is described in detail. The steps are as follows:
[0098] S30: Receive, through the processing channel, a sandbox address corresponding to the preview image returned by the native platform.
[0099] Specifically, through this processing channel, the Flutter platform can receive the sandbox address returned by the native platform in real time.
[0100] It can be seen from the above technical solution that this embodiment provides an optional way for the Flutter platform to interact with the native platform. Through the above process, a processing channel can be created to help the Flutter platform and the native platform interact in real time to display requests and sandbox addresses, which can increase the rate of information interaction of this application, thereby enabling this application to efficiently display preview images.
[0101] The following describes a Flutter-based image preview device provided in an embodiment of the present application. The Flutter-based image preview device described below and the Flutter-based image preview method described above can refer to each other.
[0102] See also Figure 2 , Figure 2 This is a schematic diagram of the structure of a Flutter-based image preview device disclosed in an embodiment of the present application.
[0103] like Figure 2 As shown, the Flutter-based image preview device may include:
[0104] Generating unit 1, configured to generate a display request when a picture needs to be displayed, wherein the display request includes the address of the picture, and the picture includes a face image;
[0105] Sending unit 2, configured to send the display request to the native platform, so that the native platform performs face recognition on the image based on the display request, obtains a recognition result, and segments the image according to the recognition result and the display request to obtain a preview image, and stores the preview image in a sandbox;
[0106] Receiving unit 3, configured to receive the sandbox address corresponding to the preview image returned by the native platform;
[0107] The acquisition unit 4 is configured to acquire the preview image according to the sandbox address and display the preview image.
[0108] Optionally, the generating unit may include:
[0109] The priority determination subunit is used to determine the priority of each picture when multiple pictures need to be displayed in sequence;
[0110] The image address acquisition subunit is used to acquire the address of each image and associate the address of each image with the priority of the image;
[0111] The priority utilization subunit is configured to generate a display request based on the address and priority of each picture.
[0112] Optionally, the generation unit may further include:
[0113] The identification acquisition subunit is used to obtain the address of the picture and the unique identification of the picture when the picture needs to be displayed;
[0114] A urlKey identifier obtaining subunit, configured to generate a urlKey identifier corresponding to the image according to the image's address and the unique identifier;
[0115] The urlKey identifier sending subunit is used to generate a display request based on the address of the picture and the urlKey identifier, so that the native platform can send the urlKey identifier of the picture corresponding to the preview picture and the sandbox address in correspondence.
[0116] Optionally, the acquisition unit may include:
[0117] The target identifier determination subunit is used to determine the target urlKey identifier of the picture currently to be displayed;
[0118] The target preview image acquisition subunit is used to acquire and display the target preview image corresponding to the image currently required to be displayed according to the target sandbox address corresponding to the target urlKey identifier.
[0119] Optionally, the target preview image acquisition subunit may include:
[0120] The framework creates a subunit, which is used to create an image loading framework using the Image Provider;
[0121] The framework utilizing subunit is used to utilize the picture loading framework and the target sandbox address corresponding to the target urlKey identifier to display and cache the target preview picture.
[0122] Optionally, the sending unit may include:
[0123] a channel utilizing subunit, configured to send the display request to the native platform through a pre-created processing channel;
[0124] On this basis, the receiving unit may include:
[0125] The address receiving subunit is configured to receive, through the processing channel, a sandbox address corresponding to the preview image returned by the native platform.
[0126] The Flutter-based image preview device provided in the embodiment of the present application can be applied to Flutter-based image preview devices, such as PC terminals, mobile terminals, and mobile phone terminals. Figure 3 The hardware structure diagram of the image preview device based on Flutter is shown. Figure 3 ,The hardware structure of the Flutter-based image preview device may include: at least one processor 1, at least one communication interface 2, at least one memory 3 and at least one communication bus 4;
[0127] In the embodiment of the present application, the number of the processor 1, the communication interface 2, the memory 3, and the communication bus 4 is at least one, and the processor 1, the communication interface 2, and the memory 3 communicate with each other through the communication bus 4;
[0128] The processor 1 may be a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention;
[0129] The memory 3 may include a high-speed RAM memory, and may also include a non-volatile memory, such as at least one disk memory;
[0130] The memory stores a program, and the processor can call the program stored in the memory, wherein the program is used to:
[0131] When a picture needs to be displayed, a display request is generated, wherein the display request includes the address of the picture, and the picture includes a face image;
[0132] Sending the display request to the native platform, so that the native platform performs face recognition on the image based on the display request to obtain a recognition result, and cutting the image according to the recognition result and the display request to obtain a preview image, and storing the preview image in a sandbox;
[0133] Receive the sandbox address corresponding to the preview image returned by the native platform;
[0134] According to the sandbox address, the preview image is obtained and displayed.
[0135] Optionally, the refined functions and extended functions of the program may refer to the above description.
[0136] The present application also provides a readable storage medium, which may store a program suitable for execution by a processor, wherein the program is used to:
[0137] When a picture needs to be displayed, a display request is generated, wherein the display request includes the address of the picture, and the picture includes a face image;
[0138] Sending the display request to the native platform, so that the native platform performs face recognition on the image based on the display request to obtain a recognition result, and cutting the image according to the recognition result and the display request to obtain a preview image, and storing the preview image in a sandbox;
[0139] Receive the sandbox address corresponding to the preview image returned by the native platform;
[0140] According to the sandbox address, the preview image is obtained and displayed.
[0141] Optionally, the refined functions and extended functions of the program may refer to the above description.
[0142] Finally, it should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or device comprising the element.
[0143] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0144] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. The various embodiments of the present application may be combined with each other. Therefore, the present application is not limited to the embodiments shown herein, but is intended to conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A picture preview method based on Flutter, characterized in that: Applied to the Flutter platform, including: When a picture needs to be displayed, a display request is generated, wherein the display request includes the address of the picture, and the picture includes a face image; Sending the display request to the native platform, so that the native platform performs face recognition on the image based on the display request to obtain a recognition result, and cutting the image according to the recognition result and the display request to obtain a preview image, and storing the preview image in a sandbox; Receive the sandbox address corresponding to the preview image returned by the native platform; According to the sandbox address, the preview image is obtained and displayed.
2. The Flutter-based image preview method according to claim 1, characterized in that: When the display request includes addresses of multiple pictures, the display request also includes the priority of each picture; When an image needs to be displayed, a display request is generated, including: When multiple pictures need to be displayed in sequence, determine the priority of each picture; Get the address of each picture and map the address of each picture to the priority of the picture; Based on the address and priority of each picture, a display request is generated.
3. The Flutter-based image preview method according to claim 1, characterized in that: The display request also includes a urlKey identifier corresponding to the address of the picture; When an image needs to be displayed, a display request is generated, including: When a picture needs to be displayed, obtain the address of the picture and the unique identifier of the picture; Generate a urlKey identifier corresponding to the image according to the address of the image and the unique identifier; Based on the address of the picture and the urlKey identifier, a display request is generated so that the native platform sends the urlKey identifier of the picture corresponding to the preview picture and the sandbox address in correspondence.
4. The Flutter-based image preview method according to claim 3, characterized in that: Obtaining the preview image according to the sandbox address and displaying the preview image includes: Determine the target urlKey identifier of the image that needs to be displayed; According to the target sandbox address corresponding to the target urlKey identifier, the target preview image corresponding to the image currently to be displayed is obtained and displayed.
5. The Flutter-based image preview method according to claim 4, characterized in that: According to the target sandbox address corresponding to the target urlKey identifier, obtaining and displaying the target preview image corresponding to the image currently to be displayed, including: Use Image Provider to create an image loading framework; The target preview image is displayed and cached using the image loading framework and the target sandbox address corresponding to the target urlKey identifier.
6. The Flutter-based image preview method according to claim 1, characterized in that: Sending the display request to the native platform includes: Sending the display request to the native platform through a pre-created processing channel; Receiving the sandbox address corresponding to the preview image returned by the native platform includes: The sandbox address corresponding to the preview image returned by the native platform is received through the processing channel.
7. A picture preview device based on Flutter, characterized in that: include: a generating unit, configured to generate a display request when a picture needs to be displayed, wherein the display request includes an address of the picture, and the picture includes a face image; a sending unit, configured to send the display request to the native platform, so that the native platform performs face recognition on the image based on the display request to obtain a recognition result, and cuts the image according to the recognition result and the display request to obtain a preview image, and stores the preview image in a sandbox; A receiving unit, configured to receive a sandbox address corresponding to the preview image returned by the native platform; An acquiring unit is configured to acquire the preview image according to the sandbox address and display the preview image.
8. The Flutter-based image preview device according to claim 7, characterized in that: The generating unit comprises: The priority determination subunit is used to determine the priority of each picture when multiple pictures need to be displayed in sequence; The image address acquisition subunit is used to acquire the address of each image and associate the address of each image with the priority of the image; The priority utilization subunit is configured to generate a display request based on the address and priority of each picture.
9. A Flutter-based image preview device, characterized in that: including memory and processor; The memory is used to store programs; The processor is configured to execute the program to implement each step of the Flutter-based image preview method according to any one of claims 1 to 6.
10. A readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, each step of the Flutter-based image preview method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Mobile terminal and method for controlling the same
US20170026582A1
Preview method and apparatus for searching for pictures by mobile terminal
US20180129653A1