diff --git a/lib/data/models/selectionPopupModel/selection_popup_model.dart b/lib/core/data/selectionPopupModel/selection_popup_model.dart similarity index 100% rename from lib/data/models/selectionPopupModel/selection_popup_model.dart rename to lib/core/data/selectionPopupModel/selection_popup_model.dart diff --git a/lib/data/models/selectionPopupModel/selection_popup_model.freezed.dart b/lib/core/data/selectionPopupModel/selection_popup_model.freezed.dart similarity index 100% rename from lib/data/models/selectionPopupModel/selection_popup_model.freezed.dart rename to lib/core/data/selectionPopupModel/selection_popup_model.freezed.dart diff --git a/lib/features/auth/auth_screen/auth_screen.dart b/lib/features/auth/auth_screen/auth_screen.dart index da510bd8..998b6ac0 100644 --- a/lib/features/auth/auth_screen/auth_screen.dart +++ b/lib/features/auth/auth_screen/auth_screen.dart @@ -5,7 +5,6 @@ import 'package:eatvio_app/core/token_storage.dart'; import 'package:eatvio_app/core/utils/image_constant.dart'; import 'package:eatvio_app/generated/l10n.dart'; import 'package:eatvio_app/theme/theme_helper.dart'; -import 'package:eatvio_app/widgets/app_bar/appbar_title_image.dart'; import 'package:eatvio_app/widgets/custom_text_form_field.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; @@ -45,7 +44,11 @@ class _AuthScreenState extends State { return Scaffold( appBar: AppBar( centerTitle: true, - title: AppbarTitleImage(imagePath: ImageConstant.imgLogoEatvio), + title: Image.asset( + ImageConstant.imgLogoEatvio, + height: 48, + fit: BoxFit.contain, + ), ), body: SafeArea( child: Padding( diff --git a/lib/features/consultant/become_consultant/presentation/pages/stepper_become_consultant_screen.dart b/lib/features/consultant/become_consultant/presentation/pages/stepper_become_consultant_screen.dart index 3d970a01..eb1358ea 100644 --- a/lib/features/consultant/become_consultant/presentation/pages/stepper_become_consultant_screen.dart +++ b/lib/features/consultant/become_consultant/presentation/pages/stepper_become_consultant_screen.dart @@ -8,7 +8,6 @@ import 'package:eatvio_app/features/consultant/become_consultant/presentation/pa import 'package:eatvio_app/features/consultant/become_consultant/presentation/pages/social_networks_screen.dart'; import 'package:eatvio_app/locator_service.dart'; import 'package:eatvio_app/theme/theme_helper.dart'; -import 'package:eatvio_app/widgets/app_bar/appbar_title_image.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:go_router/go_router.dart'; @@ -215,7 +214,11 @@ class _StepperBecomeConsultantScreenState extends State { decoration: BoxDecoration( borderRadius: BorderRadius.circular(4), ), - child: CustomImageView( - imagePath: ImageConstant.imgFavorite, + child: Image.asset( + ImageConstant.imgFavorite, height: 16, width: 16, ), @@ -119,8 +118,8 @@ class _BloodPressureScreenState extends State { decoration: BoxDecoration( borderRadius: BorderRadius.circular(4), ), - child: CustomImageView( - imagePath: ImageConstant.imgFavorite, + child: Image.asset( + ImageConstant.imgFavorite, height: 16, width: 16, ), diff --git a/lib/features/registration/presentation/pages/city_of_living_screen.dart b/lib/features/registration/presentation/pages/city_of_living_screen.dart index bae25803..1f2755e0 100644 --- a/lib/features/registration/presentation/pages/city_of_living_screen.dart +++ b/lib/features/registration/presentation/pages/city_of_living_screen.dart @@ -1,4 +1,4 @@ -import 'package:eatvio_app/data/models/selectionPopupModel/selection_popup_model.dart'; +import 'package:eatvio_app/core/data/selectionPopupModel/selection_popup_model.dart'; import 'package:eatvio_app/features/registration/models/user_registration_model.dart'; import 'package:eatvio_app/features/registration/presentation/bloc/registration_cubit/registration_cubit.dart'; import 'package:eatvio_app/theme/theme_helper.dart'; diff --git a/lib/features/registration/presentation/pages/language_select_screen.dart b/lib/features/registration/presentation/pages/language_select_screen.dart index ed167fc1..638a207e 100644 --- a/lib/features/registration/presentation/pages/language_select_screen.dart +++ b/lib/features/registration/presentation/pages/language_select_screen.dart @@ -1,4 +1,4 @@ -import 'package:eatvio_app/data/models/selectionPopupModel/selection_popup_model.dart'; +import 'package:eatvio_app/core/data/selectionPopupModel/selection_popup_model.dart'; import 'package:eatvio_app/features/registration/models/user_registration_model.dart'; import 'package:eatvio_app/features/registration/presentation/bloc/registration_cubit/registration_cubit.dart'; import 'package:eatvio_app/generated/l10n.dart'; diff --git a/lib/features/registration/presentation/pages/registration_screen.dart b/lib/features/registration/presentation/pages/registration_screen.dart index b47212ba..c5cc8826 100644 --- a/lib/features/registration/presentation/pages/registration_screen.dart +++ b/lib/features/registration/presentation/pages/registration_screen.dart @@ -19,11 +19,10 @@ import 'package:eatvio_app/features/registration/presentation/pages/weight_scree import 'package:eatvio_app/generated/l10n.dart'; import 'package:eatvio_app/locator_service.dart'; import 'package:eatvio_app/theme/theme_helper.dart'; -import 'package:eatvio_app/widgets/app_bar/appbar_title_image.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:go_router/go_router.dart'; -import 'package:rive/rive.dart'; +import 'package:rive/rive.dart' as rive; import 'package:validators/validators.dart'; class RegistrationScreen extends StatefulWidget { @@ -116,7 +115,11 @@ class _RegistrationScreenState extends State { ), ), centerTitle: true, - title: AppbarTitleImage(imagePath: ImageConstant.imgLogoEatvio), + title: Image.asset( + ImageConstant.imgLogoEatvio, + height: 48, + fit: BoxFit.contain, + ), actions: [ Padding( padding: const EdgeInsets.only(right: 16), @@ -322,7 +325,7 @@ class _RegistrationScreenState extends State { child: SizedBox( height: 32, width: 32, - child: RiveAnimation.asset( + child: rive.RiveAnimation.asset( 'assets/rive_animations/loading.riv', ), ), diff --git a/lib/features/settings/presentation/pages/general_info_screen.dart b/lib/features/settings/presentation/pages/general_info_screen.dart index 4ad9e084..693e909d 100644 --- a/lib/features/settings/presentation/pages/general_info_screen.dart +++ b/lib/features/settings/presentation/pages/general_info_screen.dart @@ -1,5 +1,5 @@ +import 'package:eatvio_app/core/data/selectionPopupModel/selection_popup_model.dart'; import 'package:eatvio_app/core/utils/date_time_utils.dart'; -import 'package:eatvio_app/data/models/selectionPopupModel/selection_popup_model.dart'; import 'package:eatvio_app/features/settings/entities/settings_entity.dart'; import 'package:eatvio_app/features/settings/presentation/bloc/settings_cubit/settings_state.dart'; import 'package:eatvio_app/generated/l10n.dart'; diff --git a/lib/features/settings/presentation/pages/pressure_screen.dart b/lib/features/settings/presentation/pages/pressure_screen.dart index 7c1ee72a..9a7538dc 100644 --- a/lib/features/settings/presentation/pages/pressure_screen.dart +++ b/lib/features/settings/presentation/pages/pressure_screen.dart @@ -1,4 +1,4 @@ -import 'package:eatvio_app/data/models/selectionPopupModel/selection_popup_model.dart'; +import 'package:eatvio_app/core/data/selectionPopupModel/selection_popup_model.dart'; import 'package:eatvio_app/features/settings/entities/settings_entity.dart'; import 'package:eatvio_app/features/settings/presentation/bloc/settings_cubit/settings_state.dart'; import 'package:eatvio_app/generated/l10n.dart'; diff --git a/lib/widgets/app_bar/appbar_leading_image.dart b/lib/widgets/app_bar/appbar_leading_image.dart deleted file mode 100644 index 0f930dcb..00000000 --- a/lib/widgets/app_bar/appbar_leading_image.dart +++ /dev/null @@ -1,34 +0,0 @@ -import 'package:eatvio_app/widgets/custom_image_view.dart'; -import 'package:flutter/material.dart'; - -class AppbarLeadingImage extends StatelessWidget { - const AppbarLeadingImage({ - this.imagePath, - this.margin, - this.onTap, - }); - - final String? imagePath; - final EdgeInsetsGeometry? margin; - final Function? onTap; - - @override - Widget build(BuildContext context) { - return InkWell( - onTap: onTapCall, - child: Padding( - padding: margin ?? EdgeInsets.zero, - child: CustomImageView( - imagePath: imagePath, - height: 26, - width: 13, - fit: BoxFit.contain, - ), - ), - ); - } - - void onTapCall() { - onTap!.call(); - } -} diff --git a/lib/widgets/app_bar/appbar_subtitle.dart b/lib/widgets/app_bar/appbar_subtitle.dart deleted file mode 100644 index ff1325f7..00000000 --- a/lib/widgets/app_bar/appbar_subtitle.dart +++ /dev/null @@ -1,30 +0,0 @@ -import 'package:eatvio_app/theme/custom_text_style.dart'; -import 'package:eatvio_app/theme/theme_helper.dart'; -import 'package:flutter/material.dart'; - -class AppbarSubtitle extends StatelessWidget { - const AppbarSubtitle({ - required this.text, - this.margin, - this.onTap, - }); - - final String text; - final EdgeInsetsGeometry? margin; - final Function? onTap; - - @override - Widget build(BuildContext context) { - return GestureDetector( - child: Padding( - padding: margin ?? EdgeInsets.zero, - child: Text( - text, - style: CustomTextStyles.titleMediumBlack.copyWith( - color: appTheme.black900, - ), - ), - ), - ); - } -} diff --git a/lib/widgets/app_bar/appbar_title_image.dart b/lib/widgets/app_bar/appbar_title_image.dart deleted file mode 100644 index cf7fedcf..00000000 --- a/lib/widgets/app_bar/appbar_title_image.dart +++ /dev/null @@ -1,17 +0,0 @@ -import 'package:eatvio_app/widgets/custom_image_view.dart'; -import 'package:flutter/material.dart'; - -class AppbarTitleImage extends StatelessWidget { - const AppbarTitleImage({required this.imagePath, super.key}); - - final String? imagePath; - - @override - Widget build(BuildContext context) { - return CustomImageView( - imagePath: imagePath, - height: 48, - fit: BoxFit.contain, - ); - } -} diff --git a/lib/widgets/app_bar/custom_app_bar.dart b/lib/widgets/app_bar/custom_app_bar.dart deleted file mode 100644 index ce58516a..00000000 --- a/lib/widgets/app_bar/custom_app_bar.dart +++ /dev/null @@ -1,39 +0,0 @@ -import 'package:flutter/material.dart'; - -// ignore: must_be_immutable -class CustomAppBar extends StatelessWidget implements PreferredSizeWidget { - CustomAppBar({ - Key? key, - this.height, - this.leadingWidth, - this.leading, - this.title, - this.centerTitle, - this.actions, - }) : super(key: key); - - final double? height; - final double? leadingWidth; - final Widget? leading; - final Widget? title; - final bool? centerTitle; - final List? actions; - - @override - Widget build(BuildContext context) { - return AppBar( - toolbarHeight: height ?? 56, - automaticallyImplyLeading: false, - backgroundColor: Colors.transparent, - leadingWidth: leadingWidth ?? 0, - leading: leading, - title: title, - titleSpacing: 0, - centerTitle: centerTitle ?? false, - actions: actions, - ); - } - - @override - Size get preferredSize => Size(double.infinity, height ?? 56); -} diff --git a/lib/widgets/custom_about_list.dart b/lib/widgets/custom_about_list.dart deleted file mode 100644 index 90b1d3d0..00000000 --- a/lib/widgets/custom_about_list.dart +++ /dev/null @@ -1,58 +0,0 @@ -import 'package:flutter/material.dart'; - -class AboutList extends StatefulWidget { - final String title; - final List items; - - AboutList(this.title, this.items); - - @override - _AboutListState createState() => _AboutListState(); -} - -class _AboutListState extends State { - bool isExpanded = false; - - @override - Widget build(BuildContext context) { - return Column( - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - GestureDetector( - onTap: toggleList(), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text( - widget.title, - style: TextStyle( - color: Colors.black, - fontSize: 14, - fontWeight: FontWeight.bold, - ), - ), - Icon(isExpanded ? Icons.arrow_drop_up : Icons.arrow_drop_down), - ], - ), - ), - if (isExpanded) - Padding( - padding: const EdgeInsets.only(left: 16.0), - child: Column( - //children: widget.items.map((item) => Text(item)).toList(), - children: [Text(widget.items.join('\n'))], - ), - ), - Divider(), - ], - ); - } - - toggleList() { - return () { - setState(() { - isExpanded = !isExpanded; - }); - }; - } -} diff --git a/lib/widgets/custom_drop_down.dart b/lib/widgets/custom_drop_down.dart index 7522893a..887f4597 100644 --- a/lib/widgets/custom_drop_down.dart +++ b/lib/widgets/custom_drop_down.dart @@ -1,4 +1,4 @@ -import 'package:eatvio_app/data/models/selectionPopupModel/selection_popup_model.dart'; +import 'package:eatvio_app/core/data/selectionPopupModel/selection_popup_model.dart'; import 'package:flutter/material.dart'; class CustomDropDown extends StatelessWidget { diff --git a/lib/widgets/custom_image_view.dart b/lib/widgets/custom_image_view.dart deleted file mode 100644 index 07b9a5d9..00000000 --- a/lib/widgets/custom_image_view.dart +++ /dev/null @@ -1,162 +0,0 @@ -// ignore_for_file: must_be_immutable - -import 'dart:io'; - -import 'package:cached_network_image/cached_network_image.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_svg/flutter_svg.dart'; - -class CustomImageView extends StatelessWidget { - ///[imagePath] is required parameter for showing image - String? imagePath; - - double? height; - double? width; - Color? color; - BoxFit? fit; - final String placeHolder; - Alignment? alignment; - VoidCallback? onTap; - EdgeInsetsGeometry? margin; - BorderRadius? radius; - BoxBorder? border; - - ///a [CustomImageView] it can be used for showing any type of images - /// it will shows the placeholder image if image is not found on network image - CustomImageView({ - this.imagePath, - this.height, - this.width, - this.color, - this.fit, - this.alignment, - this.onTap, - this.radius, - this.margin, - this.border, - this.placeHolder = 'assets/images/image_not_found.png', - }); - - @override - Widget build(BuildContext context) { - return alignment != null - ? Align( - alignment: alignment!, - child: Padding( - padding: margin ?? EdgeInsets.zero, - child: InkWell( - onTap: onTap, - child: _buildCircleImage(), - ), - ), - ) - : Padding( - padding: margin ?? EdgeInsets.zero, - child: InkWell( - onTap: onTap, - child: _buildCircleImage(), - ), - ); - } - - ///build the image with border radius - _buildCircleImage() { - if (radius != null) { - return ClipRRect( - borderRadius: radius ?? BorderRadius.zero, - child: _buildImageWithBorder(), - ); - } else { - return _buildImageWithBorder(); - } - } - - ///build the image with border and border radius style - _buildImageWithBorder() { - if (border != null) { - return Container( - decoration: BoxDecoration( - border: border, - borderRadius: radius, - ), - child: _buildImageView(), - ); - } else { - return _buildImageView(); - } - } - - _buildImageView() { - if (imagePath != null) { - switch (imagePath!.imageType) { - case ImageType.svg: - return Container( - height: height, - width: width, - child: SvgPicture.asset( - imagePath!, - height: height, - width: width, - fit: fit ?? BoxFit.contain, - ), - ); - case ImageType.file: - return Image.file( - File(imagePath!), - height: height, - width: width, - fit: fit ?? BoxFit.cover, - color: color, - ); - case ImageType.network: - return CachedNetworkImage( - height: height, - width: width, - fit: fit, - imageUrl: imagePath!, - color: color, - placeholder: (context, url) => Container( - height: 30, - width: 30, - child: LinearProgressIndicator( - color: Colors.grey.shade200, - backgroundColor: Colors.grey.shade100, - ), - ), - errorWidget: (context, url, error) => Image.asset( - placeHolder, - height: height, - width: width, - fit: fit ?? BoxFit.cover, - ), - ); - case ImageType.png: - default: - return Image.asset( - imagePath!, - height: height, - width: width, - fit: fit ?? BoxFit.cover, - color: color, - ); - } - } - return SizedBox(); - } -} - -extension ImageTypeExtension on String { - ImageType get imageType { - if (this.startsWith('http') || this.startsWith('https')) { - return ImageType.network; - } else if (this.endsWith('.svg')) { - return ImageType.svg; - } else if (this.startsWith('file://')) { - return ImageType.file; - } else { - return ImageType.png; - } - } -} - -enum ImageType { svg, png, network, file, unknown } diff --git a/lib/widgets/custom_language_drop_down.dart b/lib/widgets/custom_language_drop_down.dart deleted file mode 100644 index f04a703a..00000000 --- a/lib/widgets/custom_language_drop_down.dart +++ /dev/null @@ -1,49 +0,0 @@ -import 'package:flutter/material.dart'; - -class LanguageDropdown extends StatefulWidget { - @override - _LanguageDropdownState createState() => _LanguageDropdownState(); -} - -class _LanguageDropdownState extends State { - String selectedLanguage = 'Русский'; - - @override - Widget build(BuildContext context) { - return DropdownButton( - value: selectedLanguage, - onChanged: selectLanguage(), - isDense: false, - // Установите isDense в false - selectedItemBuilder: getList(), - items: ['Русский'].map((String language) { - return DropdownMenuItem( - value: language, - child: Text(language), - ); - }).toList(), - ); - } - - getList() { - return (BuildContext context) { - return ['Русский'].map((String language) { - return Align( - alignment: Alignment.center, // Выравнивание текста по центру - child: Text( - language, - style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold), - ), - ); - }).toList(); - }; - } - - selectLanguage() { - return (newValue) { - setState(() { - selectedLanguage = newValue!; - }); - }; - } -} diff --git a/lib/widgets/custom_notification_screen.dart b/lib/widgets/custom_notification_screen.dart deleted file mode 100644 index 20c2055b..00000000 --- a/lib/widgets/custom_notification_screen.dart +++ /dev/null @@ -1,48 +0,0 @@ -import 'package:eatvio_app/theme/theme_helper.dart'; -import 'package:flutter/material.dart'; - -class NotificationSwitch extends StatefulWidget { - final String title; - - NotificationSwitch(this.title); - - @override - _NotificationSwitchState createState() => _NotificationSwitchState(); -} - -class _NotificationSwitchState extends State { - bool switchValue = false; - - @override - Widget build(BuildContext context) { - return Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text( - widget.title, - style: TextStyle( - color: Colors.black, - fontSize: 14, - fontWeight: FontWeight.bold, - ), - ), - Switch( - value: switchValue, - onChanged: toggleSwitch(), - inactiveThumbColor: appTheme.blueA400, - inactiveTrackColor: Colors.white, - activeTrackColor: appTheme.blueA400, - activeColor: Colors.white, - ), - ], - ); - } - - toggleSwitch() { - return (value) { - setState(() { - switchValue = value; - }); - }; - } -} diff --git a/lib/widgets/custom_scale_element.dart b/lib/widgets/custom_scale_element.dart deleted file mode 100644 index 531c95ef..00000000 --- a/lib/widgets/custom_scale_element.dart +++ /dev/null @@ -1,28 +0,0 @@ -import 'package:flutter/material.dart'; - -class ScaleElement extends StatelessWidget { - final Color color; - final bool isSelected; - final VoidCallback onTap; - - const ScaleElement({ - required this.color, - required this.isSelected, - required this.onTap, - }); - - @override - Widget build(BuildContext context) { - return GestureDetector( - onTap: onTap, - child: Container( - width: isSelected ? 40 : 20, - height: isSelected ? 40 : 20, - decoration: BoxDecoration( - color: color, - shape: BoxShape.circle, - ), - ), - ); - } -} diff --git a/lib/widgets/custom_section_title.dart b/lib/widgets/custom_section_title.dart deleted file mode 100644 index 282f3d6a..00000000 --- a/lib/widgets/custom_section_title.dart +++ /dev/null @@ -1,19 +0,0 @@ -import 'package:flutter/material.dart'; - -class SectionTitle extends StatelessWidget { - final String title; - - SectionTitle(this.title); - - @override - Widget build(BuildContext context) { - return Padding( - padding: const EdgeInsets.symmetric(vertical: 8.0), - child: Text( - title, - textAlign: TextAlign.center, - style: TextStyle(fontSize: 18), - ), - ); - } -} diff --git a/lib/widgets/next_step_button.dart b/lib/widgets/next_step_button.dart deleted file mode 100644 index 05332f15..00000000 --- a/lib/widgets/next_step_button.dart +++ /dev/null @@ -1,89 +0,0 @@ -import 'package:eatvio_app/theme/theme_helper.dart'; -import 'package:eatvio_app/widgets/base_button.dart'; -import 'package:flutter/material.dart'; - -class NextStepButton extends BaseButton { - NextStepButton({ - Key? key, - this.decoration, - this.leftIcon, - this.rightIcon, - this.label, - VoidCallback? onPressed, - ButtonStyle? buttonStyle, - TextStyle? buttonTextStyle, - bool? isDisabled, - Alignment? alignment, - double? height, - double? width, - EdgeInsets? margin, - required String text, - }) : super( - text: text, - onPressed: onPressed, - buttonStyle: buttonStyle, - isDisabled: isDisabled, - buttonTextStyle: buttonTextStyle, - height: height, - alignment: alignment, - width: width, - margin: margin, - ); - - final BoxDecoration? decoration; - final Widget? leftIcon; - final Widget? rightIcon; - final Widget? label; - - @override - Widget build(BuildContext context) { - return (alignment != null) - ? Align( - alignment: alignment!, - child: Container( - height: this.height ?? 30, - width: this.width ?? double.maxFinite, - margin: margin, - decoration: decoration, - child: OutlinedButton( - style: buttonStyle, - onPressed: isDisabled ?? false ? null : onPressed ?? () {}, - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - leftIcon ?? const SizedBox.shrink(), - Text( - text, - style: buttonTextStyle ?? theme.textTheme.titleSmall, - ), - rightIcon ?? const SizedBox.shrink(), - ], - ), - ), - ), - ) - : Container( - height: this.height ?? 30, - width: this.width ?? double.maxFinite, - margin: margin, - decoration: decoration, - child: OutlinedButton( - style: buttonStyle, - onPressed: isDisabled ?? false ? null : onPressed ?? () {}, - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - leftIcon ?? const SizedBox.shrink(), - Text( - text, - style: buttonTextStyle ?? theme.textTheme.titleSmall, - ), - rightIcon ?? const SizedBox.shrink(), - ], - ), - ), - ); - } -}