Skip to content

Commit

Permalink
трекер (#44)
Browse files Browse the repository at this point in the history
* получение счетчиков обновлений, отображение в шапке кнопки трекера

- репозиторий, сервис, модели и блок для трекера

* получение и отображение публикаций в трекере, удаление публикаций из отслеживаемых

* получений и отображение уведомлений подписок

- сортировка в трекере публикаций по количеству непрочитанных комментариев

- вид карточки в трекере публикаций изменен

* подсвечивание карточек, скелетончики при загрузке

* переход на пользователя из трекера

* пуш на экран комментариев с помощью роутера

* переменные окружения

* вывод карточки для неизвестного уведомления

- обновление счетчиков в шапке
- фикс парсинга типа статьи
- обновление auto_route

* кнопки "Назад" в AppBar для трекера и комментариев

* роутер: фикс переходов

* фикс: переход на профиль из статьи
  • Loading branch information
iska9der authored Sep 17, 2024
1 parent 47152b2 commit a44656e
Show file tree
Hide file tree
Showing 74 changed files with 1,812 additions and 265 deletions.
27 changes: 23 additions & 4 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,44 @@
{
"name": "debug",
"request": "launch",
"type": "dart"
"type": "dart",
"args": [
"--dart-define-from-file",
"env/variables.json"
]
},
{
"name": "profile",
"request": "launch",
"type": "dart",
"flutterMode": "profile"
"flutterMode": "profile",
"args": [
"--dart-define-from-file",
"env/variables.json"
]
},
{
"name": "release",
"request": "launch",
"type": "dart",
"flutterMode": "release"
"flutterMode": "release",
"args": [
"--dart-define-from-file",
"env/variables.json"
]
},
{
"name": "web: debug",
"request": "launch",
"type": "dart",
"args": ["-d", "chrome", "--web-browser-flag", "--disable-web-security"]
"args": [
"-d",
"chrome",
"--web-browser-flag",
"--disable-web-security",
"--dart-define-from-file",
"env/variables.json"
]
}
]
}
4 changes: 4 additions & 0 deletions env/variables.example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"CONTACT_EMAIL": "example@gmail.com",
"CONTACT_TG": "username"
}
10 changes: 8 additions & 2 deletions lib/core/component/di/injector.config.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion lib/core/component/http/dio_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,6 @@ class DioClient implements HttpClient {
);

@override
Future<Response> delete(String url, {dynamic body}) => client.delete(url);
Future<Response> delete(String url, {dynamic body}) =>
client.delete(url, data: body);
}
187 changes: 109 additions & 78 deletions lib/core/component/router/app_router.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ import '../../../presentation/page/publications/publication_dashboard_page.dart'
import '../../../presentation/page/publications/publication_detail_page.dart';
import '../../../presentation/page/publications/publication_flow.dart';
import '../../../presentation/page/publications/search/search_anywhere_page.dart';
import '../../../presentation/page/publications/tracker/tracker_dashboard_page.dart';
import '../../../presentation/page/publications/tracker/tracker_flow.dart';
import '../../../presentation/page/publications/tracker/tracker_publications_page.dart';
import '../../../presentation/page/publications/tracker/tracker_subscription_page.dart';
import '../../../presentation/page/publications/tracker/tracker_system_page.dart';
import '../../../presentation/page/services/company/page/company_dashboard_page.dart';
import '../../../presentation/page/services/company/page/company_detail_page.dart';
import '../../../presentation/page/services/company/page/company_list_page.dart';
Expand Down Expand Up @@ -59,7 +64,7 @@ class AppRouter extends _$AppRouter {

if (isUserUrl(uri)) {
return await navigate(
ServicesRouter(
ServicesFlowRoute(
children: [
UserDashboardRoute(
alias: id,
Expand Down Expand Up @@ -137,8 +142,8 @@ class AppRouter extends _$AppRouter {
/// Таб "Моя лента"
AutoRoute(
initial: true,
path: FeedFlow.routePath,
page: FeedRouter.page,
page: FeedFlowRoute.page,
path: FeedFlowPage.routePath,
children: [
AutoRoute(
path: FeedListPage.routePath,
Expand All @@ -149,8 +154,8 @@ class AppRouter extends _$AppRouter {

/// Таб "Статьи"
AutoRoute(
path: ArticlesFlow.routePath,
page: ArticlesRouter.page,
page: ArticlesFlowRoute.page,
path: ArticlesFlowPage.routePath,
children: [
RedirectRoute(path: '', redirectTo: 'flows/all'),
AutoRoute(
Expand All @@ -162,8 +167,8 @@ class AppRouter extends _$AppRouter {

/// Таб "Посты"
AutoRoute(
path: PostsFlow.routePath,
page: PostsRouter.page,
page: PostsFlowRoute.page,
path: PostsFlowPage.routePath,
children: [
RedirectRoute(path: '', redirectTo: 'flows/all'),
AutoRoute(
Expand All @@ -175,13 +180,13 @@ class AppRouter extends _$AppRouter {

/// Таб "Новости"
AutoRoute(
path: NewsFlow.routePath,
page: NewsRouter.page,
page: NewsFlowRoute.page,
path: NewsFlowPage.routePath,
children: [
RedirectRoute(path: '', redirectTo: 'flows/all'),
AutoRoute(
path: NewsListPage.routePath,
page: NewsListRoute.page,
path: NewsListPage.routePath,
),
],
),
Expand All @@ -191,75 +196,101 @@ class AppRouter extends _$AppRouter {
/////////////////////////
/// Таб "Сервисы"
AutoRoute(
path: ServicesFlow.routePath,
page: ServicesRouter.page,
page: ServicesFlowRoute.page,
path: ServicesFlowPage.routePath,
children: [
AutoRoute(
initial: true,
path: ServicesPage.routePath,
page: ServicesRoute.page,
path: ServicesPage.routePath,
),

/// Хабы
AutoRoute(
path: HubListPage.routePath,
page: HubListRoute.page,
path: HubListPage.routePath,
),
_hubDashboard,
_hubDashboard(),

/// Пользователи/Авторы
AutoRoute(
path: UserListPage.routePath,
page: UserListRoute.page,
path: UserListPage.routePath,
),
_userDashboard,
_userDashboard(),

/// Компании
AutoRoute(
path: CompanyListPage.routePath,
page: CompanyListRoute.page,
path: CompanyListPage.routePath,
),
_companyDashboard,
_companyDashboard(),
],
),

/// Таб "Настройки"
AutoRoute(
path: 'settings',
page: SettingsRouter.page,
page: SettingsRoute.page,
path: SettingsPage.routePath,
),
],
),

/// Поиск
AutoRoute(
path: SearchAnywherePage.routePath,
page: SearchAnywhereRoute.page,
path: SearchAnywherePage.routePath,
),

/// Трекер
AutoRoute(
page: TrackerFlowRoute.page,
path: TrackerFlowPage.routePath,
children: [
AutoRoute(
initial: true,
page: TrackerDashboardRoute.page,
path: TrackerDashboardPage.routePath,
children: [
AutoRoute(
initial: true,
page: TrackerPublicationsRoute.page,
path: TrackerPublicationsPage.routePath,
),
AutoRoute(
page: TrackerSystemRoute.page,
path: TrackerSystemPage.routePath,
),
AutoRoute(
page: TrackerSubscriptionRoute.page,
path: TrackerSubscriptionPage.routePath,
),
],
),
],
),

/// Просмотр публикации
AutoRoute(
path: PublicationFlow.routePath,
page: PublicationRouter.page,
page: PublicationFlowRoute.page,
path: PublicationFlowPage.routePath,
children: [
AutoRoute(
path: PublicationDetailPage.routePath,
initial: true,
page: PublicationDetailRoute.page,
path: PublicationDetailPage.routePath,
),
AutoRoute(
path: PublicationCommentPage.routePath,
page: PublicationCommentRoute.page,
path: PublicationCommentPage.routePath,
),

/// Чтобы навигация из статьи происходила с помощью пушей экранов
/// поверх открытой публикации. Без этого нас перемещает
/// через [DashboardRoute] и сама публикация закрывается
_userDashboard,
_companyDashboard,
_hubDashboard,
],
),

_userDashboard(isRoot: true),
_companyDashboard(isRoot: true),
_hubDashboard(isRoot: true),

/// /////////////////////
/// Редиректы с хабропутей
///
Expand All @@ -272,53 +303,53 @@ class AppRouter extends _$AppRouter {
];
}

final _userDashboard = AutoRoute(
path: UserDashboardPage.routePath,
page: UserDashboardRoute.page,
children: [
AutoRoute(
initial: true,
path: UserDetailPage.routePath,
page: UserDetailRoute.page,
),
AutoRoute(
path: UserPublicationListPage.routePath,
page: UserPublicationListRoute.page,
),
AutoRoute(
path: UserCommentListPage.routePath,
page: UserCommentListRoute.page,
),
AutoRoute(
path: UserBookmarkListPage.routePath,
page: UserBookmarkListRoute.page,
),
],
);
AutoRoute _userDashboard({bool isRoot = false}) => AutoRoute(
page: UserDashboardRoute.page,
path: "${isRoot == true ? '/' : ''}${UserDashboardPage.routePath}",
children: [
AutoRoute(
initial: true,
page: UserDetailRoute.page,
path: UserDetailPage.routePath,
),
AutoRoute(
page: UserPublicationListRoute.page,
path: UserPublicationListPage.routePath,
),
AutoRoute(
page: UserCommentListRoute.page,
path: UserCommentListPage.routePath,
),
AutoRoute(
page: UserBookmarkListRoute.page,
path: UserBookmarkListPage.routePath,
),
],
);

final _hubDashboard = AutoRoute(
path: HubDashboardPage.routePath,
page: HubDashboardRoute.page,
children: [
AutoRoute(
initial: true,
path: HubDetailPage.routePath,
page: HubDetailRoute.page,
),
],
);
AutoRoute _hubDashboard({bool isRoot = false}) => AutoRoute(
page: HubDashboardRoute.page,
path: "${isRoot == true ? '/' : ''}${HubDashboardPage.routePath}",
children: [
AutoRoute(
initial: true,
page: HubDetailRoute.page,
path: HubDetailPage.routePath,
),
],
);

final _companyDashboard = AutoRoute(
path: CompanyDashboardPage.routePath,
page: CompanyDashboardRoute.page,
children: [
AutoRoute(
initial: true,
path: CompanyDetailPage.routePath,
page: CompanyDetailRoute.page,
),
],
);
AutoRoute _companyDashboard({bool isRoot = false}) => AutoRoute(
page: CompanyDashboardRoute.page,
path: "${isRoot == true ? '/' : ''}${CompanyDashboardPage.routePath}",
children: [
AutoRoute(
initial: true,
page: CompanyDetailRoute.page,
path: CompanyDetailPage.routePath,
),
],
);

List<RedirectRoute> _newsRedirects() {
return [
Expand Down
Loading

0 comments on commit a44656e

Please sign in to comment.