censor stuff
This commit is contained in:
parent
0f5bf5f66e
commit
c478380c04
@ -10,11 +10,12 @@ import 'package:flutter_feather_icons/flutter_feather_icons.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class GradeTile extends StatelessWidget {
|
||||
const GradeTile(this.grade, {Key? key, this.onTap, this.padding}) : super(key: key);
|
||||
const GradeTile(this.grade, {Key? key, this.onTap, this.padding, this.censored = false}) : super(key: key);
|
||||
|
||||
final Grade grade;
|
||||
final void Function()? onTap;
|
||||
final EdgeInsetsGeometry? padding;
|
||||
final bool censored;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@ -76,7 +77,14 @@ class GradeTile extends StatelessWidget {
|
||||
: SizedBox(
|
||||
width: 44,
|
||||
height: 44,
|
||||
child: Center(
|
||||
child: censored
|
||||
? Container(
|
||||
decoration: BoxDecoration(
|
||||
color: AppColors.of(context).text.withOpacity(.55),
|
||||
borderRadius: BorderRadius.circular(60.0),
|
||||
),
|
||||
)
|
||||
: Center(
|
||||
child: Padding(
|
||||
padding: leadingPadding,
|
||||
child: Icon(
|
||||
@ -87,14 +95,40 @@ class GradeTile extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
),
|
||||
title: Text(
|
||||
title: censored
|
||||
? Wrap(
|
||||
children: [
|
||||
Container(
|
||||
width: 110,
|
||||
height: 15,
|
||||
decoration: BoxDecoration(
|
||||
color: AppColors.of(context).text.withOpacity(.85),
|
||||
borderRadius: BorderRadius.circular(8.0),
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
: Text(
|
||||
title,
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: const TextStyle(fontWeight: FontWeight.w600),
|
||||
),
|
||||
subtitle: subtitle != ""
|
||||
? Text(
|
||||
? censored
|
||||
? Wrap(
|
||||
children: [
|
||||
Container(
|
||||
width: 50,
|
||||
height: 10,
|
||||
decoration: BoxDecoration(
|
||||
color: AppColors.of(context).text.withOpacity(.45),
|
||||
borderRadius: BorderRadius.circular(8.0),
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
: Text(
|
||||
subtitle,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
@ -111,6 +145,15 @@ class GradeTile extends StatelessWidget {
|
||||
calculatorProvider.removeGrade(grade);
|
||||
},
|
||||
)
|
||||
: censored
|
||||
? Container(
|
||||
width: 15,
|
||||
height: 15,
|
||||
decoration: BoxDecoration(
|
||||
color: AppColors.of(context).text.withOpacity(.45),
|
||||
borderRadius: BorderRadius.circular(8.0),
|
||||
),
|
||||
)
|
||||
: GradeValueWidget(grade.value),
|
||||
minLeadingWidth: isSubjectView ? 32.0 : 0,
|
||||
),
|
||||
|
@ -15,12 +15,14 @@ class MessageTile extends StatelessWidget {
|
||||
this.messages,
|
||||
this.padding,
|
||||
this.onTap,
|
||||
this.censored = false,
|
||||
}) : super(key: key);
|
||||
|
||||
final Message message;
|
||||
final List<Message>? messages;
|
||||
final EdgeInsetsGeometry? padding;
|
||||
final Function()? onTap;
|
||||
final bool censored;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@ -38,13 +40,28 @@ class MessageTile extends StatelessWidget {
|
||||
name: message.author,
|
||||
radius: 22.0,
|
||||
backgroundColor: ColorUtils.stringToColor(message.author),
|
||||
censored: censored,
|
||||
)
|
||||
: ProfileImage(
|
||||
name: "Béla",
|
||||
radius: 22.0,
|
||||
backgroundColor: Theme.of(context).colorScheme.secondary,
|
||||
censored: censored,
|
||||
),
|
||||
title: Row(
|
||||
title: censored
|
||||
? Wrap(
|
||||
children: [
|
||||
Container(
|
||||
width: 105,
|
||||
height: 15,
|
||||
decoration: BoxDecoration(
|
||||
color: AppColors.of(context).text.withOpacity(.85),
|
||||
borderRadius: BorderRadius.circular(8.0),
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Text(
|
||||
@ -57,13 +74,39 @@ class MessageTile extends StatelessWidget {
|
||||
if (message.attachments.isNotEmpty) const Icon(FeatherIcons.paperclip, size: 16.0)
|
||||
],
|
||||
),
|
||||
subtitle: Text(
|
||||
subtitle: censored
|
||||
? Wrap(
|
||||
children: [
|
||||
Container(
|
||||
width: 150,
|
||||
height: 10,
|
||||
decoration: BoxDecoration(
|
||||
color: AppColors.of(context).text.withOpacity(.45),
|
||||
borderRadius: BorderRadius.circular(8.0),
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
: Text(
|
||||
message.subject,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: const TextStyle(fontWeight: FontWeight.w500, fontSize: 14.0),
|
||||
),
|
||||
trailing: Text(
|
||||
trailing: censored
|
||||
? Wrap(
|
||||
children: [
|
||||
Container(
|
||||
width: 35,
|
||||
height: 15,
|
||||
decoration: BoxDecoration(
|
||||
color: AppColors.of(context).text.withOpacity(.45),
|
||||
borderRadius: BorderRadius.circular(8.0),
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
: Text(
|
||||
message.date.format(context),
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w500,
|
||||
|
Loading…
x
Reference in New Issue
Block a user