-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix about page ordering being reversed (#171)
- Loading branch information
1 parent
93d5b1c
commit 29dabd9
Showing
6 changed files
with
115 additions
and
140 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,77 +1,43 @@ | ||
part of carp_study_app; | ||
|
||
class DetailsBanner extends StatelessWidget { | ||
const DetailsBanner(this.title, this.imagePath, | ||
{super.key, this.isCarpBanner = false}); | ||
const DetailsBanner(this.title, this.imagePath, {super.key}); | ||
final String title; | ||
final String? imagePath; | ||
final bool isCarpBanner; | ||
|
||
@override | ||
Widget build( | ||
BuildContext context, | ||
) { | ||
RPLocalizations locale = RPLocalizations.of(context)!; | ||
return SliverAppBar( | ||
expandedHeight: 150.0, | ||
backgroundColor: Theme.of(context).colorScheme.secondary, | ||
floating: false, | ||
pinned: false, | ||
flexibleSpace: FlexibleSpaceBar( | ||
centerTitle: true, | ||
titlePadding: const EdgeInsets.only(top: 15), | ||
background: imagePath != null && imagePath!.isNotEmpty | ||
? ClipRRect( | ||
child: ImageFiltered( | ||
imageFilter: ui.ImageFilter.blur(sigmaX: 1, sigmaY: 1), | ||
child: bloc.data.studyPageViewModel | ||
.getMessageImage(imagePath)), | ||
) | ||
: const SizedBox.shrink(), | ||
title: InkWell( | ||
onTap: () { | ||
if (isCarpBanner) { | ||
context.push('/studyDetails'); | ||
} | ||
}, | ||
child: Padding( | ||
padding: const EdgeInsets.all(10), | ||
child: Stack( | ||
alignment: AlignmentDirectional.bottomEnd, | ||
children: [ | ||
Stack( | ||
children: [ | ||
Text( | ||
locale.translate(title), | ||
style: studyNameStyle.copyWith( | ||
// color: Theme.of(context).primaryColor, | ||
foreground: Paint() | ||
..style = PaintingStyle.stroke | ||
..strokeWidth = 1 | ||
..color = Theme.of(context).colorScheme.secondary), | ||
), | ||
Text( | ||
locale.translate(title), | ||
style: studyNameStyle.copyWith( | ||
color: Theme.of(context).primaryColor), | ||
), | ||
], | ||
), | ||
isCarpBanner | ||
? Row( | ||
mainAxisAlignment: MainAxisAlignment.start, | ||
crossAxisAlignment: CrossAxisAlignment.end, | ||
children: [ | ||
Icon(Icons.touch_app, | ||
color: Theme.of(context).primaryColor, size: 15), | ||
], | ||
) | ||
: const SizedBox.shrink(), | ||
], | ||
), | ||
return Column( | ||
// crossAxisAlignment: CrossAxisAlignment.start, | ||
mainAxisAlignment: MainAxisAlignment.start, | ||
children: [ | ||
// only show this widget if there is an image = imagePath is not null and not empty | ||
if (imagePath != null && imagePath!.isNotEmpty) | ||
SizedBox( | ||
height: 300, | ||
child: bloc.data.studyPageViewModel.getMessageImage(imagePath), | ||
), | ||
Padding( | ||
padding: const EdgeInsets.all(16), | ||
child: Stack( | ||
alignment: AlignmentDirectional.bottomEnd, | ||
children: [ | ||
Stack( | ||
children: [ | ||
Text( | ||
locale.translate(title), | ||
style: studyNameStyle.copyWith( | ||
fontSize: 30, color: Theme.of(context).primaryColor), | ||
), | ||
], | ||
), | ||
], | ||
), | ||
), | ||
), | ||
], | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters