Preview generation method and device and electronic equipment

The method and device generate a preview view in Android Studio by interacting with a dart plug-in, addressing the inefficiency in Flutter development by enabling preview views, thus improving development efficiency.

CN119065667APending Publication Date: 2024-12-03HANGZHOU SHUPAO TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411001376.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-24
Publication Date
2024-12-03

AI Technical Summary

Technical Problem

In Flutter development, view development can only be implemented through dart code, and the actual display effect can only be seen after compilation, leading to poor development efficiency.

Method used

A method and device for generating a preview view by sending a call request to a dart plug-in with an identifier of the Flutter development source file to obtain drawing data, allowing for the generation of a preview view in Android Studio, improving development efficiency.

Benefits of technology

Enables the display of preview views during Flutter development, enhancing development efficiency by allowing developers to see the actual display effect without full compilation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119065667A_ABST
    Figure CN119065667A_ABST
Patent Text Reader

Abstract

The invention provides a preview view generation method and device and electronic equipment, and relates to the technical field of big data, the method comprises the steps that an Android Studio plug-in obtains a preview view generation request, and the preview view generation request comprises an identifier of a to-be-processed flutter development source file; sending a calling request carrying the identifier to the dart plug-in to obtain a calling result returned by the dart plug-in; and under the condition that the calling result comprises the drawing data of the dart class meeting the preview condition in the flutter development source file, generating the preview view according to the drawing data, so that the display of the preview view in the flutter development can be realized, and the development efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of big data technology, and in particular to a method, device and electronic device for generating a preview view. Background Art

[0002] Currently, in Android development, the XML static page is read and parsed into a map structure in memory; then a preview view is drawn according to the map structure and the data of each node in the XML static page.

[0003] However, in Flutter development, view development can only be implemented through dart code, and the view cannot be previewed. The actual display effect can only be seen after the dart code is compiled, resulting in poor development efficiency. Summary of the invention

[0004] The purpose of this application is to solve one of the above technical problems at least to a certain extent.

[0005] To this end, the present application proposes a method for generating a preview view. When a preview view generation request is received, a call request is sent to a dart plug-in according to the identifier of the flutter development source file to be processed, so as to obtain the drawing data of the dart class that meets the preview conditions in the flutter development source file, and then generate a preview view, thereby realizing the display of the preview view in flutter development and improving development efficiency.

[0006] The first aspect embodiment of the present application proposes a method for generating a preview view, which is applied to an AndroidStudio plug-in, including: obtaining a preview view generation request, the preview view generation request including: an identifier of a flutter development source file to be processed; sending a call request carrying the identifier to a dart plug-in to obtain a call result returned by the dart plug-in; and generating a preview view according to the drawing data when the call result includes drawing data of a dart class that meets a preview condition in the flutter development source file.

[0007] Optionally, obtaining a preview view generation request includes: obtaining a display page of an Android Studio tool; obtaining a control corresponding to the Android Studio plug-in in the display page, and a flutter development source file displayed in the display page; and when an operation request for the control is received, determining that a preview view generation request carrying an identifier of the flutter development source file is received.

[0008] Optionally, the method for the dart plug-in to obtain the call result includes: obtaining a dart class in the flutter development source file; when the dart class meets the preview condition, parsing the dart class to obtain drawing data of the dart class; and determining the drawing data of the dart class as the call result.

[0009] Optionally, the method for the dart plug-in to obtain the call result further includes: determining whether the dart class is a subclass of the widget class and whether the dart class is set with a preview mark; if the dart class is a subclass of the widget class and the dart class is set with a preview mark, determining that the dart class meets the preview condition; if the dart class is not a subclass of the widget class, or the dart class is not set with the preview mark, determining that the dart class does not meet the preview condition.

[0010] Optionally, when the dart class meets the preview condition, parsing the dart class to obtain drawing data of the dart class includes: when the dart class meets the preview condition, compiling the dart class to obtain a compilation result of the dart class; the compilation result includes attribute data of each control in the dart class; and generating drawing data of the dart class according to the attribute data of each control.

[0011] Optionally, generating a preview view according to the drawing data includes: obtaining view tree data of the flutter development source file; and generating the preview view according to a UI development framework of an Android Studio tool, the view tree data, and the drawing data.

[0012] Optionally, the method further includes: displaying the preview view in a pop-up window.

[0013] In the method for generating a preview view in an embodiment of the present application, the Android Studio plug-in obtains a preview view generation request, and the preview view generation request includes: an identifier of the flutter development source file to be processed; a call request carrying the identifier is sent to the dart plug-in to obtain a call result returned by the dart plug-in; when the call result includes drawing data of the dart class that meets the preview condition in the flutter development source file, a preview view is generated according to the drawing data, thereby realizing the display of the preview view in the flutter development and improving the development efficiency.

[0014] The second aspect embodiment of the present application proposes a preview view generation device, which is applied to an Android Studio plug-in, including: an acquisition module, used to obtain a preview view generation request, and the preview view generation request includes: an identifier of a flutter development source file to be processed; a calling module, used to send a call request carrying the identifier to a dart plug-in to obtain a call result returned by the dart plug-in; a generation module, used to generate a preview view according to the drawing data when the call result includes drawing data of a dart class that meets a preview condition in the flutter development source file.

[0015] Optionally, the acquisition module is specifically used to obtain a display page of the Android Studio tool; obtain a control in the display page corresponding to the Android Studio plug-in, and a flutter development source file displayed in the display page; and when an operation request for the control is received, determine that a preview view generation request carrying an identifier of the flutter development source file is received.

[0016] Optionally, the calling module is specifically used to obtain a dart class in the flutter development source file; when the dart class meets the preview condition, parse the dart class to obtain drawing data of the dart class; and determine the drawing data of the dart class as the calling result.

[0017] Optionally, the calling module is further specifically used to determine whether the dart class is a subclass of the widget class and whether the dart class is set with a preview mark; if the dart class is a subclass of the widget class and the dart class is set with a preview mark, determine that the dart class meets the preview condition; if the dart class is not a subclass of the widget class, or the dart class is not set with the preview mark, determine that the dart class does not meet the preview condition.

[0018] Optionally, the calling module is specifically used to compile the dart class and obtain the compilation result of the dart class when the dart class meets the preview condition; the compilation result includes attribute data of each control in the dart class; and generate drawing data of the dart class according to the attribute data of each control.

[0019] Optionally, the generation module is specifically used to obtain view tree data of the flutter development source file; and generate the preview view according to the UI development framework of the Android Studio tool, the view tree data and the drawing data.

[0020] Optionally, the device further includes: a display module, configured to display the preview view in a pop-up window.

[0021] In the device for generating a preview view in the embodiment of the present application, the Android Studio plug-in obtains a preview view generation request, and the preview view generation request includes: an identifier of the flutter development source file to be processed; a call request carrying the identifier is sent to the dart plug-in to obtain a call result returned by the dart plug-in; when the call result includes drawing data of the dart class that meets the preview condition in the flutter development source file, a preview view is generated according to the drawing data, thereby realizing the display of the preview view in the flutter development and improving the development efficiency.

[0022] The third aspect of the present application provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method for generating a preview view as described in the first aspect when executing the program.

[0023] The fourth aspect of the present application provides a non-temporary computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the method for generating a preview view as described in the first aspect is implemented.

[0024] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:

[0026] Figure 1 A flowchart of a method for generating a preview view provided by an embodiment of the present application;

[0027] Figure 2 It is a structural schematic diagram of a preview view generation device according to an embodiment of the present application;

[0028] Figure 3 It is a schematic diagram of the structure of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0029] Embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present application, and should not be construed as limiting the present application.

[0030] Currently, in Android development, the XML static page is read and parsed into a map structure in memory; then a preview view is drawn according to the map structure and the data of each node in the XML static page.

[0031] However, in Flutter development, view development can only be implemented through dart code, and the view cannot be previewed. The actual display effect can only be seen after the dart code is compiled, resulting in poor development efficiency.

[0032] In view of the above problems, the embodiments of the present application provide a method, device and electronic device for generating a preview view.

[0033] Combine the following Figure 1 , the method for generating the preview view provided by this application is described in detail.

[0034] Figure 1 A flowchart of a method for generating a preview view provided in accordance with an embodiment of the present application.

[0035] The method for generating a preview view of an embodiment of the present application can be applied to a device for generating a preview view, which can be an existing Android Studio plug-in in the Android Studio tool, or can be a newly added Android Studio plug-in in the Android Studio tool; the plug-in can be configured in an electronic device so that the electronic device can perform the function of generating a preview view.

[0036] The electronic device may be any device with computing capability, and the device or the application in the device may perform the document style generation function. The device with computing capability may be, for example, a personal computer (PC), a mobile terminal, a server, etc. The mobile terminal may be, for example, a vehicle-mounted device, a mobile phone, a tablet computer, a personal digital assistant, a wearable device, or other hardware device with various operating systems, touch screens, and / or display screens. The following embodiments are described by taking the execution subject as an Android Studio plug-in as an example.

[0037] like Figure 1 As shown, the method for generating the preview view includes the following steps:

[0038] Step 101: Obtain a preview view generation request, where the preview view generation request includes: an identifier of a flutter development source file to be processed.

[0039] In an embodiment of the present application, the Android Studio tool is used in the flutter development process, that is, on the display page of the Android Studio tool, the developer can write code in the dart language required for flutter development to obtain the flutter development source file; or, the developer can open the written flutter development source file and display it on the display page.

[0040] Among them, the identifier of the flutter development source file can be the name of the flutter development source file, or can be a number that uniquely identifies the source file, etc., and can be set according to actual needs, which is not specifically described here.

[0041] In an embodiment of the present application, the process of the Android Studio plug-in executing step 101 may, for example, be to obtain a display page of the Android Studio tool; obtain a control in the display page corresponding to the Android Studio plug-in, and a flutter development source file displayed in the display page; and when an operation request for the control is received, determine that a preview view generation request carrying an identifier of the flutter development source file is received.

[0042] The Android Studio tool may include multiple Android Studio plug-ins; multiple controls may be displayed on the display page of the Android Studio tool; different controls may be used to represent the functions of different Android Studio plug-ins. The execution subject in this application is one of the multiple Android Studio plug-ins.

[0043] Step 102: Send a call request carrying an identifier to the dart plug-in to obtain a call result returned by the dart plug-in.

[0044] In an embodiment of the present application, the execution entity Android Studio plug-in in the present application may be provided with a dependency relationship with the dart plug-in, that is, the Android Studio plug-in may be provided with code for calling the dart plug-in, so that when the Android Studio plug-in is running, the dart plug-in can be called, that is, a call request is sent to the dart plug-in to obtain the call result of the dart plug-in.

[0045] In an embodiment of the present application, the process of the dart plug-in obtaining the call result may include the following steps: obtaining the dart class in the flutter development source file; when the dart class meets the preview condition, parsing the dart class to obtain the drawing data of the dart class; determining the drawing data of the dart class as the call result.

[0046] In an embodiment of the present application, the process of the dart plug-in determining whether the dart class meets the preview condition can be, for example, to determine whether the dart class is a subclass of the widget class and whether the dart class is set with a preview mark; if the dart class is a subclass of the widget class and the dart class is set with a preview mark, it is determined that the dart class meets the preview condition; if the dart class is not a subclass of the widget class, or the dart class is not set with a preview mark, it is determined that the dart class does not meet the preview condition.

[0047] It should be noted that the widget class is used to store the content to be rendered and the view layout information. Therefore, if the dart class is a subclass of the widget class, the dart class stores the content to be rendered, that is, the view content.

[0048] If the dart class is set with a preview tag, it means that the dart class needs to be previewed; if the dart class is not set with a preview tag, it means that the dart class does not need to be previewed. The preview tag may be, for example, "@Preview".

[0049] In an embodiment of the present application, when the dart class meets the preview conditions, the dart plug-in parses the dart class, and the process of obtaining the drawing data of the dart class can be, for example, when the dart class meets the preview conditions, compile the dart class to obtain the compilation result of the dart class; the compilation result includes the attribute data of each control in the dart class; and the drawing data of the dart class is generated according to the attribute data of each control. Among them, the attribute data of the control, such as position information, size information, color information, shape information, etc., can be set according to actual needs, and no specific limitation is made here.

[0050] Step 103: When the call result includes drawing data of the dart class in the flutter development source file that meets the preview condition, a preview view is generated according to the drawing data.

[0051] In an embodiment of the present application, the process of executing step 103 by the execution subject Android Studio plug-in in the present application can be, for example, obtaining the view tree data of the flutter development source file; generating a preview view according to the UI development framework, view tree data and drawing data of the Android Studio tool. Among them, the hierarchical relationship or nested relationship between each control is defined in the view tree data.

[0052] Among them, the Android Studio plug-in can call the GUI Form sub-plug-in, which can generate a preview view in combination with the drawing data.

[0053] In the embodiment of the present application, after step 103, the Android Studio plug-in can also perform the following process: display the preview view in a pop-up window. That is, whenever the developer operates the control corresponding to the Android Studio plug-in, the Android Studio plug-in will execute steps 101 to 103, and display the preview view in a pop-up window, so as to facilitate the developer to adjust the flutter development source files displayed in the display page of the Android Studio tool in combination with the preview effect of the preview view.

[0054] To prevent pop-up windows from overwriting flutter development source files, you can display a pop-up window on the right side of the display page of the Android Studio tool to prevent pop-up windows from overwriting flutter development source files.

[0055] It should also be noted that if there is an update to the flutter development source file, the developer can close the pop-up window and re-operate the corresponding control of the Android Studio plug-in to display the updated preview view.

[0056] In the method for generating a preview view in an embodiment of the present application, the Android Studio plug-in obtains a preview view generation request, and the preview view generation request includes: an identifier of the flutter development source file to be processed; a call request carrying the identifier is sent to the dart plug-in to obtain a call result returned by the dart plug-in; when the call result includes drawing data of the dart class that meets the preview condition in the flutter development source file, a preview view is generated according to the drawing data, thereby realizing the display of the preview view in the flutter development and improving the development efficiency.

[0057] Corresponding to the preview view generation method provided in the above-mentioned embodiments, an embodiment of the present application further provides a preview view generation device. Since the preview view generation device provided in the embodiment of the present application corresponds to the preview view generation method provided in the above-mentioned embodiments, the implementation of the preview view generation method is also applicable to the preview view generation device provided in this embodiment, and will not be described in detail in this embodiment.

[0058] Figure 2 The figure is a schematic diagram of the structure of a preview view generating device according to an embodiment of the present application.

[0059] like Figure 2 As shown, the preview view generation device 200 can be applied to an Android Studio plug-in and can include: an acquisition module 210, a calling module 220 and a generation module 230.

[0060] The acquisition module 210 is used to obtain a preview view generation request, where the preview view generation request includes: an identifier of a flutter development source file to be processed;

[0061] The calling module 220 is used to send a calling request carrying the identifier to the dart plug-in to obtain a calling result returned by the dart plug-in;

[0062] The generating module 230 is used to generate a preview view according to the drawing data when the calling result includes the drawing data of the dart class in the flutter development source file that meets the preview condition.

[0063] As a possible implementation manner of an embodiment of the present application, the acquisition module 210 is specifically used to obtain a display page of the Android Studio tool; obtain a control corresponding to the Android Studio plug-in in the display page, and a flutter development source file displayed in the display page; and when an operation request for the control is received, determine that a preview view generation request carrying an identifier of the flutter development source file is received.

[0064] As a possible implementation manner of an embodiment of the present application, the method for the dart plug-in to obtain the call result includes: obtaining a dart class in the flutter development source file; when the dart class meets the preview condition, parsing the dart class to obtain drawing data of the dart class; and determining the drawing data of the dart class as the call result.

[0065] As a possible implementation manner of an embodiment of the present application, the method for the dart plug-in to obtain the call result further includes: determining whether the dart class is a subclass of the widget class and whether the dart class is set with a preview mark; if the dart class is a subclass of the widget class and the dart class is set with a preview mark, determining that the dart class meets the preview condition; if the dart class is not a subclass of the widget class, or the dart class is not set with the preview mark, determining that the dart class does not meet the preview condition.

[0066] As a possible implementation method of an embodiment of the present application, when the dart class meets the preview condition, parsing the dart class to obtain drawing data of the dart class includes: when the dart class meets the preview condition, compiling the dart class to obtain the compilation result of the dart class; the compilation result includes attribute data of each control in the dart class; and generating the drawing data of the dart class according to the attribute data of each control.

[0067] As a possible implementation method of an embodiment of the present application, the generation module is specifically used to obtain the view tree data of the flutter development source file; and generate the preview view according to the UI development framework of the Android Studio tool, the view tree data and the drawing data.

[0068] As a possible implementation of the embodiment of the present application, the device further includes: a display module, configured to display the preview view in a pop-up window.

[0069] In the device for generating a preview view in the embodiment of the present application, the Android Studio plug-in obtains a preview view generation request, and the preview view generation request includes: an identifier of the flutter development source file to be processed; a call request carrying the identifier is sent to the dart plug-in to obtain a call result returned by the dart plug-in; when the call result includes drawing data of the dart class that meets the preview condition in the flutter development source file, a preview view is generated according to the drawing data, thereby realizing the display of the preview view in the flutter development and improving the development efficiency.

[0070] In order to implement the above embodiment, the present application also proposes an electronic device, Figure 3 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. The electronic device includes:

[0071] A memory 301 , a processor 302 , and a computer program stored in the memory 301 and executable on the processor 302 .

[0072] When the processor 302 executes the program, the method for generating a preview view provided in the above embodiment is implemented.

[0073] Furthermore, the electronic device further comprises:

[0074] The communication interface 303 is used for communication between the memory 301 and the processor 302 .

[0075] The memory 301 is used to store computer programs that can be run on the processor 302 .

[0076] The memory 301 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.

[0077] The processor 302 is configured to implement the method for generating a preview view described in the above embodiment when executing the program.

[0078] If the memory 301, the processor 302 and the communication interface 303 are implemented independently, the communication interface 303, the memory 301 and the processor 302 can be connected to each other through a bus and communicate with each other. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 3 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0079] Optionally, in a specific implementation, if the memory 301, the processor 302 and the communication interface 303 are integrated on a chip, the memory 301, the processor 302 and the communication interface 303 can communicate with each other through an internal interface.

[0080] The processor 302 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 application.

[0081] In order to implement the above embodiment, the embodiment of the present application also proposes a non-temporary computer-readable storage medium, on which a computer program is stored. When the program is executed by a processor, the method for generating a preview view provided in the above embodiment is implemented.

[0082] In order to implement the above embodiment, the embodiment of the present application further proposes a computer program product, when the instruction processor in the computer program product is executed, the method for generating a preview view provided in the above embodiment is implemented.

[0083] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.

[0084] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of this application, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.

[0085] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, fragment or portion of code comprising one or more executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present application belong.

[0086] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute the instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purpose of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or processing in other suitable ways if necessary, and then stored in a computer memory.

[0087] It should be understood that the various parts of the present application can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0088] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.

[0089] In addition, each functional unit in each embodiment of the present application may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.

[0090] The storage medium mentioned above may be a read-only memory, a magnetic disk or an optical disk, etc. Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limiting the present application. A person of ordinary skill in the art may change, modify, replace and modify the above embodiments within the scope of the present application.

Claims

1. A method for generating a preview view, characterized in that: Applied to the Android Studio plug-in, the method includes: Get a preview view generation request, where the preview view generation request includes: an identifier of a flutter development source file to be processed; Sending a call request carrying the identifier to the dart plug-in to obtain a call result returned by the dart plug-in; In a case where the call result includes drawing data of a dart class in the flutter development source file that meets the preview condition, a preview view is generated according to the drawing data.

2. The method according to claim 1, characterized in that The obtaining of the preview view generation request includes: Get the display page of the Android Studio tool; Obtain the control corresponding to the Android Studio plug-in in the display page, and the flutter development source file displayed in the display page; In a case where an operation request for the control is received, it is determined that a preview view generation request carrying an identifier of the flutter development source file is received.

3. The method according to claim 1, characterized in that The method for the dart plug-in to obtain the call result includes: Get the dart class in the flutter development source file; When the dart class meets the preview condition, the dart class is parsed to obtain drawing data of the dart class; The drawing data of the dart class is determined as the calling result.

4. The method according to claim 3, characterized in that The method for the dart plug-in to obtain the call result also includes: Determine whether the dart class is a subclass of the widget class, and whether the dart class is set with a preview mark; In a case where the dart class is a subclass of the widget class and a preview mark is set for the dart class, determining that the dart class satisfies the preview condition; In a case where the dart class is not a subclass of the widget class, or the dart class is not set with the preview mark, it is determined that the dart class does not meet the preview condition.

5. The method according to claim 3, characterized in that: When the dart class meets the preview condition, parsing the dart class to obtain drawing data of the dart class includes: When the dart class meets the preview condition, compile the dart class to obtain a compilation result of the dart class; the compilation result includes attribute data of each control in the dart class; The drawing data of the dart class is generated according to the attribute data of each control.

6. The method according to claim 1, characterized in that The generating a preview view according to the drawing data includes: Get the view tree data of the flutter development source file; The preview view is generated according to the UI development framework of the Android Studio tool, the view tree data and the drawing data.

7. The method according to claim 1, characterized in that The method further comprises: The preview view is displayed in a pop-up window.

8. A device for generating a preview view, characterized in that: Applies to Android Studio plugins, including: An acquisition module is used to obtain a preview view generation request, where the preview view generation request includes: an identifier of a flutter development source file to be processed; A calling module, used to send a calling request carrying the identifier to the dart plug-in to obtain a calling result returned by the dart plug-in; A generation module is used to generate a preview view according to the drawing data when the call result includes the drawing data of the dart class in the flutter development source file that meets the preview condition.

9. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method for generating a preview view according to any one of claims 1 to 7 when executing the program.

10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method for generating a preview view according to any one of claims 1 to 7 is implemented.