Skip to content

Commit

Permalink
Merge branch 'develop' into feat/6001
Browse files Browse the repository at this point in the history
  • Loading branch information
monsieurtanuki authored Dec 5, 2024
2 parents 3a6a2a9 + 5caff9e commit cdee642
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,14 @@ class ConsentAnalyticsPage extends StatelessWidget {
),
),
OnboardingBottomBar(
rightButton: _buildButton(
leftButton: _buildButton(
context,
appLocalizations.refuse_button_label,
false,
const Color(0xFFA08D84),
Colors.white,
),
leftButton: _buildButton(
rightButton: _buildButton(
context,
appLocalizations.authorize_button_label,
true,
Expand Down
4 changes: 2 additions & 2 deletions packages/smooth_app/lib/pages/onboarding/next_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class NextButton extends StatelessWidget {
OnboardingFlowNavigator(userPreferences);
final OnboardingPage previousPage = currentPage.getPrevPage();
return OnboardingBottomBar(
rightButton: previousPage.isOnboardingNotStarted()
leftButton: previousPage.isOnboardingNotStarted()
? null
: OnboardingBottomIcon(
onPressed: () async => navigator.navigateToPage(
Expand All @@ -50,7 +50,7 @@ class NextButton extends StatelessWidget {
? const EdgeInsetsDirectional.only(end: 2.0)
: EdgeInsets.zero,
),
leftButton: OnboardingBottomButton(
rightButton: OnboardingBottomButton(
onPressed: () async {
await OnboardingLoader(localDatabase)
.runAtNextTime(currentPage, context);
Expand Down
20 changes: 10 additions & 10 deletions packages/smooth_app/lib/pages/onboarding/onboarding_bottom_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ import 'package:smooth_app/generic_lib/design_constants.dart';
/// Bottom Bar during onboarding. Typical use case: previous/next buttons.
class OnboardingBottomBar extends StatelessWidget {
const OnboardingBottomBar({
required this.leftButton,
required this.rightButton,
required this.backgroundColor,
this.rightButton,
required this.leftButton,
this.semanticsHorizontalOrder = true,
});

final Widget leftButton;
final Widget? rightButton;
final Widget? leftButton;
final Widget rightButton;

/// If [true], the [leftButton] will be said first by the screen reader.
final bool semanticsHorizontalOrder;
Expand All @@ -27,7 +27,7 @@ class OnboardingBottomBar extends StatelessWidget {
final Size screenSize = MediaQuery.sizeOf(context);
// Side padding is 8% of total width.
final double sidePadding = screenSize.width * .08;
final bool hasPrevious = rightButton != null;
final bool hasPrevious = leftButton != null;
return Column(
children: <Widget>[
Container(
Expand All @@ -48,14 +48,14 @@ class OnboardingBottomBar extends StatelessWidget {
: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
if (rightButton != null)
if (leftButton != null)
Semantics(
sortKey: OrdinalSortKey(semanticsHorizontalOrder ? 1.0 : 2.0),
child: rightButton,
sortKey: OrdinalSortKey(semanticsHorizontalOrder ? 2.0 : 1.0),
child: leftButton,
),
Semantics(
sortKey: OrdinalSortKey(semanticsHorizontalOrder ? 2.0 : 1.0),
child: leftButton,
sortKey: OrdinalSortKey(semanticsHorizontalOrder ? 1.0 : 2.0),
child: rightButton,
),
],
),
Expand Down
14 changes: 9 additions & 5 deletions packages/smooth_app/lib/pages/onboarding/permissions_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,12 @@ class _PermissionsPageState extends State<PermissionsPage> {
),
)),
OnboardingBottomBar(
rightButton: _IgnoreButton(
onPermissionIgnored: () => _moveToNextScreen(context),
),
leftButton: _AskPermissionButton(
leftButton: !Platform.isIOS
? _IgnoreButton(
onPermissionIgnored: () => _moveToNextScreen(context),
)
: null,
rightButton: _AskPermissionButton(
onPermissionIgnored: () => _moveToNextScreen(context),
),
backgroundColor: widget.backgroundColor,
Expand Down Expand Up @@ -153,7 +155,9 @@ class _AskPermissionButton extends StatelessWidget {
},
backgroundColor: Colors.white,
foregroundColor: Colors.black,
label: appLocalizations.authorize_button_label,
label: Platform.isIOS
? appLocalizations.onboarding_continue_button
: appLocalizations.authorize_button_label,
);
}
}
Expand Down
4 changes: 2 additions & 2 deletions packages/smooth_app/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1076,10 +1076,10 @@ packages:
dependency: "direct main"
description:
name: openfoodfacts
sha256: "2a2076e5190e4b573ce5326cd4981ebdefa33c57c0507ca0057c57c12b79c47a"
sha256: c0d85d236aebc874b694bb0b52c34cee2d0d68169cffcec0d006605c2014ea04
url: "https://pub.dev"
source: hosted
version: "3.18.0"
version: "3.18.1"
openfoodfacts_flutter_lints:
dependency: "direct dev"
description:
Expand Down
2 changes: 1 addition & 1 deletion packages/smooth_app/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ dependencies:
path: ../scanner/zxing


openfoodfacts: 3.18.0
openfoodfacts: 3.18.1
# openfoodfacts:
# path: ../../../openfoodfacts-dart

Expand Down

0 comments on commit cdee642

Please sign in to comment.