fix sizing

This commit is contained in:
zoe 2022-09-11 22:29:41 +02:00
parent e2caa421b8
commit 074f9c3c82
13 changed files with 185 additions and 112 deletions

View File

@ -15,12 +15,14 @@ class FullPostView extends StatefulWidget {
this.hidden = true, this.hidden = true,
this.ancestors, this.ancestors,
this.descendants, this.descendants,
this.forceSensitive = false,
}); });
final PostModel originPostModel; final PostModel originPostModel;
final Map<String, PostModel>? identities; final Map<String, PostModel>? identities;
final bool hidden; final bool hidden;
final List<PostModel>? ancestors; final List<PostModel>? ancestors;
final List<PostModel>? descendants; final List<PostModel>? descendants;
final bool forceSensitive;
@override @override
State<FullPostView> createState() => _FullPostViewState(); State<FullPostView> createState() => _FullPostViewState();
@ -152,7 +154,7 @@ class _FullPostViewState extends State<FullPostView> {
}, },
), ),
), ),
if (sensitive) if (sensitive || widget.forceSensitive)
ElevatedButton.icon( ElevatedButton.icon(
onPressed: () { onPressed: () {
setState(() { setState(() {
@ -165,6 +167,7 @@ class _FullPostViewState extends State<FullPostView> {
identities: identities, identities: identities,
ancestors: ancestors, ancestors: ancestors,
descendants: descendants, descendants: descendants,
forceSensitive: true,
), ),
); );
}); });
@ -179,7 +182,7 @@ class _FullPostViewState extends State<FullPostView> {
), ),
Container( Container(
constraints: BoxConstraints( constraints: BoxConstraints(
maxHeight: MediaQuery.of(context).size.height * 0.9, maxHeight: MediaQuery.of(context).size.height * 2 / 3,
maxWidth: global.getConstraints(context).maxWidth), maxWidth: global.getConstraints(context).maxWidth),
width: global.getWidth(context), width: global.getWidth(context),
child: SingleChildScrollView( child: SingleChildScrollView(

View File

@ -206,7 +206,7 @@ class _ProfileViewState extends State<ProfileView> {
constraints: global.getConstraints(context), constraints: global.getConstraints(context),
width: global.getWidth(context) + width: global.getWidth(context) +
MediaQuery.of(context).size.width * 0.2, MediaQuery.of(context).size.width * 0.2,
height: MediaQuery.of(context).size.height * 0.9, height: MediaQuery.of(context).size.height * 2 / 3,
child: ListView.builder( child: ListView.builder(
controller: _scrollController, controller: _scrollController,
itemCount: threads.length + 2, itemCount: threads.length + 2,

View File

@ -27,7 +27,10 @@ class SingleNotif extends StatelessWidget {
padding: const EdgeInsets.all(24), padding: const EdgeInsets.all(24),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Theme.of(context).colorScheme.surface, color: Theme.of(context).colorScheme.surface,
border: Border.all(color: Theme.of(context).colorScheme.secondary), border: Border.all(
color: Theme.of(context).colorScheme.secondary,
width: 2,
),
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
), ),
child: Material( child: Material(

View File

@ -46,7 +46,10 @@ class SettingsPanel extends StatelessWidget {
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: Theme.of(context).colorScheme.surface, color: Theme.of(context).colorScheme.surface,
border: Border.all(color: Theme.of(context).colorScheme.secondary), border: Border.all(
color: Theme.of(context).colorScheme.secondary,
width: 2,
),
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
), ),
padding: const EdgeInsets.all(24), padding: const EdgeInsets.all(24),

View File

@ -84,7 +84,10 @@ class _ThreadState extends State<Thread> {
padding: const EdgeInsets.all(24), padding: const EdgeInsets.all(24),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Theme.of(context).colorScheme.surface, color: Theme.of(context).colorScheme.surface,
border: Border.all(color: Theme.of(context).colorScheme.secondary), border: Border.all(
color: Theme.of(context).colorScheme.secondary,
width: 2,
),
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
), ),
child: Column( child: Column(
@ -107,8 +110,8 @@ class _ThreadState extends State<Thread> {
constraints: global.getConstraints(context), constraints: global.getConstraints(context),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Theme.of(context).colorScheme.surface, color: Theme.of(context).colorScheme.surface,
border: border: Border.all(
Border.all(color: Theme.of(context).colorScheme.secondary), color: Theme.of(context).colorScheme.secondary, width: 2),
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
), ),
child: Material( child: Material(

View File

@ -16,7 +16,9 @@ themes.CustomColors themeDark = themes.CustomColors(
onBackground: Color.fromARGB(255, 246, 245, 244), onBackground: Color.fromARGB(255, 246, 245, 244),
surface: Color.fromARGB(255, 61, 56, 70), surface: Color.fromARGB(255, 61, 56, 70),
onSurface: Color.fromARGB(255, 246, 245, 244), onSurface: Color.fromARGB(255, 246, 245, 244),
)); ),
const Color.fromARGB(255, 36, 31, 49),
);
themes.CustomColors themeLight = themes.CustomColors( themes.CustomColors themeLight = themes.CustomColors(
"adwaita light", "adwaita light",
@ -33,4 +35,6 @@ themes.CustomColors themeLight = themes.CustomColors(
onBackground: Color.fromARGB(255, 36, 31, 49), onBackground: Color.fromARGB(255, 36, 31, 49),
surface: Color.fromARGB(255, 246, 245, 244), surface: Color.fromARGB(255, 246, 245, 244),
onSurface: Color.fromARGB(255, 36, 31, 49), onSurface: Color.fromARGB(255, 36, 31, 49),
)); ),
const Color.fromARGB(255, 222, 221, 218),
);

View File

@ -21,4 +21,5 @@ themes.CustomColors theme = themes.CustomColors(
onBackground: Color.fromARGB(255, 248, 248, 242), onBackground: Color.fromARGB(255, 248, 248, 242),
surface: Color.fromARGB(255, 40, 42, 54), surface: Color.fromARGB(255, 40, 42, 54),
onSurface: Color.fromARGB(255, 248, 248, 242), onSurface: Color.fromARGB(255, 248, 248, 242),
)); ),
const Color.fromARGB(255, 68, 71, 90));

21
lib/themes/first.dart Normal file
View File

@ -0,0 +1,21 @@
import 'package:flutter/material.dart';
import 'themes.dart' as themes;
themes.CustomColors theme = themes.CustomColors(
"website #1",
const Color.fromARGB(255, 89, 89, 89),
const ColorScheme(
brightness: Brightness.light,
primary: Color.fromARGB(255, 0, 25, 53),
onPrimary: Color.fromARGB(255, 255, 255, 255),
secondary: Color.fromARGB(255, 0, 184, 255),
onSecondary: Color.fromARGB(255, 255, 255, 255),
error: Color.fromARGB(255, 245, 248, 250),
onError: Color.fromARGB(255, 20, 23, 26),
background: Color.fromARGB(255, 0, 25, 53),
onBackground: Color.fromARGB(255, 20, 23, 26),
surface: Color.fromARGB(255, 255, 255, 255),
onSurface: Color.fromARGB(255, 0, 0, 0),
),
const Color.fromARGB(255, 188, 195, 202),
);

View File

@ -18,7 +18,9 @@ themes.CustomColors theme = themes.CustomColors(
error: Color.fromARGB(255, 255, 85, 85), error: Color.fromARGB(255, 255, 85, 85),
onError: Color.fromARGB(255, 255, 249, 242), onError: Color.fromARGB(255, 255, 249, 242),
background: Color.fromARGB(255, 255, 241, 223), background: Color.fromARGB(255, 255, 241, 223),
onBackground: Color.fromARGB(255, 248, 248, 242), onBackground: Color.fromARGB(255, 25, 25, 25),
surface: Color.fromARGB(255, 255, 249, 242), surface: Color.fromARGB(255, 255, 249, 242),
onSurface: Color.fromARGB(255, 25, 25, 25), onSurface: Color.fromARGB(255, 25, 25, 25),
)); ),
const Color.fromARGB(255, 255, 241, 223),
);

View File

@ -16,7 +16,9 @@ themes.CustomColors themeDark = themes.CustomColors(
onBackground: Color.fromARGB(255, 249, 245, 215), onBackground: Color.fromARGB(255, 249, 245, 215),
surface: Color.fromARGB(255, 50, 48, 47), surface: Color.fromARGB(255, 50, 48, 47),
onSurface: Color.fromARGB(255, 249, 245, 215), onSurface: Color.fromARGB(255, 249, 245, 215),
)); ),
const Color.fromARGB(255, 29, 32, 33),
);
themes.CustomColors themeLight = themes.CustomColors( themes.CustomColors themeLight = themes.CustomColors(
"gruvbox light", "gruvbox light",
@ -33,4 +35,6 @@ themes.CustomColors themeLight = themes.CustomColors(
onBackground: Color.fromARGB(255, 29, 32, 33), onBackground: Color.fromARGB(255, 29, 32, 33),
surface: Color.fromARGB(255, 249, 245, 215), surface: Color.fromARGB(255, 249, 245, 215),
onSurface: Color.fromARGB(255, 29, 32, 33), onSurface: Color.fromARGB(255, 29, 32, 33),
)); ),
const Color.fromARGB(255, 242, 229, 188),
);

21
lib/themes/second.dart Normal file
View File

@ -0,0 +1,21 @@
import 'package:flutter/material.dart';
import 'themes.dart' as themes;
themes.CustomColors theme = themes.CustomColors(
"website #2",
const Color.fromARGB(255, 170, 184, 194),
const ColorScheme(
brightness: Brightness.light,
primary: Color.fromARGB(255, 29, 161, 242),
onPrimary: Color.fromARGB(255, 245, 248, 250),
secondary: Color.fromARGB(255, 29, 161, 242),
onSecondary: Color.fromARGB(255, 245, 248, 250),
error: Color.fromARGB(255, 245, 248, 250),
onError: Color.fromARGB(255, 20, 23, 26),
background: Color.fromARGB(255, 245, 248, 250),
onBackground: Color.fromARGB(255, 20, 23, 26),
surface: Color.fromARGB(255, 245, 248, 250),
onSurface: Color.fromARGB(255, 20, 23, 26),
),
const Color.fromARGB(255, 225, 232, 237),
);

View File

@ -21,4 +21,6 @@ themes.CustomColors theme = themes.CustomColors(
onBackground: Color.fromARGB(255, 238, 141, 239), onBackground: Color.fromARGB(255, 238, 141, 239),
surface: Color.fromARGB(255, 3, 16, 20), surface: Color.fromARGB(255, 3, 16, 20),
onSurface: Color.fromARGB(255, 238, 141, 239), onSurface: Color.fromARGB(255, 238, 141, 239),
)); ),
const Color.fromARGB(255, 3, 16, 20),
);

View File

@ -4,6 +4,8 @@ import 'tess.dart' as color_tess;
import 'adwaita.dart' as color_adwaita; import 'adwaita.dart' as color_adwaita;
import 'gruvbox.dart' as color_gruvbox; import 'gruvbox.dart' as color_gruvbox;
import 'fourth_website.dart' as color_fourth; import 'fourth_website.dart' as color_fourth;
import 'second.dart' as color_second;
import 'first.dart' as color_first;
// color schemes to pick from can be added here // color schemes to pick from can be added here
// there is a class to create these // there is a class to create these
@ -14,6 +16,8 @@ final available = [
color_tess.theme, color_tess.theme,
color_gruvbox.themeDark, color_gruvbox.themeDark,
color_gruvbox.themeLight, color_gruvbox.themeLight,
color_first.theme,
color_second.theme,
color_fourth.theme, color_fourth.theme,
]; ];
@ -160,9 +164,9 @@ ThemeData getTheme(CustomColors colors) {
textSelectionTheme: textSelectionTheme:
TextSelectionThemeData(selectionColor: colors.hintColor), TextSelectionThemeData(selectionColor: colors.hintColor),
primaryIconTheme: const IconThemeData(size: 24), primaryIconTheme: const IconThemeData(size: 24),
hoverColor: colors.colorScheme.background, hoverColor: colors.hoverColor,
shadowColor: colors.colorScheme.surface, shadowColor: colors.colorScheme.surface,
focusColor: colors.colorScheme.background, focusColor: colors.hoverColor,
indicatorColor: colors.hintColor, indicatorColor: colors.hintColor,
disabledColor: colors.hintColor, disabledColor: colors.hintColor,
unselectedWidgetColor: colors.hintColor, unselectedWidgetColor: colors.hintColor,
@ -196,6 +200,8 @@ ThemeData getTheme(CustomColors colors) {
class CustomColors { class CustomColors {
late String name; late String name;
late Color hintColor; late Color hintColor;
// must be set for twilight themes
late Color hoverColor;
late ColorScheme colorScheme; late ColorScheme colorScheme;
CustomColors(this.name, this.hintColor, this.colorScheme); CustomColors(this.name, this.hintColor, this.colorScheme, this.hoverColor);
} }