A dynamic skin-renewing method and device

By using a custom component-wide skin theme configuration file and binding with StreamBuilder components, efficient skin theme switching for Flutter applications is achieved, solving the problems of low skin switching efficiency and high performance loss in existing technologies, and ensuring good compatibility.

CN115237521BActive Publication Date: 2026-01-30BEIJING SHANGYIN MICRO CORE TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210860627.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-21
Publication Date
2026-01-30
Estimated Expiration
2042-07-21

AI Technical Summary

Technical Problem

Existing Flutter skinning solutions require rebuilding and refreshing the top-level MaterialApp of the application, resulting in low skinning efficiency and significant performance loss. Furthermore, compatibility issues arise with Flutter version upgrades.

Method used

By creating a common skin theme configuration file for custom components, each skin theme configuration file sets a skin theme key. When a user switches skins, the target skin theme configuration file is read and the custom component library is notified asynchronously to refresh. The StreamBuilder component is bound to the skin manager, allowing skin theme switching to be performed independently of the application theme.

Benefits of technology

It improves skin-changing efficiency, reduces application performance loss, and maintains compatibility during Flutter version upgrades without intruding on the original application system theme.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115237521B_ABST
    Figure CN115237521B_ABST
Patent Text Reader

Abstract

This application discloses a dynamic skin-changing method and apparatus. By pre-storing multiple skin theme configuration file schemes, each skin theme configuration file scheme is set with a skin theme key. When a user needs to switch the application's skin, the system can read the target skin theme configuration file scheme from the pre-stored skin theme configuration file scheme according to the user's desired skin. The skin theme key is then read from the target skin theme configuration file scheme and assigned to the current skin theme variable. Based on the skin theme key, the corresponding target skin theme configuration file can be accurately determined. A skin theme saving plugin is used to save the currently selected skin theme key so that when the application is closed or exited, it can continue to use the previously selected skin theme upon restarting. When switching skin themes, the system can asynchronously notify the custom components in the custom component library to refresh and reconstruct, thereby improving the efficiency of skin-changing and reducing application performance loss.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and more specifically, to a dynamic skinning method and apparatus. Background Technology

[0002] Flutter, as a new cross-platform technology solution in the mobile field, is increasingly favored by projects when selecting technologies due to its superior performance and efficient and rapid development methods. To quickly meet business development needs, frequently used UI components are often encapsulated into UI component libraries during actual project development and rapidly applied to new projects. However, the original component library in a new project may not meet the needs of the new business, usually requiring adjustments such as changing the skin theme.

[0003] The current mainstream Flutter skinning solution is to bind the skinning settings to the application theme and bind them to the entire application through state management. When the skin theme is updated, the top-level MaterialApp of the application needs to be rebuilt and refreshed. Although this solution can solve the skinning problem, it has a lot of uncontrollable factors. This is because the actual encapsulated business components are developed internally by the development team and do not depend on the application theme. If they need to be changed to depend on the application theme, the amount of changes will be huge, and with the upgrade of Flutter version, the compatibility of the solution will also have problems in the future. On the other hand, just switching the skin theme of a custom component causes the entire application to be refreshed, which also has a significant impact on the performance of the application.

[0004] It is evident that the existing Flutter-based skinning solution has the problem of requiring the top-level MaterialApp of the application to be rebuilt and refreshed, resulting in low skinning efficiency and significant performance loss to the application. Summary of the Invention

[0005] The purpose of this application is to provide a dynamic skinning method and apparatus. This skin theme switching scheme does not intrude on or damage the original theme and is independent of the original application system theme, used for skinning schemes within custom components. This application creates a universal skin theme configuration file for custom components. All attributes of custom components are found in the skin theme configuration file. By pre-storing multiple skin theme configuration file schemes, each with a skin theme key, when a user needs to switch application skins, the application can read the target skin theme configuration file scheme from the pre-storage schemes and assign the skin theme key from that scheme to the current skin theme variable. In this way, the corresponding target skin theme configuration file can be accurately determined based on the skin theme key. When switching skin themes, only the current skin theme configuration file needs to be replaced. Furthermore, a skin theme saving plugin saves the currently selected skin theme key so that when the application is closed or exited, it can continue to use the previously selected skin theme upon restart. When switching skin themes, the custom components in the custom component library can be asynchronously notified to refresh and refactor, improving the efficiency of skinning and reducing application performance loss.

[0006] To achieve the above objectives, this application provides a dynamic skinning method, the method comprising:

[0007] Obtain a user's request to switch application skin theme, the request including a first target skin theme scheme;

[0008] Based on the request, determine whether the first target skin theme scheme exists in the pre-stored skin theme configuration file schemes;

[0009] If the first target skin theme scheme exists in the pre-stored skin theme configuration file scheme, obtain the first target skin theme key corresponding to the first target skin theme scheme from the skin theme configuration file scheme, assign the first target skin theme key to the current skin theme variable, and obtain the updated current skin theme variable;

[0010] The updated value of the current skin theme variable is saved to the skin theme saving plugin, and the custom component in the custom component library is asynchronously notified to refresh and refactor.

[0011] Optionally, each custom component in the custom component library is bound using a StreamBuilder component, and the StreamBuilder component is bound to a Stream object in the skin manager;

[0012] The asynchronous notification of custom component refresh and reconstruction in the custom component library includes: asynchronously broadcasting notifications of custom component refresh and reconstruction in the custom component library through the Stream object of the skin manager.

[0013] Optionally, the method further includes:

[0014] Retrieve the skin attribute configuration of the custom component from the current skin theme in the skin manager.

[0015] Optionally, the method further includes:

[0016] In response to the user's request to launch the application, multiple skin theme configuration file schemes are pre-stored in the skin manager;

[0017] Read the skin theme key record from the skin theme saving plugin;

[0018] Determine whether a stored skin theme key exists in the skin theme saving plugin based on the skin theme key record;

[0019] If the stored skin theme key exists in the skin theme saving plugin, then determine whether there is a second target skin theme scheme in the skin theme configuration file scheme pre-stored by the skin manager that corresponds to the skin theme key stored in the skin theme saving plugin;

[0020] If the skin manager has the second target skin theme scheme, then the second target skin theme scheme is read, and the stored skin theme key corresponding to the second target skin theme scheme is assigned to the current skin theme variable;

[0021] If the stored skin theme key does not exist in the skin theme saving plugin, or if the skin theme configuration file scheme pre-stored by the skin manager does not contain a second target skin theme scheme corresponding to the stored skin theme key, then a default skin theme scheme is created, and the default skin theme key corresponding to the default skin theme scheme is assigned to the current skin theme variable.

[0022] Optionally, reading the second target skin theme scheme includes:

[0023] Read the Stream object corresponding to the second target skin theme scheme from the skin manager.

[0024] This application also provides a dynamic skin-changing device, the device comprising:

[0025] The acquisition unit is used to acquire a user's request to switch the application skin theme, the request including a first target skin theme scheme;

[0026] The first judgment unit is used to determine whether the first target skin theme scheme exists in the pre-stored skin theme configuration file scheme according to the request;

[0027] The update unit is configured to, if the first target skin theme scheme exists in the pre-stored skin theme configuration file scheme, obtain the first target skin theme key corresponding to the first target skin theme scheme from the skin theme configuration file scheme, assign the first target skin theme key to the current skin theme variable, and obtain the updated current skin theme variable;

[0028] Storage unit, used to save the updated value of the current skin theme variable to the skin theme saving plugin;

[0029] The processing unit is used to asynchronously notify custom components in the custom component library to refresh and refactor.

[0030] Optionally, each custom component in the custom component library is bound using a StreamBuilder component, and the StreamBuilder component is bound to a Stream object in the skin manager;

[0031] The processing unit is specifically used to: asynchronously broadcast notifications to the custom components in the custom component library to refresh and refactor via the Stream object of the skin manager.

[0032] Optionally, the device further includes:

[0033] The first generation unit is used to obtain the skin attribute configuration of the custom component from the current skin theme of the skin manager.

[0034] Optionally, the device further includes:

[0035] The initialization unit is used to respond to the user's request to launch the application, pre-store multiple skin theme configuration file schemes in the skin manager, and read the skin theme key record from the skin theme saving plugin;

[0036] The second judgment unit is used to determine whether there is a stored skin theme key in the skin theme saving plugin based on the skin theme key record.

[0037] The third judgment unit is used to determine whether there is a second target skin theme scheme corresponding to the skin theme key stored in the skin theme saving plugin if the stored skin theme key exists in the skin theme saving plugin.

[0038] The first determining unit is configured to, if the skin manager has the second target skin theme scheme, read the second target skin theme scheme and assign the stored skin theme key corresponding to the second target skin theme scheme to the current skin theme variable;

[0039] The second determining unit is used to create a default skin theme scheme and assign the default skin theme key corresponding to the stored skin theme key to the current skin theme variable if the stored skin theme key key is not present in the skin theme saving plugin or the skin theme configuration file scheme pre-stored by the skin manager is not present.

[0040] Optionally, the first determining unit is specifically used to: read the Stream object corresponding to the second target skin theme scheme from the skin manager.

[0041] This application provides a dynamic skin-switching method. This method pre-stores multiple skin theme configuration files, each with a skin theme key. When a user needs to switch application skins, the method reads the target skin theme configuration file from the pre-stored files and assigns the skin theme key from that file to the current skin theme variable. A skin theme saving plugin saves the currently selected skin theme key so that when the application is closed or exited, it can continue to use the previously selected skin theme upon restart. Based on this skin theme key, the corresponding target skin theme configuration file can be accurately determined. Furthermore, when switching skin themes, custom components in the custom component library are asynchronously notified to refresh and refactor, improving skin-switching efficiency and reducing application performance overhead. This skin theme switching scheme is non-intrusive and non-destructive to the original theme, operating independently of the original application system theme, and is used for skin-switching schemes within custom components.

[0042] In addition, this application embodiment also provides a dynamic skin-changing device, with the same effect as above. Attached Figure Description

[0043] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0044] Figure 1 A flowchart of a dynamic skinning method provided in an embodiment of this application;

[0045] Figure 2 This is a flowchart illustrating the skin theme switching process during application operation, provided in an embodiment of this application.

[0046] Figure 3 This application provides a flowchart of the initial skin theme setting process for the first launch of the application, as illustrated in this embodiment.

[0047] Figure 4 This is a schematic diagram of a dynamic skin-changing device provided in an embodiment of this application. Detailed Implementation

[0048] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0049] Current Flutter skinning solutions are based on application themes. When the skin theme is updated, the top-level MaterialApp needs to be rebuilt and refreshed. While this solution solves the skinning issue, it has significant uncontrollable factors. This is because the actual encapsulated business components are developed internally by the development team and do not depend on the application theme. If they need to be changed to depend on the application theme, the amount of modification would be enormous. Furthermore, with Flutter version upgrades, compatibility issues will arise in the future. On the other hand, simply switching the skin theme of a custom component causes the entire application to be refreshed, resulting in low skinning efficiency and significant performance overhead.

[0050] This application provides a dynamic skinning method and apparatus. It creates a universal skin theme configuration file for custom components, where all custom component attributes are found. The skin theme configuration file uses default parameters in the constructor, supporting the creation of multiple different skin theme configuration file schemes. Thus, when the skin manager switches skin themes, only the current skin theme configuration file needs to be replaced. Furthermore, custom component skin attributes are decoupled from the application theme and bound to the theme in the skin manager via a Stream. When the skin theme in the skin manager changes, all custom components are asynchronously broadcast via a Stream to refresh and reconstruct, and the current skin theme key is saved locally for direct access upon the next application launch. This technical solution achieves the refresh and reconstruction of the application's new skin theme scheme for all custom components on all pages without refreshing the entire application, resulting in minimal performance overhead. Simultaneously, because it is separated from the MaterialApp application theme attributes, it has no intrusiveness when integrated into existing projects and has minimal compatibility issues with subsequent Flutter version upgrades.

[0051] The following is a detailed description of a dynamic skinning method in this application:

[0052] Figure 1 This is a flowchart illustrating a dynamic skinning method provided in an embodiment of this application. Figure 1 As shown in the embodiment of this application, a dynamic skinning method includes:

[0053] S10: Obtain a user's request to switch application skin theme, the request including a first target skin theme scheme;

[0054] Specifically, when a user switches skin themes within the application, in response to the user's click to switch and the selected target skin theme, a corresponding request to switch the application's skin theme is generated. This request carries an identifier of the user's selected target skin theme scheme. Based on this identifier, the target skin theme scheme can be determined from multiple pre-stored skin theme configuration files in the skin manager. Optionally, this identifier can be a skin theme key corresponding to the skin theme scheme, or a code or identification code used to distinguish each skin theme scheme.

[0055] S11: Determine whether the first target skin theme scheme exists in the pre-stored skin theme configuration file schemes according to the request;

[0056] Specifically, this application pre-stores multiple skin theme configuration file schemes through the skin manager. Each skin theme configuration file scheme has its corresponding skin theme configuration file. The skin theme configuration file contains the skin theme key corresponding to the skin theme, as well as the attribute parameters corresponding to the skin theme. The attribute parameters include the color, font size, font, and font weight of each component in the application.

[0057] S12: If the first target skin theme scheme exists in the pre-stored skin theme configuration file scheme, obtain the first target skin theme key corresponding to the first target skin theme scheme from the skin theme configuration file scheme, assign the first target skin theme key to the current skin theme variable, and obtain the updated current skin theme variable;

[0058] Specifically, the first target skin theme key is obtained and assigned to the current skin theme variable. The value of the current skin theme variable will be updated accordingly to the first target skin theme key. Through the current skin theme variable, the skin theme configuration file corresponding to the current application skin theme can be accurately determined. Based on the first target skin theme key, the target skin theme scheme can be quickly located from multiple application skin theme configuration file schemes, improving the efficiency and accuracy of determining the target skin theme scheme.

[0059] S13: Save the updated value of the current skin theme variable to the skin theme saving plugin, and asynchronously notify the custom component in the custom component library to refresh and refactor.

[0060] Specifically, the skin theme saving plugin is Flutter's Shared Preferences plugin, which is a local storage. In this embodiment of the application, the Flutter Shared Preferences plugin is used to save the currently selected skin theme key. Saving the skin theme key in the Shared Preferences plugin realizes the local storage of the configuration file so that when the application is closed or exited, the previously selected skin theme can be continued when the application is restarted.

[0061] Furthermore, each custom component in the custom component library is bound using a StreamBuilder component, and the StreamBuilder component is bound to a Stream object in the skin manager; the asynchronous notification of the custom component refresh and reconstruction in the custom component library includes: asynchronously broadcasting notifications to the custom component library to refresh and reconstruct through the Stream object of the skin manager.

[0062] In this embodiment of the application, when constructing the component, the component is wrapped with a StreamBuilder component. The StreamBuilder component's constructor parameter `stream` is bound to a Stream object in the skin manager. The skin manager's function is to predefine several skin theme schemes. When switching skin themes, it can immediately broadcast notifications to all custom components to refresh and refactor via the Stream object. Here, Stream is the core of asynchronous programming provided by the Dart language. By broadcasting notifications to the component library components to refresh and refactor via a Broadcast type Stream, all associated custom components in the application will take effect when switching skin themes, and this effect will also remain after the application restarts. Asynchronously broadcasting notifications to refresh and refactor custom components in the custom component library via the Stream object can minimize the performance loss caused by skin switching. On the other hand, the component library's skinning scheme is independent of the application theme and will not be affected by the scheme compatibility issues caused by Flutter version upgrades.

[0063] Furthermore, the method in this embodiment of the application also includes: obtaining the skin attribute configuration of the custom component from the current skin theme of the skin manager.

[0064] Specifically, when creating a custom component, the skin attribute configuration of the custom component is obtained from the current skin theme of the skin manager by default. That is, when encapsulating and designing a custom component library according to business needs, the attributes of each custom component in the custom component library that involve skin changes are obtained from the corresponding attributes of the current skin theme in the skin manager. The skin manager is responsible for storing, initializing and switching skin schemes for the entire custom component library.

[0065] For details, please refer to Figure 2 , Figure 2 The attached flowchart illustrates the skin theme switching process during application operation. Figure 2 As shown, the entire process of skin theme switching in the embodiments of this application is described in detail:

[0066] When a user switches skin themes, the corresponding skin theme is selected from the pre-built skin themes. If a skin theme exists in the pre-built skin themes, it is assigned to the current theme variable. The current skin theme key is saved via SharedPreferences. If SharedPreferences saves successfully, a custom component is asynchronously broadcast to refresh and refactor via Stream.sink.add(), and the process ends. Specifically, after setting a new skin theme, Stream.sink.add() in the skin manager is called to send an asynchronous broadcast notification to the custom component library. Custom components in the custom component library will refresh and refactor upon receiving the broadcast notification. If no skin theme is found in the pre-built skin themes, a message indicating that no skin theme exists is displayed, and the process ends. If saving the current skin theme key via SharedPreferences fails, the process ends.

[0067] This application provides a dynamic skin-switching method. This method pre-stores multiple skin theme configuration files, each with a skin theme key. When a user needs to switch application skins, the method reads the target skin theme configuration file from the pre-stored files and assigns the skin theme key from that file to the current skin theme variable. A skin theme saving plugin saves the currently selected skin theme key so that when the application is closed or exited, it can continue to use the previously selected skin theme upon restart. Based on this skin theme key, the corresponding target skin theme configuration file can be accurately determined. Furthermore, when switching skin themes, custom components in the custom component library are asynchronously notified to refresh and refactor, improving skin-switching efficiency and reducing application performance overhead. This skin theme switching scheme is non-intrusive and non-destructive to the original theme, operating independently of the original application system theme, and is used for skin-switching schemes within custom components.

[0068] Furthermore, another embodiment of this application provides a dynamic method, the method further comprising:

[0069] In response to a user's request to launch the application, multiple skin theme configuration file schemes are pre-stored in the skin manager; skin theme key records are read from the skin theme saving plugin; based on the skin theme key records, it is determined whether a stored skin theme key exists in the skin theme saving plugin; if the stored skin theme key exists in the skin theme saving plugin, it is determined whether a second target skin theme scheme corresponding to the stored skin theme key exists in the skin theme configuration file schemes pre-stored in the skin manager; if the second target skin theme scheme exists in the skin manager, the second target skin theme scheme is read, and the stored skin theme key corresponding to the second target skin theme scheme is assigned to the current skin theme variable; if the stored skin theme key does not exist in the skin theme saving plugin, or the second target skin theme scheme corresponding to the stored skin theme key does not exist in the skin theme configuration file schemes pre-stored in the skin manager, a default skin theme scheme is created, and the default skin theme key corresponding to the default skin theme scheme is assigned to the current skin theme variable.

[0070] The step of reading the second target skin theme scheme includes: reading the Stream object corresponding to the second target skin theme scheme from the skin manager. When the application starts for the first time, the skin theme settings also use a Stream object to send asynchronous events, notifying custom components in the custom component library to refresh.

[0071] For details, please refer to Figure 3 , Figure 3 A flowchart illustrating the process of setting up the initial skin theme for the application upon first launch, as follows: Figure 3 The following provides a detailed description of the initial skin theme setting method when the application is first launched in this embodiment of the present application:

[0072] In response to a user's request to launch the application, multiple different skin theme schemes are manually pre-installed by calling the skin manager `setThemeDataMap()` upon application launch, followed by initializing the skin manager by calling `init()`. The initialization method reads skin theme key records from the SharedPreferences plugin. It checks if the local storage (SharedPreferences plugin) contains a record of the skin theme key. If the key exists, it reads a skin theme scheme from the pre-installed schemes. If a skin theme is found in the pre-installed schemes, the key is assigned to the current skin theme variable. If no key exists, a default skin theme is created, and the corresponding default skin theme key is assigned to the current skin theme variable, thus initializing the skin.

[0073] In this embodiment of the application, the skin theme key record is first read from the SharedPreferences plugin. If the skin theme key in the SharedPreferences plugin can be read directly, after reading the skin theme configuration file scheme from the skin manager, the skin theme key in the SharedPreferences plugin is used to set the skin when the application starts. There is no need to repeatedly store the skin theme key in the SharedPreferences plugin, which saves resources and improves the efficiency of skin theme initialization.

[0074] The following describes a dynamic skin-swapping device according to an embodiment of this application. Please refer to [link / reference]. Figure 4 Based on the dynamic skinning method in the above embodiments, this application implements the dynamic skinning method through a dynamic skinning device. The dynamic skinning device in this application includes:

[0075] The acquisition unit 201 is used to acquire a user's request to switch the application skin theme, the request including a first target skin theme scheme;

[0076] The first judgment unit 202 is used to determine whether the first target skin theme scheme exists in the pre-stored skin theme configuration file scheme according to the request;

[0077] Update unit 203 is used to obtain the first target skin theme key corresponding to the first target skin theme scheme from the skin theme configuration file scheme if the first target skin theme scheme exists in the pre-stored skin theme configuration file scheme, and assign the first target skin theme key to the current skin theme variable to obtain the updated current skin theme variable;

[0078] Storage unit 204 is used to save the updated value of the current skin theme variable to the skin theme saving plugin;

[0079] Processing unit 205 is used to asynchronously notify custom components in the custom component library to refresh and refactor.

[0080] Each custom component in the custom component library is bound to a StreamBuilder component, and the StreamBuilder component is bound to a Stream object in the skin manager; the processing unit 205 is specifically used to: asynchronously broadcast notifications to the custom components in the custom component library to refresh and reconstruct via the Stream object of the skin manager.

[0081] Furthermore, the dynamic skin-skinning device also includes:

[0082] The first generation unit is used to obtain the skin attribute configuration of the custom component from the current skin theme of the skin manager.

[0083] Furthermore, the dynamic skin-changing device in this embodiment of the application also includes:

[0084] The initialization unit is used to respond to the user's request to launch the application, pre-store multiple skin theme configuration file schemes in the skin manager, and read the skin theme key record from the skin theme saving plugin;

[0085] The second judgment unit is used to determine whether there is a stored skin theme key in the skin theme saving plugin based on the skin theme key record.

[0086] The third judgment unit is used to determine whether there is a second target skin theme scheme corresponding to the skin theme key stored in the skin theme saving plugin if the stored skin theme key exists in the skin theme saving plugin.

[0087] The first determining unit is configured to, if the skin manager has the second target skin theme scheme, read the second target skin theme scheme and assign the stored skin theme key corresponding to the second target skin theme scheme to the current skin theme variable;

[0088] The second determining unit is used to create a default skin theme scheme and assign the default skin theme key corresponding to the stored skin theme key to the current skin theme variable if the stored skin theme key key is not present in the skin theme saving plugin or the skin theme configuration file scheme pre-stored by the skin manager is not present.

[0089] Specifically, the first determining unit is used to: read the Stream object corresponding to the second target skin theme scheme from the skin manager.

[0090] This application discloses a dynamic skin-changing device in this embodiment. The device pre-stores multiple skin theme configuration files, each with a skin theme key. When a user needs to switch application skins, it reads the target skin theme configuration file from the pre-stored files and assigns the skin theme key from that file to the current skin theme variable. A skin theme saving plugin saves the currently selected skin theme key so that when the application is closed or exited, it can continue using the previously selected skin theme upon restart. Based on this skin theme key, the corresponding target skin theme configuration file can be accurately determined. Furthermore, when creating custom components, the component's skin attribute configuration is obtained by default from the current skin theme in the skin manager. During component construction, the component is wrapped with a StreamBuilder component, and the StreamBuilder component's constructor parameter `stream` is bound to a Stream object in the skin manager. When switching skin themes, all custom components are immediately notified via a broadcast through the Stream object to refresh and refactor, thus improving the efficiency of application skin-changing and reducing application performance overhead.

[0091] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily 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 this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A Flutter-based dynamic skinning method, characterized in that, The method comprises: obtaining a request of a user switching an application skin theme, the request comprising a first target skin theme scheme; determining whether the first target skin theme scheme exists in a pre-stored skin theme configuration file scheme according to the request; the skin theme configuration file adopts a constructor default parameter form, and supports creating multiple different skin theme configuration file schemes; if the first target skin theme scheme exists in the pre-stored skin theme configuration file scheme, obtaining a first target skin theme key corresponding to the first target skin theme scheme from the skin theme configuration file scheme, assigning the first target skin theme key to a current skin theme variable, and obtaining an updated current skin theme variable; saving a value of the updated current skin theme variable to a skin theme saving plug-in, asynchronously notifying custom component libraries of refreshing and reconstruction, separating custom component skin attributes from application themes, binding each custom component in the custom component libraries by using a StreamBuilder component, and binding the StreamBuilder component and a Stream object in a skin manager; when a skin theme in the skin manager changes, the custom components in the custom component libraries are asynchronously notified of refreshing and reconstruction by the Stream object in the skin manager.

2. The method of claim 1, wherein, The method further comprises: obtaining skin attribute configurations of the custom components from a current skin theme of the skin manager.

3. The method of claim 1, wherein, The method further comprises: in response to a request of a user starting an application, pre-storing multiple skin theme configuration file schemes in a skin manager; reading skin theme key records from the skin theme saving plug-in; determining whether the skin theme saving plug-in stores a stored skin theme key according to the skin theme key records; if the skin theme saving plug-in stores the stored skin theme key, determining whether a second target skin theme scheme corresponding to the stored skin theme key exists in the skin theme configuration file schemes pre-stored in the skin manager; if the skin manager stores the second target skin theme scheme, reading the second target skin theme scheme, and assigning a stored skin theme key corresponding to the second target skin theme scheme to the current skin theme variable; if the skin theme saving plug-in does not store the stored skin theme key, or the skin theme configuration file schemes pre-stored in the skin manager do not store a second target skin theme scheme corresponding to the stored skin theme key, creating a default skin theme scheme, and assigning a default skin theme key corresponding to the default skin theme scheme to the current skin theme variable.

4. The method of claim 3, wherein, The reading of the second target skin theme scheme comprises: reading a Stream object corresponding to the second target skin theme scheme from the skin manager.

5. A Flutter-based dynamic skin changing device, characterized by, The device comprises: The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device.

6. The dynamic skin device of claim 5, wherein, The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device.

7. The dynamic skin device of claim 5, wherein, The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching method and device. The application discloses a skin theme switching The second determining unit is configured to: if the stored skin theme key does not exist in the skin theme storage plug-in, or the second target skin theme scheme corresponding to the stored skin theme key does not exist in the pre-stored skin theme profile scheme of the skin manager, create a default skin theme scheme, and assign a default skin theme key corresponding to the default skin theme scheme to the current skin theme variable.

8. The dynamic skin device of claim 7, wherein, The first determining unit is specifically configured to: read a Stream object corresponding to the second target skin theme scheme from the skin manager.

Citation Information

Patent Citations

  • One-key skin changing method based on Android platform

    CN106250157A