Skip to content

Commit

Permalink
fix: Ensure we always use the SmoothAppBar and not the regular `App…
Browse files Browse the repository at this point in the history
…Bar` (#4184)
  • Loading branch information
g123k authored Jun 18, 2023
1 parent 38b2b8a commit 29bdad3
Show file tree
Hide file tree
Showing 19 changed files with 85 additions and 54 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import 'package:smooth_app/knowledge_panel/knowledge_panels/knowledge_panel_expa
import 'package:smooth_app/knowledge_panel/knowledge_panels_builder.dart';
import 'package:smooth_app/pages/inherited_data_manager.dart';
import 'package:smooth_app/pages/product/common/product_refresher.dart';
import 'package:smooth_app/widgets/smooth_app_bar.dart';
import 'package:smooth_app/widgets/smooth_scaffold.dart';

class KnowledgePanelPage extends StatefulWidget {
Expand Down Expand Up @@ -64,7 +65,7 @@ class _KnowledgePanelPageState extends State<KnowledgePanelPage>
context.watch<LocalDatabase>();
_product = _localDatabase.upToDate.getLocalUpToDate(_initialProduct);
return SmoothScaffold(
appBar: AppBar(
appBar: SmoothAppBar(
title: Text(
_getTitle(),
maxLines: 2,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import 'package:smooth_app/pages/preferences/user_preferences_list_tile.dart';
import 'package:smooth_app/pages/product/common/product_list_page.dart';
import 'package:smooth_app/pages/product_list_user_dialog_helper.dart';
import 'package:smooth_app/themes/constant_icons.dart';
import 'package:smooth_app/widgets/smooth_app_bar.dart';
import 'package:smooth_app/widgets/smooth_scaffold.dart';

/// Page that lists all user product lists.
Expand Down Expand Up @@ -57,7 +58,7 @@ class _AllUserProductListLoadedState extends State<_AllUserProductListLoaded> {
final ThemeData themeData = Theme.of(context);
final List<String> userLists = widget.userLists;
return SmoothScaffold(
appBar: AppBar(title: Text(appLocalizations.user_list_all_title)),
appBar: SmoothAppBar(title: Text(appLocalizations.user_list_all_title)),
body: userLists.isEmpty
? Center(
child: SingleChildScrollView(
Expand Down
3 changes: 2 additions & 1 deletion packages/smooth_app/lib/pages/html_page.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'package:flutter/material.dart';
import 'package:smooth_app/generic_lib/smooth_html_widget.dart';
import 'package:smooth_app/widgets/smooth_app_bar.dart';
import 'package:smooth_app/widgets/smooth_scaffold.dart';

/// Displays in widgets a HTML page
Expand All @@ -14,7 +15,7 @@ class HtmlPage extends StatelessWidget {

@override
Widget build(BuildContext context) => SmoothScaffold(
appBar: AppBar(title: Text(pageTitle)),
appBar: SmoothAppBar(title: Text(pageTitle)),
body: SingleChildScrollView(child: SmoothHtmlWidget(htmlString)),
);
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'package:auto_size_text/auto_size_text.dart';
import 'package:flutter/material.dart';
import 'package:openfoodfacts/openfoodfacts.dart';
import 'package:smooth_app/widgets/smooth_app_bar.dart';

/// Zoomable full page of a question image.
class QuestionImageFullPage extends StatelessWidget {
Expand All @@ -10,7 +11,7 @@ class QuestionImageFullPage extends StatelessWidget {

@override
Widget build(BuildContext context) => Scaffold(
appBar: AppBar(
appBar: SmoothAppBar(
title: AutoSizeText(
'${question.question!} (${question.value!})',
maxLines: 2,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import 'package:smooth_app/generic_lib/design_constants.dart';
import 'package:smooth_app/generic_lib/widgets/images/smooth_image.dart';
import 'package:smooth_app/pages/crop_page.dart';
import 'package:smooth_app/pages/image_crop_page.dart';
import 'package:smooth_app/widgets/smooth_app_bar.dart';
import 'package:smooth_app/widgets/smooth_scaffold.dart';

/// Gallery of all images already uploaded, about a given product.
Expand All @@ -35,7 +36,7 @@ class UploadedImageGallery extends StatelessWidget {
final double columnWidth = mediaQueryData.size.width * .45;
return SmoothScaffold(
backgroundColor: Colors.black,
appBar: AppBar(
appBar: SmoothAppBar(
title: Text(appLocalizations.edit_photo_select_existing_all_label),
backgroundColor: Colors.black,
foregroundColor: WHITE_COLOR,
Expand Down
6 changes: 4 additions & 2 deletions packages/smooth_app/lib/pages/offline_data_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import 'package:smooth_app/database/local_database.dart';
import 'package:smooth_app/generic_lib/design_constants.dart';
import 'package:smooth_app/generic_lib/duration_constants.dart';
import 'package:smooth_app/helpers/app_helper.dart';
import 'package:smooth_app/widgets/smooth_app_bar.dart';
import 'package:smooth_app/widgets/smooth_scaffold.dart';

class OfflineDataPage extends StatefulWidget {
const OfflineDataPage({Key? key}) : super(key: key);
Expand All @@ -27,8 +29,8 @@ class _OfflineDataPageState extends State<OfflineDataPage> {
final LocalDatabase localDatabase = context.watch<LocalDatabase>();
final DaoProduct daoProduct = DaoProduct(localDatabase);
final AppLocalizations appLocalizations = AppLocalizations.of(context);
return Scaffold(
appBar: AppBar(
return SmoothScaffold(
appBar: SmoothAppBar(
title: Text(appLocalizations.offline_data),
),
body: RefreshIndicator(
Expand Down
3 changes: 2 additions & 1 deletion packages/smooth_app/lib/pages/offline_tasks_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import 'package:smooth_app/data_models/operation_type.dart';
import 'package:smooth_app/database/dao_instant_string.dart';
import 'package:smooth_app/database/local_database.dart';
import 'package:smooth_app/generic_lib/dialogs/smooth_alert_dialog.dart';
import 'package:smooth_app/widgets/smooth_app_bar.dart';

class OfflineTaskPage extends StatefulWidget {
const OfflineTaskPage();
Expand All @@ -23,7 +24,7 @@ class _OfflineTaskState extends State<OfflineTaskPage> {
final DaoInstantString daoInstantString = DaoInstantString(localDatabase);
final List<String> taskIds = localDatabase.getAllTaskIds();
return Scaffold(
appBar: AppBar(
appBar: SmoothAppBar(
title: Text(
appLocalizations.background_task_title,
maxLines: 2,
Expand Down
3 changes: 2 additions & 1 deletion packages/smooth_app/lib/pages/personalized_ranking_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import 'package:smooth_app/generic_lib/duration_constants.dart';
import 'package:smooth_app/helpers/product_compatibility_helper.dart';
import 'package:smooth_app/pages/product/common/product_list_item_simple.dart';
import 'package:smooth_app/pages/product_list_user_dialog_helper.dart';
import 'package:smooth_app/widgets/smooth_app_bar.dart';
import 'package:smooth_app/widgets/smooth_scaffold.dart';

class PersonalizedRankingPage extends StatefulWidget {
Expand Down Expand Up @@ -95,7 +96,7 @@ class _PersonalizedRankingPageState extends State<PersonalizedRankingPage>
final AppLocalizations appLocalizations = AppLocalizations.of(context);

return SmoothScaffold(
appBar: AppBar(
appBar: SmoothAppBar(
title: Text(widget.title, overflow: TextOverflow.fade),
actions: <Widget>[
PopupMenuButton<String>(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:openfoodfacts/openfoodfacts.dart';
import 'package:smooth_app/helpers/user_management_helper.dart';
import 'package:smooth_app/widgets/smooth_app_bar.dart';
import 'package:smooth_app/widgets/smooth_scaffold.dart';
import 'package:webview_flutter/webview_flutter.dart';

Expand Down Expand Up @@ -49,7 +50,7 @@ class _AccountDeletionWebviewState extends State<AccountDeletionWebview> {
@override
Widget build(BuildContext context) {
return SmoothScaffold(
appBar: AppBar(),
appBar: SmoothAppBar(),
body: WebView(
initialUrl: _getUrl(),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import 'package:package_info_plus/package_info_plus.dart';
import 'package:smooth_app/helpers/analytics_helper.dart';
import 'package:smooth_app/helpers/global_vars.dart';
import 'package:smooth_app/query/product_query.dart';
import 'package:smooth_app/widgets/smooth_app_bar.dart';
import 'package:smooth_app/widgets/smooth_scaffold.dart';

class UserPreferencesDebugInfo extends StatefulWidget {
Expand Down Expand Up @@ -57,7 +58,7 @@ class _UserPreferencesDebugInfoState extends State<UserPreferencesDebugInfo> {
@override
Widget build(BuildContext context) {
return SmoothScaffold(
appBar: AppBar(
appBar: SmoothAppBar(
title: const Text('Debugging information'),
actions: <Widget>[
IconButton(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import 'package:smooth_app/pages/preferences/user_preferences_settings.dart';
import 'package:smooth_app/pages/preferences/user_preferences_user_lists.dart';
import 'package:smooth_app/pages/preferences/user_preferences_widgets.dart';
import 'package:smooth_app/themes/theme_provider.dart';
import 'package:smooth_app/widgets/smooth_app_bar.dart';
import 'package:smooth_app/widgets/smooth_scaffold.dart';

enum PreferencePageType {
Expand Down Expand Up @@ -138,7 +139,7 @@ class _UserPreferencesPageState extends State<UserPreferencesPage>

if (headerAsset == null) {
return SmoothScaffold(
appBar: AppBar(
appBar: SmoothAppBar(
title: Text(
appBarTitle,
maxLines: 2,
Expand Down Expand Up @@ -170,7 +171,7 @@ class _UserPreferencesPageState extends State<UserPreferencesPage>
: Brightness.light,
contentBehindStatusBar: false,
spaceBehindStatusBar: false,
appBar: AppBar(
appBar: SmoothAppBar(
title: Text(
appBarTitle,
maxLines: 2,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import 'package:smooth_app/pages/product/nutrition_page_loaded.dart';
import 'package:smooth_app/pages/product/product_field_editor.dart';
import 'package:smooth_app/pages/product/simple_input_page_helpers.dart';
import 'package:smooth_app/query/product_query.dart';
import 'package:smooth_app/widgets/smooth_app_bar.dart';
import 'package:smooth_app/widgets/smooth_scaffold.dart';

const IconData _doneIcon = Icons.check;
Expand Down Expand Up @@ -132,7 +133,7 @@ class _AddNewProductPageState extends State<AddNewProductPage> {
return leaveThePage ?? false;
},
child: SmoothScaffold(
appBar: AppBar(
appBar: SmoothAppBar(
title: ListTile(
title: Text(_product.productName ?? appLocalizations.new_product),
subtitle: Text(barcode),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import 'package:provider/provider.dart';
import 'package:smooth_app/background/background_task_manager.dart';
import 'package:smooth_app/data_models/product_image_data.dart';
import 'package:smooth_app/database/local_database.dart';
import 'package:smooth_app/generic_lib/widgets/smooth_back_button.dart';
import 'package:smooth_app/generic_lib/widgets/smooth_list_tile_card.dart';
import 'package:smooth_app/helpers/analytics_helper.dart';
import 'package:smooth_app/helpers/image_field_extension.dart';
Expand Down Expand Up @@ -72,9 +71,6 @@ class _ProductImageGalleryViewState extends State<ProductImageGalleryView> {
overflow: TextOverflow.ellipsis,
maxLines: 1,
),
leading: SmoothBackButton(
onPressed: () => Navigator.maybePop(context),
),
),
floatingActionButton: FloatingActionButton.extended(
onPressed: () async {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import 'package:smooth_app/helpers/image_field_extension.dart';
import 'package:smooth_app/helpers/product_cards_helper.dart';
import 'package:smooth_app/pages/product/product_image_viewer.dart';
import 'package:smooth_app/query/product_query.dart';
import 'package:smooth_app/widgets/smooth_app_bar.dart';
import 'package:smooth_app/widgets/smooth_scaffold.dart';

/// Widget to display swipeable product images of particular category.
Expand Down Expand Up @@ -86,7 +87,7 @@ class _ProductImageSwipeableViewState extends State<ProductImageSwipeableView> {
}
return SmoothScaffold(
backgroundColor: Colors.black,
appBar: AppBar(
appBar: SmoothAppBar(
backgroundColor: Colors.black,
foregroundColor: WHITE_COLOR,
systemOverlayStyle: SystemUiOverlayStyle.light,
Expand Down
3 changes: 2 additions & 1 deletion packages/smooth_app/lib/pages/scan/search_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import 'package:smooth_app/pages/product/common/product_dialog_helper.dart';
import 'package:smooth_app/pages/product/common/product_query_page_helper.dart';
import 'package:smooth_app/pages/scan/search_history_view.dart';
import 'package:smooth_app/query/keywords_product_query.dart';
import 'package:smooth_app/widgets/smooth_app_bar.dart';
import 'package:smooth_app/widgets/smooth_scaffold.dart';

void _performSearch(
Expand Down Expand Up @@ -108,7 +109,7 @@ class _SearchPageState extends State<SearchPage> {
@override
Widget build(BuildContext context) {
return SmoothScaffold(
appBar: AppBar(toolbarHeight: 0.0),
appBar: SmoothAppBar(toolbarHeight: 0.0),
body: ChangeNotifierProvider<TextEditingController>(
create: (_) => _searchTextController,
child: Column(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import 'package:openfoodfacts/openfoodfacts.dart';
import 'package:smooth_app/generic_lib/design_constants.dart';
import 'package:smooth_app/generic_lib/widgets/smooth_card.dart';
import 'package:smooth_app/generic_lib/widgets/smooth_text_form_field.dart';
import 'package:smooth_app/widgets/smooth_app_bar.dart';
import 'package:smooth_app/widgets/smooth_scaffold.dart';

class ForgotPasswordPage extends StatefulWidget {
Expand Down Expand Up @@ -68,7 +69,7 @@ class _ForgotPasswordPageState extends State<ForgotPasswordPage>
final Size size = MediaQuery.of(context).size;

return SmoothScaffold(
appBar: AppBar(
appBar: SmoothAppBar(
backgroundColor: Colors.transparent,
elevation: 0,
iconTheme: IconThemeData(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import 'package:smooth_app/helpers/user_feedback_helper.dart';
import 'package:smooth_app/pages/user_management/forgot_password_page.dart';
import 'package:smooth_app/pages/user_management/sign_up_page.dart';
import 'package:smooth_app/services/smooth_services.dart';
import 'package:smooth_app/widgets/smooth_app_bar.dart';
import 'package:smooth_app/widgets/smooth_scaffold.dart';

class LoginPage extends StatefulWidget {
Expand Down Expand Up @@ -98,7 +99,7 @@ class _LoginPageState extends State<LoginPage> with TraceableClientMixin {
statusBarBackgroundColor: SmoothScaffold.semiTranslucentStatusBar,
contentBehindStatusBar: true,
fixKeyboard: true,
appBar: AppBar(
appBar: SmoothAppBar(
backgroundColor: Colors.transparent,
elevation: 0,
iconTheme: IconThemeData(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import 'package:smooth_app/generic_lib/loading_dialog.dart';
import 'package:smooth_app/generic_lib/widgets/smooth_text_form_field.dart';
import 'package:smooth_app/helpers/analytics_helper.dart';
import 'package:smooth_app/helpers/user_management_helper.dart';
import 'package:smooth_app/widgets/smooth_app_bar.dart';
import 'package:smooth_app/widgets/smooth_scaffold.dart';
import 'package:url_launcher/url_launcher.dart';

Expand Down Expand Up @@ -76,7 +77,7 @@ class _SignUpPageState extends State<SignUpPage> with TraceableClientMixin {

return SmoothScaffold(
fixKeyboard: true,
appBar: AppBar(
appBar: SmoothAppBar(
title: Text(appLocalizations.sign_up_page_title),
backgroundColor: Colors.transparent,
elevation: 0,
Expand Down
Loading

0 comments on commit 29bdad3

Please sign in to comment.