FigmaClient class
A client for interacting with the Figma API.
Constructors
- FigmaClient(String accessToken, {String apiVersion = 'v1', bool useHttp2 = !kIsWeb, bool useOAuth = false})
Properties
- accessToken → String
-
The personal access token for the Figma Account to be used
Or the OAuth token, if useOAuth is true.
final
- apiVersion → String
-
Specifies the Figma API version to be used. Should only be
specified if package is not updated with a new API release.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- useHttp2 → bool
-
Use HTTP2 sockets for interacting with API.
final
- useOAuth → bool
-
final
Methods
-
authenticatedGet(
String url) → Future< Map< String, dynamic> > - Does an authenticated GET request towards the Figma API.
-
deleteComment(
String key, String id) → Future< void> -
Deletes the comment given by
id
from the Figma file specified bykey
. -
getComments(
String key) → Future< List< Comment> > -
Retrieves comments from the Figma file specified by
key
. -
getComponent(
String key) → Future< ComponentResponse> -
Retrivies a specific component specified by
key
. -
getFile(
String key, [FigmaQuery? query]) → Future< FileResponse> -
Retrieves the Figma file specified by
key
. -
getFileComponents(
String key, [FigmaQuery? query]) → Future< ComponentsResponse> -
Retrieves all components from the Figma file specified by
key
. -
getFileNodes(
String key, FigmaQuery query) → Future< NodesResponse> - Retrieves the file nodes specified.
-
getFileStyles(
String key, [FigmaQuery? query]) → Future< StylesResponse> -
Retrieves all styles from the Figma file specified by
key
. -
getFileVersions(
String key) → Future< List< Version> > -
Retrieves all versions of the Figma file specified by
key
. -
getImageFills(
String? key) → Future< ImageResponse> - Retrieves the image fills specified.
-
getImages(
String key, FigmaQuery query) → Future< ImageResponse> - Retrieves the images specified.
-
getMe(
) → Future< User> -
Retrieves the Figma
User
in ownership of the currently used access token. -
getProjectFiles(
String project) → Future< ProjectFilesResponse> -
Retrieives all project files specified by
project
. -
getStyle(
String key) → Future< StyleResponse> -
Retrieves a specific style specified by
key
. -
getTeamComponents(
String team, [FigmaQuery? query]) → Future< ComponentsResponse> -
Retrieives all components from the Figma team specified by
team
. -
getTeamProjects(
String team) → Future< TeamProjectsResponse> -
Retrieves all projects for the specified
team
. -
getTeamStyles(
String team, [FigmaQuery? query]) → Future< StylesResponse> -
Retrieves all styles for the Figma team specified by
team
. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
postComment(
String key, PostComment comment) → Future< Comment> -
Posts the given
Comment
to the Figma file specified bykey
. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited