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

@ -2,35 +2,39 @@ import 'package:flutter/material.dart';
import 'themes.dart' as themes; import 'themes.dart' as themes;
themes.CustomColors themeDark = themes.CustomColors( themes.CustomColors themeDark = themes.CustomColors(
"adwaita dark", "adwaita dark",
const Color.fromARGB(255, 26, 95, 180), const Color.fromARGB(255, 26, 95, 180),
const ColorScheme( const ColorScheme(
brightness: Brightness.dark, brightness: Brightness.dark,
primary: Color.fromARGB(255, 255, 190, 111), primary: Color.fromARGB(255, 255, 190, 111),
onPrimary: Color.fromARGB(255, 61, 56, 70), onPrimary: Color.fromARGB(255, 61, 56, 70),
secondary: Color.fromARGB(255, 143, 240, 164), secondary: Color.fromARGB(255, 143, 240, 164),
onSecondary: Color.fromARGB(255, 61, 56, 70), onSecondary: Color.fromARGB(255, 61, 56, 70),
error: Color.fromARGB(255, 255, 85, 85), error: Color.fromARGB(255, 255, 85, 85),
onError: Color.fromARGB(255, 61, 56, 70), onError: Color.fromARGB(255, 61, 56, 70),
background: Color.fromARGB(255, 36, 31, 49), background: Color.fromARGB(255, 36, 31, 49),
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",
const Color.fromARGB(255, 153, 193, 241), const Color.fromARGB(255, 153, 193, 241),
const ColorScheme( const ColorScheme(
brightness: Brightness.dark, brightness: Brightness.dark,
primary: Color.fromARGB(255, 198, 70, 0), primary: Color.fromARGB(255, 198, 70, 0),
onPrimary: Color.fromARGB(255, 246, 245, 244), onPrimary: Color.fromARGB(255, 246, 245, 244),
secondary: Color.fromARGB(255, 38, 162, 105), secondary: Color.fromARGB(255, 38, 162, 105),
onSecondary: Color.fromARGB(255, 246, 245, 244), onSecondary: Color.fromARGB(255, 246, 245, 244),
error: Color.fromARGB(255, 165, 29, 45), error: Color.fromARGB(255, 165, 29, 45),
onError: Color.fromARGB(255, 246, 245, 244), onError: Color.fromARGB(255, 246, 245, 244),
background: Color.fromARGB(255, 222, 221, 218), background: Color.fromARGB(255, 222, 221, 218),
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

@ -2,23 +2,25 @@ import 'package:flutter/material.dart';
import 'themes.dart' as themes; import 'themes.dart' as themes;
themes.CustomColors theme = themes.CustomColors( themes.CustomColors theme = themes.CustomColors(
"website #4", "website #4",
const Color.fromARGB( const Color.fromARGB(
255, 255,
255, 255,
170, 170,
90, 90,
), ),
const ColorScheme( const ColorScheme(
brightness: Brightness.light, brightness: Brightness.light,
primary: Color.fromARGB(255, 131, 37, 79), primary: Color.fromARGB(255, 131, 37, 79),
onPrimary: Color.fromARGB(255, 255, 249, 242), onPrimary: Color.fromARGB(255, 255, 249, 242),
secondary: Color.fromARGB(255, 81, 17, 46), secondary: Color.fromARGB(255, 81, 17, 46),
onSecondary: Color.fromARGB(255, 255, 249, 242), onSecondary: Color.fromARGB(255, 255, 249, 242),
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

@ -2,35 +2,39 @@ import 'package:flutter/material.dart';
import 'themes.dart' as themes; import 'themes.dart' as themes;
themes.CustomColors themeDark = themes.CustomColors( themes.CustomColors themeDark = themes.CustomColors(
"gruvbox dark", "gruvbox dark",
const Color.fromARGB(255, 175, 58, 3), const Color.fromARGB(255, 175, 58, 3),
const ColorScheme( const ColorScheme(
brightness: Brightness.dark, brightness: Brightness.dark,
primary: Color.fromARGB(255, 211, 134, 155), primary: Color.fromARGB(255, 211, 134, 155),
onPrimary: Color.fromARGB(255, 29, 32, 33), onPrimary: Color.fromARGB(255, 29, 32, 33),
secondary: Color.fromARGB(255, 184, 187, 38), secondary: Color.fromARGB(255, 184, 187, 38),
onSecondary: Color.fromARGB(255, 29, 32, 33), onSecondary: Color.fromARGB(255, 29, 32, 33),
error: Color.fromARGB(255, 251, 73, 52), error: Color.fromARGB(255, 251, 73, 52),
onError: Color.fromARGB(255, 29, 32, 33), onError: Color.fromARGB(255, 29, 32, 33),
background: Color.fromARGB(255, 29, 32, 33), background: Color.fromARGB(255, 29, 32, 33),
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",
const Color.fromARGB(255, 255, 190, 111), const Color.fromARGB(255, 255, 190, 111),
const ColorScheme( const ColorScheme(
brightness: Brightness.light, brightness: Brightness.light,
primary: Color.fromARGB(255, 175, 58, 3), primary: Color.fromARGB(255, 175, 58, 3),
onPrimary: Color.fromARGB(255, 249, 245, 215), onPrimary: Color.fromARGB(255, 249, 245, 215),
secondary: Color.fromARGB(255, 121, 116, 14), secondary: Color.fromARGB(255, 121, 116, 14),
onSecondary: Color.fromARGB(255, 249, 245, 215), onSecondary: Color.fromARGB(255, 249, 245, 215),
error: Color.fromARGB(255, 255, 85, 85), error: Color.fromARGB(255, 255, 85, 85),
onError: Color.fromARGB(255, 249, 245, 215), onError: Color.fromARGB(255, 249, 245, 215),
background: Color.fromARGB(255, 242, 229, 188), background: Color.fromARGB(255, 242, 229, 188),
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

@ -2,23 +2,25 @@ import 'package:flutter/material.dart';
import 'themes.dart' as themes; import 'themes.dart' as themes;
themes.CustomColors theme = themes.CustomColors( themes.CustomColors theme = themes.CustomColors(
"tess 🐯", "tess 🐯",
const Color.fromARGB( const Color.fromARGB(
255, 255,
6, 6,
34, 34,
42, 42,
), ),
const ColorScheme( const ColorScheme(
brightness: Brightness.dark, brightness: Brightness.dark,
primary: Color.fromARGB(255, 230, 62, 98), primary: Color.fromARGB(255, 230, 62, 98),
onPrimary: Color.fromARGB(255, 3, 16, 20), onPrimary: Color.fromARGB(255, 3, 16, 20),
secondary: Color.fromARGB(255, 230, 62, 98), secondary: Color.fromARGB(255, 230, 62, 98),
onSecondary: Color.fromARGB(255, 3, 16, 20), onSecondary: Color.fromARGB(255, 3, 16, 20),
error: Color.fromARGB(255, 241, 108, 86), error: Color.fromARGB(255, 241, 108, 86),
onError: Color.fromARGB(255, 3, 16, 20), onError: Color.fromARGB(255, 3, 16, 20),
background: Color.fromARGB(255, 3, 16, 20), background: Color.fromARGB(255, 3, 16, 20),
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);
} }