better content warnings
This commit is contained in:
parent
331d3a584d
commit
853ec95f37
|
@ -88,9 +88,14 @@ class RebloggedBy extends StatelessWidget {
|
|||
Row(
|
||||
children: [
|
||||
const Icon(Icons.repeat),
|
||||
Flexible(child: SelectableText("reblogged-by".i18n())),
|
||||
Flexible(
|
||||
child: SelectableText("reblogged-by".i18n()),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(
|
||||
height: 8,
|
||||
),
|
||||
DisplayName(account: account!),
|
||||
],
|
||||
);
|
||||
|
@ -160,10 +165,11 @@ class _PostBodyState extends State<PostBody> {
|
|||
children: [
|
||||
Visibility(
|
||||
visible: widget.sensitive,
|
||||
child: Text(widget.spoilerText),
|
||||
),
|
||||
Visibility(
|
||||
visible: widget.sensitive,
|
||||
child: SelectableText.rich(
|
||||
TextSpan(
|
||||
text: "",
|
||||
children: [
|
||||
WidgetSpan(
|
||||
child: OutlinedButton.icon(
|
||||
onPressed: () {
|
||||
setState(() {
|
||||
|
@ -178,7 +184,13 @@ class _PostBodyState extends State<PostBody> {
|
|||
});
|
||||
},
|
||||
icon: cwButtonIcon,
|
||||
label: Text(cwButtonText)),
|
||||
label: Text(cwButtonText),
|
||||
),
|
||||
),
|
||||
TextSpan(text: widget.spoilerText),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
Visibility(
|
||||
visible: visible,
|
||||
|
|
|
@ -14,11 +14,13 @@ class PostTextRenderer extends StatelessWidget {
|
|||
dom.Document document = parser.parse(htmlInput);
|
||||
final List<InlineSpan> children =
|
||||
createSpansFromDoc(document.body!.children);
|
||||
return SelectableText.rich(TextSpan(
|
||||
return SelectableText.rich(
|
||||
TextSpan(
|
||||
style: Theme.of(context).textTheme.bodyMedium,
|
||||
text: "",
|
||||
children: children,
|
||||
));
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -17,8 +17,8 @@ themes.CustomColors theme = themes.CustomColors(
|
|||
onSecondary: Color.fromARGB(255, 40, 42, 54),
|
||||
error: Color.fromARGB(255, 255, 85, 85),
|
||||
onError: Color.fromARGB(255, 40, 42, 54),
|
||||
background: Color.fromARGB(255, 40, 42, 54),
|
||||
background: Color.fromARGB(255, 68, 71, 90),
|
||||
onBackground: Color.fromARGB(255, 248, 248, 242),
|
||||
surface: Color.fromARGB(255, 68, 71, 90),
|
||||
surface: Color.fromARGB(255, 40, 42, 54),
|
||||
onSurface: Color.fromARGB(255, 248, 248, 242),
|
||||
));
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'dracula.dart' as color_dracula;
|
||||
|
||||
// color schemes to pick from can be added here
|
||||
// there is a class to create these
|
||||
final available = [color_dracula.theme];
|
||||
ThemeData getTheme(CustomColors colors) {
|
||||
return ThemeData(
|
||||
|
@ -15,7 +17,7 @@ ThemeData getTheme(CustomColors colors) {
|
|||
fontSize: 18,
|
||||
),
|
||||
bodySmall: TextStyle(
|
||||
color: colors.colorScheme.onSurface,
|
||||
color: colors.colorScheme.secondary,
|
||||
fontSize: 14,
|
||||
),
|
||||
displayLarge: TextStyle(
|
||||
|
@ -46,6 +48,25 @@ ThemeData getTheme(CustomColors colors) {
|
|||
fontSize: 24,
|
||||
),
|
||||
),
|
||||
iconTheme: IconThemeData(
|
||||
color: colors.colorScheme.onSurface,
|
||||
),
|
||||
outlinedButtonTheme: OutlinedButtonThemeData(
|
||||
style: ButtonStyle(
|
||||
backgroundColor: MaterialStateProperty.all(
|
||||
colors.colorScheme.primary,
|
||||
),
|
||||
foregroundColor: MaterialStateProperty.all(
|
||||
colors.colorScheme.onPrimary,
|
||||
),
|
||||
textStyle: MaterialStateProperty.all(
|
||||
const TextStyle(
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
textButtonTheme: TextButtonThemeData(
|
||||
style: ButtonStyle(
|
||||
textStyle: MaterialStateProperty.all(
|
||||
|
@ -70,17 +91,21 @@ ThemeData getTheme(CustomColors colors) {
|
|||
elevation: 0,
|
||||
),
|
||||
navigationBarTheme: NavigationBarThemeData(
|
||||
labelTextStyle: MaterialStateProperty.all(TextStyle(
|
||||
labelTextStyle: MaterialStateProperty.all(
|
||||
TextStyle(
|
||||
color: colors.colorScheme.onSurface,
|
||||
fontSize: 14,
|
||||
)),
|
||||
),
|
||||
),
|
||||
backgroundColor: Colors.transparent,
|
||||
labelBehavior: NavigationDestinationLabelBehavior.onlyShowSelected,
|
||||
indicatorColor: Colors.transparent,
|
||||
elevation: 0,
|
||||
height: 64,
|
||||
),
|
||||
scrollbarTheme: const ScrollbarThemeData(),
|
||||
scrollbarTheme: ScrollbarThemeData(
|
||||
thumbColor: MaterialStateProperty.all(colors.hintColor),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue