Skip to content

Commit

Permalink
331 module list (#339)
Browse files Browse the repository at this point in the history
* app : add illustration asset

* library : update list standard by list_item

* app : add l10n keys

* app : update list standard by list_item

* app : add module lists

* app and library : add changelog
  • Loading branch information
Tayebsed93 authored Mar 4, 2024
1 parent 879fdeb commit b7b558b
Show file tree
Hide file tree
Showing 29 changed files with 453 additions and 375 deletions.
3 changes: 2 additions & 1 deletion NOTICE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ ods-flutter/app/assets/il_snackbars.svg
ods-flutter/app/assets/il_app_bars_top_generic.svg
ods-flutter/app/assets/il_chips.png
ods-flutter/app/assets/il_floating_action_button.svg
ods-flutter/app/assets/il_lists.svg
ods-flutter/app/assets/il_lists.png
ods-flutter/app/assets/il_color.png
ods-flutter/app/assets/il_spacing.png
ods-flutter/app/assets/il_sheets_bottom.png
Expand All @@ -47,6 +47,7 @@ ods-flutter/app/assets/il_navigation_rail.png
ods-flutter/app/assets/ic_calendar_event_info.png
ods-flutter/app/assets/ic_identity_protection.png
ods-flutter/app/assets/ic_task_list.png
ods-flutter/app/assets/il_list_item.png

ods-flutter/app/assets/1.5x/il_about.png
ods-flutter/app/assets/1.5x/il_switches.png
Expand Down
1 change: 1 addition & 0 deletions app/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- ODS - Component - Navigation Rail ([#25](https://github.com/Orange-OpenSource/ods-flutter/issues/25))
- ODS - Component - Cards: Title First Card ([#9](https://github.com/Orange-OpenSource/ods-flutter/issues/9))
- About - Page ([#332](https://github.com/Orange-OpenSource/ods-flutter/issues/332))
- Module - List ([#331](https://github.com/Orange-OpenSource/ods-flutter/issues/331))

## Changed

Expand Down
Binary file added app/assets/il_list_item.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/il_lists.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion app/assets/il_lists.svg

This file was deleted.

21 changes: 7 additions & 14 deletions app/lib/l10n/ods_flutter_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -228,19 +228,17 @@
"componentListItemDescription": "A list item is the individual element of data entries like text, icons or images that is used to create a list.",

"@_LISTS_VARIANT": {},
"listVariantSelectionTitle": "List with selection",
"listSelectionTitle": "List selection",
"listVariantSelectionSubtitle": "OdsListSelectionItem",
"listVariantStandardTitle": "Standard Lists",
"listVariantStandardSubtitle": "OdsListStandardItem",
"listVariantItemTitle": "List item demo",
"listSelectionTitle": "List item",
"listVariantItemSubtitle": "OdsListItem",
"listCustomizationSubtitle": "Subtitle",
"listLeadingCustomizationTitle": "Leading",
"listLeadingCustomizationTitle": "Leading - Before the list text",
"listLeadingEnumNone": "None",
"listLeadingEnumIcon": "Icon",
"listLeadingEnumCircle": "Circle",
"listLeadingEnumWide": "Wide",
"listLeadingEnumSquare": "Square",
"listTrailingCustomizationTitle": "Trailing",
"listTrailingCustomizationTitle": "Trailing - After the list text",
"listTrailingEnumNone": "None",
"listTrailingEnumSwitch": "Switch",
"listTrailingEnumCheckbox": "Checkbox",
Expand Down Expand Up @@ -369,13 +367,8 @@
"componentTextFieldVisualisationIcon": "Visualisation icon",
"componentTextFieldErrorMessage": "Error message",

"@_COMPONENTS_MATERIALS": {},
"componentMaterialsTitle": "Materials",

"componentMaterialsDescription": "On/off switches toggle the state of a single settings option. The function of the switch should be made clear by the inline label.",
"@_MATERIALS_VARIANT": {},
"materialsVariantTitle": "Others",
"materialsVariantSubtitle": "Material",
"@_MODULES_SCREEN": {},
"moduleLists": "Lists",

"@_ABOUT_SCREEN": {},
"aboutScreenTitle": "Orange Design System Flutter App",
Expand Down
10 changes: 5 additions & 5 deletions app/lib/ui/about/about_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/ods_flutter_app_localizations.dart';
import 'package:get/get.dart';
import 'package:ods_flutter/components/lists/ods_list_standard_item.dart';
import 'package:ods_flutter/components/lists/ods_list_item.dart';
import 'package:ods_flutter/guidelines/spacings.dart';
import 'package:ods_flutter_demo/ui/about/detail/about_file_screen.dart';
import 'package:package_info_plus/package_info_plus.dart';
Expand Down Expand Up @@ -75,7 +75,7 @@ class _AboutScreenState extends State<AboutScreen> {
],
),
),
OdsListStandardItem(
OdsListItem(
title: AppLocalizations.of(context)!.aboutMenuChangelog,
image: ImageIcon(
AssetImage('assets/ic_task_list.png'),
Expand All @@ -91,7 +91,7 @@ class _AboutScreenState extends State<AboutScreen> {
);
},
),
OdsListStandardItem(
OdsListItem(
title: "Privacy Policy",
image: ImageIcon(
AssetImage('assets/ic_identity_protection.png'),
Expand All @@ -107,7 +107,7 @@ class _AboutScreenState extends State<AboutScreen> {
);
},
),
OdsListStandardItem(
OdsListItem(
title: "Terms of services",
image: ImageIcon(
AssetImage('assets/ic_calendar_event_info.png'),
Expand All @@ -123,7 +123,7 @@ class _AboutScreenState extends State<AboutScreen> {
);
},
),
OdsListStandardItem(
OdsListItem(
title: "Third party library",
image: ImageIcon(
AssetImage('assets/ic_task_list.png'),
Expand Down
20 changes: 7 additions & 13 deletions app/lib/ui/components/components.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,10 @@ import 'package:ods_flutter_demo/ui/components/chips/chips_input.dart';
import 'package:ods_flutter_demo/ui/components/component_entities.dart';
import 'package:ods_flutter_demo/ui/components/dialogs/dialogs.dart';
import 'package:ods_flutter_demo/ui/components/floating_action_button/floating_action_button.dart';
import 'package:ods_flutter_demo/ui/components/lists/lists_checkboxes.dart';
import 'package:ods_flutter_demo/ui/components/lists/lists_radio_buttons.dart';
import 'package:ods_flutter_demo/ui/components/lists/lists_selection.dart';
import 'package:ods_flutter_demo/ui/components/lists/lists_standard.dart';
import 'package:ods_flutter_demo/ui/components/lists/lists_switches.dart';
import 'package:ods_flutter_demo/ui/components/list_item/list_checkbox.dart';
import 'package:ods_flutter_demo/ui/components/list_item/list_item.dart';
import 'package:ods_flutter_demo/ui/components/list_item/list_radio_buttons.dart';
import 'package:ods_flutter_demo/ui/components/list_item/list_switches.dart';
import 'package:ods_flutter_demo/ui/components/menus/menu_dropdown.dart';
import 'package:ods_flutter_demo/ui/components/menus/menu_exposed_dropdown.dart';
import 'package:ods_flutter_demo/ui/components/navigation_bar/navigation_bar.dart';
Expand Down Expand Up @@ -199,19 +198,14 @@ List<Component> components(BuildContext context) {
),
Component(
AppLocalizations.of(context)!.componentListItem,
'assets/il_lists.svg',
'assets/il_list_item.png',
AppLocalizations.of(context)!.componentListItemDescription,
[
Variant(
AppLocalizations.of(context)!.listVariantSelectionTitle,
AppLocalizations.of(context)!.listVariantSelectionSubtitle,
AppLocalizations.of(context)!.listVariantItemTitle,
AppLocalizations.of(context)!.listVariantItemSubtitle,
ComponentListsSelection(),
),
Variant(
AppLocalizations.of(context)!.listVariantStandardTitle,
AppLocalizations.of(context)!.listVariantStandardSubtitle,
ComponentListsStandard(),
),
Variant(
AppLocalizations.of(context)!.listCheckboxesTitle,
AppLocalizations.of(context)!.listCheckboxesSubtitle,
Expand Down
116 changes: 116 additions & 0 deletions app/lib/ui/components/list_item/list_customization.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
/*
* Software Name : Orange Design System
* SPDX-FileCopyrightText: Copyright (c) Orange SA
* SPDX-License-Identifier: MIT
*
* This software is distributed under the MIT licence,
* the text of which is available at https://opensource.org/license/MIT/
* or see the "LICENSE" file for more details.
*
* Software description: Flutter library of reusable graphical components for Android and iOS
*/

import 'package:flutter/material.dart';
import 'package:ods_flutter_demo/ui/components/list_item/list_leading_enum.dart';
import 'package:ods_flutter_demo/ui/components/list_item/list_trailing_enum.dart';

class _ListCustomization extends InheritedWidget {
_ListCustomization({
Key? key,
required Widget child,
required this.data,
}) : super(key: key, child: child);

final ListCustomizationState data;

@override
bool updateShouldNotify(_ListCustomization oldWidget) => true;
}

class ListCustomization extends StatefulWidget {
const ListCustomization({
super.key,
required this.child,
});

final Widget child;

@override
ListCustomizationState createState() => ListCustomizationState();

static ListCustomizationState? of(BuildContext context) {
return (context.dependOnInheritedWidgetOfExactType<_ListCustomization>())
?.data;
}
}

class ListCustomizationState extends State<ListCustomization> {
bool _hasSubtitle = true;

///Leading Enum
List<ListLeadingEnum> _leadingElements = [
ListLeadingEnum.none,
ListLeadingEnum.icon,
ListLeadingEnum.circle,
ListLeadingEnum.wide,
ListLeadingEnum.square,
];
ListLeadingEnum _selectedLeadingElement = ListLeadingEnum.circle;

///Trailing Enum
List<ListTrailingEnum> _trailingElements = [
ListTrailingEnum.none,
ListTrailingEnum.trailingSwitch,
ListTrailingEnum.trailingCheckbox,
ListTrailingEnum.trailingText,
ListTrailingEnum.trailingInfoButton,
];
ListTrailingEnum _selectedTrailingElement = ListTrailingEnum.none;

bool get hasSubtitle => _hasSubtitle;
set hasSubtitle(bool value) {
setState(() {
_hasSubtitle = value;
});
}

///Leading Enum
List<ListLeadingEnum> get leadingElements => _leadingElements;
set leadingElements(List<ListLeadingEnum> value) {
setState(() {
_leadingElements = value;
});
}

ListLeadingEnum get selectedLeadingElement => _selectedLeadingElement;

set selectedLeadingElement(ListLeadingEnum value) {
setState(() {
_selectedLeadingElement = value;
});
}

///Trailing Enum
List<ListTrailingEnum> get trailingElements => _trailingElements;
set trailingElements(List<ListTrailingEnum> value) {
setState(() {
_trailingElements = value;
});
}

ListTrailingEnum get selectedTrailingElement => _selectedTrailingElement;

set selectedTrailingElement(ListTrailingEnum value) {
setState(() {
_selectedTrailingElement = value;
});
}

@override
Widget build(BuildContext context) {
return _ListCustomization(
data: this,
child: widget.child,
);
}
}
Loading

0 comments on commit b7b558b

Please sign in to comment.