Skip to content
This repository was archived by the owner on Jun 25, 2025. It is now read-only.

Commit 06e193f

Browse files
authored
Documentation sprint 28 v0.8.0 (#346)
* documentation: add navigation rail * documentation: add header card and add api token * fix : get started and code menu, app bar top * add change log
1 parent dad86ef commit 06e193f

22 files changed

+233
-44
lines changed

app/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1818
- ODS - Component - Cards: Title First Card ([#9](https://github.com/Orange-OpenSource/ods-flutter/issues/9))
1919
- About - Page ([#332](https://github.com/Orange-OpenSource/ods-flutter/issues/332))
2020
- Module - List ([#331](https://github.com/Orange-OpenSource/ods-flutter/issues/331))
21+
- Documentation : sprint documentation ([#345](https://github.com/Orange-OpenSource/ods-flutter/issues/345))
2122

2223
## Changed
2324

2425
- Vertical Card customization updates ([#189](https://github.com/Orange-OpenSource/ods-flutter/issues/189))
2526
- Update Copyright in files ([#303](https://github.com/Orange-OpenSource/ods-flutter/issues/303))
2627
- Typographie flutter ios ([#293](https://github.com/Orange-OpenSource/ods-flutter/issues/293))
27-
- [Bug]: Snackbar without action text positioning ([#198](https://github.com/Orange-OpenSource/ods-flutter/issues/198))
2828
- Update components to show label content examples ([#198](https://github.com/Orange-OpenSource/ods-flutter/issues/295))
2929
- [Bug]: Text Field > Trailing element > text issue ([#314](https://github.com/Orange-OpenSource/ods-flutter/issues/314))
3030
- [Bug]: Text Field > Input type > single line doesn't stay on 1 line ([#315](https://github.com/Orange-OpenSource/ods-flutter/issues/315))

app/lib/ui/components/cards/card_small.dart

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import 'dart:math';
1414

1515
import 'package:flutter/material.dart';
1616
import 'package:flutter_gen/gen_l10n/ods_flutter_app_localizations.dart';
17+
import 'package:ods_flutter/components/card/ods_cards_common.dart';
1718
import 'package:ods_flutter/components/card/ods_small_card.dart';
1819
import 'package:ods_flutter/components/lists/ods_list_switch.dart';
1920
import 'package:ods_flutter/components/sheets_bottom/ods_sheets_bottom.dart';
@@ -75,16 +76,11 @@ class _Body extends StatelessWidget {
7576
subtitle: customizationState?.hasSubtitle == true
7677
? recipe.subtitle
7778
: null,
78-
image: FadeInImage(
79-
placeholder: AssetImage('assets/placeholder.png'),
80-
image: NetworkImage(recipe.url),
81-
fit: BoxFit.cover,
82-
imageErrorBuilder: (context, error, stackTrace) {
83-
return Image(
84-
image: AssetImage('assets/placeholder.png'),
85-
fit: BoxFit.cover,
86-
);
87-
},
79+
image: OdsCardImage(
80+
imageProvider: NetworkImage(recipe.url),
81+
contentDescription: '', //Optional
82+
alignment: Alignment.center,
83+
contentScale: BoxFit.cover,
8884
),
8985
onTap: customizationState!.clickable ? () {} : null,
9086
),

docs/_data/data_menus.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ toc2:
3434
url: components/listsItem_docs
3535
- page: Menus
3636
url: components/menus_docs
37+
- page: Navigation Rail
38+
url: components/navigation_rail_docs
3739
- page: Progress indicator
3840
url: components/progressIndicator_docs
3941
- page: Radio buttons

docs/components/appBarsTop.md

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -34,20 +34,11 @@ Here is an example of use:
3434

3535
```dart
3636
return OdsAppTopBar(
37-
title: "Regular",
38-
actions: IconButton(icon: const Icon(Icons.notifications), onPressed: () {}),
39-
leading: BackButton(),
40-
body: ListView.builder(
41-
itemCount: 10,
42-
itemBuilder: (context, index) {
43-
final itemNumber = index.toString();
44-
return ListTile(
45-
title: Text(
46-
'Item #$itemNumber',
47-
),
48-
);
49-
},
50-
)
37+
title: "App Bar",
38+
actions: [
39+
IconButton(icon: const Icon(Icons.color_lens), onPressed: () {})
40+
],
41+
navigationIcon: const BackButton(),
5142
);
5243
```
5344

docs/components/cards.md

Lines changed: 84 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,24 @@ description: Cards contain content and actions about a single subject.
99
**Page Summary**
1010

1111
* Table of contents
12-
{:toc}
12+
* [Specifications references](#specifications-references)
13+
* [Accessibility](#accessibility)
14+
* [Variants](#variants)
15+
* [Vertical image first card](#vertical-image-first-card)
16+
* [OdsVerticalImageFirstCard API](#odsverticalimagefirstcard-api)
17+
* [Vertical header first card](#vertical-header-first-card)
18+
* [OdsVerticalHeaderFirstCard API](#odsverticalheaderfirstcard-api)
19+
* [Small card](#small-card)
20+
* [OdsSmallCard API](#odssmallcard-api)
21+
* [Horizontal card](#horizontal-card)
22+
* [OdsHorizontalCard API](#odshorizontalcard-api)
1323

1424
---
1525

1626
## Specifications references
1727

1828
- [Design System Manager - Cards](https://system.design.orange.com/0c1af118d/p/0336aa-cards/b/47a25a)
1929
- [Material Design - Cards](https://material.io/components/cards/)
20-
- Technical documentation soon available
2130

2231
## Accessibility
2332

@@ -29,17 +38,17 @@ Please follow [accessibility criteria for development](https://m3.material.io/co
2938

3039
This is a full width card containing elements arranged vertically with an image as first element.
3140

32-
![Horizontal card light](images/card_vertical_image_first_light.png) ![Horizontal card dark](images/card_vertical_image_first_dark.png)
41+
![Horizontal card light](images/card_vertical_image_first_lightt.png) ![Horizontal card dark](images/card_vertical_image_first_darkk.png)
3342

3443
> **Flutter implementation**
3544
36-
In your screen you can use `OdsVerticalImageFirstCard` composable:
45+
In your screen you can use `OdsVerticalImageFirstCard` :
3746

3847
```dart
3948
return OdsVerticalImageFirstCard(
4049
title: "Title",
4150
image: OdsCardImage(
42-
imageProvider: NetworkImage(recipe.url),
51+
imageProvider: NetworkImage('assets/placeholder.png'),
4352
contentDescription: 'Picture content description', //Optional
4453
alignment: Alignment.center, //Optional. Center by default.
4554
contentScale: BoxFit.cover, //Optional. BoxFit.cover by default.
@@ -60,27 +69,90 @@ Parameter | Default value | Description
6069
`image: OdsCardImage` | | Image displayed into the card
6170
`subtitle: String?` | `null` | Subtitle displayed into the card
6271
`text: String?` | `null` | Text displayed into the card
63-
`firstButton: OdsCard.Button?` | `null` | First button displayed into the card
64-
`secondButton: OdsCard.Button?` | `null` | Second button displayed into the card
72+
`firstButton: OdsOutlinedButton?` | `null` | First button displayed into the card
73+
`secondButton: OdsButton?` | `null` | Second button displayed into the card
6574
`onClick: (() -> Void)?` | `null` | Callback called on card click
6675

6776
### Vertical header first card
6877

6978
This is a full width card containing elements arranged vertically with a header (thumbnail, title & subtitle) as first element.
7079

80+
![Horizontal card light](images/card_header_first_light.png) ![Horizontal card dark](images/card_header_first_dark.png)
81+
7182
> **Flutter implementation**
7283
73-
_Soon available_
84+
In your screen you can use `OdsVerticalHeaderFirstCard` :
85+
86+
```dart
87+
return OdsVerticalHeaderFirstCard(
88+
title: "Title",
89+
thumbnail: OdsCardThumbnail(
90+
imageProvider: NetworkImage('assets/placeholder.png'),
91+
contentDescription: 'Picture content description', //Optional
92+
alignment: Alignment.center, //Optional. Center by default.
93+
contentScale: BoxFit.cover, //Optional. BoxFit.cover by default.
94+
),
95+
image: OdsCardImage(
96+
imageProvider: NetworkImage('assets/placeholder.png'),
97+
contentDescription: 'Picture content description', //Optional
98+
alignment: Alignment.center, //Optional. Center by default.
99+
contentScale: BoxFit.cover, //Optional. BoxFit.cover by default.
100+
),
101+
subtitle: "Subtitle", //Optional
102+
text: "Text", //Optional
103+
firstButton: OdsOutlinedButton(text: "First button", onClick: () {}), //Optional
104+
secondButton: OdsButton(text: "Second button", onClick: () {}), //Optional
105+
onClick: () {},
106+
);
107+
```
108+
109+
##### OdsVerticalHeaderFirstCard API
110+
111+
Parameter | Default value | Description
112+
-- | -- | --
113+
`title: String` | | Title displayed into the card
114+
`image: OdsCardImage` | | Image displayed into the card
115+
`subtitle: String?` | `null` | Subtitle displayed into the card
116+
`text: String?` | `null` | Text displayed into the card
117+
`firstButton: OdsOutlinedButton?` | `null` | First button displayed into the card
118+
`secondButton: OdsButton?` | `null` | Second button displayed into the card
119+
`onClick: (() -> Void)?` | `null` | Callback called on card click
120+
{:.table}
121+
74122

75123
### Small card
76124

77125
This is a small card which takes the half screen width.
78126

127+
![Horizontal card light](images/card_small_light.png) ![Horizontal card dark](images/card_small_dark.png)
128+
79129
> **Flutter implementation**
80130
81131
You can add an `OdsSmallCard` in your screen to add a small card:
82132

83-
_Soon available_
133+
```dart
134+
return OdsSmallCard(
135+
title: "Title",
136+
image: OdsCardImage(
137+
imageProvider: NetworkImage('assets/placeholder.png'),
138+
contentDescription: 'Picture content description', //Optional
139+
alignment: Alignment.center, //Optional. Center by default.
140+
contentScale: BoxFit.cover, //Optional. BoxFit.cover by default.
141+
),
142+
subtitle: "Subtitle", //Optional
143+
onTap: () {},
144+
);
145+
```
146+
147+
##### OdsSmallCard API
148+
149+
Parameter | Default value | Description
150+
-- | -- | --
151+
`title: String` | | Title displayed into the card
152+
`image: OdsCardImage` | | Image displayed into the card
153+
`subtitle: String?` | `null` | Subtitle displayed into the card
154+
`onTap: (() -> Void)?` | `null` | Callback called on card click
155+
{:.table}
84156

85157
### Horizontal card
86158

@@ -96,7 +168,7 @@ In your screen you can use `OdsHorizontalCard` composable:
96168
return OdsHorizontalCard(
97169
title: "Title",
98170
image: OdsCardImage(
99-
imageProvider: NetworkImage(recipe.url),
171+
imageProvider: NetworkImage('assets/placeholder.png'),
100172
contentDescription: 'Picture content description', //Optional
101173
alignment: Alignment.center, //Optional. Center by default.
102174
contentScale: BoxFit.cover, //Optional. BoxFit.cover by default.
@@ -119,12 +191,8 @@ Parameter | Default value | Description
119191
`image: OdsCardImage` | | Image displayed into the card
120192
`subtitle: String?` | `null` | Subtitle displayed into the card
121193
`text: String?` | `null` | Text displayed into the card
122-
`firstButton: OdsCard.Button?` | `null` | First button displayed into the card
123-
`secondButton: OdsCard.Button?` | `null` | Second button displayed into the card
194+
`firstButton: OdsOutlinedButton?` | `null` | First button displayed into the card
195+
`secondButton: OdsButton?` | `null` | Second button displayed into the card
124196
`imagePosition: OdsHorizontalCardImagePosition` | `OdsHorizontalCardImagePosition.Start` | Position of the image within the card, it can be set to `OdsHorizontalCardImagePosition.start` or `OdsHorizontalCardImagePosition.end`
125197
`divider: Boolean` | `false` | Controls the divider display. If true, it will be displayed between the card content and the action buttons.
126198
`onClick: (() -> Void)?` | `null` | Callback called on card click
127-
128-
## Component specific tokens
129-
130-
_Soon available_
183 KB
Loading
165 KB
Loading
118 KB
Loading
118 KB
Loading
-30.2 KB
Binary file not shown.

0 commit comments

Comments
 (0)