Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/smooth_app/lib/l10n/app_localizations.dart
Original file line number Diff line number Diff line change
Expand Up @@ -987,7 +987,7 @@ abstract class AppLocalizations {
/// No description provided for @sign_up_page_email_error_empty.
///
/// In en, this message translates to:
/// **'E-post is required'**
/// **'E-mail is required'**
String get sign_up_page_email_error_empty;

/// No description provided for @sign_up_page_email_error_invalid.
Expand Down Expand Up @@ -2624,7 +2624,7 @@ abstract class AppLocalizations {
/// Please keep the ** syntax to make the text bold
///
/// In en, this message translates to:
/// **'This image was taken more than a year ago.\n**Please check that\'s it\'s still up-to-date**.\n\nThis is **just a warning**. If the content is still the same, you can ignore this message.'**
/// **'This image was taken more than a year ago.\n**Please check that it\'s still up-to-date**.\n\nThis is **just a warning**. If the content is still the same, you can ignore this message.'**
String get product_image_outdated_explanations_content;

/// Action on the photo gallery to replace an existing picture
Expand Down

This file was deleted.

14 changes: 0 additions & 14 deletions packages/smooth_app/lib/pages/prices/price_amount_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import 'package:smooth_app/generic_lib/design_constants.dart';
import 'package:smooth_app/generic_lib/widgets/smooth_sliver_card.dart';
import 'package:smooth_app/l10n/app_localizations.dart';
import 'package:smooth_app/pages/prices/price_amount_card_item.dart';
import 'package:smooth_app/pages/prices/price_amount_quantity.dart';
import 'package:smooth_app/pages/prices/price_amount_sum.dart';
import 'package:smooth_app/pages/prices/price_model.dart';

/// Card that displays the amounts (discounted or not) for price adding.
Expand All @@ -25,18 +23,6 @@ class PriceAmountCard extends StatelessWidget {
vertical: BALANCED_SPACE,
horizontal: LARGE_SPACE,
),
trailing: model.multipleProducts
? IconTheme.merge(
data: IconThemeData(
size: 16.0,
color: DefaultTextStyle.of(context).style.color,
),
child: const Row(
spacing: SMALL_SPACE,
children: <Widget>[PriceAmountQuantity(), PriceAmountSum()],
),
)
: null,
contentPadding: const EdgeInsetsDirectional.symmetric(
horizontal: SMALL_SPACE,
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import 'package:smooth_app/generic_lib/design_constants.dart';
import 'package:smooth_app/l10n/app_localizations.dart';
import 'package:smooth_app/pages/prices/price_amount_field.dart';
import 'package:smooth_app/pages/prices/price_amount_model.dart';
import 'package:smooth_app/pages/prices/price_discount_type_widget.dart';
import 'package:smooth_app/pages/prices/price_model.dart';
import 'package:smooth_app/pages/prices/price_per_extension.dart';
import 'package:smooth_app/pages/prices/price_product_list_tile.dart';
Expand Down Expand Up @@ -94,6 +95,13 @@ class _PriceAmountCardItemState extends State<PriceAmountCardItem> {
controlAffinity: ListTileControlAffinity.leading,
contentPadding: EdgeInsetsDirectional.zero,
),
if (model.promo)
PriceDiscountTypeDropdown(
value: model.discountType,
onChanged: (final DiscountType? value) {
setState(() => model.discountType = value);
},
),
const SizedBox(height: SMALL_SPACE),
Row(
children: <Widget>[
Expand Down
42 changes: 0 additions & 42 deletions packages/smooth_app/lib/pages/prices/price_amount_quantity.dart

This file was deleted.

66 changes: 0 additions & 66 deletions packages/smooth_app/lib/pages/prices/price_amount_sum.dart

This file was deleted.

22 changes: 11 additions & 11 deletions packages/smooth_app/lib/pages/prices/price_location_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ class PriceLocationCard extends StatelessWidget {
final PriceModel model = context.watch<PriceModel>();
final AppLocalizations appLocalizations = AppLocalizations.of(context);
final OsmLocation? location = model.location;
final bool editable = model.cropParameters != null;
final VoidCallback? onTap = editable ? () => _onTap(context) : null;

return SmoothCardWithRoundedHeader(
title: appLocalizations.prices_location_subtitle,
Expand All @@ -52,13 +50,12 @@ class PriceLocationCard extends StatelessWidget {
),
child: const icons.Map(size: 12.0),
),
if (editable)
SmoothCardHeaderButton(
tooltip: appLocalizations.owner_field_info_title,
circled: true,
onTap: onTap!,
child: const icons.Edit(size: 12.0),
),
SmoothCardHeaderButton(
tooltip: appLocalizations.owner_field_info_title,
circled: true,
onTap: () => _onTap(context),
child: const icons.Edit(size: 12.0),
),
],
)
: null,
Expand All @@ -69,8 +66,11 @@ class PriceLocationCard extends StatelessWidget {
child: SizedBox(
width: double.infinity,
child: location == null
? _PriceLocationCardEmptyLocation(onTap: onTap)
: _PriceLocationCardWithLocation(location: location, onTap: onTap),
? _PriceLocationCardEmptyLocation(onTap: () => _onTap(context))
: _PriceLocationCardWithLocation(
location: location,
onTap: () => _onTap(context),
),
),
);
}
Expand Down
54 changes: 14 additions & 40 deletions packages/smooth_app/lib/pages/prices/product_price_add_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import 'package:smooth_app/generic_lib/widgets/smooth_back_button.dart';
import 'package:smooth_app/helpers/provider_helper.dart';
import 'package:smooth_app/l10n/app_localizations.dart';
import 'package:smooth_app/pages/locations/osm_location.dart';
import 'package:smooth_app/pages/prices/add_product/price_add_product_button.dart';
import 'package:smooth_app/pages/prices/add_product/price_add_product_card.dart';
import 'package:smooth_app/pages/prices/price_add_helper.dart';
import 'package:smooth_app/pages/prices/price_amount_card.dart';
Expand Down Expand Up @@ -164,7 +163,7 @@ class _ProductPriceAddPageState extends State<ProductPriceAddPage>
),
sliver: PriceAmountCard(key: UniqueKey()),
),
if (model.multipleProducts && model.length == 0)
if (model.multipleProducts)
const SliverPadding(
padding: EdgeInsetsDirectional.only(
top: LARGE_SPACE,
Expand All @@ -183,45 +182,20 @@ class _ProductPriceAddPageState extends State<ProductPriceAddPage>
),
],
),
floatingActionButtonLocation:
FloatingActionButtonLocation.centerFloat,
floatingActionButton: Padding(
padding: const EdgeInsetsDirectional.symmetric(
horizontal: SMALL_SPACE,
),
child: Stack(
fit: StackFit.expand,
children: <Widget>[
if (model.multipleProducts && model.length > 0)
const Align(
alignment: AlignmentDirectional.bottomCenter,
child: PriceAddProductButton(),
),
Align(
alignment: AlignmentDirectional.bottomEnd,
child: SmoothExpandableFloatingActionButton(
scrollController: _scrollController,
onPressed: () async => _exitPage(
await _mayExitPage(saving: true, model: model),
),
icon: const icons.Send(size: 18.0),
label: Padding(
padding: const EdgeInsetsDirectional.only(
bottom: 2.0,
),
child: Text(
appLocalizations.prices_send_n_prices(
model.length,
),
style: const TextStyle(
fontWeight: FontWeight.w600,
fontSize: 15.0,
),
),
),
),
floatingActionButton: SmoothExpandableFloatingActionButton(
scrollController: _scrollController,
onPressed: () async =>
_exitPage(await _mayExitPage(saving: true, model: model)),
icon: const icons.Send(size: 18.0),
label: Padding(
padding: const EdgeInsetsDirectional.only(bottom: 2.0),
child: Text(
appLocalizations.prices_send_n_prices(model.length),
style: const TextStyle(
fontWeight: FontWeight.w600,
fontSize: 15.0,
),
],
),
),
),
),
Expand Down
Loading