Skip to content

Commit

Permalink
feat: Add profile announcements image render
Browse files Browse the repository at this point in the history
  • Loading branch information
0niel committed Jan 5, 2024
1 parent d65d88d commit 54e3609
Show file tree
Hide file tree
Showing 6 changed files with 93 additions and 19 deletions.
5 changes: 2 additions & 3 deletions lib/presentation/pages/news/news_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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<int> _tabValueNotifier = ValueNotifier(0);
Expand Down Expand Up @@ -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(
Expand Down
6 changes: 6 additions & 0 deletions lib/presentation/pages/profile/profile_announces_page.dart
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -67,6 +69,10 @@ class ProfileAnnouncesPage extends StatelessWidget {
launchUrlString(url);
}
},
extensions: const [
VideoHtmlExtension(),
SvgHtmlExtension(),
],
),
],
),
Expand Down
5 changes: 2 additions & 3 deletions lib/presentation/pages/profile/profile_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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("Профиль"),
Expand Down
12 changes: 0 additions & 12 deletions lib/service_locator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -78,17 +77,6 @@ Future<void> 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(
Expand Down
80 changes: 80 additions & 0 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand All @@ -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:
Expand Down
4 changes: 3 additions & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 54e3609

Please sign in to comment.