Interface display method, device, electronic device and storage medium

By receiving control instructions from the Flutter application interface and calling JavaScript logic functions to obtain and parse status data, it solves the problem that the Flutter framework does not support dynamic generation of the environment, and realizes dynamic adjustment and efficient updating of the Flutter application interface.

CN113094138BActive Publication Date: 2024-09-10BOE TECHNOLOGY GROUP CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202110421092.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-04-19
Publication Date
2024-09-10
Estimated Expiration
2041-04-19

AI Technical Summary

Technical Problem

The Flutter framework does not support dynamization of the generation environment, which prevents developers from easily dynamically adjusting Flutter applications, reduces page update efficiency, and the readability of the Dart language is poor.

Method used

By receiving the control instructions of the Flutter application interface, calling the JavaScript language logic function of the interface component to obtain the status data, parsing it into Dart language data, and rendering the interface component based on the data, the dynamic adjustment of the Flutter application interface is realized.

Benefits of technology

This allows developers to use highly readable JavaScript language to easily and dynamically adjust the Flutter application interface, improving page update efficiency and reducing development costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113094138B
    Figure CN113094138B
Patent Text Reader

Abstract

The interface display method, device, electronic device and storage medium provided in the present application are applied to the field of computer technology. The method includes: receiving a control instruction for a Flutter application interface; in response to the control instruction, calling a JavaScript language logic function corresponding to at least one interface component in the Flutter application interface to obtain the first state data of the interface component; parsing the first state data to obtain the second state data of the Dart language; rendering the interface component according to the second state data to display the Flutter application interface containing the interface component. This solution enables the Flutter application interface to be adjusted through the highly readable JavaScript language, so that developers can use the JavaScript language to conveniently and dynamically adjust the Flutter application interface.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of computer technology, and in particular, relates to an interface display method, device, electronic device and storage medium. Background Art

[0002] Flutter is a cross-platform mobile development framework that uses Dart as the development language and supports operating systems such as Android, iOS, and Web. Since Dart supports both AOT (Ahead-of-Time Compilation) and JIT (Just in Time Compilation), Flutter naturally supports dynamicization, but for security reasons, the Flutter framework does not support Flutter enabling dynamicization in the build environment.

[0003] Therefore, in the prior art, when a page in an application needs to be updated, the developer needs to redevelop a new version of the application and publish it. The mobile terminal downloads the update before the new page style and content can be displayed on the client. Obviously, this method requires a lot of manpower and time costs, reduces the update efficiency of the page in the Flutter application, and cannot meet the user's demand for page updates in the application. In addition, the Dart language under the Flutter framework has poor readability, which is not convenient for developers to dynamically adjust the Flutter application. Summary of the invention

[0004] In view of this, the embodiments of the present application propose an interface display method, device, electronic device and storage medium, which are used to solve the problem in the prior art that the Flutter framework does not support the dynamic generation environment and the use of the Dart language, which makes it impossible for developers to easily and dynamically adjust the Flutter application.

[0005] A first aspect of the present application provides an interface display method, the method comprising:

[0006] Receive control instructions for the Flutter application interface;

[0007] In response to the control instruction, calling a JavaScript language logic function corresponding to at least one interface component in the Flutter application interface to obtain first state data of the interface component;

[0008] Parsing the first state data to obtain second state data in Dart language;

[0009] The interface component is rendered according to the second state data to display a Flutter application interface including the interface component.

[0010] Optionally, when the control instruction is a display instruction for the Flutter application interface, calling a JavaScript language logic function corresponding to at least one interface component in the Flutter application interface to obtain first state data of each interface component includes:

[0011] Call the JavaScript language logic function corresponding to each interface component in the Flutter application interface to obtain the initial state data of each interface component, and use the initial state data as the first state data.

[0012] Optionally, when the control instruction is an update instruction for a target interface component in the Flutter application interface, calling a JavaScript language logic function corresponding to at least one interface component in the Flutter application interface to obtain first state data of each interface component includes:

[0013] Calling the JavaScript language logic function corresponding to the target interface component to obtain the update status data of the target interface component, and using the update status data as the first status data;

[0014] The rendering of the interface component according to the second state data to display a Flutter application interface including the interface component includes:

[0015] The target interface component is rendered according to the second state data to update the target interface component in the displayed Flutter application interface.

[0016] Optionally, before calling a JavaScript language logic function corresponding to at least one interface component in the Flutter application interface to obtain first state data of the interface component, the method further includes:

[0017] Obtain a binding property value of at least one interface component in the Flutter application interface;

[0018] The JavaScript language logic function containing the state data field name and the same as the binding attribute value is used as the JavaScript language logic function corresponding to the interface component.

[0019] Optionally, before receiving a control instruction for a Flutter application interface, the method further includes:

[0020] Unpack the Flutter application package to obtain the Flutter interface layer program code and the JavaScript logic layer program code in JSON format, wherein the JavaScript logic layer program code is used to calculate the status data of the interface components in the Flutter application interface;

[0021] The Flutter interface layer program code in JSON format is parsed by an AST parser to obtain the Flutter interface layer program code in the Dart language, where the Flutter interface layer program code is used to render and display the Flutter application interface.

[0022] Optionally, the Flutter interface layer program code includes at least: interface component construction information;

[0023] After obtaining the Flutter interface layer program code in the Dart language, the method further includes:

[0024] The interface component construction information is instantiated to obtain the interface component of the Flutter application interface.

[0025] Optionally, the receiving a control instruction for a Flutter application interface includes:

[0026] When a target input is received in a Flutter application interface, a control instruction for the Flutter application interface is generated.

[0027] According to a second aspect of the present application, an interface display device is provided, the device comprising:

[0028] A receiving module is configured to receive control instructions for the Flutter application interface;

[0029] A calling module is configured to call a JavaScript language logic function corresponding to at least one interface component in the Flutter application interface in response to the control instruction to obtain first state data of the interface component;

[0030] A parsing module, configured to parse the first state data to obtain second state data in Dart language;

[0031] The display module is configured to render the interface component according to the second state data to display a Flutter application interface including the interface component.

[0032] Optionally, when the control instruction is a display instruction for the Flutter application interface, the calling module is further configured to:

[0033] Call the JavaScript language logic function corresponding to each interface component in the Flutter application interface to obtain the initial state data of each interface component, and use the initial state data as the first state data.

[0034] Optionally, when the control instruction is an update instruction for a target interface component in the Flutter application interface, the calling module is further configured to:

[0035] Calling the JavaScript language logic function corresponding to the target interface component to obtain the update status data of the target interface component, and using the update status data as the first status data;

[0036] The display module is further configured as:

[0037] The target interface component is rendered according to the second state data to update the target interface component in the displayed Flutter application interface.

[0038] Optionally, the calling module is further configured to:

[0039] Obtain a binding property value of at least one interface component in the Flutter application interface;

[0040] The JavaScript language logic function containing the state data field name and the same as the binding attribute value is used as the JavaScript language logic function corresponding to the interface component.

[0041] Optionally, the device further includes: a deployment module configured to:

[0042] Unpack the Flutter application package to obtain the Flutter interface layer program code and the JavaScript logic layer program code in JSON format, wherein the JavaScript logic layer program code is used to calculate the status data of the interface components in the Flutter application interface;

[0043] The Flutter interface layer program code in JSON format is parsed by an AST parser to obtain the Flutter interface layer program code in the Dart language, where the Flutter interface layer program code is used to render and display the Flutter application interface.

[0044] Optionally, the Flutter interface layer program code includes at least: interface component construction information;

[0045] The deployment module is also configured to

[0046] The interface component construction information is instantiated to obtain the interface component of the Flutter application interface.

[0047] Optionally, the receiving module is further configured to:

[0048] When a target input is received in a Flutter application interface, a control instruction for the Flutter application interface is generated.

[0049] According to the third aspect of the present application, an electronic device is provided, comprising a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein when the program or instruction is executed by the processor, the interface display method described in the first aspect or the gateway control method described in the second aspect is implemented.

[0050] According to the fourth aspect of the present application, a computer non-volatile readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the interface display method described in the first aspect or the gateway control method described in the second aspect is implemented.

[0051] With respect to the prior art, this application has the following advantages:

[0052] The present application provides an interface display method, device, electronic device and storage medium. The solution establishes a corresponding relationship between the interface components of the Flutter application interface and the JavaScript language logic function, so that when the Flutter application interface receives a control instruction, it can obtain status data by calling the JavaScript language logic function corresponding to the interface component, parse the status data into the Dart language applicable to the interface component, and render and display the interface components in the Flutter application interface based on the status data, so that the Flutter application interface can be adjusted through the JavaScript language with high readability, so that developers can use the JavaScript language to conveniently and dynamically adjust the Flutter application interface.

[0053] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0054] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present application. Also, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:

[0055] Figure 1 It is a flowchart of the steps of an interface display method provided in an embodiment of the present application;

[0056] Figure 2 It is a program architecture diagram of an interface display method provided in an embodiment of the present application;

[0057] Figure 3 This is a data transmission flow chart of another interface display method provided in an embodiment of the present application;

[0058] Figure 4 It is a schematic diagram of the principle of an interface display method provided in an embodiment of the present application;

[0059] Figure 5 It is a structural block diagram of an interface display device provided in an embodiment of the present application;

[0060] Figure 6 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0061] The exemplary embodiments of the present application will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present application are shown in the accompanying drawings, it should be understood that the present application can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided in order to enable a more thorough understanding of the present application and to fully convey the scope of the present application to those skilled in the art.

[0062] Figure 1 The present invention provides a method for displaying an interface, which includes:

[0063] Step 101: Receive a control instruction for a Flutter application interface.

[0064] In the embodiment of the present application, the Flutter application interface is the interface of an application developed based on the Flutter architecture. The control instruction may be an instruction for controlling the display of the Flutter application interface, may be an instruction generated in response to a user's input to the Flutter application interface, or may be automatically generated by the system based on specific rules, such as reaching a specific time point or detecting a specific event. The specific setting may be based on actual needs and is not limited here.

[0065] In actual use, since the Flutter architecture does not support the dynamic generation environment, the style and functions of the Flutter application interface cannot be modified after it is released, that is, after it is installed in an electronic device and run, a new version of the Flutter application needs to be re-released for the electronic device to install before it can be modified. This not only wastes a lot of development resources, but also has low efficiency.

[0066] Step 102: In response to the control instruction, call a JavaScript language logic function corresponding to at least one interface component in the Flutter application interface to obtain first state data of the interface component.

[0067] In an embodiment of the present application, an interface component (Web widget, Widget) is a component of the Flutter application interface. For example, functions such as clocks, video controls, audio controls, and alarms can be set in the Flutter application interface in the form of interface components. The JavaScript language logic function is a logic function developed based on the JavaScript language, which is used to provide the interface component with the state data required for rendering. The state data is a parameter for setting the display of the interface component. The interface component can have a variety of display modes for different functions, and the interface component can be rendered based on different state data so that the interface component can display different styles in the Flutter application interface. For example: the interface component of an alarm clock has two state data, display state and hidden state. The alarm clock can be displayed when it rings by inputting the state data of the display state to the interface component, and the alarm clock can be hidden when it does not ring by inputting the state data of the hidden state to the interface component. Of course, the state data in the interface component can also be set in other ways, which can be set according to actual needs, and is not limited here.

[0068] As an interpreted language, JavaScript language itself has natural dynamic characteristics, which is conducive to developers' identification. Applying it to the Flutter framework can not only lower the threshold for developing Flutter applications, but also dynamically adjust the Flutter application interface in real time. Specifically, the embodiment of the present application sets the interface component by establishing an interface (UI, UserInterface) layer based on the Flutter framework, and sets the JavaScript language logic function that provides state data for the interface component by establishing a logic layer based on the JavaScript language, and establishes a binding relationship between the interface component and the JavaScript language logic function, so that the Flutter layer and the JavaScript layer can perform their respective duties and give play to their respective characteristics. In actual use, developers can make adjustments by designing and developing JavaScript language logic functions, and JavaScript language logic functions control the display of interface components by outputting different first state data. It should be noted that the first state data is obtained by data processing by the JavaScript language logic function, so it follows the grammatical characteristics of the JavaScript language and cannot be directly read and used by the interface component under the Flutter framework, so it needs to be processed in one step.

[0069] Step 103: parse the first state data to obtain second state data in Dart language.

[0070] In the embodiment of the present application, the Dart language is a special language suitable for the Flutter framework, which can be read and used by the interface components in the Flutter framework. Specifically, the first state data of the JavaScript language can be parsed by a pre-set syntax parser to convert the first state data into the second state data of the Dart language. The syntax parser can be specifically set according to the specific differences between the Dart language and the JavaScript language. It can be set specifically with reference to the conventional syntax conversion method in the art. It can mainly convert the JavaScript language into the Dart language, which is applicable to the embodiment of the present application, and will not be repeated here.

[0071] Step 104: Render the interface component according to the second state data to display a Flutter application interface including the interface component.

[0072] In an embodiment of the present application, when the Flutter layer monitors the second state data provided by the JavaScript layer, it extracts the second state data and renders the corresponding interface component through the second state data, thereby generating a Flutter application interface for display by combining the interface components obtained by rendering. If the Flutter application interface is already displayed, the Flutter application interface is refreshed to dynamically adjust the Flutter application interface.

[0073] For ease of understanding, refer to Figure 2 A program structure diagram of an interface display method provided by an embodiment of the present application is shown, which includes a Flutter interface layer and a JavaScript logic layer. When the Flutter interface layer monitors the occurrence of a trigger event, it calls the business logic function of the JavaScript logic layer, so that the JavaScript logic layer processes the business logic function corresponding to the trigger event to obtain updated status data, and then notifies the Flutter interface layer of the updated status data, so that the Flutter interface layer can pull the updated status data and perform interface jump according to the status data rendering component.

[0074] The embodiment of the present application establishes a corresponding relationship between the interface components of the Flutter application interface and the JavaScript language logic function, so that when the Flutter application interface receives a control instruction, it can obtain status data by calling the JavaScript language logic function corresponding to the interface component, and parse the status data into the Dart language applicable to the interface component, so as to render and display the interface components in the Flutter application interface based on the status data, so that the Flutter application interface can be adjusted through the highly readable JavaScript language, so that developers can use the JavaScript language to conveniently and dynamically adjust the Flutter application interface.

[0075] Figure 3 1 is a schematic diagram of another method for displaying an interface provided by an embodiment of the present application, the method comprising:

[0076] Step 201, unpack the Flutter application package, obtain the Flutter interface layer program code and JavaScript logic layer program code in JSON format, the JavaScript logic layer program code, the JavaScript logic layer program code is used to calculate the status data of the interface components in the Flutter application interface.

[0077] In an embodiment of the present application, the Flutter application package is the installation program code of the Flutter application, in which the Flutter interface layer program code and the JavaScript logic layer program code can be encapsulated in JSON format, so as to be suitable for the small data volume of the JSON format and improve the data transmission efficiency of the Flutter application package.

[0078] In the actual development process, you can first develop the Flutter interface layer program code based on the Dart language, and develop the JavaScript logic layer program code based on the JavaScript language, and then convert the Flutter interface layer program code into a text file in AST JSON format using AST syntax. Since the JavaScript logic layer program code itself is in JSON format, you can directly add the JavaScript logic layer program code to the converted JSON file to obtain a Flutter application installation package encapsulated in JSON format.

[0079] Step 202: Parse the Flutter interface layer program code in JSON format through an AST parser to obtain the Flutter interface layer program code in Dart language, where the Flutter interface layer program code is used to render and display the Flutter application interface.

[0080] In the embodiment of the present application, in actual use, since it is necessary to build an interface layer under the Flutter framework, it is necessary to parse the Flutter interface layer program code in JSON format through the AST parser, and convert it into the Flutter interface layer program code in the Dart language to perform interface rendering and interface display functions. Since the JavaScript logic layer program code is in JSON format for this application, it can directly execute the logic layer function of providing status data.

[0081] Optionally, the Flutter interface layer program code includes at least: interface component construction information.

[0082] Step 203: instantiate the interface component construction information to obtain the interface component of the Flutter application interface.

[0083] In an embodiment of the present application, by setting the interface component construction information in the Flutter interface layer program code, the interface component construction information is converted into an interface component instance during actual runtime, and the status data can be obtained when the JavaScript logic layer program code is running to render and display the Flutter application interface.

[0084] Step 204: When the target input is received in the Flutter application interface, a control instruction for the Flutter application interface is generated.

[0085] In the embodiment of the present application, the target input can be a click, long press, slide, voice, gesture and other types of input for the Flutter application interface, which can be set according to actual needs and is not limited here. The control instructions for the Flutter application interface can be automatically generated according to the user's target input.

[0086] Step 205: In response to the control instruction, obtain a binding property value of at least one interface component in the Flutter application interface.

[0087] In the embodiment of the present application, the binding attribute value is the value of a specific attribute value set in the interface component in the embodiment of the present application, which is used to bind the attribute value of the state data in the JavaScript language logic function, and can be obtained by the binding attribute value of the interface component indicated by different control instructions.

[0088] Step 206: The JavaScript language logic function having the same name of the contained state data field and the binding attribute value is used as the JavaScript language logic function corresponding to the interface component.

[0089] In the embodiment of the present application, in order to facilitate the query, the binding relationship between the interface component and the JavaScript language logic function can be established by setting the binding attribute value in the interface component and the field name where the state data is located in the JavaScript language logic function to be the same. When querying, you only need to compare the naming of the binding attribute value with the field name of the state data in the JavaScript language logic function to query the JavaScript language logic function corresponding to the interface component.

[0090] Exemplary:

[0091] For example, there is an interface component TextEx that is an extension of Flutter's built-in WidgetText. The binding attributes bindData and bindTap are added, and their attribute values ​​are count and onClick respectively. The names of the fields where the data status is located in the corresponding JavaScript language logic function can be written as count and onClick, and the binding relationship between the interface component and the JavaScript language logic function can be established.

[0092] Step 207: Call a JavaScript language logic function corresponding to at least one interface component in the Flutter application interface to obtain first state data of the interface component.

[0093] This step can refer to the detailed description of step 102 and will not be repeated here.

[0094] Step 208: parse the first state data to obtain second state data in Dart language.

[0095] This step can refer to the detailed description of step 103 and will not be repeated here.

[0096] Step 209: Render the interface component according to the second state data to display a Flutter application interface including the interface component.

[0097] This step can refer to the detailed description of step 104 and will not be described again here.

[0098] Optionally, an embodiment of the present application provides another achievable embodiment, wherein, when the control instruction is a display instruction for the Flutter application interface, the step 207 may include: calling the JavaScript language logic function corresponding to each interface component in the Flutter application interface to obtain the initial state data of each interface component, and using the initial state data as the first state data.

[0099] In the embodiments of this application, refer to Figure 4 When a display instruction for the Flutter application interface is received, that is, when the JavaScript content needs to be loaded, the initial state data can be parsed when the JavaScript layer is running, so that the initial state data can be converted into the second state data of the Dart language to render each interface component to obtain the Flutter application interface.

[0100] Optionally, the embodiment of the present application also provides another achievable embodiment, wherein, when the control instruction is an update instruction for the target interface component in the Flutter application interface, the step 207 may include: calling the JavaScript language logic function corresponding to the target interface component to obtain the update status data of the target interface component, and using the update status data as the first status data.

[0101] The step 209 may include: rendering the target interface component according to the second state data to update the target interface component in the displayed Flutter application interface.

[0102] In the embodiments of this application, refer to Figure 4 When an update instruction for the Flutter application interface is received, which may specifically be a click event for the Flutter application interface, the update status data can be obtained by calling the JavaScript language logic function to process the data when the JavaScript language logic function is running, and the update status data is converted into the status data of the Dart language to provide it to the Flutter layer for rendering the target interface component, thereby updating the re-rendered target interface component to the Flutter application interface.

[0103] The embodiment of the present application establishes a corresponding relationship between the interface components of the Flutter application interface and the JavaScript language logic function, so that when the Flutter application interface receives a control instruction, it can obtain status data by calling the JavaScript language logic function corresponding to the interface component, and parse the status data into the Dart language applicable to the interface component, so as to render and display the interface components in the Flutter application interface based on the status data, so that the Flutter application interface can be adjusted through the highly readable JavaScript language, so that developers can use the JavaScript language to conveniently and dynamically adjust the Flutter application interface.

[0104] Figure 5 The present invention provides a schematic diagram of the structure of an interface display device 30, which includes:

[0105] The receiving module 301 is configured to receive a control instruction for the Flutter application interface;

[0106] The calling module 302 is configured to call a JavaScript language logic function corresponding to at least one interface component in the Flutter application interface in response to the control instruction to obtain first state data of the interface component;

[0107] A parsing module 303 is configured to parse the first state data to obtain second state data in Dart language;

[0108] The display module 304 is configured to render the interface component according to the second state data to display a Flutter application interface including the interface component.

[0109] Optionally, when the control instruction is a display instruction for the Flutter application interface, the calling module 302 is further configured to:

[0110] Call the JavaScript language logic function corresponding to each interface component in the Flutter application interface to obtain the initial state data of each interface component, and use the initial state data as the first state data.

[0111] Optionally, when the control instruction is an update instruction for a target interface component in the Flutter application interface, the calling module 302 is further configured to:

[0112] Calling the JavaScript language logic function corresponding to the target interface component to obtain the update status data of the target interface component, and using the update status data as the first status data;

[0113] The display module 304 is further configured to:

[0114] The target interface component is rendered according to the second state data to update the target interface component in the displayed Flutter application interface.

[0115] Optionally, the calling module 302 is further configured to:

[0116] Obtain a binding property value of at least one interface component in the Flutter application interface;

[0117] The JavaScript language logic function containing the state data field name and the same as the binding attribute value is used as the JavaScript language logic function corresponding to the interface component.

[0118] Optionally, the device further includes: a deployment module configured to:

[0119] Unpack the Flutter application package to obtain the Flutter interface layer program code and the JavaScript logic layer program code in JSON format, wherein the JavaScript logic layer program code is used to calculate the status data of the interface components in the Flutter application interface;

[0120] The Flutter interface layer program code in JSON format is parsed by an AST parser to obtain the Flutter interface layer program code in the Dart language, where the Flutter interface layer program code is used to render and display the Flutter application interface.

[0121] Optionally, the Flutter interface layer program code includes at least: interface component construction information;

[0122] The deployment module is also configured to

[0123] The interface component construction information is instantiated to obtain the interface component of the Flutter application interface.

[0124] Optionally, the receiving module 301 is further configured to:

[0125] When a target input is received in a Flutter application interface, a control instruction for the Flutter application interface is generated.

[0126] The embodiment of the present application establishes a corresponding relationship between the interface components of the Flutter application interface and the JavaScript language logic function, so that when the Flutter application interface receives a control instruction, it can obtain status data by calling the JavaScript language logic function corresponding to the interface component, and parse the status data into the Dart language applicable to the interface component, so as to render and display the interface components in the Flutter application interface based on the status data, so that the Flutter application interface can be adjusted through the highly readable JavaScript language, so that developers can use the JavaScript language to conveniently and dynamically adjust the Flutter application interface.

[0127] In another embodiment provided by the present application, an electronic device is also provided. The electronic device may include: a processor, a memory, and a computer program stored in the memory and executable on the processor. When the processor executes the program, each process of the above-mentioned interface display method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here. For example, Figure 6 As shown, the electronic device may specifically include: a processor 401, a storage device 402, a display screen 403 with a touch function, an input device 404, an output device 405, and a communication device 406. The number of processors 401 in the electronic device may be one or more. Figure 6 A processor 401 is taken as an example. The processor 401, storage device 402, display screen 403, input device 404, output device 405 and communication device 406 of the electronic device can be connected via a bus or other means.

[0128] In another embodiment provided in the present application, a computer non-volatile readable storage medium is provided, in which instructions are stored. When the instructions are executed on a computer, the computer executes the interface display method described in any of the above embodiments.

[0129] In another embodiment provided in the present application, a computer program product including instructions is also provided, which, when executed on a computer, enables the computer to execute the interface display method described in any one of the above embodiments.

[0130] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0131] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0132] The above description is only a preferred embodiment of the present application and is not intended to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application are included in the protection scope of the present application.

Claims

1. An interface display method, characterized in that: The method comprises: Receive control instructions for the Flutter application interface; In response to the control instruction, calling a JavaScript language logic function corresponding to at least one interface component in the Flutter application interface to obtain first state data of the interface component; Parsing the first state data to obtain second state data in Dart language; Rendering the interface component according to the second state data to display a Flutter application interface including the interface component; In a case where the control instruction is a display instruction for the Flutter application interface, calling a JavaScript language logic function corresponding to at least one interface component in the Flutter application interface to obtain first state data of each interface component includes: Calling the JavaScript language logic function corresponding to each interface component in the Flutter application interface to obtain the initial state data of each interface component, and using the initial state data as the first state data; In a case where the control instruction is an update instruction for a target interface component in the Flutter application interface, calling a JavaScript language logic function corresponding to at least one interface component in the Flutter application interface to obtain first state data of each interface component includes: Calling the JavaScript language logic function corresponding to the target interface component to obtain the updated state data of the target interface component, and using the updated state data as the first state data; The rendering of the interface component according to the second state data to display a Flutter application interface including the interface component includes: Rendering the target interface component according to the second state data to update the target interface component in the displayed Flutter application interface; Before calling the JavaScript language logic function corresponding to at least one interface component in the Flutter application interface to obtain the first state data of the interface component, the method further includes: Obtain a binding property value of at least one interface component in the Flutter application interface; The JavaScript language logic function containing the state data field name and the same as the binding attribute value is used as the JavaScript language logic function corresponding to the interface component.

2. The method according to claim 1, characterized in that Before receiving the control instruction for the Flutter application interface, the method further includes: Unpack the Flutter application package to obtain the Flutter interface layer program code and JavaScript logic layer program code in JSON format, where the JavaScript logic layer program code is used to calculate the status data of the interface components in the Flutter application interface; The Flutter interface layer program code in JSON format is parsed by an AST parser to obtain the Flutter interface layer program code in the Dart language, and the Flutter interface layer program code is used to render and display the Flutter application interface.

3. The method according to claim 2, characterized in that The Flutter interface layer program code includes at least: interface component construction information; After obtaining the Flutter interface layer program code in the Dart language, the method further includes: The interface component construction information is instantiated to obtain the interface component of the Flutter application interface.

4. The method according to claim 1, characterized in that: The receiving of a control instruction for the Flutter application interface includes: When a target input is received in a Flutter application interface, a control instruction for the Flutter application interface is generated.

5. An interface display device, characterized in that: The device comprises: A receiving module is configured to receive control instructions for the Flutter application interface; A calling module is configured to call a JavaScript language logic function corresponding to at least one interface component in the Flutter application interface in response to the control instruction to obtain first state data of the interface component; A parsing module, configured to parse the first state data to obtain second state data in Dart language; A display module is configured to render the interface component according to the second state data to display a Flutter application interface including the interface component; Wherein, when the control instruction is a display instruction for the Flutter application interface, the calling module is further configured to: call the JavaScript language logic function corresponding to each interface component in the Flutter application interface to obtain the initial state data of each interface component, and use the initial state data as the first state data; In the case where the control instruction is an update instruction for a target interface component in the Flutter application interface, the calling module is further configured to: call a JavaScript language logic function corresponding to the target interface component to obtain update status data of the target interface component, and use the update status data as the first status data; The display module is further configured to: render the target interface component according to the second state data to update the target interface component in the displayed Flutter application interface; The calling module is also configured to: obtain a binding property value of at least one interface component in the Flutter application interface; and use a JavaScript language logic function having a state data field name that is the same as the binding property value as a JavaScript language logic function corresponding to the interface component.

6. An electronic device, characterized in that: It comprises a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the interface display method as claimed in any one of claims 1 to 4.

7. A computer non-transitory readable storage medium, characterized in that: The readable storage medium stores a computer program, and when the computer program is executed by a processor, the interface display method according to any one of claims 1 to 4 is implemented.

Citation Information

Patent Citations

  • Method and device for dynamically adjusting routing, medium and electronic equipment

    CN110489621A

  • Application dynamic updating method and device base on Flutter, storage medium and electronic equipment

    CN111381852A

  • Data packet publishing method and device, dynamic updating method and device, equipment and medium

    CN111740948A

  • Cross-platform data production method and device based on Flutter

    CN112131300A