From 54e3609ab4e21dc7c9616b620e1797c48ea0f247 Mon Sep 17 00:00:00 2001 From: Sergey Dmitriev <51058739+0niel@users.noreply.github.com> Date: Sat, 6 Jan 2024 00:10:56 +0300 Subject: [PATCH] feat: Add profile announcements image render --- lib/presentation/pages/news/news_page.dart | 5 +- .../pages/profile/profile_announces_page.dart | 6 ++ .../pages/profile/profile_page.dart | 5 +- lib/service_locator.dart | 12 --- pubspec.lock | 80 +++++++++++++++++++ pubspec.yaml | 4 +- 6 files changed, 93 insertions(+), 19 deletions(-) diff --git a/lib/presentation/pages/news/news_page.dart b/lib/presentation/pages/news/news_page.dart index 261bd373..b325f065 100644 --- a/lib/presentation/pages/news/news_page.dart +++ b/lib/presentation/pages/news/news_page.dart @@ -5,14 +5,13 @@ import 'package:rtu_mirea_app/domain/entities/news_item.dart'; import 'package:rtu_mirea_app/presentation/bloc/news_bloc/news_bloc.dart'; import 'package:rtu_mirea_app/presentation/widgets/buttons/app_settings_button.dart'; import 'package:rtu_mirea_app/presentation/widgets/buttons/primary_tab_button.dart'; -import 'package:rtu_mirea_app/presentation/widgets/page_with_theme_consumer.dart'; import 'package:shimmer/shimmer.dart'; import 'widgets/news_card.dart'; import 'widgets/tag_badge.dart'; import 'package:rtu_mirea_app/presentation/typography.dart'; import 'package:rtu_mirea_app/presentation/theme.dart'; -class NewsPage extends PageWithThemeConsumer { +class NewsPage extends StatelessWidget { NewsPage({super.key}); final ValueNotifier _tabValueNotifier = ValueNotifier(0); @@ -151,7 +150,7 @@ class NewsPage extends PageWithThemeConsumer { } @override - Widget buildPage(BuildContext context) { + Widget build(BuildContext context) { return Scaffold( backgroundColor: AppTheme.colors.background01, appBar: AppBar( diff --git a/lib/presentation/pages/profile/profile_announces_page.dart b/lib/presentation/pages/profile/profile_announces_page.dart index 74417dd3..b44e3dd4 100644 --- a/lib/presentation/pages/profile/profile_announces_page.dart +++ b/lib/presentation/pages/profile/profile_announces_page.dart @@ -1,6 +1,8 @@ import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_html/flutter_html.dart'; +import 'package:flutter_html_svg/flutter_html_svg.dart'; +import 'package:flutter_html_video/flutter_html_video.dart'; import 'package:rtu_mirea_app/presentation/bloc/announces_bloc/announces_bloc.dart'; import 'package:url_launcher/url_launcher_string.dart'; import 'package:rtu_mirea_app/presentation/typography.dart'; @@ -67,6 +69,10 @@ class ProfileAnnouncesPage extends StatelessWidget { launchUrlString(url); } }, + extensions: const [ + VideoHtmlExtension(), + SvgHtmlExtension(), + ], ), ], ), diff --git a/lib/presentation/pages/profile/profile_page.dart b/lib/presentation/pages/profile/profile_page.dart index b05a3fe8..07f60d9e 100644 --- a/lib/presentation/pages/profile/profile_page.dart +++ b/lib/presentation/pages/profile/profile_page.dart @@ -9,7 +9,6 @@ import 'package:rtu_mirea_app/presentation/bloc/user_bloc/user_bloc.dart'; import 'package:rtu_mirea_app/presentation/widgets/buttons/colorful_button.dart'; import 'package:rtu_mirea_app/presentation/widgets/buttons/icon_button.dart'; import 'package:rtu_mirea_app/presentation/widgets/buttons/settings_button.dart'; -import 'package:rtu_mirea_app/presentation/widgets/page_with_theme_consumer.dart'; import 'package:url_launcher/url_launcher_string.dart'; import '../../bloc/announces_bloc/announces_bloc.dart'; @@ -18,11 +17,11 @@ import '../../widgets/container_label.dart'; import 'package:rtu_mirea_app/presentation/typography.dart'; import 'package:rtu_mirea_app/presentation/theme.dart'; -class ProfilePage extends PageWithThemeConsumer { +class ProfilePage extends StatelessWidget { const ProfilePage({Key? key}) : super(key: key); @override - Widget buildPage(BuildContext context) { + Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: const Text("Профиль"), diff --git a/lib/service_locator.dart b/lib/service_locator.dart index 81bd0109..78feec70 100644 --- a/lib/service_locator.dart +++ b/lib/service_locator.dart @@ -59,7 +59,6 @@ import 'package:rtu_mirea_app/presentation/bloc/news_bloc/news_bloc.dart'; import 'package:rtu_mirea_app/presentation/bloc/nfc_feedback_bloc/nfc_feedback_bloc.dart'; import 'package:rtu_mirea_app/presentation/bloc/nfc_pass_bloc/nfc_pass_bloc.dart'; import 'package:rtu_mirea_app/presentation/bloc/notification_preferences/notification_preferences_bloc.dart'; -import 'package:rtu_mirea_app/presentation/bloc/schedule_bloc/schedule_bloc.dart'; import 'package:rtu_mirea_app/presentation/bloc/scores_bloc/scores_bloc.dart'; import 'package:rtu_mirea_app/presentation/bloc/user_bloc/user_bloc.dart'; import 'package:rtu_mirea_app/presentation/core/routes/routes.dart'; @@ -78,17 +77,6 @@ Future setup() async { ); // BloC / Cubit - getIt.registerFactory( - () => ScheduleBloc( - getSchedule: getIt(), - getActiveGroup: getIt(), - getGroups: getIt(), - setActiveGroup: getIt(), - getDownloadedSchedules: getIt(), - deleteSchedule: getIt(), - getScheduleSettings: getIt(), - setScheduleSettings: getIt()), - ); getIt.registerFactory(() => NewsBloc(getNews: getIt(), getNewsTags: getIt())); getIt.registerFactory(() => MapCubit()); getIt.registerLazySingleton(() => UserBloc( diff --git a/pubspec.lock b/pubspec.lock index 337e22f6..8e0d73ca 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -208,6 +208,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.0.3" + chewie: + dependency: transitive + description: + name: chewie + sha256: "3427e469d7cc99536ac4fbaa069b3352c21760263e65ffb4f0e1c054af43a73e" + url: "https://pub.dev" + source: hosted + version: "1.7.4" cli_util: dependency: transitive description: @@ -547,6 +555,22 @@ packages: url: "https://pub.dev" source: hosted version: "3.0.0-beta.2" + flutter_html_svg: + dependency: "direct main" + description: + name: flutter_html_svg + sha256: "793be10cfa6fd0925a7adde9f58d73d2ce6a84c02ae12d01a985244f55ee631a" + url: "https://pub.dev" + source: hosted + version: "3.0.0-beta.2" + flutter_html_video: + dependency: "direct main" + description: + name: flutter_html_video + sha256: ecc8bcc614dd8a8286d32ace462481817660f5a7e854c663c1fcb3424fc3be89 + url: "https://pub.dev" + source: hosted + version: "3.0.0-beta.2" flutter_keyboard_visibility: dependency: transitive description: @@ -1949,6 +1973,46 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.4" + video_player: + dependency: transitive + description: + name: video_player + sha256: fbf28ce8bcfe709ad91b5789166c832cb7a684d14f571a81891858fefb5bb1c2 + url: "https://pub.dev" + source: hosted + version: "2.8.2" + video_player_android: + dependency: transitive + description: + name: video_player_android + sha256: "7f8f25d7ad56819a82b2948357f3c3af071f6a678db33833b26ec36bbc221316" + url: "https://pub.dev" + source: hosted + version: "2.4.11" + video_player_avfoundation: + dependency: transitive + description: + name: video_player_avfoundation + sha256: "08da93071ef322603839aa42e90e23d4820b03cf2db7eb6a45de5d41fe85c2aa" + url: "https://pub.dev" + source: hosted + version: "2.5.4" + video_player_platform_interface: + dependency: transitive + description: + name: video_player_platform_interface + sha256: be72301bf2c0150ab35a8c34d66e5a99de525f6de1e8d27c0672b836fe48f73a + url: "https://pub.dev" + source: hosted + version: "6.2.1" + video_player_web: + dependency: transitive + description: + name: video_player_web + sha256: "34beb3a07d4331a24f7e7b2f75b8e2b103289038e07e65529699a671b6a6e2cb" + url: "https://pub.dev" + source: hosted + version: "2.1.3" vm_service: dependency: transitive description: @@ -1957,6 +2021,22 @@ packages: url: "https://pub.dev" source: hosted version: "11.10.0" + wakelock_plus: + dependency: transitive + description: + name: wakelock_plus + sha256: f268ca2116db22e57577fb99d52515a24bdc1d570f12ac18bb762361d43b043d + url: "https://pub.dev" + source: hosted + version: "1.1.4" + wakelock_plus_platform_interface: + dependency: transitive + description: + name: wakelock_plus_platform_interface + sha256: "40fabed5da06caff0796dc638e1f07ee395fb18801fbff3255a2372db2d80385" + url: "https://pub.dev" + source: hosted + version: "1.1.0" watcher: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 2b45876d..bef69abf 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -12,7 +12,7 @@ publish_to: 'none' # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 1.4.2+52 +version: 1.4.2+53 environment: sdk: ">=3.1.1" @@ -119,6 +119,8 @@ dependencies: # Iframe widget for flutter_html # See https://pub.dev/packages/flutter_html_iframe flutter_html_iframe: ^3.0.0-beta.2 + flutter_html_video: ^3.0.0-beta.2 + flutter_html_svg: ^3.0.0-beta.2 # The Font Awesome Icon pack available as Flutter Icons. # Provides 1600 additional icons to use in your apps.