Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Light theme news details #940

Merged
merged 4 commits into from
Mar 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 28 additions & 10 deletions lib/ui/views/news_details_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import 'package:intl/intl.dart';
import 'package:stacked/stacked.dart';

// Project imports:
import 'package:notredame/core/utils/utils.dart';
import 'package:notredame/core/models/news.dart';
import 'package:notredame/core/services/analytics_service.dart';
import 'package:notredame/core/viewmodels/news_details_viewmodel.dart';
Expand Down Expand Up @@ -56,6 +57,7 @@ class _NewsDetailsViewState extends State<NewsDetailsView> {
titleSpacing: 0,
leading: IconButton(
icon: const Icon(Icons.arrow_back),
color: Colors.white,
onPressed: () => Navigator.of(context).pop(),
),
title: Text(
Expand Down Expand Up @@ -128,7 +130,10 @@ class _NewsDetailsViewState extends State<NewsDetailsView> {
child: Text(
title,
style: Theme.of(context).textTheme.bodyText1!.copyWith(
color: Colors.white, fontSize: 25, fontWeight: FontWeight.bold),
color:
Utils.getColorByBrightness(context, Colors.black, Colors.white),
fontSize: 25,
fontWeight: FontWeight.bold),
),
);
}
Expand All @@ -145,8 +150,9 @@ class _NewsDetailsViewState extends State<NewsDetailsView> {
}

Widget _buildAuthor(String avatar, String author, String activity) {
return Container(
color: const Color(0xff1e1e1e),
return ColoredBox(
color: Utils.getColorByBrightness(
context, AppTheme.etsLightRed, Theme.of(context).bottomAppBarColor),
child: ListTile(
leading: ClipOval(
child: avatar == ""
Expand All @@ -162,14 +168,17 @@ class _NewsDetailsViewState extends State<NewsDetailsView> {
author,
style: const TextStyle(
fontWeight: FontWeight.bold,
color: Colors.white,
fontSize: 20,
),
),
subtitle: Padding(
padding: const EdgeInsets.only(top: 8.0),
child: Text(
activity,
style: const TextStyle(
style: TextStyle(
color: Utils.getColorByBrightness(
context, Colors.white, const Color(0xffbababa)),
fontSize: 16,
),
),
Expand Down Expand Up @@ -197,7 +206,9 @@ class _NewsDetailsViewState extends State<NewsDetailsView> {
children: [
Text(
formattedPublishedDate,
style: const TextStyle(color: Colors.white),
style: TextStyle(
color: Utils.getColorByBrightness(
context, Colors.black, Colors.white)),
),
const SizedBox(height: 12.0),
],
Expand All @@ -208,30 +219,37 @@ class _NewsDetailsViewState extends State<NewsDetailsView> {
children: [
Container(
padding: const EdgeInsets.all(8),
decoration: const BoxDecoration(
color: AppTheme.etsDarkGrey,
decoration: BoxDecoration(
color: Utils.getColorByBrightness(context,
AppTheme.darkThemeAccent, AppTheme.etsDarkGrey),
shape: BoxShape.circle,
),
child:
const Icon(Icons.event, size: 20.0, color: Colors.white),
),
Flexible(
child: Padding(
padding: const EdgeInsets.only(left: 4),
child: Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Text(
AppIntl.of(context)!.news_event_date,
style: const TextStyle(color: AppTheme.etsLightGrey),
style: TextStyle(
color: Utils.getColorByBrightness(
context, Colors.black, AppTheme.etsLightGrey)),
textAlign: TextAlign.right,
),
Text(
formattedEventDate,
style: const TextStyle(color: Colors.white),
style: TextStyle(
color: Utils.getColorByBrightness(context,
AppTheme.darkThemeAccent, Colors.white)),
textAlign: TextAlign.right,
),
],
),
),
)),
],
),
),
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: The 4th generation of ÉTSMobile, the main gateway between the Éco
# pub.dev using `pub publish`. This is preferred for private packages.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev

version: 4.34.0+1
version: 4.33.3+1

environment:
sdk: ">=2.12.0 <3.0.0"
Expand Down
Loading