diff --git a/packages/smooth_app/assets/onboarding/analytics.svg b/packages/smooth_app/assets/onboarding/analytics.svg deleted file mode 100644 index 74fdc378216..00000000000 --- a/packages/smooth_app/assets/onboarding/analytics.svg +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/smooth_app/lib/pages/onboarding/consent_analytics_page.dart b/packages/smooth_app/lib/pages/onboarding/consent_analytics_page.dart index cc185ade37b..d421e1b5c97 100644 --- a/packages/smooth_app/lib/pages/onboarding/consent_analytics_page.dart +++ b/packages/smooth_app/lib/pages/onboarding/consent_analytics_page.dart @@ -1,12 +1,10 @@ import 'package:flutter/material.dart'; import 'package:flutter_gen/gen_l10n/app_localizations.dart'; -import 'package:flutter_svg/flutter_svg.dart'; import 'package:provider/provider.dart'; import 'package:smooth_app/data_models/onboarding_loader.dart'; import 'package:smooth_app/data_models/user_preferences.dart'; import 'package:smooth_app/database/local_database.dart'; import 'package:smooth_app/generic_lib/design_constants.dart'; -import 'package:smooth_app/generic_lib/widgets/smooth_card.dart'; import 'package:smooth_app/pages/onboarding/onboarding_flow_navigator.dart'; class ConsentAnalytics extends StatelessWidget { @@ -16,35 +14,24 @@ class ConsentAnalytics extends StatelessWidget { Widget build(BuildContext context) { final Size size = MediaQuery.of(context).size; final AppLocalizations appLocalizations = AppLocalizations.of(context)!; - const String assetName = 'assets/onboarding/analytics.svg'; return Scaffold( body: Center( child: SingleChildScrollView( child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ - SizedBox( - height: size.height * 0.2, - width: size.width * 0.45, - child: SvgPicture.asset( - assetName, - semanticsLabel: - appLocalizations.analytics_consent_image_semantic_label, - fit: BoxFit.contain, - ), + Icon( + Icons.analytics, + size: size.width * 0.4, ), - - SizedBox(height: size.height * 0.01), - + SizedBox(height: size.height * 0.02), Center( child: Text( appLocalizations.consent_analytics_title, - style: Theme.of(context).textTheme.displayMedium, + style: Theme.of(context).textTheme.titleLarge, ), ), - SizedBox(height: size.height * 0.04), - ConstrainedBox( constraints: BoxConstraints( maxWidth: size.width * 0.8, @@ -52,12 +39,9 @@ class ConsentAnalytics extends StatelessWidget { child: Text( appLocalizations.consent_analytics_body1, textAlign: TextAlign.center, - style: Theme.of(context).textTheme.displaySmall, ), ), - SizedBox(height: size.height * 0.02), - ConstrainedBox( constraints: BoxConstraints( maxWidth: size.width * 0.8, @@ -65,35 +49,13 @@ class ConsentAnalytics extends StatelessWidget { child: Text( appLocalizations.consent_analytics_body2, textAlign: TextAlign.center, - style: Theme.of(context).textTheme.displaySmall, ), ), - - SizedBox(height: size.height * 0.02), - - // Authorize Button - _buildButton( - context, - Colors.green, - appLocalizations.authorize_button_label, - Icons.check, - true, - ), - - SizedBox(height: size.height * 0.01), - - // Reject button - _buildButton( - context, - Colors.red, - appLocalizations.refuse_button_label, - Icons.close, - false, - ), ], ), ), ), + bottomNavigationBar: _buildBottomAppBar(context, appLocalizations), ); } @@ -115,18 +77,49 @@ class ConsentAnalytics extends StatelessWidget { ); } + BottomAppBar _buildBottomAppBar( + BuildContext context, AppLocalizations appLocalizations) { + return BottomAppBar( + child: ButtonBar( + alignment: MainAxisAlignment.spaceBetween, + mainAxisSize: MainAxisSize.max, + children: [ + _buildButton( + context, + appLocalizations.refuse_button_label, + const Icon( + Icons.close_rounded, + ), + false, + ), + _buildButton( + context, + appLocalizations.authorize_button_label, + const Icon( + Icons.check_rounded, + ), + true, + ), + ], + ), + ); + } + Widget _buildButton( BuildContext context, - Color btnColor, String label, - IconData icon, + Icon icon, bool isAccepted, ) { - final Size size = MediaQuery.of(context).size; final LocalDatabase localDatabase = context.watch(); final UserPreferences userPreferences = context.watch(); - return InkWell( - onTap: () { + return TextButton.icon( + style: ButtonStyle( + padding: MaterialStateProperty.all( + const EdgeInsets.symmetric( + horizontal: VERY_LARGE_SPACE, vertical: SMALL_SPACE)), + ), + onPressed: () { _analyticsLogic( isAccepted, userPreferences, @@ -134,41 +127,8 @@ class ConsentAnalytics extends StatelessWidget { context, ); }, - child: Padding( - padding: EdgeInsets.fromLTRB( - size.width * 0.2, - 0, - size.width * 0.2, - 0, - ), - child: SmoothCard( - color: btnColor, - elevation: 5, - child: ConstrainedBox( - constraints: BoxConstraints( - minHeight: size.height * 0.04, - ), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text( - label, - style: TextStyle( - fontWeight: FontWeight.bold, - color: WHITE_COLOR, - fontSize: size.height * 0.025, - ), - ), - Icon( - icon, - color: WHITE_COLOR, - size: size.height * 0.05, - ), - ], - ), - ), - ), - ), + icon: icon, + label: Text(label), ); } }