Skip to content

Commit a7bbd03

Browse files
Merge branch 'develop' into fix/7530_2
2 parents ca0c8a5 + 42a621d commit a7bbd03

2 files changed

Lines changed: 66 additions & 92 deletions

File tree

packages/smooth_app/lib/pages/scan/carousel/main_card/bottom_cards/scan_app_review_card.dart

Lines changed: 45 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -27,51 +27,56 @@ class ScanAppReview extends StatelessWidget {
2727
return ScanBottomCardContainer(
2828
title: appLocalizations.app_review_title,
2929
onClose: () => context.read<AppReviewProvider>().hide(),
30-
body: Row(
31-
children: <Widget>[
32-
Expanded(
33-
child: _AppReviewItem(
34-
asset: 'assets/misc/tagline_0.svg.vec',
35-
text: appLocalizations.app_review_low,
36-
backgroundColor: const Color(0xFFD44C29),
37-
borderRadius: BorderRadiusHelper.fromDirectional(
38-
context: context,
39-
bottomStart: ScanBottomCardContainer.radius,
40-
),
41-
onTap: () => _showUserFeedBackModalSheet(
42-
context,
43-
AppReviewResult.unsatisfied,
30+
body: Padding(
31+
padding: const EdgeInsets.symmetric(vertical: LARGE_SPACE),
32+
child: Row(
33+
children: <Widget>[
34+
Expanded(
35+
child: _AppReviewItem(
36+
asset: 'assets/misc/tagline_0.svg.vec',
37+
text: appLocalizations.app_review_low,
38+
backgroundColor: const Color(0xFFD44C29),
39+
borderRadius: BorderRadiusHelper.fromDirectional(
40+
context: context,
41+
bottomStart: ScanBottomCardContainer.radius,
42+
),
43+
onTap: () => _showUserFeedBackModalSheet(
44+
context,
45+
AppReviewResult.unsatisfied,
46+
),
4447
),
4548
),
46-
),
47-
Expanded(
48-
child: _AppReviewItem(
49-
asset: 'assets/misc/tagline_1.svg.vec',
50-
text: appLocalizations.app_review_medium,
51-
backgroundColor: const Color(0xFFFF8C14),
52-
borderRadius: BorderRadius.zero,
53-
onTap: () =>
54-
_showUserFeedBackModalSheet(context, AppReviewResult.neutral),
49+
Expanded(
50+
child: _AppReviewItem(
51+
asset: 'assets/misc/tagline_1.svg.vec',
52+
text: appLocalizations.app_review_medium,
53+
backgroundColor: const Color(0xFFFF8C14),
54+
borderRadius: BorderRadius.zero,
55+
onTap: () => _showUserFeedBackModalSheet(
56+
context,
57+
AppReviewResult.neutral,
58+
),
59+
),
5560
),
56-
),
57-
Expanded(
58-
child: _AppReviewItem(
59-
asset: 'assets/misc/tagline_2.svg.vec',
60-
text: appLocalizations.app_review_high,
61-
backgroundColor: const Color(0xFF6CB564),
62-
borderRadius: BorderRadiusHelper.fromDirectional(
63-
context: context,
64-
bottomEnd: ScanBottomCardContainer.radius,
61+
Expanded(
62+
child: _AppReviewItem(
63+
asset: 'assets/misc/tagline_2.svg.vec',
64+
text: appLocalizations.app_review_high,
65+
backgroundColor: const Color(0xFF6CB564),
66+
borderRadius: BorderRadiusHelper.fromDirectional(
67+
context: context,
68+
bottomEnd: ScanBottomCardContainer.radius,
69+
),
70+
onTap: () async {
71+
final AppReviewProvider appReview = context
72+
.read<AppReviewProvider>();
73+
await ApplicationStore.openAppReview();
74+
appReview.markAsReviewed(AppReviewResult.satisfied);
75+
},
6576
),
66-
onTap: () async {
67-
final AppReviewProvider appReview = context
68-
.read<AppReviewProvider>();
69-
await ApplicationStore.openAppReview();
70-
appReview.markAsReviewed(AppReviewResult.satisfied);
71-
},
7277
),
73-
),
74-
],
78+
],
79+
),
7580
),
7681
);
7782
}

packages/smooth_app/lib/pages/scan/carousel/main_card/scan_main_card.dart

Lines changed: 21 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import 'package:smooth_app/generic_lib/design_constants.dart';
66
import 'package:smooth_app/helpers/provider_helper.dart';
77
import 'package:smooth_app/pages/scan/carousel/main_card/bottom_cards/scan_bottom_card.dart';
88
import 'package:smooth_app/pages/scan/carousel/main_card/top_card/scan_search_card.dart';
9-
import 'package:smooth_app/widgets/text/text_extensions.dart';
109

1110
class ScanMainCard extends StatelessWidget {
1211
const ScanMainCard();
@@ -21,59 +20,29 @@ class ScanMainCard extends StatelessWidget {
2120
builder: (BuildContext context, AppNewsProvider newsFeed, _) {
2221
if (!newsFeed.hasContent) {
2322
return const ScanSearchCard(expandedMode: true);
24-
} else {
25-
return Semantics(
26-
explicitChildNodes: true,
27-
child: LayoutBuilder(
28-
builder: (_, BoxConstraints constraints) {
29-
final bool dense =
30-
constraints.maxHeight * 0.4 <=
31-
_maxHeight(context.textScaler());
32-
33-
if (dense) {
34-
return ListView(
35-
padding: EdgeInsetsDirectional.zero,
36-
children: <Widget>[
37-
ConstrainedBox(
38-
constraints: BoxConstraints(
39-
minHeight: math.max(
40-
ScanSearchCard.computeMinSize(context),
41-
constraints.maxHeight * 0.5,
42-
),
43-
),
44-
child: const ScanSearchCard(expandedMode: false),
45-
),
46-
const SizedBox(height: SMALL_SPACE),
47-
const ScanBottomCard(dense: true),
48-
],
49-
);
50-
} else {
51-
return const Column(
52-
children: <Widget>[
53-
Expanded(
54-
flex: 6,
55-
child: ScanSearchCard(expandedMode: false),
56-
),
57-
SizedBox(height: SMALL_SPACE),
58-
Expanded(flex: 4, child: ScanBottomCard(dense: false)),
59-
],
60-
);
61-
}
62-
},
63-
),
64-
);
6523
}
24+
return Semantics(
25+
explicitChildNodes: true,
26+
child: LayoutBuilder(
27+
builder: (_, BoxConstraints constraints) => ListView(
28+
padding: EdgeInsetsDirectional.zero,
29+
children: <Widget>[
30+
ConstrainedBox(
31+
constraints: BoxConstraints(
32+
minHeight: math.max(
33+
ScanSearchCard.computeMinSize(context),
34+
constraints.maxHeight * 0.5,
35+
),
36+
),
37+
child: const ScanSearchCard(expandedMode: false),
38+
),
39+
const SizedBox(height: SMALL_SPACE),
40+
const ScanBottomCard(dense: true),
41+
],
42+
),
43+
),
44+
);
6645
},
6746
);
6847
}
69-
70-
double _maxHeight(double textScaler) {
71-
if (textScaler < 1.1) {
72-
return 160.0;
73-
} else if (textScaler < 1.3) {
74-
return 173.0;
75-
} else {
76-
return 186.0;
77-
}
78-
}
7948
}

0 commit comments

Comments
 (0)