diff --git a/.fvmrc b/.fvmrc new file mode 100644 index 00000000..2549cd21 --- /dev/null +++ b/.fvmrc @@ -0,0 +1,3 @@ +{ + "flutter": "3.10.0" +} \ No newline at end of file diff --git a/.gitignore b/.gitignore index cad66c5d..3db7f081 100644 --- a/.gitignore +++ b/.gitignore @@ -2,5 +2,8 @@ *.iml *.ipr *.iws +.dart_tool/ +.fvm/ .idea/ +.vscode/ app/ios/Podfile.lock diff --git a/app/lib/firebase_options.dart b/app/lib/firebase_options.dart deleted file mode 100644 index f837e9c7..00000000 --- a/app/lib/firebase_options.dart +++ /dev/null @@ -1,75 +0,0 @@ -// File generated by FlutterFire CLI. -// ignore_for_file: lines_longer_than_80_chars, avoid_classes_with_only_static_members -import 'package:firebase_core/firebase_core.dart' show FirebaseOptions; -import 'package:flutter/foundation.dart' - show defaultTargetPlatform, kIsWeb, TargetPlatform; - -/// Default [FirebaseOptions] for use with your Firebase apps. -/// -/// Example: -/// ```dart -/// import 'firebase_options.dart'; -/// // ... -/// await Firebase.initializeApp( -/// options: DefaultFirebaseOptions.currentPlatform, -/// ); -/// ``` -class DefaultFirebaseOptions { - static FirebaseOptions get currentPlatform { - if (kIsWeb) { - return web; - } - switch (defaultTargetPlatform) { - case TargetPlatform.android: - return android; - case TargetPlatform.iOS: - return ios; - case TargetPlatform.macOS: - throw UnsupportedError( - 'DefaultFirebaseOptions have not been configured for macos - ' - 'you can reconfigure this by running the FlutterFire CLI again.', - ); - case TargetPlatform.windows: - throw UnsupportedError( - 'DefaultFirebaseOptions have not been configured for windows - ' - 'you can reconfigure this by running the FlutterFire CLI again.', - ); - case TargetPlatform.linux: - throw UnsupportedError( - 'DefaultFirebaseOptions have not been configured for linux - ' - 'you can reconfigure this by running the FlutterFire CLI again.', - ); - default: - throw UnsupportedError( - 'DefaultFirebaseOptions are not supported for this platform.', - ); - } - } - - static const FirebaseOptions web = FirebaseOptions( - apiKey: 'AIzaSyBJ3a8cczdo5C6Zos4HSOYw83SO7jXT9Ws', - appId: '1:212698857200:web:4eb6504b6229fa875ecc35', - messagingSenderId: '212698857200', - projectId: 'orange-design-system-6f3f1', - authDomain: 'orange-design-system-6f3f1.firebaseapp.com', - storageBucket: 'orange-design-system-6f3f1.appspot.com', - ); - - static const FirebaseOptions android = FirebaseOptions( - apiKey: 'AIzaSyAIY6bMaglXBkcA72v_vja3yI6-7uaR-8U', - appId: '1:212698857200:android:92978ae61c91c8b85ecc35', - messagingSenderId: '212698857200', - projectId: 'orange-design-system-6f3f1', - storageBucket: 'orange-design-system-6f3f1.appspot.com', - ); - - static const FirebaseOptions ios = FirebaseOptions( - apiKey: 'AIzaSyAeQGo-TWlYr2zV-EsORydwijMUz5NIrzg', - appId: '1:212698857200:ios:65d81b588576928f5ecc35', - messagingSenderId: '212698857200', - projectId: 'orange-design-system-6f3f1', - storageBucket: 'orange-design-system-6f3f1.appspot.com', - iosClientId: '212698857200-lbjkbnd7ra3isfq2tgjiq65kava294ph.apps.googleusercontent.com', - iosBundleId: 'com.orange.ods.test.flutterapp', - ); -} diff --git a/app/lib/ui/about/about_screen.dart b/app/lib/ui/about/about_screen.dart index a918abd5..1b839a8e 100644 --- a/app/lib/ui/about/about_screen.dart +++ b/app/lib/ui/about/about_screen.dart @@ -22,7 +22,7 @@ class AboutScreen extends StatefulWidget { const AboutScreen({Key? key}) : super(key: key); @override - _AboutScreenState createState() => _AboutScreenState(); + State createState() => _AboutScreenState(); } class _AboutScreenState extends State { diff --git a/app/lib/ui/about/detail/about_file_screen.dart b/app/lib/ui/about/detail/about_file_screen.dart index bdd94935..d2a9dcc9 100644 --- a/app/lib/ui/about/detail/about_file_screen.dart +++ b/app/lib/ui/about/detail/about_file_screen.dart @@ -13,6 +13,7 @@ import 'dart:convert'; import 'dart:io'; +import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:markdown/markdown.dart' as md; @@ -317,10 +318,14 @@ String convertToHtml( var result = ""; result += head; - if (Platform.isIOS) { - result += cssApple; - } else if (Platform.isAndroid) { - result += cssAndroid; + if (!kIsWeb) { + if (Platform.isIOS) { + result += cssApple; + } else { + if (Platform.isAndroid) { + result += cssAndroid; + } + } } result += ""; diff --git a/app/lib/ui/components/app_bars/top/top_app_bar_large.dart b/app/lib/ui/components/app_bars/top/top_app_bar_large.dart index bfa41da1..2ccf3f37 100644 --- a/app/lib/ui/components/app_bars/top/top_app_bar_large.dart +++ b/app/lib/ui/components/app_bars/top/top_app_bar_large.dart @@ -20,21 +20,10 @@ import 'package:ods_flutter_demo/ui/components/app_bars/top/top_app_bars_customi import 'package:ods_flutter_demo/ui/theme/theme_selector.dart'; import 'package:ods_flutter_demo/ui/utilities/component_count_row.dart'; -class ComponentTopAppBarLarge extends StatefulWidget { - const ComponentTopAppBarLarge({super.key}); - @override - State createState() => - _ComponentTopAppBarLargeState(); -} - -class _ComponentTopAppBarLargeState extends State { +class ComponentTopAppBarLarge extends StatelessWidget { + ComponentTopAppBarLarge({super.key}); final _scaffoldKey = GlobalKey(); - @override - void initState() { - super.initState(); - } - @override Widget build(BuildContext context) { return ComponentTopAppBarsCustomization( diff --git a/app/lib/ui/components/app_bars/top/top_app_bars.dart b/app/lib/ui/components/app_bars/top/top_app_bars.dart index a44cf2ee..c485a73a 100644 --- a/app/lib/ui/components/app_bars/top/top_app_bars.dart +++ b/app/lib/ui/components/app_bars/top/top_app_bars.dart @@ -20,20 +20,10 @@ import 'package:ods_flutter_demo/ui/components/app_bars/top/top_app_bars_customi import 'package:ods_flutter_demo/ui/theme/theme_selector.dart'; import 'package:ods_flutter_demo/ui/utilities/component_count_row.dart'; -class ComponentTopAppBars extends StatefulWidget { - const ComponentTopAppBars({super.key}); - @override - State createState() => _ComponentTopAppBarsState(); -} - -class _ComponentTopAppBarsState extends State { +class ComponentTopAppBars extends StatelessWidget { + ComponentTopAppBars({super.key}); final _scaffoldKey = GlobalKey(); - @override - void initState() { - super.initState(); - } - @override Widget build(BuildContext context) { return ComponentTopAppBarsCustomization( diff --git a/app/lib/ui/components/buttons/button_contained.dart b/app/lib/ui/components/buttons/button_contained.dart index 58bb0130..e3b42aaa 100644 --- a/app/lib/ui/components/buttons/button_contained.dart +++ b/app/lib/ui/components/buttons/button_contained.dart @@ -28,42 +28,36 @@ enum ButtonEmphasis { functional, } -class ButtonsContained extends StatefulWidget { - final ButtonEmphasis emphasis; - - ButtonsContained({Key? key, required this.emphasis}) : super(key: key); +class ButtonsContained extends StatelessWidget { + const ButtonsContained({Key? key, required this.emphasis}) : super(key: key); - @override - _ButtonsContainedState createState() => _ButtonsContainedState(); -} - -class _ButtonsContainedState extends State { - _ButtonsContainedState(); + final ButtonEmphasis emphasis; @override Widget build(BuildContext context) { + String getAppBarTitle() { + switch (emphasis) { + case ButtonEmphasis.highEmphasis: + return AppLocalizations.of(context)!.buttonsHighEmphasisVariantTitle; + case ButtonEmphasis.mediumEmphasis: + return AppLocalizations.of(context)! + .buttonsMediumEmphasisVariantTitle; + case ButtonEmphasis.functional: + return AppLocalizations.of(context)!.buttonsFunctionalVariantTitle; + } + } + return ButtonCustomization( child: Scaffold( bottomSheet: OdsSheetsBottom( - sheetContent: _CustomizationContent(emphasis: widget.emphasis), + sheetContent: _CustomizationContent(emphasis: emphasis), title: AppLocalizations.of(context)!.componentCustomizeTitle, ), appBar: MainAppBar(getAppBarTitle()), - body: SafeArea(child: _Body(emphasis: widget.emphasis)), + body: SafeArea(child: _Body(emphasis: emphasis)), ), ); } - - String getAppBarTitle() { - switch (widget.emphasis) { - case ButtonEmphasis.highEmphasis: - return AppLocalizations.of(context)!.buttonsHighEmphasisVariantTitle; - case ButtonEmphasis.mediumEmphasis: - return AppLocalizations.of(context)!.buttonsMediumEmphasisVariantTitle; - case ButtonEmphasis.functional: - return AppLocalizations.of(context)!.buttonsFunctionalVariantTitle; - } - } } class _Body extends StatelessWidget { @@ -118,11 +112,6 @@ class _CustomizationContent extends StatefulWidget { class _CustomizationContentState extends State<_CustomizationContent> { _CustomizationContentState(); - @override - void initState() { - super.initState(); - } - @override Widget build(BuildContext context) { final ButtonCustomizationState? customizationState = diff --git a/app/lib/ui/components/buttons/button_outlined.dart b/app/lib/ui/components/buttons/button_outlined.dart index 66353b1b..b8ffe941 100644 --- a/app/lib/ui/components/buttons/button_outlined.dart +++ b/app/lib/ui/components/buttons/button_outlined.dart @@ -20,21 +20,11 @@ import 'package:ods_flutter/guidelines/spacings.dart'; import 'package:ods_flutter_demo/ui/components/buttons/button_customization.dart'; import 'package:ods_flutter_demo/ui/main_app_bar.dart'; -class ButtonsOutlined extends StatefulWidget { - const ButtonsOutlined({super.key}); +class ButtonsOutlined extends StatelessWidget { + ButtonsOutlined({super.key}); - @override - State createState() => _ButtonsOutlinedState(); -} - -class _ButtonsOutlinedState extends State { final _scaffoldKey = GlobalKey(); - @override - void initState() { - super.initState(); - } - @override Widget build(BuildContext context) { return ButtonCustomization( diff --git a/app/lib/ui/components/buttons/button_text.dart b/app/lib/ui/components/buttons/button_text.dart index acb2b4ae..07115164 100644 --- a/app/lib/ui/components/buttons/button_text.dart +++ b/app/lib/ui/components/buttons/button_text.dart @@ -22,21 +22,11 @@ import 'package:ods_flutter_demo/ui/components/buttons/button_customization.dart import 'package:ods_flutter_demo/ui/components/buttons/button_enum.dart'; import 'package:ods_flutter_demo/ui/main_app_bar.dart'; -class ButtonsText extends StatefulWidget { - const ButtonsText({super.key}); +class ButtonsText extends StatelessWidget { + ButtonsText({super.key}); - @override - State createState() => _ButtonsTextState(); -} - -class _ButtonsTextState extends State { final _scaffoldKey = GlobalKey(); - @override - void initState() { - super.initState(); - } - @override Widget build(BuildContext context) { return ButtonCustomization( @@ -95,11 +85,6 @@ class _CustomizationContent extends StatefulWidget { class _CustomizationContentState extends State<_CustomizationContent> { _CustomizationContentState(); - @override - void initState() { - super.initState(); - } - @override Widget build(BuildContext context) { final ButtonCustomizationState? customizationState = diff --git a/app/lib/ui/components/buttons/buttons_icon/button_icon.dart b/app/lib/ui/components/buttons/buttons_icon/button_icon.dart index 8fa03a95..edcb5e7a 100644 --- a/app/lib/ui/components/buttons/buttons_icon/button_icon.dart +++ b/app/lib/ui/components/buttons/buttons_icon/button_icon.dart @@ -21,21 +21,11 @@ import 'package:ods_flutter_demo/ui/components/buttons/buttons_icon/button_icon_ import 'package:ods_flutter_demo/ui/components/buttons/buttons_icon/button_icon_enum.dart'; import 'package:ods_flutter_demo/ui/main_app_bar.dart'; -class ButtonsIcons extends StatefulWidget { - const ButtonsIcons({super.key}); +class ButtonsIcons extends StatelessWidget { + ButtonsIcons({super.key}); - @override - State createState() => _ButtonsIconsState(); -} - -class _ButtonsIconsState extends State { final _scaffoldKey = GlobalKey(); - @override - void initState() { - super.initState(); - } - @override Widget build(BuildContext context) { return ButtonIconCustomization( @@ -73,10 +63,12 @@ class _BodyState extends State<_Body> { child: Column( crossAxisAlignment: CrossAxisAlignment.center, children: [ - Text( - selected - ? AppLocalizations.of(context)!.buttonsIconSelected - : AppLocalizations.of(context)!.buttonsIconDeselected, + ExcludeSemantics( + child: Text( + selected + ? AppLocalizations.of(context)!.buttonsIconSelected + : AppLocalizations.of(context)!.buttonsIconDeselected, + ), ), OdsButtonIcon( icon: Image.asset('assets/ic_heart_deselected.png'), @@ -124,11 +116,6 @@ class _CustomizationContent extends StatefulWidget { class _CustomizationContentState extends State<_CustomizationContent> { _CustomizationContentState(); - @override - void initState() { - super.initState(); - } - @override Widget build(BuildContext context) { final ButtonIconCustomizationState? customizationState = diff --git a/app/lib/ui/components/buttons/segmented/segmented_button.dart b/app/lib/ui/components/buttons/segmented/segmented_button.dart index 5fe57840..177e948f 100644 --- a/app/lib/ui/components/buttons/segmented/segmented_button.dart +++ b/app/lib/ui/components/buttons/segmented/segmented_button.dart @@ -24,21 +24,11 @@ import 'package:ods_flutter_demo/ui/utilities/component_count_row.dart'; enum Foods { ham, milk, figs, eggs, oil } -class SegmentedButtons extends StatefulWidget { - const SegmentedButtons({super.key}); +class SegmentedButtons extends StatelessWidget { + SegmentedButtons({super.key}); - @override - State createState() => _SegmentedButtonsState(); -} - -class _SegmentedButtonsState extends State { final _scaffoldKey = GlobalKey(); - @override - void initState() { - super.initState(); - } - @override Widget build(BuildContext context) { return SegmentedButtonCustomization( diff --git a/app/lib/ui/components/cards/card_horizontal.dart b/app/lib/ui/components/cards/card_horizontal.dart index 1fd31ac3..9935c48a 100644 --- a/app/lib/ui/components/cards/card_horizontal.dart +++ b/app/lib/ui/components/cards/card_horizontal.dart @@ -27,21 +27,11 @@ import 'package:ods_flutter_demo/ui/components/cards/card_enum.dart'; import 'package:ods_flutter_demo/ui/main_app_bar.dart'; import 'package:ods_flutter_demo/ui/utilities/component_count_row.dart'; -class CardHorizontal extends StatefulWidget { - const CardHorizontal({super.key}); +class CardHorizontal extends StatelessWidget { + CardHorizontal({super.key}); - @override - State createState() => _CardHorizontalState(); -} - -class _CardHorizontalState extends State { final _scaffoldKey = GlobalKey(); - @override - void initState() { - super.initState(); - } - @override Widget build(BuildContext context) { return CardCustomization( @@ -53,7 +43,7 @@ class _CardHorizontalState extends State { key: _scaffoldKey, appBar: MainAppBar( AppLocalizations.of(context)!.componentCardHorizontalTitle), - body: _Body()), + body: SafeArea(child: _Body())), ); } } @@ -93,31 +83,27 @@ class _Body extends StatelessWidget { secondButton = buttons[1] as OdsTextButton; } - return SafeArea( - child: Padding( - padding: const EdgeInsets.all(spacingM), - child: SingleChildScrollView( - child: OdsHorizontalCard( - image: OdsCardImage( - imageProvider: NetworkImage(recipe.url), - contentDescription: '', //Optional - alignment: Alignment.center, - contentScale: BoxFit.cover, - ), - title: recipe.title, - subtitle: customizationState?.hasSubtitle == true - ? recipe.subtitle - : null, - text: - customizationState?.hasText == true ? recipe.description : null, - firstButton: firstButton, - secondButton: secondButton, - imagePosition: customizationState?.selectedElement == CardEnum.start - ? OdsHorizontalCardImagePosition.start - : OdsHorizontalCardImagePosition.end, - divider: customizationState!.hasDivider == true ? true : false, - onClick: customizationState.clickable ? () {} : null, + return Padding( + padding: const EdgeInsets.all(spacingM), + child: SingleChildScrollView( + child: OdsHorizontalCard( + image: OdsCardImage( + imageProvider: NetworkImage(recipe.url), + contentDescription: '', //Optional + alignment: Alignment.center, + contentScale: BoxFit.cover, ), + title: recipe.title, + subtitle: + customizationState?.hasSubtitle == true ? recipe.subtitle : null, + text: customizationState?.hasText == true ? recipe.description : null, + firstButton: firstButton, + secondButton: secondButton, + imagePosition: customizationState?.selectedElement == CardEnum.start + ? OdsHorizontalCardImagePosition.start + : OdsHorizontalCardImagePosition.end, + divider: customizationState!.hasDivider == true ? true : false, + onClick: customizationState.clickable ? () {} : null, ), ), ); diff --git a/app/lib/ui/components/cards/card_small.dart b/app/lib/ui/components/cards/card_small.dart index c3dd62ee..db8fe857 100644 --- a/app/lib/ui/components/cards/card_small.dart +++ b/app/lib/ui/components/cards/card_small.dart @@ -18,25 +18,16 @@ import 'package:ods_flutter/components/card/ods_cards_common.dart'; import 'package:ods_flutter/components/card/ods_small_card.dart'; import 'package:ods_flutter/components/lists/ods_list_switch.dart'; import 'package:ods_flutter/components/sheets_bottom/ods_sheets_bottom.dart'; +import 'package:ods_flutter/guidelines/spacings.dart'; import 'package:ods_flutter_demo/main.dart'; import 'package:ods_flutter_demo/ui/components/cards/card_customization.dart'; import 'package:ods_flutter_demo/ui/main_app_bar.dart'; -class CardSmall extends StatefulWidget { - const CardSmall({super.key}); +class CardSmall extends StatelessWidget { + CardSmall({super.key}); - @override - State createState() => _CardSmallState(); -} - -class _CardSmallState extends State { final _scaffoldKey = GlobalKey(); - @override - void initState() { - super.initState(); - } - @override Widget build(BuildContext context) { return CardCustomization( @@ -48,7 +39,7 @@ class _CardSmallState extends State { key: _scaffoldKey, appBar: MainAppBar(AppLocalizations.of(context)!.cardSmallVariantTitle), - body: _Body()), + body: SafeArea(child: _Body())), ); } } @@ -62,14 +53,16 @@ class _Body extends StatelessWidget { final CardCustomizationState? customizationState = CardCustomization.of(context); - return SafeArea( - child: OrientationBuilder( - builder: (context, orientation) { - return GridView.count( - crossAxisCount: orientation == Orientation.portrait ? 2 : 3, - childAspectRatio: orientation == Orientation.portrait ? 0.9 : 1.1, - children: [ - Column( + return OrientationBuilder( + builder: (context, orientation) { + return GridView.count( + crossAxisCount: orientation == Orientation.portrait ? 2 : 3, + childAspectRatio: orientation == Orientation.portrait ? 0.9 : 1.1, + children: [ + Padding( + padding: const EdgeInsets.all(spacingM), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, children: [ OdsSmallCard( title: recipe.title, @@ -86,10 +79,10 @@ class _Body extends StatelessWidget { ), ], ), - ], - ); - }, - ), + ), + ], + ); + }, ); } } diff --git a/app/lib/ui/components/cards/card_vertical_header_first.dart b/app/lib/ui/components/cards/card_vertical_header_first.dart index 09922336..23277f1d 100644 --- a/app/lib/ui/components/cards/card_vertical_header_first.dart +++ b/app/lib/ui/components/cards/card_vertical_header_first.dart @@ -19,27 +19,17 @@ import 'package:ods_flutter/components/card/ods_cards_common.dart'; import 'package:ods_flutter/components/card/ods_vertical_header_first_card.dart'; import 'package:ods_flutter/components/lists/ods_list_switch.dart'; import 'package:ods_flutter/components/sheets_bottom/ods_sheets_bottom.dart'; +import 'package:ods_flutter/guidelines/spacings.dart'; import 'package:ods_flutter_demo/main.dart'; import 'package:ods_flutter_demo/ui/components/cards/card_customization.dart'; import 'package:ods_flutter_demo/ui/main_app_bar.dart'; import 'package:ods_flutter_demo/ui/utilities/component_count_row.dart'; -class CardVerticalHeaderFirst extends StatefulWidget { - const CardVerticalHeaderFirst({super.key}); +class CardVerticalHeaderFirst extends StatelessWidget { + CardVerticalHeaderFirst({super.key}); - @override - State createState() => - _CardVerticalHeaderFirstState(); -} - -class _CardVerticalHeaderFirstState extends State { final _scaffoldKey = GlobalKey(); - @override - void initState() { - super.initState(); - } - @override Widget build(BuildContext context) { return CardCustomization( @@ -51,7 +41,7 @@ class _CardVerticalHeaderFirstState extends State { key: _scaffoldKey, appBar: MainAppBar( AppLocalizations.of(context)!.componentCardVerticalHeaderFirst), - body: _Body()), + body: SafeArea(child: _Body())), ); } } @@ -93,7 +83,8 @@ class _Body extends StatelessWidget { return SingleChildScrollView( child: Padding( - padding: const EdgeInsets.only(bottom: 91), + padding: const EdgeInsets.only( + top: spacingM, bottom: 91, left: spacingM, right: spacingM), child: OdsVerticalHeaderFirstCard( thumbnail: customizationState!.thumbnail ? OdsCardThumbnail( @@ -105,8 +96,8 @@ class _Body extends StatelessWidget { : null, title: recipe.title, subtitle: - customizationState?.hasSubtitle == true ? recipe.subtitle : null, - text: customizationState?.hasText == true ? recipe.description : null, + customizationState.hasSubtitle == true ? recipe.subtitle : null, + text: customizationState.hasText == true ? recipe.description : null, image: OdsCardImage( imageProvider: NetworkImage(recipe.url), contentDescription: '', //Optional @@ -115,22 +106,14 @@ class _Body extends StatelessWidget { ), firstButton: firstButton, secondButton: secondButton, - onClick: customizationState!.clickable ? () {} : null, + onClick: customizationState.clickable ? () {} : null, ), ), ); } } -class _CustomizationContent extends StatefulWidget { - @override - State<_CustomizationContent> createState() => _CustomizationContentState(); -} - -class _CustomizationContentState extends State<_CustomizationContent> { - int selectedIndex = 0; - bool isFiltered = true; - +class _CustomizationContent extends StatelessWidget { @override Widget build(BuildContext context) { final CardCustomizationState? customizationState = diff --git a/app/lib/ui/components/cards/card_vertical_image_first.dart b/app/lib/ui/components/cards/card_vertical_image_first.dart index fa1830fd..6428cf1e 100644 --- a/app/lib/ui/components/cards/card_vertical_image_first.dart +++ b/app/lib/ui/components/cards/card_vertical_image_first.dart @@ -25,21 +25,11 @@ import 'package:ods_flutter_demo/ui/components/cards/card_customization.dart'; import 'package:ods_flutter_demo/ui/main_app_bar.dart'; import 'package:ods_flutter_demo/ui/utilities/component_count_row.dart'; -class CardVerticalImageFirst extends StatefulWidget { - const CardVerticalImageFirst({super.key}); +class CardVerticalImageFirst extends StatelessWidget { + CardVerticalImageFirst({super.key}); - @override - State createState() => _CardVerticalImageFirstState(); -} - -class _CardVerticalImageFirstState extends State { final _scaffoldKey = GlobalKey(); - @override - void initState() { - super.initState(); - } - @override Widget build(BuildContext context) { return CardCustomization( @@ -51,7 +41,7 @@ class _CardVerticalImageFirstState extends State { key: _scaffoldKey, appBar: MainAppBar( AppLocalizations.of(context)!.cardVerticalImageFirstVariantTitle), - body: _Body()), + body: SafeArea(child: _Body())), ); } } @@ -67,7 +57,7 @@ class _Body extends StatelessWidget { List listButtons = [ OdsTextButton( - text: AppLocalizations.of(context)!.componentElementButton2, + text: AppLocalizations.of(context)!.componentElementButton1, style: OdsTextButtonStyle.functionalPrimary, onClick: () {}, ), @@ -95,7 +85,8 @@ class _Body extends StatelessWidget { child: Column( children: [ Padding( - padding: const EdgeInsets.only(top: spacingM, bottom: 91), + padding: const EdgeInsets.only( + top: spacingM, bottom: 91, left: spacingM, right: spacingM), child: OdsVerticalImageFirstCard( image: OdsCardImage( imageProvider: NetworkImage(recipe.url), @@ -121,15 +112,7 @@ class _Body extends StatelessWidget { } } -class _CustomizationContent extends StatefulWidget { - @override - State<_CustomizationContent> createState() => _CustomizationContentState(); -} - -class _CustomizationContentState extends State<_CustomizationContent> { - int selectedIndex = 0; - bool isFiltered = true; - +class _CustomizationContent extends StatelessWidget { @override Widget build(BuildContext context) { final CardCustomizationState? customizationState = diff --git a/app/lib/ui/components/checkboxes/checkboxes.dart b/app/lib/ui/components/checkboxes/checkboxes.dart index acc5d52c..76789d07 100644 --- a/app/lib/ui/components/checkboxes/checkboxes.dart +++ b/app/lib/ui/components/checkboxes/checkboxes.dart @@ -20,21 +20,11 @@ import 'package:ods_flutter_demo/main.dart'; import 'package:ods_flutter_demo/ui/components/checkboxes/checkboxes_customization.dart'; import 'package:ods_flutter_demo/ui/main_app_bar.dart'; -class ComponentCheckboxes extends StatefulWidget { - const ComponentCheckboxes({super.key}); +class ComponentCheckboxes extends StatelessWidget { + ComponentCheckboxes({super.key}); - @override - State createState() => _ComponentCheckboxesState(); -} - -class _ComponentCheckboxesState extends State { final _scaffoldKey = GlobalKey(); - @override - void initState() { - super.initState(); - } - @override Widget build(BuildContext context) { return CheckboxesCustomization( diff --git a/app/lib/ui/components/chips/chips_action.dart b/app/lib/ui/components/chips/chips_action.dart index 74d8f688..dbd848a3 100644 --- a/app/lib/ui/components/chips/chips_action.dart +++ b/app/lib/ui/components/chips/chips_action.dart @@ -22,20 +22,10 @@ import 'package:ods_flutter_demo/main.dart'; import 'package:ods_flutter_demo/ui/components/chips/chips_customization.dart'; import 'package:ods_flutter_demo/ui/theme/theme_selector.dart'; -class ComponentChipsAction extends StatefulWidget { - const ComponentChipsAction({super.key}); - @override - State createState() => _ComponentChipsActionState(); -} - -class _ComponentChipsActionState extends State { +class ComponentChipsAction extends StatelessWidget { + ComponentChipsAction({super.key}); bool isFiltered = true; - @override - void initState() { - super.initState(); - } - @override Widget build(BuildContext context) { return ChipsCustomization( diff --git a/app/lib/ui/components/chips/chips_choice.dart b/app/lib/ui/components/chips/chips_choice.dart index 398d712a..02292d32 100644 --- a/app/lib/ui/components/chips/chips_choice.dart +++ b/app/lib/ui/components/chips/chips_choice.dart @@ -23,19 +23,8 @@ import 'package:ods_flutter_demo/ui/components/chips/chips_customization.dart'; import 'package:ods_flutter_demo/ui/components/chips/chips_enum.dart'; import 'package:ods_flutter_demo/ui/theme/theme_selector.dart'; -class ComponentChipsChoice extends StatefulWidget { +class ComponentChipsChoice extends StatelessWidget { const ComponentChipsChoice({super.key}); - @override - State createState() => _ComponentChipsChoiceState(); -} - -class _ComponentChipsChoiceState extends State { - bool isFiltered = true; - - @override - void initState() { - super.initState(); - } @override Widget build(BuildContext context) { diff --git a/app/lib/ui/components/chips/chips_filter.dart b/app/lib/ui/components/chips/chips_filter.dart index 8070b163..e81d26fd 100644 --- a/app/lib/ui/components/chips/chips_filter.dart +++ b/app/lib/ui/components/chips/chips_filter.dart @@ -24,19 +24,8 @@ import 'package:ods_flutter_demo/ui/components/chips/chips_customization.dart'; import 'package:ods_flutter_demo/ui/components/chips/chips_enum.dart'; import 'package:ods_flutter_demo/ui/theme/theme_selector.dart'; -class ComponentChipsFilter extends StatefulWidget { +class ComponentChipsFilter extends StatelessWidget { const ComponentChipsFilter({super.key}); - @override - State createState() => _ComponentChipsFilterState(); -} - -class _ComponentChipsFilterState extends State { - bool isFiltered = true; - - @override - void initState() { - super.initState(); - } @override Widget build(BuildContext context) { diff --git a/app/lib/ui/components/chips/chips_input.dart b/app/lib/ui/components/chips/chips_input.dart index 02db67f2..9a04cb5c 100644 --- a/app/lib/ui/components/chips/chips_input.dart +++ b/app/lib/ui/components/chips/chips_input.dart @@ -24,19 +24,8 @@ import 'package:ods_flutter_demo/ui/components/chips/chips_customization.dart'; import 'package:ods_flutter_demo/ui/components/chips/chips_enum.dart'; import 'package:ods_flutter_demo/ui/theme/theme_selector.dart'; -class ComponentChipsInput extends StatefulWidget { +class ComponentChipsInput extends StatelessWidget { const ComponentChipsInput({super.key}); - @override - State createState() => _ComponentChipsInputState(); -} - -class _ComponentChipsInputState extends State { - bool isFiltered = true; - - @override - void initState() { - super.initState(); - } @override Widget build(BuildContext context) { @@ -56,15 +45,7 @@ class _ComponentChipsInputState extends State { } } -class _Body extends StatefulWidget { - @override - _BodyState createState() => _BodyState(); -} - -class _BodyState extends State<_Body> { - int selectedIndex = 0; - bool isFiltered = true; - +class _Body extends StatelessWidget { @override Widget build(BuildContext context) { final ChipsCustomizationState? customizationState = @@ -157,7 +138,7 @@ class _CustomizationContentState extends State<_CustomizationContent> { onClick: (selected) { setState(() { selectedIndex = index; - isFiltered = selected!; + isFiltered = selected; customizationState?.selectedElement = customizationState.elements[index]; }); diff --git a/app/lib/ui/components/components_screen.dart b/app/lib/ui/components/components_screen.dart index 00dcb884..0945a2cf 100644 --- a/app/lib/ui/components/components_screen.dart +++ b/app/lib/ui/components/components_screen.dart @@ -18,16 +18,11 @@ import 'package:ods_flutter_demo/ui/components/component_detail_screen.dart'; import 'package:ods_flutter_demo/ui/components/component_entities.dart'; import 'package:ods_flutter_demo/ui/utilities/display_image.dart'; -class ComponentsScreen extends StatefulWidget { +class ComponentsScreen extends StatelessWidget { final List odsComponents; ComponentsScreen({required this.odsComponents}); - @override - State createState() => _ComponentsScreenState(); -} - -class _ComponentsScreenState extends State { @override Widget build(BuildContext context) { final width = MediaQuery.of(context).size.width; @@ -55,7 +50,7 @@ class _ComponentsScreenState extends State { child: GridView.count( crossAxisCount: crossAxisCount, childAspectRatio: childAspectRatio, - children: widget.odsComponents.map( + children: odsComponents.map( (component) { return Column( children: [ diff --git a/app/lib/ui/components/dialogs/dialogs.dart b/app/lib/ui/components/dialogs/dialogs.dart index c1dec561..b2530765 100644 --- a/app/lib/ui/components/dialogs/dialogs.dart +++ b/app/lib/ui/components/dialogs/dialogs.dart @@ -45,12 +45,7 @@ class ComponentDialogs extends StatelessWidget { } } -class _Body extends StatefulWidget { - @override - _BodyState createState() => _BodyState(); -} - -class _BodyState extends State<_Body> { +class _Body extends StatelessWidget { @override Widget build(BuildContext context) { final DialogsCustomizationState? customizationState = @@ -128,12 +123,7 @@ class _BodyState extends State<_Body> { } } -class _CustomizationContent extends StatefulWidget { - @override - State<_CustomizationContent> createState() => _CustomizationContentState(); -} - -class _CustomizationContentState extends State<_CustomizationContent> { +class _CustomizationContent extends StatelessWidget { @override Widget build(BuildContext context) { final DialogsCustomizationState? customizationState = diff --git a/app/lib/ui/components/floating_action_button/floating_action_button.dart b/app/lib/ui/components/floating_action_button/floating_action_button.dart index adc4d0c2..786c5434 100644 --- a/app/lib/ui/components/floating_action_button/floating_action_button.dart +++ b/app/lib/ui/components/floating_action_button/floating_action_button.dart @@ -25,23 +25,11 @@ import 'package:ods_flutter_demo/ui/components/floating_action_button/floating_a import 'package:ods_flutter_demo/ui/components/floating_action_button/floating_action_customization.dart'; import 'package:ods_flutter_demo/ui/main_app_bar.dart'; -class ComponentFloatingActionButton extends StatefulWidget { - const ComponentFloatingActionButton({super.key}); +class ComponentFloatingActionButton extends StatelessWidget { + ComponentFloatingActionButton({super.key}); - @override - State createState() => - _ComponentFloatingActionButtonState(); -} - -class _ComponentFloatingActionButtonState - extends State { final _scaffoldKey = GlobalKey(); - @override - void initState() { - super.initState(); - } - @override Widget build(BuildContext context) { return FloatingActionButtonCustomization( @@ -155,7 +143,7 @@ class _CustomizationContentState extends State<_CustomizationContent> { onClick: (selected) { setState(() { selectedIndex = index; - isFiltered = selected!; + isFiltered = selected; customizationState?.selectedElement = customizationState.elements[index]; }); diff --git a/app/lib/ui/components/list_item/list_checkbox.dart b/app/lib/ui/components/list_item/list_checkbox.dart index f4cb77d5..ce8b1c73 100644 --- a/app/lib/ui/components/list_item/list_checkbox.dart +++ b/app/lib/ui/components/list_item/list_checkbox.dart @@ -19,22 +19,11 @@ import 'package:ods_flutter_demo/main.dart'; import 'package:ods_flutter_demo/ui/components/checkboxes/checkboxes_customization.dart'; import 'package:ods_flutter_demo/ui/main_app_bar.dart'; -class ComponentCheckboxesList extends StatefulWidget { - const ComponentCheckboxesList({super.key}); +class ComponentCheckboxesList extends StatelessWidget { + ComponentCheckboxesList({super.key}); - @override - State createState() => - _ComponentCheckboxesListState(); -} - -class _ComponentCheckboxesListState extends State { final _scaffoldKey = GlobalKey(); - @override - void initState() { - super.initState(); - } - @override Widget build(BuildContext context) { return CheckboxesCustomization( diff --git a/app/lib/ui/components/list_item/list_item.dart b/app/lib/ui/components/list_item/list_item.dart index ac2ec316..000fa713 100644 --- a/app/lib/ui/components/list_item/list_item.dart +++ b/app/lib/ui/components/list_item/list_item.dart @@ -24,22 +24,11 @@ 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'; import 'package:ods_flutter_demo/ui/main_app_bar.dart'; -class ComponentListsSelection extends StatefulWidget { - const ComponentListsSelection({super.key}); +class ComponentListsSelection extends StatelessWidget { + ComponentListsSelection({super.key}); - @override - State createState() => - _ComponentListsSelectionState(); -} - -class _ComponentListsSelectionState extends State { final _scaffoldKey = GlobalKey(); - @override - void initState() { - super.initState(); - } - @override Widget build(BuildContext context) { return ListCustomization( diff --git a/app/lib/ui/components/list_item/list_radio_buttons.dart b/app/lib/ui/components/list_item/list_radio_buttons.dart index a1b338f7..8d0b49cb 100644 --- a/app/lib/ui/components/list_item/list_radio_buttons.dart +++ b/app/lib/ui/components/list_item/list_radio_buttons.dart @@ -19,24 +19,11 @@ import 'package:ods_flutter_demo/main.dart'; import 'package:ods_flutter_demo/ui/components/checkboxes/checkboxes_customization.dart'; import 'package:ods_flutter_demo/ui/main_app_bar.dart'; -class ComponentRadioButtonsList extends StatefulWidget { - const ComponentRadioButtonsList({super.key}); +class ComponentRadioButtonsList extends StatelessWidget { + ComponentRadioButtonsList({super.key}); - @override - State createState() => - _ComponentRadioButtonsListState(); -} - -enum Options { option1, option2, option3 } - -class _ComponentRadioButtonsListState extends State { final _scaffoldKey = GlobalKey(); - @override - void initState() { - super.initState(); - } - @override Widget build(BuildContext context) { return CheckboxesCustomization( @@ -53,6 +40,8 @@ class _ComponentRadioButtonsListState extends State { } } +enum Options { option1, option2, option3 } + class _Body extends StatefulWidget { @override __BodyState createState() => __BodyState(); diff --git a/app/lib/ui/components/list_item/list_switches.dart b/app/lib/ui/components/list_item/list_switches.dart index 7fa51202..55448e34 100644 --- a/app/lib/ui/components/list_item/list_switches.dart +++ b/app/lib/ui/components/list_item/list_switches.dart @@ -18,21 +18,11 @@ import 'package:ods_flutter_demo/main.dart'; import 'package:ods_flutter_demo/ui/components/switches/switches_customization.dart'; import 'package:ods_flutter_demo/ui/main_app_bar.dart'; -class ComponentSwitchesList extends StatefulWidget { - const ComponentSwitchesList({super.key}); +class ComponentSwitchesList extends StatelessWidget { + ComponentSwitchesList({super.key}); - @override - State createState() => _ComponentSwitchesListState(); -} - -class _ComponentSwitchesListState extends State { final _scaffoldKey = GlobalKey(); - @override - void initState() { - super.initState(); - } - @override Widget build(BuildContext context) { return SwitchesCustomization( @@ -77,7 +67,7 @@ class __BodyState extends State<_Body> { customizationState?.hasEnabled == true ? isEnabled : false, onCheckedChange: (value) { setState(() { - isChecked0 = value!; + isChecked0 = value; }); }, ), @@ -89,7 +79,7 @@ class __BodyState extends State<_Body> { customizationState?.hasEnabled == true ? isEnabled : false, onCheckedChange: (value) { setState(() { - isChecked1 = value!; + isChecked1 = value; }); }, ), @@ -101,7 +91,7 @@ class __BodyState extends State<_Body> { customizationState?.hasEnabled == true ? isEnabled : false, onCheckedChange: (value) { setState(() { - isChecked2 = value!; + isChecked2 = value; }); }, ), diff --git a/app/lib/ui/components/menus/menu_dropdown.dart b/app/lib/ui/components/menus/menu_dropdown.dart index 6aa3cb07..1742cf63 100644 --- a/app/lib/ui/components/menus/menu_dropdown.dart +++ b/app/lib/ui/components/menus/menu_dropdown.dart @@ -24,21 +24,11 @@ import 'package:ods_flutter_demo/main.dart'; import 'package:ods_flutter_demo/ui/components/menus/menu_customization.dart'; import 'package:ods_flutter_demo/ui/main_app_bar.dart'; -class ComponentMenuDropdown extends StatefulWidget { - const ComponentMenuDropdown({super.key}); +class ComponentMenuDropdown extends StatelessWidget { + ComponentMenuDropdown({super.key}); - @override - State createState() => _ComponentMenuDropdownState(); -} - -class _ComponentMenuDropdownState extends State { final _scaffoldKey = GlobalKey(); - @override - void initState() { - super.initState(); - } - @override Widget build(BuildContext context) { return MenuCustomization( @@ -49,19 +39,14 @@ class _ComponentMenuDropdownState extends State { ), key: _scaffoldKey, appBar: MainAppBar(AppLocalizations.of(context)!.componentMenuDropdown), - body: _Body(), + body: SafeArea(child: _Body()), ), ); } } -class _Body extends StatefulWidget { - @override - __BodyState createState() => __BodyState(); -} - -class __BodyState extends State<_Body> { - var recipe = +class _Body extends StatelessWidget { + final recipe = OdsApplication.recipes[Random().nextInt(OdsApplication.recipes.length)]; @override @@ -73,20 +58,21 @@ class __BodyState extends State<_Body> { ? Colors.grey[600] : Colors.grey[400]; - return Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding( - padding: const EdgeInsets.all(spacingM), - child: Text( - AppLocalizations.of(context)!.componentMenuDropdownDescription, - style: Theme.of(context).textTheme.bodyMedium, - ), - ), - Expanded( - child: ListView( - children: [ - ListTile( + return SingleChildScrollView( + child: Padding( + padding: const EdgeInsets.only(bottom: spacingXxl), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.all(spacingM), + child: Text( + AppLocalizations.of(context)!.componentMenuDropdownDescription, + style: Theme.of(context).textTheme.bodyMedium, + ), + ), + MergeSemantics( + child: ListTile( title: Text(recipe.title, style: Theme.of(context).textTheme.titleMedium), subtitle: Text(recipe.subtitle), @@ -158,10 +144,10 @@ class __BodyState extends State<_Body> { }, ), ), - ], - ), + ), + ], ), - ], + ), ); } } diff --git a/app/lib/ui/components/menus/menu_exposed_dropdown.dart b/app/lib/ui/components/menus/menu_exposed_dropdown.dart index eda19a48..a89e06b0 100644 --- a/app/lib/ui/components/menus/menu_exposed_dropdown.dart +++ b/app/lib/ui/components/menus/menu_exposed_dropdown.dart @@ -16,25 +16,16 @@ import 'package:flutter_svg/flutter_svg.dart'; import 'package:ods_flutter/components/lists/ods_list_switch.dart'; import 'package:ods_flutter/components/menu/ods_exposed_dropdown_menu.dart'; import 'package:ods_flutter/components/sheets_bottom/ods_sheets_bottom.dart'; +import 'package:ods_flutter/guidelines/spacings.dart'; import 'package:ods_flutter_demo/main.dart'; import 'package:ods_flutter_demo/ui/components/menus/menu_customization.dart'; import 'package:ods_flutter_demo/ui/main_app_bar.dart'; -class MenuExposedDropdown extends StatefulWidget { - const MenuExposedDropdown({super.key}); +class MenuExposedDropdown extends StatelessWidget { + MenuExposedDropdown({super.key}); - @override - State createState() => _MenuExposedDropdownState(); -} - -class _MenuExposedDropdownState extends State { final _scaffoldKey = GlobalKey(); - @override - void initState() { - super.initState(); - } - @override Widget build(BuildContext context) { return MenuCustomization( @@ -46,7 +37,7 @@ class _MenuExposedDropdownState extends State { key: _scaffoldKey, appBar: MainAppBar( AppLocalizations.of(context)!.componentMenuExposedDropdown), - body: _Body(), + body: SafeArea(child: _Body()), ), ); } @@ -63,79 +54,90 @@ class __BodyState extends State<_Body> { final MenuCustomizationState? customizationState = MenuCustomization.of(context); - return Center( - child: OdsExposedDropdownMenu( - label: "Recipe", - enabled: customizationState?.enabled == true ? true : false, - items: >[ - DropdownMenuEntry( - value: OdsApplication.recipes[0].title, - label: OdsApplication.recipes[0].title, - leadingIcon: customizationState?.hasIcon == true - ? SvgPicture.asset( - "assets/recipes/ic_cooking_pot.svg", - colorFilter: ColorFilter.mode( - Theme.of(context).colorScheme.onBackground, - BlendMode.srcIn), - ) - : null, + return Padding( + padding: const EdgeInsets.only(top: spacingM), + child: Align( + alignment: Alignment.topCenter, + child: SingleChildScrollView( + child: ConstrainedBox( + constraints: BoxConstraints( + maxWidth: MediaQuery.of(context).size.width * 1.0, + ), + child: OdsExposedDropdownMenu( + label: "Recipe", + enabled: customizationState?.enabled == true ? true : false, + items: >[ + DropdownMenuEntry( + value: OdsApplication.recipes[0].title, + label: OdsApplication.recipes[0].title, + leadingIcon: customizationState?.hasIcon == true + ? SvgPicture.asset( + "assets/recipes/ic_cooking_pot.svg", + colorFilter: ColorFilter.mode( + Theme.of(context).colorScheme.onBackground, + BlendMode.srcIn), + ) + : null, + ), + DropdownMenuEntry( + value: OdsApplication.recipes[1].title, + label: OdsApplication.recipes[1].title, + leadingIcon: customizationState?.hasIcon == true + ? SvgPicture.asset( + "assets/recipes/ic_cooking_pot.svg", + colorFilter: ColorFilter.mode( + Theme.of(context).colorScheme.onBackground, + BlendMode.srcIn), + ) + : null, + ), + DropdownMenuEntry( + value: OdsApplication.recipes[2].title, + label: OdsApplication.recipes[2].title, + leadingIcon: customizationState?.hasIcon == true + ? SvgPicture.asset( + "assets/recipes/ic_restaurant.svg", + colorFilter: ColorFilter.mode( + Theme.of(context).colorScheme.onBackground, + BlendMode.srcIn), + ) + : null, + ), + DropdownMenuEntry( + value: OdsApplication.recipes[3].title, + label: OdsApplication.recipes[3].title, + leadingIcon: customizationState?.hasIcon == true + ? SvgPicture.asset( + "assets/recipes/ic_restaurant.svg", + colorFilter: ColorFilter.mode( + Theme.of(context).colorScheme.onBackground, + BlendMode.srcIn), + ) + : null, + ), + DropdownMenuEntry( + value: OdsApplication.recipes[4].title, + label: OdsApplication.recipes[4].title, + leadingIcon: customizationState?.hasIcon == true + ? SvgPicture.asset( + "assets/recipes/ic_ice_cream.svg", + colorFilter: ColorFilter.mode( + Theme.of(context).colorScheme.onBackground, + BlendMode.srcIn), + ) + : null, + ), + ], + selectedItem: (value) { + setState( + () { + print('$value'); + }, + ); + }, + ), ), - DropdownMenuEntry( - value: OdsApplication.recipes[1].title, - label: OdsApplication.recipes[1].title, - leadingIcon: customizationState?.hasIcon == true - ? SvgPicture.asset( - "assets/recipes/ic_cooking_pot.svg", - colorFilter: ColorFilter.mode( - Theme.of(context).colorScheme.onBackground, - BlendMode.srcIn), - ) - : null, - ), - DropdownMenuEntry( - value: OdsApplication.recipes[2].title, - label: OdsApplication.recipes[2].title, - leadingIcon: customizationState?.hasIcon == true - ? SvgPicture.asset( - "assets/recipes/ic_restaurant.svg", - colorFilter: ColorFilter.mode( - Theme.of(context).colorScheme.onBackground, - BlendMode.srcIn), - ) - : null, - ), - DropdownMenuEntry( - value: OdsApplication.recipes[3].title, - label: OdsApplication.recipes[3].title, - leadingIcon: customizationState?.hasIcon == true - ? SvgPicture.asset( - "assets/recipes/ic_restaurant.svg", - colorFilter: ColorFilter.mode( - Theme.of(context).colorScheme.onBackground, - BlendMode.srcIn), - ) - : null, - ), - DropdownMenuEntry( - value: OdsApplication.recipes[4].title, - label: OdsApplication.recipes[4].title, - leadingIcon: customizationState?.hasIcon == true - ? SvgPicture.asset( - "assets/recipes/ic_ice_cream.svg", - colorFilter: ColorFilter.mode( - Theme.of(context).colorScheme.onBackground, - BlendMode.srcIn), - ) - : null, - ), - ], - selectedItem: (value) { - setState( - () { - print('$value'); - }, - ); - }, + ), ), ); } diff --git a/app/lib/ui/components/navigation_bar/navigation_bar.dart b/app/lib/ui/components/navigation_bar/navigation_bar.dart index a3d52bbe..0a1191c4 100644 --- a/app/lib/ui/components/navigation_bar/navigation_bar.dart +++ b/app/lib/ui/components/navigation_bar/navigation_bar.dart @@ -21,21 +21,11 @@ import 'package:ods_flutter_demo/ui/components/navigation_bar/navigation_bar_cus import 'package:ods_flutter_demo/ui/main_app_bar.dart'; import 'package:ods_flutter_demo/ui/utilities/component_count_row.dart'; -class ComponentNavigationBar extends StatefulWidget { - const ComponentNavigationBar({Key? key}) : super(key: key); +class ComponentNavigationBar extends StatelessWidget { + ComponentNavigationBar({Key? key}) : super(key: key); - @override - State createState() => _ComponentNavigationBarState(); -} - -class _ComponentNavigationBarState extends State { final _scaffoldKey = GlobalKey(); - @override - void initState() { - super.initState(); - } - @override Widget build(BuildContext context) { return NavigationBarCustomization( diff --git a/app/lib/ui/components/navigation_rail/navigation_rail.dart b/app/lib/ui/components/navigation_rail/navigation_rail.dart index aa429aa3..8a9b1c97 100644 --- a/app/lib/ui/components/navigation_rail/navigation_rail.dart +++ b/app/lib/ui/components/navigation_rail/navigation_rail.dart @@ -26,22 +26,11 @@ import 'package:ods_flutter_demo/ui/components/navigation_rail/navigation_rail_e import 'package:ods_flutter_demo/ui/main_app_bar.dart'; import 'package:ods_flutter_demo/ui/utilities/component_count_row.dart'; -class ComponentNavigationRail extends StatefulWidget { - const ComponentNavigationRail({Key? key}) : super(key: key); +class ComponentNavigationRail extends StatelessWidget { + ComponentNavigationRail({Key? key}) : super(key: key); - @override - State createState() => - _ComponentNavigationBarState(); -} - -class _ComponentNavigationBarState extends State { final _scaffoldKey = GlobalKey(); - @override - void initState() { - super.initState(); - } - @override Widget build(BuildContext context) { return NavigationRailCustomization( @@ -124,6 +113,8 @@ class _NavRailDemoState extends State<_NavRailDemo> { semanticsLabel: 'Add', //Optional ); break; + case null: + break; } return Row( @@ -251,7 +242,7 @@ class _CustomizationContentState extends State<_CustomizationContent> { scrollDirection: Axis.horizontal, child: Row( children: List.generate( - customizationState!.elements.length, + customizationState.elements.length, (int index) { NavigationRailsEnum currentElement = customizationState.elements[index]; diff --git a/app/lib/ui/components/progress/progress_circular.dart b/app/lib/ui/components/progress/progress_circular.dart index 50790b27..5ee48e78 100644 --- a/app/lib/ui/components/progress/progress_circular.dart +++ b/app/lib/ui/components/progress/progress_circular.dart @@ -43,12 +43,7 @@ class ComponentProgressCircular extends StatelessWidget { } } -class _Body extends StatefulWidget { - @override - _BodyState createState() => _BodyState(); -} - -class _BodyState extends State<_Body> { +class _Body extends StatelessWidget { @override Widget build(BuildContext context) { final ProgressCustomizationState? customizationState = diff --git a/app/lib/ui/components/progress/progress_linear.dart b/app/lib/ui/components/progress/progress_linear.dart index b5107038..6259bcfc 100644 --- a/app/lib/ui/components/progress/progress_linear.dart +++ b/app/lib/ui/components/progress/progress_linear.dart @@ -43,12 +43,7 @@ class ComponentProgressLinear extends StatelessWidget { } } -class _Body extends StatefulWidget { - @override - _BodyState createState() => _BodyState(); -} - -class _BodyState extends State<_Body> { +class _Body extends StatelessWidget { @override Widget build(BuildContext context) { final ProgressCustomizationState? customizationState = diff --git a/app/lib/ui/components/radio_buttons/radio_buttons.dart b/app/lib/ui/components/radio_buttons/radio_buttons.dart index 3f56de78..b0db5d72 100644 --- a/app/lib/ui/components/radio_buttons/radio_buttons.dart +++ b/app/lib/ui/components/radio_buttons/radio_buttons.dart @@ -19,23 +19,11 @@ import 'package:ods_flutter_demo/main.dart'; import 'package:ods_flutter_demo/ui/components/radio_buttons/radio_buttons_customization.dart'; import 'package:ods_flutter_demo/ui/main_app_bar.dart'; -class ComponentRadioButtons extends StatefulWidget { - const ComponentRadioButtons({Key? key}) : super(key: key); +class ComponentRadioButtons extends StatelessWidget { + ComponentRadioButtons({Key? key}) : super(key: key); - @override - State createState() => _ComponentRadioButtonsState(); -} - -enum Options { option1, option2 } - -class _ComponentRadioButtonsState extends State { final _scaffoldKey = GlobalKey(); - @override - void initState() { - super.initState(); - } - @override Widget build(BuildContext context) { return RadioButtonsCustomization( @@ -52,6 +40,8 @@ class _ComponentRadioButtonsState extends State { } } +enum Options { option1, option2 } + class _Body extends StatefulWidget { @override __BodyState createState() => __BodyState(); @@ -72,6 +62,7 @@ class __BodyState extends State<_Body> { title: OdsApplication.recipes[0].title, value: Options.option1, groupValue: _selectedOption, + enabled: customizationState?.hasEnabled, onCheckedChange: customizationState?.hasEnabled == true ? (Options? value) { setState( @@ -86,6 +77,7 @@ class __BodyState extends State<_Body> { title: OdsApplication.recipes[1].title, value: Options.option2, groupValue: _selectedOption, + enabled: customizationState?.hasEnabled, onCheckedChange: customizationState?.hasEnabled == true ? (value) { setState( diff --git a/app/lib/ui/components/sheets_bottom/sheets_bottom.dart b/app/lib/ui/components/sheets_bottom/sheets_bottom.dart index bc85ba19..b209de31 100644 --- a/app/lib/ui/components/sheets_bottom/sheets_bottom.dart +++ b/app/lib/ui/components/sheets_bottom/sheets_bottom.dart @@ -23,17 +23,8 @@ import 'package:ods_flutter_demo/ui/components/sheets_bottom/sheets_bottom_custo import 'package:ods_flutter_demo/ui/components/sheets_bottom/sheets_bottom_enum.dart'; import 'package:ods_flutter_demo/ui/theme/theme_selector.dart'; -class ComponentSheetsBottom extends StatefulWidget { +class ComponentSheetsBottom extends StatelessWidget { const ComponentSheetsBottom({super.key}); - @override - State createState() => _ComponentSheetsBottomState(); -} - -class _ComponentSheetsBottomState extends State { - @override - void initState() { - super.initState(); - } @override Widget build(BuildContext context) { @@ -95,7 +86,7 @@ class _BodyState extends State<_Body> { setState( () { selectedIndex = index; - isFiltered = selected!; + isFiltered = selected; customizationState.selectedElement = customizationState.elements[index]; }, @@ -112,12 +103,7 @@ class _BodyState extends State<_Body> { } } -class _CustomizationContent extends StatefulWidget { - @override - State<_CustomizationContent> createState() => _CustomizationContentState(); -} - -class _CustomizationContentState extends State<_CustomizationContent> { +class _CustomizationContent extends StatelessWidget { @override Widget build(BuildContext context) { final SheetsBottomCustomizationState? customizationState = diff --git a/app/lib/ui/components/sliders/sliders.dart b/app/lib/ui/components/sliders/sliders.dart index 6ab8688b..136f7d65 100644 --- a/app/lib/ui/components/sliders/sliders.dart +++ b/app/lib/ui/components/sliders/sliders.dart @@ -41,13 +41,8 @@ class ComponentSliders extends StatelessWidget { } } -class _Body extends StatefulWidget { - @override - _BodyState createState() => _BodyState(); -} - -class _BodyState extends State<_Body> { - double value = 20.0; +class _Body extends StatelessWidget { + final value = 20.0; @override Widget build(BuildContext context) { diff --git a/app/lib/ui/components/snackbars/snackbars.dart b/app/lib/ui/components/snackbars/snackbars.dart index c44cc247..a325773d 100644 --- a/app/lib/ui/components/snackbars/snackbars.dart +++ b/app/lib/ui/components/snackbars/snackbars.dart @@ -21,21 +21,11 @@ import 'package:ods_flutter_demo/main.dart'; import 'package:ods_flutter_demo/ui/components/snackbars/snackbars_customization.dart'; import 'package:ods_flutter_demo/ui/main_app_bar.dart'; -class ComponentSnackbars extends StatefulWidget { - const ComponentSnackbars({Key? key}) : super(key: key); +class ComponentSnackbars extends StatelessWidget { + ComponentSnackbars({Key? key}) : super(key: key); - @override - State createState() => _ComponentSnackbarsState(); -} - -class _ComponentSnackbarsState extends State { final _scaffoldKey = GlobalKey(); - @override - void initState() { - super.initState(); - } - @override Widget build(BuildContext context) { return ComponentSnackbarsCustomization( diff --git a/app/lib/ui/components/switches/switches.dart b/app/lib/ui/components/switches/switches.dart index 17f01338..f41280fb 100644 --- a/app/lib/ui/components/switches/switches.dart +++ b/app/lib/ui/components/switches/switches.dart @@ -18,21 +18,11 @@ import 'package:ods_flutter_demo/main.dart'; import 'package:ods_flutter_demo/ui/components/switches/switches_customization.dart'; import 'package:ods_flutter_demo/ui/main_app_bar.dart'; -class ComponentSwitches extends StatefulWidget { - const ComponentSwitches({super.key}); +class ComponentSwitches extends StatelessWidget { + ComponentSwitches({super.key}); - @override - State createState() => _ComponentSwitchesState(); -} - -class _ComponentSwitchesState extends State { final _scaffoldKey = GlobalKey(); - @override - void initState() { - super.initState(); - } - @override Widget build(BuildContext context) { return SwitchesCustomization( @@ -74,7 +64,7 @@ class __BodyState extends State<_Body> { enabled: customizationState?.hasEnabled == true ? isEnabled : false, onCheckedChange: (value) { setState(() { - isChecked = value!; + isChecked = value; }); }, ), diff --git a/app/lib/ui/components/textfields/textfield.dart b/app/lib/ui/components/textfields/textfield.dart index 882af35f..24715eec 100644 --- a/app/lib/ui/components/textfields/textfield.dart +++ b/app/lib/ui/components/textfields/textfield.dart @@ -13,6 +13,7 @@ import 'dart:io'; import 'dart:math'; +import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter_gen/gen_l10n/ods_flutter_app_localizations.dart'; import 'package:ods_flutter/components/chips/ods_choice_chips.dart'; @@ -37,11 +38,6 @@ class ComponentTextField extends StatefulWidget { class _ComponentTextFieldState extends State { final _scaffoldKey = GlobalKey(); - @override - void initState() { - super.initState(); - } - @override Widget build(BuildContext context) { var themeNotifier = Provider.of(context); @@ -77,24 +73,17 @@ class _ComponentTextFieldState extends State { ), ], ), - body: _Body()), + body: SafeArea(child: _Body())), ); } } -class _Body extends StatefulWidget { +class _Body extends StatelessWidget { _Body(); - @override - State<_Body> createState() => _BodyState(); -} - -class _BodyState extends State<_Body> { - var recipe = + final recipe = OdsApplication.recipes[Random().nextInt(OdsApplication.recipes.length)]; - _BodyState(); - @override Widget build(BuildContext context) { final TextFieldCustomizationState? customizationState = @@ -130,7 +119,7 @@ class _BodyState extends State<_Body> { ///Keyboard action switch (customizationState?.selectedKeyboardAction) { case KeyboardActionEnum.none: - if (Platform.isAndroid) { + if (kIsWeb || Platform.isAndroid) { keyboardAction = TextInputAction.none; } else if (Platform.isIOS) { keyboardAction = TextInputAction.unspecified; @@ -152,17 +141,20 @@ class _BodyState extends State<_Body> { keyboardAction = TextInputAction.send; break; case KeyboardActionEnum.previous: - if (Platform.isAndroid) { + if (kIsWeb || Platform.isAndroid) { keyboardAction = TextInputAction.previous; } break; case KeyboardActionEnum.next: keyboardAction = TextInputAction.next; break; + case null: + break; } return Padding( - padding: const EdgeInsets.all(spacingS), + padding: const EdgeInsets.only( + top: spacingL, left: spacingS, right: spacingS, bottom: spacingS), child: OdsTextField( controller: controllerTextField, enabled: diff --git a/app/lib/ui/components/textfields/textfield_password.dart b/app/lib/ui/components/textfields/textfield_password.dart index 4ab80f27..ce1eaa20 100644 --- a/app/lib/ui/components/textfields/textfield_password.dart +++ b/app/lib/ui/components/textfields/textfield_password.dart @@ -13,6 +13,7 @@ import 'dart:io'; import 'dart:math'; +import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter_gen/gen_l10n/ods_flutter_app_localizations.dart'; import 'package:ods_flutter/components/chips/ods_choice_chips.dart'; @@ -39,11 +40,6 @@ class _ComponentTextFieldPasswordState extends State { final _scaffoldKey = GlobalKey(); - @override - void initState() { - super.initState(); - } - @override Widget build(BuildContext context) { var themeNotifier = Provider.of(context); @@ -85,13 +81,8 @@ class _ComponentTextFieldPasswordState } } -class _Body extends StatefulWidget { - @override - State<_Body> createState() => _BodyState(); -} - -class _BodyState extends State<_Body> { - var recipe = +class _Body extends StatelessWidget { + final recipe = OdsApplication.recipes[Random().nextInt(OdsApplication.recipes.length)]; @override @@ -129,7 +120,7 @@ class _BodyState extends State<_Body> { ///Keyboard action switch (customizationState?.selectedKeyboardAction) { case KeyboardActionEnum.none: - if (Platform.isAndroid) { + if (kIsWeb || Platform.isAndroid) { keyboardAction = TextInputAction.none; } else if (Platform.isIOS) { keyboardAction = TextInputAction.unspecified; @@ -151,13 +142,15 @@ class _BodyState extends State<_Body> { keyboardAction = TextInputAction.send; break; case KeyboardActionEnum.previous: - if (Platform.isAndroid) { + if (!kIsWeb && Platform.isAndroid) { keyboardAction = TextInputAction.previous; } break; case KeyboardActionEnum.next: keyboardAction = TextInputAction.next; break; + case null: + break; } return Padding( diff --git a/app/lib/ui/guidelines/guidelines_screen.dart b/app/lib/ui/guidelines/guidelines_screen.dart index db2e6730..9b1e9532 100644 --- a/app/lib/ui/guidelines/guidelines_screen.dart +++ b/app/lib/ui/guidelines/guidelines_screen.dart @@ -18,23 +18,18 @@ import 'package:ods_flutter/guidelines/spacings.dart'; import 'package:ods_flutter_demo/ui/guidelines/guideline_detail_screen.dart'; import 'package:ods_flutter_demo/ui/guidelines/guidelines_entities.dart'; -class GuidelinesScreen extends StatefulWidget { +class GuidelinesScreen extends StatelessWidget { final List odsGuidelines; GuidelinesScreen({required this.odsGuidelines}); - @override - State createState() => _GuidelinesScreenState(); -} - -class _GuidelinesScreenState extends State { @override Widget build(BuildContext context) { return SafeArea( child: ListView.builder( - itemCount: widget.odsGuidelines.length, + itemCount: odsGuidelines.length, itemBuilder: (context, index) { - var guideline = widget.odsGuidelines[index]; + var guideline = odsGuidelines[index]; return Padding( padding: const EdgeInsets.all(spacingS), child: Column( diff --git a/app/lib/ui/guidelines/typography/guideline_typography_screen.dart b/app/lib/ui/guidelines/typography/guideline_typography_screen.dart index 6d0779ef..ae1dabc8 100644 --- a/app/lib/ui/guidelines/typography/guideline_typography_screen.dart +++ b/app/lib/ui/guidelines/typography/guideline_typography_screen.dart @@ -12,6 +12,7 @@ import 'dart:io'; +import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter_gen/gen_l10n/ods_flutter_app_localizations.dart'; import 'package:ods_flutter/components/divider/ods_divider.dart'; @@ -85,7 +86,7 @@ class GuidelineTypographyScreen extends StatelessWidget { padding: EdgeInsets.all(spacingM), child: Column( children: [ - Platform.isAndroid + kIsWeb || Platform.isAndroid ? Text( AppLocalizations.of(context)! .guidelinesTypographyAndroidDescription, diff --git a/app/lib/ui/modules/lists/module_lists_screen.dart b/app/lib/ui/modules/lists/module_lists_screen.dart index d39a4118..cc74219c 100644 --- a/app/lib/ui/modules/lists/module_lists_screen.dart +++ b/app/lib/ui/modules/lists/module_lists_screen.dart @@ -24,21 +24,11 @@ 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'; import 'package:ods_flutter_demo/ui/main_app_bar.dart'; -class ModuleListsStandard extends StatefulWidget { - const ModuleListsStandard({super.key}); +class ModuleListsStandard extends StatelessWidget { + ModuleListsStandard({super.key}); - @override - State createState() => _ModuleListsStandardState(); -} - -class _ModuleListsStandardState extends State { final _scaffoldKey = GlobalKey(); - @override - void initState() { - super.initState(); - } - @override Widget build(BuildContext context) { return ListCustomization( diff --git a/app/lib/ui/modules/modules_screen.dart b/app/lib/ui/modules/modules_screen.dart index 2605afad..80ba86b1 100644 --- a/app/lib/ui/modules/modules_screen.dart +++ b/app/lib/ui/modules/modules_screen.dart @@ -17,23 +17,18 @@ import 'package:ods_flutter/components/card/ods_vertical_image_first_card.dart'; import 'package:ods_flutter/guidelines/spacings.dart'; import 'package:ods_flutter_demo/ui/modules/modules_entities.dart'; -class ModulesScreen extends StatefulWidget { - final List odsModules; - +class ModulesScreen extends StatelessWidget { ModulesScreen({required this.odsModules}); - @override - State createState() => _ModulesScreenState(); -} + final List odsModules; -class _ModulesScreenState extends State { @override Widget build(BuildContext context) { return SafeArea( child: ListView.builder( - itemCount: widget.odsModules.length, + itemCount: odsModules.length, itemBuilder: (context, index) { - var module = widget.odsModules[index]; + var module = odsModules[index]; return Padding( padding: const EdgeInsets.all(spacingS), child: Column( diff --git a/app/lib/ui/utilities/expandable_text.dart b/app/lib/ui/utilities/expandable_text.dart index 41529455..6ebc0560 100644 --- a/app/lib/ui/utilities/expandable_text.dart +++ b/app/lib/ui/utilities/expandable_text.dart @@ -19,7 +19,7 @@ class ExpandableTextWidget extends StatefulWidget { ExpandableTextWidget({required this.text, this.maxLines = 2}); @override - _ExpandableTextWidgetState createState() => _ExpandableTextWidgetState(); + State createState() => _ExpandableTextWidgetState(); } class _ExpandableTextWidgetState extends State { diff --git a/app/pubspec.lock b/app/pubspec.lock index c931c538..21575ad7 100644 --- a/app/pubspec.lock +++ b/app/pubspec.lock @@ -61,10 +61,10 @@ packages: dependency: transitive description: name: collection - sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a + sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c" url: "https://pub.dev" source: hosted - version: "1.18.0" + version: "1.17.1" convert: dependency: transitive description: @@ -169,10 +169,10 @@ packages: dependency: "direct main" description: name: get - sha256: e4e7335ede17452b391ed3b2ede016545706c01a02292a6c97619705e7d2a85e + sha256: "2ba20a47c8f1f233bed775ba2dd0d3ac97b4cf32fc17731b3dfc672b06b0e92a" url: "https://pub.dev" source: hosted - version: "4.6.6" + version: "4.6.5" glob: dependency: transitive description: @@ -209,10 +209,10 @@ packages: dependency: "direct main" description: name: intl - sha256: "3bc132a9dbce73a7e4a21a17d06e1878839ffbf975568bc875c60537824b0c4d" + sha256: a3715e3bc90294e971cb7dc063fbf3cd9ee0ebf8604ffeafabd9e6f16abbdbe6 url: "https://pub.dev" source: hosted - version: "0.18.1" + version: "0.18.0" intl_translation: dependency: transitive description: @@ -221,30 +221,14 @@ packages: url: "https://pub.dev" source: hosted version: "0.18.2" - leak_tracker: + js: dependency: transitive description: - name: leak_tracker - sha256: "78eb209deea09858f5269f5a5b02be4049535f568c07b275096836f01ea323fa" + name: js + sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 url: "https://pub.dev" source: hosted - version: "10.0.0" - leak_tracker_flutter_testing: - dependency: transitive - description: - name: leak_tracker_flutter_testing - sha256: b46c5e37c19120a8a01918cfaf293547f47269f7cb4b0058f21531c2465d6ef0 - url: "https://pub.dev" - source: hosted - version: "2.0.1" - leak_tracker_testing: - dependency: transitive - description: - name: leak_tracker_testing - sha256: a597f72a664dbd293f3bfc51f9ba69816f84dcd403cdac7066cb3f6003f3ab47 - url: "https://pub.dev" - source: hosted - version: "2.0.1" + version: "0.6.7" lints: dependency: transitive description: @@ -265,26 +249,26 @@ packages: dependency: transitive description: name: matcher - sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb + sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb" url: "https://pub.dev" source: hosted - version: "0.12.16+1" + version: "0.12.15" material_color_utilities: dependency: transitive description: name: material_color_utilities - sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a" + sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 url: "https://pub.dev" source: hosted - version: "0.8.0" + version: "0.2.0" meta: dependency: transitive description: name: meta - sha256: d584fa6707a52763a52446f02cc621b077888fb63b93bbcb1143a7be5a0c0c04 + sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" url: "https://pub.dev" source: hosted - version: "1.11.0" + version: "1.9.1" nested: dependency: transitive description: @@ -328,10 +312,10 @@ packages: dependency: transitive description: name: path - sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" + sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" url: "https://pub.dev" source: hosted - version: "1.9.0" + version: "1.8.3" path_parsing: dependency: transitive description: @@ -493,26 +477,26 @@ packages: dependency: transitive description: name: source_span - sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" + sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 url: "https://pub.dev" source: hosted - version: "1.10.0" + version: "1.9.1" stack_trace: dependency: transitive description: name: stack_trace - sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" + sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 url: "https://pub.dev" source: hosted - version: "1.11.1" + version: "1.11.0" stream_channel: dependency: transitive description: name: stream_channel - sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 + sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" url: "https://pub.dev" source: hosted - version: "2.1.2" + version: "2.1.1" string_scanner: dependency: transitive description: @@ -533,10 +517,10 @@ packages: dependency: transitive description: name: test_api - sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b" + sha256: eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfb url: "https://pub.dev" source: hosted - version: "0.6.1" + version: "0.5.1" typed_data: dependency: transitive description: @@ -577,14 +561,6 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.4" - vm_service: - dependency: transitive - description: - name: vm_service - sha256: b3d56ff4341b8f182b96aceb2fa20e3dcb336b9f867bc0eafc0de10f1048e957 - url: "https://pub.dev" - source: hosted - version: "13.0.0" watcher: dependency: transitive description: @@ -658,5 +634,5 @@ packages: source: hosted version: "3.1.2" sdks: - dart: ">=3.2.0-0 <4.0.0" - flutter: ">=3.13.0" + dart: ">=3.0.0 <4.0.0" + flutter: ">=3.10.0" diff --git a/app/pubspec.yaml b/app/pubspec.yaml index 37fccfe2..396f3d4b 100644 --- a/app/pubspec.yaml +++ b/app/pubspec.yaml @@ -19,7 +19,8 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev version: 0.9.0+1 environment: - sdk: '>=2.19.6 <3.0.0' + sdk: '>=3.0.0 <4.0.0' + flutter: '>=3.10.0' # Dependencies specify other packages that your package needs in order to work. # To automatically upgrade your package dependencies to the latest versions @@ -50,7 +51,7 @@ dependencies: cupertino_icons: ^1.0.2 shared_preferences: ^2.1.0 flutter_svg: ^2.0.5 - get: ^4.6.5 + get: ^4.6.5 # Read markdown. markdown: ^7.1.1 @@ -72,7 +73,6 @@ dev_dependencies: # The following section is specific to Flutter packages. flutter: - # The following line ensures that the Material Icons font is # included with your application, so that you can use the icons in # the material Icons class. @@ -83,10 +83,10 @@ flutter: # To add assets to your application, add an assets section, like this: assets: - - assets/ - - assets/recipes/ - - THIRD_PARTY.md - - CHANGELOG.md + - assets/ + - assets/recipes/ + - THIRD_PARTY.md + - CHANGELOG.md # An image asset can refer to one or more resolution-specific "variants", see # https://flutter.dev/assets-and-images/#resolution-aware diff --git a/app/pubspec_overrides.yaml b/app/pubspec_overrides.yaml new file mode 100644 index 00000000..fd878594 --- /dev/null +++ b/app/pubspec_overrides.yaml @@ -0,0 +1,4 @@ +# melos_managed_dependency_overrides: ods_flutter +dependency_overrides: + ods_flutter: + path: ../library diff --git a/docs/_includes/footer.html b/docs/_includes/footer.html index 5fd803de..ad510806 100644 --- a/docs/_includes/footer.html +++ b/docs/_includes/footer.html @@ -1,4 +1,4 @@ -