From cc5e77504e767d6d76deec07b96fee977778c259 Mon Sep 17 00:00:00 2001 From: Eshfield Date: Mon, 24 Jun 2024 20:04:45 +0300 Subject: [PATCH] Move top bar widget to common --- lib/presentation/add_task_screen/add_task_screen.dart | 4 ++-- lib/presentation/home_screen/home_screen.dart | 4 ++-- .../widgets/top_bar.dart => widgets/app_top_bar.dart} | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) rename lib/presentation/{home_screen/widgets/top_bar.dart => widgets/app_top_bar.dart} (96%) diff --git a/lib/presentation/add_task_screen/add_task_screen.dart b/lib/presentation/add_task_screen/add_task_screen.dart index 2f56c22..7ef87d8 100644 --- a/lib/presentation/add_task_screen/add_task_screen.dart +++ b/lib/presentation/add_task_screen/add_task_screen.dart @@ -1,6 +1,6 @@ import 'package:app/domain/models/task.dart'; import 'package:app/l10n/l10n_extension.dart'; -import 'package:app/presentation/home_screen/widgets/top_bar.dart'; +import 'package:app/presentation/widgets/app_top_bar.dart'; import 'package:app/presentation/theme/app_theme_extensions.dart'; import 'package:app/presentation/widgets/app_date_picker.dart'; import 'package:app/presentation/widgets/app_dropdown_menu.dart'; @@ -133,7 +133,7 @@ class _TopBar extends StatelessWidget { @override Widget build(BuildContext context) { - return TopBar( + return AppTopBar( leading: IconButton( onPressed: () => Navigator.of(context).pop(), icon: Icon( diff --git a/lib/presentation/home_screen/home_screen.dart b/lib/presentation/home_screen/home_screen.dart index 25e3b6f..0efe6f8 100644 --- a/lib/presentation/home_screen/home_screen.dart +++ b/lib/presentation/home_screen/home_screen.dart @@ -5,7 +5,7 @@ import 'package:app/presentation/add_task_screen/add_task_screen.dart'; import 'package:app/presentation/home_screen/widgets/done_tasks_visibility_button.dart'; import 'package:app/presentation/home_screen/widgets/header.dart'; import 'package:app/presentation/home_screen/widgets/task_list.dart'; -import 'package:app/presentation/home_screen/widgets/top_bar.dart'; +import 'package:app/presentation/widgets/app_top_bar.dart'; import 'package:app/presentation/theme/app_theme_extensions.dart'; import 'package:flutter/material.dart'; @@ -244,7 +244,7 @@ class _TopBar extends StatelessWidget { opacity: showAppBar ? 1 : 0, curve: curve, duration: appTopBarAnimationDuration, - child: TopBar( + child: AppTopBar( title: context.l10n.appTitle, trailing: const Padding( padding: EdgeInsets.only(right: 16), diff --git a/lib/presentation/home_screen/widgets/top_bar.dart b/lib/presentation/widgets/app_top_bar.dart similarity index 96% rename from lib/presentation/home_screen/widgets/top_bar.dart rename to lib/presentation/widgets/app_top_bar.dart index a9b6366..80b41ba 100644 --- a/lib/presentation/home_screen/widgets/top_bar.dart +++ b/lib/presentation/widgets/app_top_bar.dart @@ -3,12 +3,12 @@ import 'package:flutter/material.dart'; const buttonPadding = 16.0 - (48.0 - 24.0) / 2; -class TopBar extends StatelessWidget { +class AppTopBar extends StatelessWidget { final Widget? leading; final String? title; final Widget? trailing; - const TopBar({ + const AppTopBar({ super.key, this.leading, this.title,