fix all the 3d effects by removing them

This commit is contained in:
zoe 2022-09-26 14:08:39 +02:00
parent 3101b19a49
commit ad7aaa5c24
3 changed files with 50 additions and 10 deletions

View File

@ -292,6 +292,7 @@ class _MakePostState extends State<MakePost> {
),
];
c.addAll([
// content warnings
TextFormField(
style: Theme.of(context).textTheme.bodyMedium,
initialValue: spoilerText,
@ -315,6 +316,7 @@ class _MakePostState extends State<MakePost> {
SizedBox(
height: MediaQuery.of(context).size.height * 0.6,
child: TextFormField(
autofocus: true,
initialValue: replyAts,
style: Theme.of(context).textTheme.bodyMedium,
maxLines: null,
@ -394,12 +396,6 @@ class _MakePostState extends State<MakePost> {
contentPadding: const EdgeInsets.all(24),
title: Column(
children: [
SelectableText(
textAlign: TextAlign.center,
widget.inReplyTo == null
? "make-post".i18n()
: "make-reply".i18n(),
style: Theme.of(context).textTheme.displayMedium),
if (status != null) SelectableText(status!),
if (sending) const LinearProgressIndicator(),
],

View File

@ -71,7 +71,7 @@ class _SearchDialogueState extends State<SearchDialogue> {
})),
decoration: InputDecoration(
prefixIcon: Icon(
color: Theme.of(context).colorScheme.secondary,
color: Theme.of(context).colorScheme.primary,
Icons.search,
))),
if (searched < global.settings!.identities.length &&

View File

@ -7,6 +7,16 @@ import 'fourth_website.dart' as color_fourth;
import 'second.dart' as color_second;
import 'first.dart' as color_first;
bool checkActive(Set<MaterialState> states) {
return states.intersection({
MaterialState.focused,
MaterialState.hovered,
MaterialState.pressed
}).isNotEmpty;
}
const defaultRadius = Radius.circular(8);
// color schemes to pick from can be added here
// there is a class to create these
final available = [
@ -23,11 +33,12 @@ final available = [
ThemeData getTheme(CustomColors colors) {
return ThemeData(
applyElevationOverlayColor: false,
floatingActionButtonTheme: FloatingActionButtonThemeData(
hoverColor: colors.colorScheme.onSurface,
elevation: 0,
enableFeedback: false,
hoverElevation: 24,
hoverElevation: 0,
),
fontFamily: 'Atkinson',
textTheme: TextTheme(
@ -77,16 +88,32 @@ ThemeData getTheme(CustomColors colors) {
),
elevatedButtonTheme: ElevatedButtonThemeData(
style: ButtonStyle(
shadowColor: MaterialStateProperty.all(Colors.transparent),
shape: MaterialStateProperty.resolveWith((states) {
if (checkActive(states)) {
return RoundedRectangleBorder(
borderRadius: const BorderRadius.all(defaultRadius),
side: BorderSide(color: colors.colorScheme.primary),
);
}
return const RoundedRectangleBorder(
borderRadius: BorderRadius.all(defaultRadius));
}),
elevation: MaterialStateProperty.all(0),
foregroundColor: MaterialStateProperty.resolveWith((states) {
if (states.contains(MaterialState.disabled)) {
return colors.colorScheme.surface;
}
if (checkActive(states)) return colors.colorScheme.primary;
return null;
}),
backgroundColor: MaterialStateProperty.resolveWith((states) {
if (states.contains(MaterialState.disabled)) return colors.hintColor;
if (checkActive(states)) return colors.colorScheme.onPrimary;
return null;
}),
overlayColor: MaterialStateProperty.all(Colors.transparent),
textStyle: MaterialStateProperty.resolveWith((states) =>
const TextStyle(
fontSize: 18,
@ -112,6 +139,18 @@ ThemeData getTheme(CustomColors colors) {
),
textButtonTheme: TextButtonThemeData(
style: ButtonStyle(
elevation: MaterialStateProperty.all(0),
shape: MaterialStateProperty.all(const RoundedRectangleBorder(
borderRadius: BorderRadius.all(defaultRadius))),
shadowColor: MaterialStateProperty.all(Colors.transparent),
backgroundColor: MaterialStateProperty.resolveWith((states) {
if (checkActive(states)) return colors.colorScheme.primary;
return null;
}),
foregroundColor: MaterialStateProperty.resolveWith((states) {
if (checkActive(states)) return colors.colorScheme.onPrimary;
return null;
}),
textStyle: MaterialStateProperty.all(
const TextStyle(fontSize: 18),
),
@ -129,6 +168,7 @@ ThemeData getTheme(CustomColors colors) {
colorScheme: colors.colorScheme,
errorColor: colors.colorScheme.error,
bottomAppBarTheme: BottomAppBarTheme(
elevation: 0,
color: colors.colorScheme.surface,
),
navigationBarTheme: NavigationBarThemeData(
@ -162,12 +202,16 @@ ThemeData getTheme(CustomColors colors) {
fontWeight: FontWeight.w700,
),
decoration: BoxDecoration(
borderRadius: const BorderRadius.all(Radius.circular(8)),
borderRadius: const BorderRadius.all(defaultRadius),
color: colors.colorScheme.primary,
),
),
canvasColor: colors.colorScheme.surface,
dialogBackgroundColor: colors.colorScheme.surface,
dialogTheme: DialogTheme(
elevation: 0,
backgroundColor: colors.colorScheme.surface,
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.all(defaultRadius))),
selectedRowColor: colors.colorScheme.background,
textSelectionTheme:
TextSelectionThemeData(selectionColor: colors.hintColor),