diff --git a/docs/resources/ui/widgets/built-in-widgets/card.md b/docs/resources/ui/widgets/built-in-widgets/card.md index 5e2086c5..f6d77d66 100644 --- a/docs/resources/ui/widgets/built-in-widgets/card.md +++ b/docs/resources/ui/widgets/built-in-widgets/card.md @@ -1,47 +1,61 @@ --- slug: card tags: [Layout Elements] +description: Learn how to add and customize a Card widget in FlutterFlow. --- # Card -The [Card](https://api.flutter.dev/flutter/material/Card-class.html) widget is used to represent some related information in a box with rounded corners and a slight shadow for a 3D effect. For example, you can use a Card widget to show a Business card, restaurant information, movie details, etc. - -The Card widget is often used with a List to display the item information for a specific record. - -![img.png](imgs/img.png) - -## Adding Card Widget - -Here's an example of how you can use a Card widget in your project: - -1. Open the [Widget Palette](../../../../intro/ff-ui/widget-palette.md) and locate the **Card** - widget under the **Layout Elements** tab. You can drag it into your desired location or add it directly from the widget tree or canvas area. -2. Start with adding a `Row` or `Column` widget inside the Card and build the UI as per your requirements. - -
- - - -## Customizing - -You can customize the appearance and behavior of this widget using the various properties -available under the Properties Panel. +The [Card](https://api.flutter.dev/flutter/material/Card-class.html) widget displays related content on a surface with rounded corners and a shadow. Use it for product details, restaurant details, profiles, or other content that should appear as a single item. + +![Card widgets used for products and team profiles](imgs/card-widget-use-cases.avif) + +## Adding a Card Widget + +To add a Card widget: + +1. Add the **Card** widget from the **Layout Elements** section of the [Widget Palette](../../../../intro/ff-ui/widget-palette.md). +2. Add a layout widget, such as a **Row** or **Column**, as its child. +3. Add and arrange the content inside the layout widget. + +
+ +
+

-### Styling the Card +## Card vs Container -Styling helps you customize a widget that matches your design. The Card widget allows you to customize the background color, elevation, and rounded corners. +Use a **Card** when you want a Material-style surface with built-in elevation, rounded corners, and a background color. Use a [**Container**](../basic-widgets/container.md) when you need more control over dimensions, alignment, borders, gradients, or other decorations. -Here's how you stylize the Card widget: +## Using Cards with Dynamic Data -1. Select the **Card** widget and move to the **Properties Panel > Card Properties**. -2. To change the background color, [modify the Color](../../widgets/widget-commonalities.md#change-color) property. -3. To change the elevation (depth or Z-axis), enter the value in the **Elevation** property. -4. To create the rounded border, use the **Border Radius** property. For uniform curvature on all sides, use the **Uniform Radius** option by sliding the adjustment bar or inputting your preferred value directly. +To display repeated records, place a **Card** inside a **ListView** or **GridView**, then [**generate dynamic children**](../composing-widgets/generate-dynamic-children.md) from a list or backend query. Bind the widgets inside the Card to the current item to show information such as a product image, name, price, or user profile. -

+## Customizing a Card Widget -
+Select the **Card** widget and use the **Card Properties** section to customize its appearance: +- **Color:** Sets the card's background color. +- **Elevation:** Controls the card's shadow and visual depth. Use `0` to remove the shadow. +- **Border Radius:** Rounds the card's corners. Apply one value to every corner or configure each corner separately. diff --git a/docs/resources/ui/widgets/built-in-widgets/imgs/card-widget-use-cases.avif b/docs/resources/ui/widgets/built-in-widgets/imgs/card-widget-use-cases.avif new file mode 100644 index 00000000..044fdeb3 Binary files /dev/null and b/docs/resources/ui/widgets/built-in-widgets/imgs/card-widget-use-cases.avif differ