mirror of
https://git.selfprivacy.org/kherel/selfprivacy.org.app.git
synced 2025-01-26 18:56:38 +00:00
refactor(ui): Get rid of BrandText and restructure the buttons
This commit is contained in:
parent
c18191f639
commit
f0f1e8cacc
|
@ -2,53 +2,16 @@ import 'package:flutter/material.dart';
|
|||
|
||||
class BrandColors {
|
||||
static const Color blue = Color(0xFF093CEF);
|
||||
static const Color white = Colors.white;
|
||||
static const Color black = Colors.black;
|
||||
|
||||
static const Color gray1 = Color(0xFF555555);
|
||||
static const Color gray2 = Color(0xFF7C7C7C);
|
||||
static const Color gray3 = Color(0xFFFAFAFA);
|
||||
static const Color gray4 = Color(0xFFDDDDDD);
|
||||
static const Color gray5 = Color(0xFFEDEEF1);
|
||||
static Color gray6 = const Color(0xFF181818).withOpacity(0.7);
|
||||
static const Color grey7 = Color(0xFFABABAB);
|
||||
|
||||
static const Color red1 = Color(0xFFFA0E0E);
|
||||
static const Color red2 = Color(0xFFE65527);
|
||||
|
||||
static const Color green1 = Color(0xFF00AF54);
|
||||
|
||||
static const Color green2 = Color(0xFF0F8849);
|
||||
|
||||
static Color get navBackgroundLight => white.withOpacity(0.8);
|
||||
static Color get navBackgroundDark => black.withOpacity(0.8);
|
||||
|
||||
static const List<Color> uninitializedGradientColors = [
|
||||
Color(0xFF555555),
|
||||
Color(0xFFABABAB),
|
||||
];
|
||||
static const List<Color> stableGradientColors = [
|
||||
Color(0xFF093CEF),
|
||||
Color(0xFF14A1CB),
|
||||
];
|
||||
|
||||
static const List<Color> progressGradientColors = [
|
||||
Color(0xFF093CEF),
|
||||
Color(0xFF14A1CB),
|
||||
];
|
||||
static const List<Color> warningGradientColors = [
|
||||
Color(0xFFEF4E09),
|
||||
Color(0xFFEFD135),
|
||||
];
|
||||
|
||||
static const Color primary = blue;
|
||||
static const Color headlineColor = black;
|
||||
static const Color inactive = gray2;
|
||||
static const Color scaffoldBackground = gray3;
|
||||
static const Color inputInactive = gray4;
|
||||
|
||||
static const Color textColor1 = black;
|
||||
static const Color textColor2 = gray1;
|
||||
static const Color dividerColor = gray5;
|
||||
static const Color warning = red1;
|
||||
}
|
||||
|
|
|
@ -1,80 +0,0 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:selfprivacy/utils/named_font_weight.dart';
|
||||
|
||||
import 'package:selfprivacy/config/brand_colors.dart';
|
||||
|
||||
const TextStyle defaultTextStyle = TextStyle(
|
||||
fontSize: 15,
|
||||
color: BrandColors.textColor1,
|
||||
);
|
||||
|
||||
final TextStyle headline1Style = defaultTextStyle.copyWith(
|
||||
fontSize: 40,
|
||||
fontWeight: NamedFontWeight.extraBold,
|
||||
color: BrandColors.headlineColor,
|
||||
);
|
||||
|
||||
final TextStyle headline2Style = defaultTextStyle.copyWith(
|
||||
fontSize: 24,
|
||||
fontWeight: NamedFontWeight.extraBold,
|
||||
color: BrandColors.headlineColor,
|
||||
);
|
||||
|
||||
final TextStyle onboardingTitle = defaultTextStyle.copyWith(
|
||||
fontSize: 30,
|
||||
fontWeight: NamedFontWeight.extraBold,
|
||||
color: BrandColors.headlineColor,
|
||||
);
|
||||
|
||||
final TextStyle headline3Style = defaultTextStyle.copyWith(
|
||||
fontSize: 20,
|
||||
fontWeight: NamedFontWeight.extraBold,
|
||||
color: BrandColors.headlineColor,
|
||||
);
|
||||
|
||||
final TextStyle headline4Style = defaultTextStyle.copyWith(
|
||||
fontSize: 18,
|
||||
fontWeight: NamedFontWeight.medium,
|
||||
color: BrandColors.headlineColor,
|
||||
);
|
||||
|
||||
final TextStyle headline4UnderlinedStyle = defaultTextStyle.copyWith(
|
||||
fontSize: 18,
|
||||
fontWeight: NamedFontWeight.medium,
|
||||
color: BrandColors.headlineColor,
|
||||
decoration: TextDecoration.underline,
|
||||
);
|
||||
|
||||
final TextStyle headline5Style = defaultTextStyle.copyWith(
|
||||
fontSize: 15,
|
||||
fontWeight: NamedFontWeight.medium,
|
||||
color: BrandColors.headlineColor.withOpacity(0.8),
|
||||
);
|
||||
|
||||
const TextStyle body1Style = defaultTextStyle;
|
||||
final TextStyle body2Style = defaultTextStyle.copyWith(
|
||||
color: BrandColors.textColor2,
|
||||
);
|
||||
|
||||
final TextStyle buttonTitleText = defaultTextStyle.copyWith(
|
||||
color: BrandColors.white,
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.bold,
|
||||
height: 1,
|
||||
);
|
||||
|
||||
final TextStyle mediumStyle =
|
||||
defaultTextStyle.copyWith(fontSize: 13, height: 1.53);
|
||||
|
||||
final TextStyle smallStyle =
|
||||
defaultTextStyle.copyWith(fontSize: 11, height: 1.45);
|
||||
|
||||
const TextStyle progressTextStyleLight = TextStyle(
|
||||
fontSize: 11,
|
||||
color: BrandColors.textColor1,
|
||||
height: 1.7,
|
||||
);
|
||||
|
||||
final TextStyle progressTextStyleDark = progressTextStyleLight.copyWith(
|
||||
color: BrandColors.white,
|
||||
);
|
|
@ -1,6 +1,4 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:selfprivacy/config/brand_colors.dart';
|
||||
import 'package:selfprivacy/config/text_themes.dart';
|
||||
|
||||
class NavigationService {
|
||||
final GlobalKey<ScaffoldMessengerState> scaffoldMessengerKey =
|
||||
|
@ -26,8 +24,7 @@ class NavigationService {
|
|||
void showSnackBar(final String text) {
|
||||
final ScaffoldMessengerState state = scaffoldMessengerKey.currentState!;
|
||||
final SnackBar snack = SnackBar(
|
||||
backgroundColor: BrandColors.black.withOpacity(0.8),
|
||||
content: Text(text, style: buttonTitleText),
|
||||
content: Text(text),
|
||||
duration: const Duration(seconds: 2),
|
||||
);
|
||||
state.showSnackBar(snack);
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:selfprivacy/config/brand_colors.dart';
|
||||
|
||||
class BrandBottomSheet extends StatelessWidget {
|
||||
const BrandBottomSheet({
|
||||
|
@ -38,7 +37,7 @@ class BrandBottomSheet extends StatelessWidget {
|
|||
width: 30,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(2),
|
||||
color: BrandColors.gray4,
|
||||
color: const Color(0xFFDDDDDD),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
|
|
@ -2,8 +2,6 @@ import 'package:flutter/material.dart';
|
|||
import 'package:flutter_markdown/flutter_markdown.dart';
|
||||
import 'package:flutter/services.dart' show rootBundle;
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:selfprivacy/config/brand_colors.dart';
|
||||
import 'package:selfprivacy/config/text_themes.dart';
|
||||
import 'package:url_launcher/url_launcher_string.dart';
|
||||
|
||||
class BrandMarkdown extends StatefulWidget {
|
||||
|
@ -37,24 +35,7 @@ class _BrandMarkdownState extends State<BrandMarkdown> {
|
|||
|
||||
@override
|
||||
Widget build(final BuildContext context) {
|
||||
final bool isDark = Theme.of(context).brightness == Brightness.dark;
|
||||
final MarkdownStyleSheet markdown = MarkdownStyleSheet(
|
||||
p: defaultTextStyle.copyWith(
|
||||
color: isDark ? BrandColors.white : null,
|
||||
),
|
||||
h1: headline1Style.copyWith(
|
||||
color: isDark ? BrandColors.white : null,
|
||||
),
|
||||
h2: headline2Style.copyWith(
|
||||
color: isDark ? BrandColors.white : null,
|
||||
),
|
||||
h3: headline3Style.copyWith(
|
||||
color: isDark ? BrandColors.white : null,
|
||||
),
|
||||
h4: headline4Style.copyWith(
|
||||
color: isDark ? BrandColors.white : null,
|
||||
),
|
||||
);
|
||||
final MarkdownStyleSheet markdown = MarkdownStyleSheet();
|
||||
return MarkdownBody(
|
||||
shrinkWrap: true,
|
||||
styleSheet: markdown,
|
||||
|
|
|
@ -1,40 +0,0 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:selfprivacy/config/brand_colors.dart';
|
||||
|
||||
// TODO: Delete this file.
|
||||
|
||||
class BrandRadio extends StatelessWidget {
|
||||
const BrandRadio({
|
||||
required this.isChecked,
|
||||
super.key,
|
||||
});
|
||||
|
||||
final bool isChecked;
|
||||
|
||||
@override
|
||||
Widget build(final BuildContext context) => Container(
|
||||
height: 20,
|
||||
width: 20,
|
||||
alignment: Alignment.center,
|
||||
padding: const EdgeInsets.all(2),
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
border: _getBorder(),
|
||||
),
|
||||
child: isChecked
|
||||
? Container(
|
||||
height: 10,
|
||||
width: 10,
|
||||
decoration: const BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: BrandColors.primary,
|
||||
),
|
||||
)
|
||||
: null,
|
||||
);
|
||||
|
||||
BoxBorder? _getBorder() => Border.all(
|
||||
color: isChecked ? BrandColors.primary : BrandColors.gray1,
|
||||
width: 2,
|
||||
);
|
||||
}
|
|
@ -1,238 +0,0 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:selfprivacy/config/text_themes.dart';
|
||||
export 'package:selfprivacy/utils/extensions/text_extensions.dart';
|
||||
|
||||
// TODO: Delete this file
|
||||
|
||||
enum TextType {
|
||||
h1, // right now only at onboarding and opened providers
|
||||
h2, // cards titles
|
||||
h3, // titles in about page
|
||||
h4, // caption
|
||||
h5, // Table data
|
||||
body1, // normal
|
||||
body2, // with opacity
|
||||
medium,
|
||||
small,
|
||||
onboardingTitle,
|
||||
buttonTitleText, // risen button title text,
|
||||
h4Underlined,
|
||||
}
|
||||
|
||||
class BrandText extends StatelessWidget {
|
||||
factory BrandText.h4(
|
||||
final String? text, {
|
||||
final TextStyle? style,
|
||||
final TextAlign? textAlign,
|
||||
}) =>
|
||||
BrandText(
|
||||
text,
|
||||
type: TextType.h4,
|
||||
style: style,
|
||||
softWrap: true,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
maxLines: 2,
|
||||
textAlign: textAlign,
|
||||
);
|
||||
|
||||
factory BrandText.onboardingTitle(
|
||||
final String text, {
|
||||
final TextStyle? style,
|
||||
}) =>
|
||||
BrandText(
|
||||
text,
|
||||
type: TextType.onboardingTitle,
|
||||
style: style,
|
||||
);
|
||||
factory BrandText.h3(
|
||||
final String text, {
|
||||
final TextStyle? style,
|
||||
final TextAlign? textAlign,
|
||||
}) =>
|
||||
BrandText(
|
||||
text,
|
||||
type: TextType.h3,
|
||||
style: style,
|
||||
textAlign: textAlign,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
);
|
||||
|
||||
factory BrandText.h4Underlined(
|
||||
final String? text, {
|
||||
final TextStyle? style,
|
||||
final TextAlign? textAlign,
|
||||
}) =>
|
||||
BrandText(
|
||||
text,
|
||||
type: TextType.h4Underlined,
|
||||
style: style,
|
||||
softWrap: true,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
maxLines: 2,
|
||||
textAlign: textAlign,
|
||||
);
|
||||
|
||||
factory BrandText.h1(
|
||||
final String? text, {
|
||||
final TextStyle? style,
|
||||
final TextOverflow? overflow,
|
||||
final bool? softWrap,
|
||||
}) =>
|
||||
BrandText(
|
||||
text,
|
||||
type: TextType.h1,
|
||||
style: style,
|
||||
);
|
||||
factory BrandText.h2(
|
||||
final String? text, {
|
||||
final TextStyle? style,
|
||||
final TextAlign? textAlign,
|
||||
}) =>
|
||||
BrandText(
|
||||
text,
|
||||
type: TextType.h2,
|
||||
style: style,
|
||||
textAlign: textAlign,
|
||||
);
|
||||
factory BrandText.body1(final String? text, {final TextStyle? style}) =>
|
||||
BrandText(
|
||||
text,
|
||||
type: TextType.body1,
|
||||
style: style,
|
||||
);
|
||||
factory BrandText.small(final String text, {final TextStyle? style}) =>
|
||||
BrandText(
|
||||
text,
|
||||
type: TextType.small,
|
||||
style: style,
|
||||
);
|
||||
factory BrandText.body2(final String? text, {final TextStyle? style}) =>
|
||||
BrandText(
|
||||
text,
|
||||
type: TextType.body2,
|
||||
style: style,
|
||||
);
|
||||
factory BrandText.buttonTitleText(
|
||||
final String? text, {
|
||||
final TextStyle? style,
|
||||
}) =>
|
||||
BrandText(
|
||||
text,
|
||||
type: TextType.buttonTitleText,
|
||||
style: style,
|
||||
);
|
||||
|
||||
factory BrandText.h5(
|
||||
final String? text, {
|
||||
final TextStyle? style,
|
||||
final TextAlign? textAlign,
|
||||
}) =>
|
||||
BrandText(
|
||||
text,
|
||||
type: TextType.h5,
|
||||
style: style,
|
||||
textAlign: textAlign,
|
||||
);
|
||||
factory BrandText.medium(
|
||||
final String? text, {
|
||||
final TextStyle? style,
|
||||
final TextAlign? textAlign,
|
||||
}) =>
|
||||
BrandText(
|
||||
text,
|
||||
type: TextType.medium,
|
||||
style: style,
|
||||
textAlign: textAlign,
|
||||
);
|
||||
const BrandText(
|
||||
this.text, {
|
||||
required this.type,
|
||||
super.key,
|
||||
this.style,
|
||||
this.overflow,
|
||||
this.softWrap,
|
||||
this.textAlign,
|
||||
this.maxLines,
|
||||
});
|
||||
|
||||
final String? text;
|
||||
final TextStyle? style;
|
||||
final TextType type;
|
||||
final TextOverflow? overflow;
|
||||
final bool? softWrap;
|
||||
final TextAlign? textAlign;
|
||||
final int? maxLines;
|
||||
@override
|
||||
Text build(final BuildContext context) {
|
||||
TextStyle style;
|
||||
final bool isDark = Theme.of(context).brightness == Brightness.dark;
|
||||
switch (type) {
|
||||
case TextType.h1:
|
||||
style = isDark
|
||||
? headline1Style.copyWith(color: Colors.white)
|
||||
: headline1Style;
|
||||
break;
|
||||
case TextType.h2:
|
||||
style = isDark
|
||||
? headline2Style.copyWith(color: Colors.white)
|
||||
: headline2Style;
|
||||
break;
|
||||
case TextType.h3:
|
||||
style = isDark
|
||||
? headline3Style.copyWith(color: Colors.white)
|
||||
: headline3Style;
|
||||
break;
|
||||
case TextType.h4:
|
||||
style = isDark
|
||||
? headline4Style.copyWith(color: Colors.white)
|
||||
: headline4Style;
|
||||
break;
|
||||
case TextType.h4Underlined:
|
||||
style = isDark
|
||||
? headline4UnderlinedStyle.copyWith(color: Colors.white)
|
||||
: headline4UnderlinedStyle;
|
||||
break;
|
||||
case TextType.h5:
|
||||
style = isDark
|
||||
? headline5Style.copyWith(color: Colors.white)
|
||||
: headline5Style;
|
||||
break;
|
||||
case TextType.body1:
|
||||
style = isDark ? body1Style.copyWith(color: Colors.white) : body1Style;
|
||||
break;
|
||||
case TextType.body2:
|
||||
style = isDark
|
||||
? body2Style.copyWith(color: Colors.white.withOpacity(0.6))
|
||||
: body2Style;
|
||||
break;
|
||||
case TextType.small:
|
||||
style = isDark ? smallStyle.copyWith(color: Colors.white) : smallStyle;
|
||||
break;
|
||||
case TextType.onboardingTitle:
|
||||
style = isDark
|
||||
? onboardingTitle.copyWith(color: Colors.white)
|
||||
: onboardingTitle;
|
||||
break;
|
||||
case TextType.medium:
|
||||
style =
|
||||
isDark ? mediumStyle.copyWith(color: Colors.white) : mediumStyle;
|
||||
break;
|
||||
case TextType.buttonTitleText:
|
||||
style = !isDark
|
||||
? buttonTitleText.copyWith(color: Colors.white)
|
||||
: buttonTitleText;
|
||||
break;
|
||||
}
|
||||
if (this.style != null) {
|
||||
style = style.merge(this.style);
|
||||
}
|
||||
return Text(
|
||||
text!,
|
||||
style: style,
|
||||
maxLines: maxLines,
|
||||
overflow: overflow,
|
||||
softWrap: softWrap,
|
||||
textAlign: textAlign,
|
||||
);
|
||||
}
|
||||
}
|
|
@ -2,7 +2,6 @@ import 'dart:async';
|
|||
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:selfprivacy/ui/components/brand_text/brand_text.dart';
|
||||
import 'package:selfprivacy/utils/named_font_weight.dart';
|
||||
|
||||
class BrandTimer extends StatefulWidget {
|
||||
|
@ -52,11 +51,12 @@ class _BrandTimerState extends State<BrandTimer> {
|
|||
}
|
||||
|
||||
@override
|
||||
Widget build(final BuildContext context) => BrandText.medium(
|
||||
_timeString,
|
||||
style: const TextStyle(
|
||||
fontWeight: NamedFontWeight.demiBold,
|
||||
),
|
||||
Widget build(final BuildContext context) => Text(
|
||||
_timeString ?? '',
|
||||
style: Theme.of(context).textTheme.bodyMedium?.copyWith(
|
||||
fontWeight: NamedFontWeight.demiBold,
|
||||
color: Theme.of(context).colorScheme.onSurface,
|
||||
),
|
||||
);
|
||||
|
||||
void _getTime() {
|
||||
|
|
|
@ -1,7 +1,4 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:selfprivacy/ui/components/brand_text/brand_text.dart';
|
||||
|
||||
enum BrandButtonTypes { rised, text, iconText }
|
||||
|
||||
class BrandButton {
|
||||
static ConstrainedBox rised({
|
||||
|
@ -58,53 +55,4 @@ class BrandButton {
|
|||
),
|
||||
child: TextButton(onPressed: onPressed, child: Text(title)),
|
||||
);
|
||||
|
||||
static IconTextButton emptyWithIconText({
|
||||
required final VoidCallback onPressed,
|
||||
required final String title,
|
||||
required final Icon icon,
|
||||
final Key? key,
|
||||
}) =>
|
||||
IconTextButton(
|
||||
key: key,
|
||||
title: title,
|
||||
onPressed: onPressed,
|
||||
icon: icon,
|
||||
);
|
||||
}
|
||||
|
||||
class IconTextButton extends StatelessWidget {
|
||||
const IconTextButton({
|
||||
super.key,
|
||||
this.onPressed,
|
||||
this.title,
|
||||
this.icon,
|
||||
});
|
||||
|
||||
final VoidCallback? onPressed;
|
||||
final String? title;
|
||||
final Icon? icon;
|
||||
|
||||
@override
|
||||
Widget build(final BuildContext context) => Material(
|
||||
color: Colors.transparent,
|
||||
child: InkWell(
|
||||
onTap: onPressed,
|
||||
child: Container(
|
||||
height: 48,
|
||||
width: double.infinity,
|
||||
alignment: Alignment.center,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
BrandText.body1(title),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(12.0),
|
||||
child: icon,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
|
@ -1,7 +1,8 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
class ActionButton extends StatelessWidget {
|
||||
const ActionButton({
|
||||
/// Basically a [TextButton] to be used in dialogs
|
||||
class DialogActionButton extends StatelessWidget {
|
||||
const DialogActionButton({
|
||||
super.key,
|
||||
this.text,
|
||||
this.onPressed,
|
|
@ -1,6 +1,16 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
/// For some reason original [SegmentedButton] does not have animations.
|
||||
///
|
||||
/// The [SegmentedButtons] was written for SelfPrivacy before [SegmentedButton] was introduced.
|
||||
/// While it doesn't have that much options to pass, it has cute little animation.
|
||||
/// It is based on [ToggleButtons].
|
||||
class SegmentedButtons extends StatelessWidget {
|
||||
/// Creates a segmented buttons widget. This is a SelfPrivacy implementation.
|
||||
///
|
||||
/// Provide the button titles in [titles] as a [List<String>].
|
||||
/// Current selection is provided in [isSelected] as a [List<bool>].
|
||||
/// This widget will call [onPressed] with the index of the button that was pressed.
|
||||
const SegmentedButtons({
|
||||
required this.isSelected,
|
||||
required this.onPressed,
|
||||
|
@ -8,15 +18,24 @@ class SegmentedButtons extends StatelessWidget {
|
|||
super.key,
|
||||
});
|
||||
|
||||
/// The current selection state of the buttons.
|
||||
///
|
||||
/// The length of this list must be equal to the length of [titles].
|
||||
/// Several buttons can be selected at the same time.
|
||||
final List<bool> isSelected;
|
||||
|
||||
/// The callback that is called when a button is pressed.
|
||||
/// It will be called with the index of the button that was pressed.
|
||||
final Function(int)? onPressed;
|
||||
|
||||
/// The titles of the buttons.
|
||||
final List<String> titles;
|
||||
|
||||
@override
|
||||
Widget build(final BuildContext context) => LayoutBuilder(
|
||||
builder: (final context, final constraints) => ToggleButtons(
|
||||
constraints: BoxConstraints(
|
||||
minWidth: (constraints.maxWidth - 8) / 3,
|
||||
minWidth: (constraints.maxWidth - 8) / titles.length,
|
||||
minHeight: 40 + Theme.of(context).visualDensity.vertical * 4,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(48),
|
|
@ -6,10 +6,9 @@ import 'package:selfprivacy/logic/cubit/client_jobs/client_jobs_cubit.dart';
|
|||
import 'package:selfprivacy/logic/cubit/server_installation/server_installation_cubit.dart';
|
||||
import 'package:selfprivacy/logic/cubit/server_jobs/server_jobs_cubit.dart';
|
||||
import 'package:selfprivacy/logic/models/json/server_job.dart';
|
||||
import 'package:selfprivacy/ui/components/brand_button/brand_button.dart';
|
||||
import 'package:selfprivacy/ui/components/buttons/brand_button.dart';
|
||||
import 'package:selfprivacy/ui/components/brand_cards/brand_cards.dart';
|
||||
import 'package:selfprivacy/ui/components/brand_loader/brand_loader.dart';
|
||||
import 'package:selfprivacy/ui/components/brand_text/brand_text.dart';
|
||||
import 'package:selfprivacy/ui/components/jobs_content/server_job_card.dart';
|
||||
import 'package:selfprivacy/ui/helpers/modals.dart';
|
||||
|
||||
|
@ -32,7 +31,12 @@ class JobsContent extends StatelessWidget {
|
|||
if (state is JobsStateEmpty) {
|
||||
widgets = [
|
||||
const SizedBox(height: 80),
|
||||
Center(child: BrandText.body1('jobs.empty'.tr())),
|
||||
Center(
|
||||
child: Text(
|
||||
'jobs.empty'.tr(),
|
||||
style: Theme.of(context).textTheme.bodyLarge,
|
||||
),
|
||||
),
|
||||
];
|
||||
|
||||
if (installationState is ServerInstallationFinished) {
|
||||
|
@ -109,8 +113,9 @@ class JobsContent extends StatelessWidget {
|
|||
children: [
|
||||
const SizedBox(height: 15),
|
||||
Center(
|
||||
child: BrandText.h2(
|
||||
child: Text(
|
||||
'jobs.title'.tr(),
|
||||
style: Theme.of(context).textTheme.headlineSmall,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:selfprivacy/config/brand_colors.dart';
|
||||
import 'package:selfprivacy/config/text_themes.dart';
|
||||
import 'package:selfprivacy/logic/cubit/app_settings/app_settings_cubit.dart';
|
||||
|
||||
class ProgressBar extends StatefulWidget {
|
||||
|
@ -65,7 +64,7 @@ class _ProgressBarState extends State<ProgressBar> {
|
|||
Container(
|
||||
alignment: Alignment.centerLeft,
|
||||
decoration: BoxDecoration(
|
||||
color: BrandColors.gray4,
|
||||
color: const Color(0xFFDDDDDD),
|
||||
borderRadius: BorderRadius.circular(5),
|
||||
),
|
||||
child: LayoutBuilder(
|
||||
|
@ -119,3 +118,13 @@ class _ProgressBarState extends State<ProgressBar> {
|
|||
);
|
||||
}
|
||||
}
|
||||
|
||||
const TextStyle progressTextStyleLight = TextStyle(
|
||||
fontSize: 11,
|
||||
color: Colors.black,
|
||||
height: 1.7,
|
||||
);
|
||||
|
||||
final TextStyle progressTextStyleDark = progressTextStyleLight.copyWith(
|
||||
color: Colors.white,
|
||||
);
|
||||
|
|
|
@ -1,36 +0,0 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:selfprivacy/config/brand_colors.dart';
|
||||
|
||||
// TODO: Delete this file.
|
||||
|
||||
class SwitcherBlock extends StatelessWidget {
|
||||
const SwitcherBlock({
|
||||
required this.child,
|
||||
required this.isActive,
|
||||
required this.onChange,
|
||||
super.key,
|
||||
});
|
||||
|
||||
final Widget child;
|
||||
final bool isActive;
|
||||
final ValueChanged<bool> onChange;
|
||||
|
||||
@override
|
||||
Widget build(final BuildContext context) => Container(
|
||||
padding: const EdgeInsets.symmetric(vertical: 16),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Flexible(child: child),
|
||||
const SizedBox(width: 5),
|
||||
Switch(
|
||||
activeColor: BrandColors.green1,
|
||||
activeTrackColor: BrandColors.green2,
|
||||
onChanged: onChange,
|
||||
value: isActive,
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
|
@ -2,7 +2,7 @@ import 'package:easy_localization/easy_localization.dart';
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:modal_bottom_sheet/modal_bottom_sheet.dart';
|
||||
import 'package:selfprivacy/config/get_it_config.dart';
|
||||
import 'package:selfprivacy/ui/components/action_button/action_button.dart';
|
||||
import 'package:selfprivacy/ui/components/buttons/dialog_action_button.dart';
|
||||
import 'package:selfprivacy/ui/components/brand_alert/brand_alert.dart';
|
||||
|
||||
Future<T?> showBrandBottomSheet<T>({
|
||||
|
@ -30,12 +30,12 @@ void showPopUpAlert({
|
|||
title: alertTitle ?? 'basis.alert'.tr(),
|
||||
contentText: description,
|
||||
actions: [
|
||||
ActionButton(
|
||||
DialogActionButton(
|
||||
text: actionButtonTitle,
|
||||
isRed: true,
|
||||
onPressed: actionButtonOnPressed,
|
||||
),
|
||||
ActionButton(
|
||||
DialogActionButton(
|
||||
text: cancelButtonTitle ?? 'basis.cancel'.tr(),
|
||||
onPressed: cancelButtonOnPressed,
|
||||
),
|
||||
|
|
|
@ -5,11 +5,10 @@ import 'package:selfprivacy/logic/cubit/server_installation/server_installation_
|
|||
import 'package:selfprivacy/logic/cubit/backups/backups_cubit.dart';
|
||||
import 'package:selfprivacy/logic/models/json/backup.dart';
|
||||
import 'package:selfprivacy/logic/models/state_types.dart';
|
||||
import 'package:selfprivacy/ui/components/brand_button/brand_button.dart';
|
||||
import 'package:selfprivacy/ui/components/buttons/brand_button.dart';
|
||||
import 'package:selfprivacy/ui/components/brand_cards/outlined_card.dart';
|
||||
import 'package:selfprivacy/ui/layouts/brand_hero_screen.dart';
|
||||
import 'package:selfprivacy/ui/components/brand_icons/brand_icons.dart';
|
||||
import 'package:selfprivacy/ui/components/brand_text/brand_text.dart';
|
||||
import 'package:selfprivacy/ui/helpers/modals.dart';
|
||||
|
||||
GlobalKey<NavigatorState> navigatorKey = GlobalKey<NavigatorState>();
|
||||
|
@ -59,7 +58,10 @@ class _BackupDetailsPageState extends State<BackupDetailsPage>
|
|||
text: 'backup.initialize'.tr(),
|
||||
),
|
||||
if (backupStatus == BackupStatusEnum.initializing)
|
||||
BrandText.body1('backup.waiting_for_rebuild'.tr()),
|
||||
Text(
|
||||
'backup.waiting_for_rebuild'.tr(),
|
||||
style: Theme.of(context).textTheme.bodyMedium,
|
||||
),
|
||||
if (backupStatus != BackupStatusEnum.initializing &&
|
||||
backupStatus != BackupStatusEnum.noKey)
|
||||
OutlinedCard(
|
||||
|
@ -229,7 +231,10 @@ class _BackupDetailsPageState extends State<BackupDetailsPage>
|
|||
),
|
||||
),
|
||||
if (backupStatus == BackupStatusEnum.error)
|
||||
BrandText.body1(backupError.toString()),
|
||||
Text(
|
||||
backupError.toString(),
|
||||
style: Theme.of(context).textTheme.bodyMedium,
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@ import 'package:easy_localization/easy_localization.dart';
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:selfprivacy/logic/cubit/devices/devices_cubit.dart';
|
||||
import 'package:selfprivacy/logic/cubit/server_installation/server_installation_cubit.dart';
|
||||
import 'package:selfprivacy/ui/components/brand_button/brand_button.dart';
|
||||
import 'package:selfprivacy/ui/components/buttons/brand_button.dart';
|
||||
import 'package:selfprivacy/ui/layouts/brand_hero_screen.dart';
|
||||
|
||||
class NewDeviceScreen extends StatelessWidget {
|
||||
|
|
|
@ -3,7 +3,6 @@ import 'package:flutter/material.dart';
|
|||
import 'package:selfprivacy/logic/api_maps/graphql_maps/server_api/server_api.dart';
|
||||
import 'package:selfprivacy/logic/cubit/server_installation/server_installation_cubit.dart';
|
||||
import 'package:selfprivacy/ui/components/brand_md/brand_md.dart';
|
||||
import 'package:selfprivacy/ui/components/brand_text/brand_text.dart';
|
||||
import 'package:package_info/package_info.dart';
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:selfprivacy/ui/layouts/brand_hero_screen.dart';
|
||||
|
@ -25,17 +24,19 @@ class AboutApplicationPage extends StatelessWidget {
|
|||
children: [
|
||||
FutureBuilder(
|
||||
future: _packageVersion(),
|
||||
builder: (final context, final snapshot) => BrandText.body1(
|
||||
builder: (final context, final snapshot) => Text(
|
||||
'about_application_page.application_version_text'
|
||||
.tr(args: [snapshot.data.toString()]),
|
||||
style: Theme.of(context).textTheme.bodyLarge,
|
||||
),
|
||||
),
|
||||
if (isReady)
|
||||
FutureBuilder(
|
||||
future: _apiVersion(),
|
||||
builder: (final context, final snapshot) => BrandText.body1(
|
||||
builder: (final context, final snapshot) => Text(
|
||||
'about_application_page.api_version_text'
|
||||
.tr(args: [snapshot.data.toString()]),
|
||||
style: Theme.of(context).textTheme.bodyLarge,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
|
|
|
@ -2,7 +2,7 @@ import 'package:auto_route/auto_route.dart';
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:selfprivacy/logic/cubit/app_settings/app_settings_cubit.dart';
|
||||
import 'package:selfprivacy/logic/cubit/server_installation/server_installation_cubit.dart';
|
||||
import 'package:selfprivacy/ui/components/action_button/action_button.dart';
|
||||
import 'package:selfprivacy/ui/components/buttons/dialog_action_button.dart';
|
||||
import 'package:selfprivacy/ui/components/brand_alert/brand_alert.dart';
|
||||
import 'package:selfprivacy/ui/layouts/brand_hero_screen.dart';
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
|
@ -84,7 +84,7 @@ class _AppSettingsPageState extends State<AppSettingsPage> {
|
|||
title: 'modals.are_you_sure'.tr(),
|
||||
contentText: 'modals.delete_server_volume'.tr(),
|
||||
actions: [
|
||||
ActionButton(
|
||||
DialogActionButton(
|
||||
text: 'modals.yes'.tr(),
|
||||
isRed: true,
|
||||
onPressed: () async {
|
||||
|
@ -104,7 +104,7 @@ class _AppSettingsPageState extends State<AppSettingsPage> {
|
|||
Navigator.of(context).pop();
|
||||
},
|
||||
),
|
||||
ActionButton(
|
||||
DialogActionButton(
|
||||
text: 'basis.cancel'.tr(),
|
||||
),
|
||||
],
|
||||
|
@ -129,7 +129,7 @@ class _ResetAppTile extends StatelessWidget {
|
|||
title: 'modals.are_you_sure'.tr(),
|
||||
contentText: 'modals.purge_all_keys'.tr(),
|
||||
actions: [
|
||||
ActionButton(
|
||||
DialogActionButton(
|
||||
text: 'modals.purge_all_keys_confirm'.tr(),
|
||||
isRed: true,
|
||||
onPressed: () {
|
||||
|
@ -137,7 +137,7 @@ class _ResetAppTile extends StatelessWidget {
|
|||
Navigator.of(context).pop();
|
||||
},
|
||||
),
|
||||
ActionButton(
|
||||
DialogActionButton(
|
||||
text: 'basis.cancel'.tr(),
|
||||
),
|
||||
],
|
||||
|
|
|
@ -77,8 +77,11 @@ class _ConsolePageState extends State<ConsolePage> {
|
|||
'${message.timeString}${isError ? '(Error)' : ''}: \n',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color:
|
||||
isError ? BrandColors.red1 : null,
|
||||
color: isError
|
||||
? Theme.of(context)
|
||||
.colorScheme
|
||||
.error
|
||||
: null,
|
||||
),
|
||||
),
|
||||
TextSpan(text: message.text),
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import 'package:auto_route/auto_route.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:selfprivacy/logic/cubit/app_settings/app_settings_cubit.dart';
|
||||
import 'package:selfprivacy/ui/components/brand_button/brand_button.dart';
|
||||
import 'package:selfprivacy/ui/components/buttons/brand_button.dart';
|
||||
import 'package:selfprivacy/ui/router/router.dart';
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ import 'package:selfprivacy/config/get_it_config.dart';
|
|||
import 'package:selfprivacy/logic/common_enum/common_enum.dart';
|
||||
import 'package:selfprivacy/logic/cubit/recovery_key/recovery_key_cubit.dart';
|
||||
import 'package:selfprivacy/logic/cubit/server_installation/server_installation_cubit.dart';
|
||||
import 'package:selfprivacy/ui/components/brand_button/brand_button.dart';
|
||||
import 'package:selfprivacy/ui/components/buttons/brand_button.dart';
|
||||
import 'package:selfprivacy/ui/components/brand_cards/filled_card.dart';
|
||||
import 'package:selfprivacy/ui/layouts/brand_hero_screen.dart';
|
||||
import 'package:selfprivacy/ui/pages/recovery_key/recovery_key_receiving.dart';
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:selfprivacy/ui/components/brand_button/brand_button.dart';
|
||||
import 'package:selfprivacy/ui/components/buttons/brand_button.dart';
|
||||
import 'package:selfprivacy/ui/layouts/brand_hero_screen.dart';
|
||||
import 'package:selfprivacy/ui/components/info_box/info_box.dart';
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@ import 'package:auto_route/auto_route.dart';
|
|||
import 'package:cubit_form/cubit_form.dart';
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:selfprivacy/config/brand_colors.dart';
|
||||
import 'package:selfprivacy/logic/common_enum/common_enum.dart';
|
||||
import 'package:selfprivacy/logic/cubit/client_jobs/client_jobs_cubit.dart';
|
||||
import 'package:selfprivacy/logic/cubit/metrics/metrics_cubit.dart';
|
||||
|
@ -11,18 +10,17 @@ import 'package:selfprivacy/logic/cubit/server_installation/server_installation_
|
|||
import 'package:selfprivacy/logic/cubit/server_volumes/server_volume_cubit.dart';
|
||||
import 'package:selfprivacy/logic/models/auto_upgrade_settings.dart';
|
||||
import 'package:selfprivacy/logic/models/job.dart';
|
||||
import 'package:selfprivacy/ui/components/brand_button/segmented_buttons.dart';
|
||||
import 'package:selfprivacy/ui/components/buttons/segmented_buttons.dart';
|
||||
import 'package:selfprivacy/ui/components/brand_cards/filled_card.dart';
|
||||
import 'package:selfprivacy/ui/layouts/brand_hero_screen.dart';
|
||||
import 'package:selfprivacy/ui/components/brand_icons/brand_icons.dart';
|
||||
import 'package:selfprivacy/ui/components/brand_loader/brand_loader.dart';
|
||||
import 'package:selfprivacy/ui/components/brand_text/brand_text.dart';
|
||||
import 'package:selfprivacy/ui/components/list_tiles/list_tile_on_surface_variant.dart';
|
||||
import 'package:selfprivacy/ui/pages/server_details/charts/cpu_chart.dart';
|
||||
import 'package:selfprivacy/ui/pages/server_details/charts/network_charts.dart';
|
||||
import 'package:selfprivacy/ui/pages/server_storage/storage_card.dart';
|
||||
import 'package:selfprivacy/utils/breakpoints.dart';
|
||||
import 'package:selfprivacy/utils/extensions/duration.dart';
|
||||
import 'package:selfprivacy/utils/named_font_weight.dart';
|
||||
import 'package:selfprivacy/utils/route_transitions/basic.dart';
|
||||
import 'package:timezone/timezone.dart';
|
||||
|
||||
|
|
|
@ -23,15 +23,13 @@ class _TextDetails extends StatelessWidget {
|
|||
),
|
||||
),
|
||||
),
|
||||
...details.metadata
|
||||
.map(
|
||||
(final metadata) => ListTileOnSurfaceVariant(
|
||||
leadingIcon: metadata.type.icon,
|
||||
title: metadata.name,
|
||||
subtitle: metadata.value,
|
||||
),
|
||||
)
|
||||
.toList(),
|
||||
...details.metadata.map(
|
||||
(final metadata) => ListTileOnSurfaceVariant(
|
||||
leadingIcon: metadata.type.icon,
|
||||
title: metadata.name,
|
||||
subtitle: metadata.value,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
@ -39,24 +37,6 @@ class _TextDetails extends StatelessWidget {
|
|||
throw Exception('wrong state');
|
||||
}
|
||||
}
|
||||
|
||||
Widget getRowTitle(final String title) => Padding(
|
||||
padding: const EdgeInsets.only(right: 10),
|
||||
child: BrandText.h5(
|
||||
title,
|
||||
textAlign: TextAlign.right,
|
||||
),
|
||||
);
|
||||
|
||||
Widget getRowValue(final String title, {final bool isBold = false}) =>
|
||||
BrandText.body1(
|
||||
title,
|
||||
style: isBold
|
||||
? const TextStyle(
|
||||
fontWeight: NamedFontWeight.demiBold,
|
||||
)
|
||||
: null,
|
||||
);
|
||||
}
|
||||
|
||||
class _TempMessage extends StatelessWidget {
|
||||
|
@ -69,7 +49,10 @@ class _TempMessage extends StatelessWidget {
|
|||
Widget build(final BuildContext context) => SizedBox(
|
||||
height: MediaQuery.of(context).size.height - 100,
|
||||
child: Center(
|
||||
child: BrandText.body2(message),
|
||||
child: Text(
|
||||
message,
|
||||
style: Theme.of(context).textTheme.bodyMedium,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
|
@ -57,66 +57,72 @@ class _SelectTimezoneState extends State<SelectTimezone> {
|
|||
}
|
||||
|
||||
@override
|
||||
Widget build(final BuildContext context) => Scaffold(
|
||||
appBar: AppBar(
|
||||
title: isSearching
|
||||
? TextField(
|
||||
readOnly: false,
|
||||
textAlign: TextAlign.start,
|
||||
textInputAction: TextInputAction.next,
|
||||
enabled: true,
|
||||
controller: searchController,
|
||||
decoration: InputDecoration(
|
||||
errorText: null,
|
||||
hintText: 'server.timezone_search_bar'.tr(),
|
||||
),
|
||||
)
|
||||
: Padding(
|
||||
padding: const EdgeInsets.only(top: 4.0),
|
||||
child: Text('server.select_timezone'.tr()),
|
||||
Widget build(final BuildContext context) {
|
||||
final isDesktop = Breakpoints.mediumAndUp.isActive(context);
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
automaticallyImplyLeading: false,
|
||||
title: (isDesktop || isSearching)
|
||||
? TextField(
|
||||
readOnly: false,
|
||||
textAlign: TextAlign.start,
|
||||
textInputAction: TextInputAction.next,
|
||||
enabled: true,
|
||||
controller: searchController,
|
||||
decoration: InputDecoration(
|
||||
errorText: null,
|
||||
hintText: 'server.timezone_search_bar'.tr(),
|
||||
),
|
||||
leading: IconButton(
|
||||
icon: const Icon(Icons.arrow_back),
|
||||
onPressed: isSearching
|
||||
? () => setState(() => isSearching = false)
|
||||
: () => Navigator.of(context).pop(),
|
||||
),
|
||||
actions: [
|
||||
if (!isSearching)
|
||||
IconButton(
|
||||
icon: const Icon(Icons.search),
|
||||
onPressed: () => setState(() => isSearching = true),
|
||||
)
|
||||
: Padding(
|
||||
padding: const EdgeInsets.only(top: 4.0),
|
||||
child: Text('server.select_timezone'.tr()),
|
||||
),
|
||||
],
|
||||
leading: !isDesktop
|
||||
? IconButton(
|
||||
icon: const Icon(Icons.arrow_back),
|
||||
onPressed: isSearching
|
||||
? () => setState(() => isSearching = false)
|
||||
: () => Navigator.of(context).pop(),
|
||||
)
|
||||
: null,
|
||||
actions: [
|
||||
if (!isSearching && !isDesktop)
|
||||
IconButton(
|
||||
icon: const Icon(Icons.search),
|
||||
onPressed: () => setState(() => isSearching = true),
|
||||
),
|
||||
],
|
||||
),
|
||||
body: SafeArea(
|
||||
child: ListView(
|
||||
controller: scrollController,
|
||||
children: locations
|
||||
.where(
|
||||
(final Location location) => timezoneFilterValue == null
|
||||
? true
|
||||
: location.name
|
||||
.toLowerCase()
|
||||
.contains(timezoneFilterValue!) ||
|
||||
Duration(
|
||||
milliseconds: location.currentTimeZone.offset,
|
||||
)
|
||||
.toDayHourMinuteFormat()
|
||||
.contains(timezoneFilterValue!),
|
||||
)
|
||||
.toList()
|
||||
.asMap()
|
||||
.map(
|
||||
(final key, final value) => locationToListTile(key, value),
|
||||
)
|
||||
.values
|
||||
.toList(),
|
||||
),
|
||||
body: SafeArea(
|
||||
child: ListView(
|
||||
controller: scrollController,
|
||||
children: locations
|
||||
.where(
|
||||
(final Location location) => timezoneFilterValue == null
|
||||
? true
|
||||
: location.name
|
||||
.toLowerCase()
|
||||
.contains(timezoneFilterValue!) ||
|
||||
Duration(
|
||||
milliseconds: location.currentTimeZone.offset,
|
||||
)
|
||||
.toDayHourMinuteFormat()
|
||||
.contains(timezoneFilterValue!),
|
||||
)
|
||||
.toList()
|
||||
.asMap()
|
||||
.map(
|
||||
(final key, final value) => locationToListTile(key, value),
|
||||
)
|
||||
.values
|
||||
.toList(),
|
||||
),
|
||||
),
|
||||
);
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
MapEntry<int, Container> locationToListTile(
|
||||
MapEntry<int, ListTile> locationToListTile(
|
||||
final int key,
|
||||
final Location location,
|
||||
) {
|
||||
|
@ -126,46 +132,19 @@ class _SelectTimezoneState extends State<SelectTimezone> {
|
|||
|
||||
return MapEntry(
|
||||
key,
|
||||
Container(
|
||||
height: 75,
|
||||
padding: const EdgeInsets.symmetric(horizontal: 20),
|
||||
decoration: const BoxDecoration(
|
||||
border: Border(
|
||||
bottom: BorderSide(
|
||||
color: BrandColors.dividerColor,
|
||||
),
|
||||
),
|
||||
ListTile(
|
||||
title: Text(
|
||||
location.name,
|
||||
),
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
context.read<ServerDetailsCubit>().repository.setTimezone(
|
||||
location.name,
|
||||
);
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
child: Container(
|
||||
padding: const EdgeInsets.symmetric(vertical: 16),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
BrandText.body1(
|
||||
location.name,
|
||||
style: const TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
BrandText.small(
|
||||
'GMT ${duration.toDayHourMinuteFormat()} ${area.isNotEmpty ? '($area)' : ''}',
|
||||
style: const TextStyle(
|
||||
fontSize: 13,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
subtitle: Text(
|
||||
'GMT ${duration.toDayHourMinuteFormat()} ${area.isNotEmpty ? '($area)' : ''}',
|
||||
),
|
||||
onTap: () {
|
||||
context.read<ServerDetailsCubit>().repository.setTimezone(
|
||||
location.name,
|
||||
);
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@ import 'package:easy_localization/easy_localization.dart';
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:selfprivacy/logic/cubit/server_jobs/server_jobs_cubit.dart';
|
||||
import 'package:selfprivacy/logic/models/json/server_job.dart';
|
||||
import 'package:selfprivacy/ui/components/brand_button/brand_button.dart';
|
||||
import 'package:selfprivacy/ui/components/buttons/brand_button.dart';
|
||||
import 'package:selfprivacy/ui/layouts/brand_hero_screen.dart';
|
||||
import 'package:selfprivacy/ui/components/brand_linear_indicator/brand_linear_indicator.dart';
|
||||
import 'package:selfprivacy/ui/pages/root_route.dart';
|
||||
|
|
|
@ -6,7 +6,7 @@ import 'package:selfprivacy/logic/cubit/services/services_cubit.dart';
|
|||
import 'package:selfprivacy/logic/models/disk_size.dart';
|
||||
import 'package:selfprivacy/logic/models/service.dart';
|
||||
import 'package:selfprivacy/ui/components/brand_bottom_sheet/brand_bottom_sheet.dart';
|
||||
import 'package:selfprivacy/ui/components/brand_button/brand_button.dart';
|
||||
import 'package:selfprivacy/ui/components/buttons/brand_button.dart';
|
||||
import 'package:selfprivacy/ui/components/brand_header/brand_header.dart';
|
||||
import 'package:selfprivacy/ui/components/info_box/info_box.dart';
|
||||
import 'package:selfprivacy/logic/models/disk_status.dart';
|
||||
|
|
|
@ -6,7 +6,7 @@ import 'package:selfprivacy/logic/cubit/provider_volumes/provider_volume_cubit.d
|
|||
import 'package:selfprivacy/logic/cubit/server_volumes/server_volume_cubit.dart';
|
||||
import 'package:selfprivacy/logic/models/disk_size.dart';
|
||||
import 'package:selfprivacy/logic/models/price.dart';
|
||||
import 'package:selfprivacy/ui/components/brand_button/brand_button.dart';
|
||||
import 'package:selfprivacy/ui/components/buttons/brand_button.dart';
|
||||
import 'package:selfprivacy/ui/layouts/brand_hero_screen.dart';
|
||||
import 'package:selfprivacy/logic/models/disk_status.dart';
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ import 'package:flutter_svg/svg.dart';
|
|||
import 'package:selfprivacy/logic/cubit/server_installation/server_installation_cubit.dart';
|
||||
import 'package:selfprivacy/logic/cubit/services/services_cubit.dart';
|
||||
import 'package:selfprivacy/logic/models/service.dart';
|
||||
import 'package:selfprivacy/ui/components/brand_button/outlined_button.dart';
|
||||
import 'package:selfprivacy/ui/components/buttons/outlined_button.dart';
|
||||
import 'package:selfprivacy/ui/layouts/brand_hero_screen.dart';
|
||||
import 'package:selfprivacy/logic/models/disk_status.dart';
|
||||
import 'package:selfprivacy/ui/components/storage_list_items/server_storage_list_item.dart';
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import 'dart:async';
|
||||
|
||||
import 'package:auto_route/auto_route.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
|
@ -7,7 +9,6 @@ import 'package:selfprivacy/logic/cubit/services/services_cubit.dart';
|
|||
import 'package:selfprivacy/logic/models/service.dart';
|
||||
import 'package:selfprivacy/logic/models/state_types.dart';
|
||||
import 'package:selfprivacy/ui/components/brand_header/brand_header.dart';
|
||||
import 'package:selfprivacy/ui/components/brand_text/brand_text.dart';
|
||||
import 'package:selfprivacy/ui/components/icon_status_mask/icon_status_mask.dart';
|
||||
import 'package:selfprivacy/ui/components/not_ready_card/not_ready_card.dart';
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
|
@ -45,24 +46,25 @@ class _ServicesPageState extends State<ServicesPage> {
|
|||
: null,
|
||||
body: RefreshIndicator(
|
||||
onRefresh: () async {
|
||||
context.read<ServicesCubit>().reload();
|
||||
unawaited(context.read<ServicesCubit>().reload());
|
||||
},
|
||||
child: ListView(
|
||||
padding: paddingH15V0,
|
||||
children: [
|
||||
BrandText.body1('basis.services_title'.tr()),
|
||||
Text(
|
||||
'basis.services_title'.tr(),
|
||||
style: Theme.of(context).textTheme.bodyLarge,
|
||||
),
|
||||
const SizedBox(height: 24),
|
||||
if (!isReady) ...[const NotReadyCard(), const SizedBox(height: 24)],
|
||||
...services
|
||||
.map(
|
||||
(final service) => Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
bottom: 30,
|
||||
),
|
||||
child: _Card(service: service),
|
||||
),
|
||||
)
|
||||
.toList()
|
||||
...services.map(
|
||||
(final service) => Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
bottom: 30,
|
||||
),
|
||||
child: _Card(service: service),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
|
@ -106,8 +108,10 @@ class _Card extends StatelessWidget {
|
|||
child: InkResponse(
|
||||
highlightShape: BoxShape.rectangle,
|
||||
onTap: isReady
|
||||
? () => context.pushRoute(
|
||||
ServiceRoute(serviceId: service.id),
|
||||
? () => unawaited(
|
||||
context.pushRoute(
|
||||
ServiceRoute(serviceId: service.id),
|
||||
),
|
||||
)
|
||||
: null,
|
||||
child: Padding(
|
||||
|
@ -134,23 +138,17 @@ class _Card extends StatelessWidget {
|
|||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
const SizedBox(height: 10),
|
||||
BrandText.h2(service.displayName),
|
||||
const SizedBox(height: 10),
|
||||
const SizedBox(height: 12),
|
||||
Text(
|
||||
service.displayName,
|
||||
style: Theme.of(context).textTheme.headlineMedium,
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
if (service.url != '' && service.url != null)
|
||||
Column(
|
||||
children: [
|
||||
GestureDetector(
|
||||
onTap: () => launchURL(
|
||||
service.url,
|
||||
),
|
||||
child: Text(
|
||||
'${service.url}',
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).colorScheme.secondary,
|
||||
decoration: TextDecoration.underline,
|
||||
),
|
||||
),
|
||||
_ServiceLink(
|
||||
url: service.url ?? '',
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
],
|
||||
|
@ -158,19 +156,22 @@ class _Card extends StatelessWidget {
|
|||
if (service.id == 'mailserver')
|
||||
Column(
|
||||
children: [
|
||||
Text(
|
||||
domainName,
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).colorScheme.primary,
|
||||
decoration: TextDecoration.underline,
|
||||
),
|
||||
_ServiceLink(
|
||||
url: domainName,
|
||||
isActive: false,
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
],
|
||||
),
|
||||
BrandText.body2(service.loginInfo),
|
||||
Text(
|
||||
service.loginInfo,
|
||||
style: Theme.of(context).textTheme.bodyMedium,
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
BrandText.body2(service.description),
|
||||
Text(
|
||||
service.description,
|
||||
style: Theme.of(context).textTheme.bodyMedium,
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
],
|
||||
)
|
||||
|
@ -181,3 +182,29 @@ class _Card extends StatelessWidget {
|
|||
);
|
||||
}
|
||||
}
|
||||
|
||||
class _ServiceLink extends StatelessWidget {
|
||||
const _ServiceLink({
|
||||
required this.url,
|
||||
this.isActive = true,
|
||||
});
|
||||
|
||||
final String url;
|
||||
final bool isActive;
|
||||
|
||||
@override
|
||||
Widget build(final BuildContext context) => GestureDetector(
|
||||
onTap: isActive
|
||||
? () => launchURL(
|
||||
url,
|
||||
)
|
||||
: null,
|
||||
child: Text(
|
||||
url,
|
||||
style: Theme.of(context).textTheme.bodyMedium?.copyWith(
|
||||
color: Theme.of(context).colorScheme.primary,
|
||||
decoration: TextDecoration.underline,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import 'dart:async';
|
||||
|
||||
import 'package:auto_route/auto_route.dart';
|
||||
import 'package:cubit_form/cubit_form.dart';
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
|
@ -10,9 +12,8 @@ import 'package:selfprivacy/logic/cubit/forms/setup/initializing/dns_provider_fo
|
|||
import 'package:selfprivacy/logic/cubit/forms/setup/initializing/domain_setup_cubit.dart';
|
||||
import 'package:selfprivacy/logic/cubit/forms/setup/initializing/root_user_form_cubit.dart';
|
||||
import 'package:selfprivacy/logic/cubit/support_system/support_system_cubit.dart';
|
||||
import 'package:selfprivacy/ui/components/brand_button/brand_button.dart';
|
||||
import 'package:selfprivacy/ui/components/brand_button/outlined_button.dart';
|
||||
import 'package:selfprivacy/ui/components/brand_text/brand_text.dart';
|
||||
import 'package:selfprivacy/ui/components/buttons/brand_button.dart';
|
||||
import 'package:selfprivacy/ui/components/buttons/outlined_button.dart';
|
||||
import 'package:selfprivacy/ui/components/brand_timer/brand_timer.dart';
|
||||
import 'package:selfprivacy/ui/components/progress_bar/progress_bar.dart';
|
||||
import 'package:selfprivacy/ui/components/support_drawer/support_drawer.dart';
|
||||
|
@ -395,7 +396,10 @@ class InitializingPage extends StatelessWidget {
|
|||
color: Colors.white,
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
BrandText.buttonTitleText('domain.update_list'.tr()),
|
||||
Text(
|
||||
'domain.update_list'.tr(),
|
||||
style: Theme.of(context).textTheme.bodyLarge,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
@ -403,8 +407,8 @@ class InitializingPage extends StatelessWidget {
|
|||
if (state is Loaded) ...[
|
||||
const SizedBox(height: 32),
|
||||
BrandButton.filled(
|
||||
onPressed: () =>
|
||||
context.read<DomainSetupCubit>().saveDomain(),
|
||||
onPressed: () => unawaited(
|
||||
context.read<DomainSetupCubit>().saveDomain()),
|
||||
text: 'initializing.save_domain'.tr(),
|
||||
),
|
||||
],
|
||||
|
|
|
@ -6,8 +6,8 @@ import 'package:selfprivacy/logic/cubit/app_config_dependent/authentication_depe
|
|||
import 'package:selfprivacy/logic/cubit/forms/setup/initializing/provider_form_cubit.dart';
|
||||
import 'package:selfprivacy/logic/cubit/support_system/support_system_cubit.dart';
|
||||
import 'package:selfprivacy/logic/models/hive/server_details.dart';
|
||||
import 'package:selfprivacy/ui/components/brand_button/brand_button.dart';
|
||||
import 'package:selfprivacy/ui/components/brand_button/outlined_button.dart';
|
||||
import 'package:selfprivacy/ui/components/buttons/brand_button.dart';
|
||||
import 'package:selfprivacy/ui/components/buttons/outlined_button.dart';
|
||||
import 'package:selfprivacy/ui/components/brand_cards/outlined_card.dart';
|
||||
import 'package:selfprivacy/ui/components/info_box/info_box.dart';
|
||||
import 'package:selfprivacy/ui/layouts/responsive_layout_with_infobox.dart';
|
||||
|
|
|
@ -5,7 +5,7 @@ import 'package:selfprivacy/logic/cubit/app_config_dependent/authentication_depe
|
|||
import 'package:selfprivacy/logic/cubit/app_settings/app_settings_cubit.dart';
|
||||
import 'package:selfprivacy/logic/models/server_provider_location.dart';
|
||||
import 'package:selfprivacy/logic/models/server_type.dart';
|
||||
import 'package:selfprivacy/ui/components/brand_button/brand_button.dart';
|
||||
import 'package:selfprivacy/ui/components/buttons/brand_button.dart';
|
||||
import 'package:selfprivacy/ui/components/info_box/info_box.dart';
|
||||
import 'package:selfprivacy/ui/layouts/responsive_layout_with_infobox.dart';
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:selfprivacy/logic/cubit/forms/setup/recovering/recovery_device_form_cubit.dart';
|
||||
import 'package:selfprivacy/ui/components/brand_button/brand_button.dart';
|
||||
import 'package:selfprivacy/ui/components/buttons/brand_button.dart';
|
||||
import 'package:selfprivacy/ui/layouts/brand_hero_screen.dart';
|
||||
import 'package:selfprivacy/utils/route_transitions/basic.dart';
|
||||
import 'package:cubit_form/cubit_form.dart';
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:selfprivacy/logic/cubit/forms/setup/recovering/recovery_device_form_cubit.dart';
|
||||
import 'package:selfprivacy/ui/components/brand_button/brand_button.dart';
|
||||
import 'package:selfprivacy/ui/components/buttons/brand_button.dart';
|
||||
import 'package:selfprivacy/ui/layouts/brand_hero_screen.dart';
|
||||
import 'package:selfprivacy/ui/components/brand_md/brand_md.dart';
|
||||
import 'package:cubit_form/cubit_form.dart';
|
||||
|
|
|
@ -4,7 +4,7 @@ import 'package:flutter/material.dart';
|
|||
import 'package:selfprivacy/logic/cubit/forms/factories/field_cubit_factory.dart';
|
||||
import 'package:selfprivacy/logic/cubit/forms/setup/recovering/recovery_device_form_cubit.dart';
|
||||
import 'package:selfprivacy/logic/cubit/server_installation/server_installation_cubit.dart';
|
||||
import 'package:selfprivacy/ui/components/brand_button/brand_button.dart';
|
||||
import 'package:selfprivacy/ui/components/buttons/brand_button.dart';
|
||||
import 'package:selfprivacy/ui/layouts/brand_hero_screen.dart';
|
||||
|
||||
class RecoverByRecoveryKey extends StatelessWidget {
|
||||
|
|
|
@ -5,7 +5,7 @@ import 'package:selfprivacy/config/brand_theme.dart';
|
|||
import 'package:selfprivacy/logic/cubit/forms/setup/initializing/backblaze_form_cubit.dart';
|
||||
import 'package:selfprivacy/logic/cubit/server_installation/server_installation_cubit.dart';
|
||||
import 'package:selfprivacy/ui/components/brand_bottom_sheet/brand_bottom_sheet.dart';
|
||||
import 'package:selfprivacy/ui/components/brand_button/brand_button.dart';
|
||||
import 'package:selfprivacy/ui/components/buttons/brand_button.dart';
|
||||
import 'package:selfprivacy/ui/layouts/brand_hero_screen.dart';
|
||||
import 'package:selfprivacy/ui/components/brand_md/brand_md.dart';
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ import 'package:selfprivacy/config/brand_theme.dart';
|
|||
import 'package:selfprivacy/logic/cubit/forms/setup/initializing/dns_provider_form_cubit.dart';
|
||||
import 'package:selfprivacy/logic/cubit/server_installation/server_installation_cubit.dart';
|
||||
import 'package:selfprivacy/ui/components/brand_bottom_sheet/brand_bottom_sheet.dart';
|
||||
import 'package:selfprivacy/ui/components/brand_button/brand_button.dart';
|
||||
import 'package:selfprivacy/ui/components/buttons/brand_button.dart';
|
||||
import 'package:selfprivacy/ui/layouts/brand_hero_screen.dart';
|
||||
import 'package:selfprivacy/ui/components/brand_md/brand_md.dart';
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ import 'package:easy_localization/easy_localization.dart';
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:selfprivacy/logic/cubit/app_config_dependent/authentication_dependend_cubit.dart';
|
||||
import 'package:selfprivacy/logic/models/server_basic_info.dart';
|
||||
import 'package:selfprivacy/ui/components/brand_button/brand_button.dart';
|
||||
import 'package:selfprivacy/ui/components/buttons/brand_button.dart';
|
||||
import 'package:selfprivacy/ui/components/brand_cards/filled_card.dart';
|
||||
import 'package:selfprivacy/ui/layouts/brand_hero_screen.dart';
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ import 'package:easy_localization/easy_localization.dart';
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:selfprivacy/logic/cubit/server_installation/server_installation_cubit.dart';
|
||||
import 'package:selfprivacy/ui/components/brand_button/brand_button.dart';
|
||||
import 'package:selfprivacy/ui/components/buttons/brand_button.dart';
|
||||
import 'package:selfprivacy/ui/components/brand_cards/outlined_card.dart';
|
||||
import 'package:selfprivacy/ui/layouts/brand_hero_screen.dart';
|
||||
import 'package:selfprivacy/ui/pages/setup/recovering/recover_by_old_token.dart';
|
||||
|
|
|
@ -5,7 +5,7 @@ import 'package:flutter/material.dart';
|
|||
import 'package:selfprivacy/logic/cubit/server_installation/server_installation_cubit.dart';
|
||||
import 'package:selfprivacy/logic/cubit/forms/factories/field_cubit_factory.dart';
|
||||
import 'package:selfprivacy/logic/cubit/forms/setup/recovering/recovery_domain_form_cubit.dart';
|
||||
import 'package:selfprivacy/ui/components/brand_button/brand_button.dart';
|
||||
import 'package:selfprivacy/ui/components/buttons/brand_button.dart';
|
||||
import 'package:selfprivacy/ui/layouts/brand_hero_screen.dart';
|
||||
import 'package:selfprivacy/ui/pages/root_route.dart';
|
||||
import 'package:selfprivacy/ui/pages/setup/recovering/recover_by_old_token.dart';
|
||||
|
|
|
@ -3,7 +3,7 @@ import 'package:flutter/material.dart';
|
|||
import 'package:selfprivacy/config/brand_theme.dart';
|
||||
import 'package:selfprivacy/logic/cubit/forms/setup/initializing/provider_form_cubit.dart';
|
||||
import 'package:selfprivacy/ui/components/brand_bottom_sheet/brand_bottom_sheet.dart';
|
||||
import 'package:selfprivacy/ui/components/brand_button/brand_button.dart';
|
||||
import 'package:selfprivacy/ui/components/buttons/brand_button.dart';
|
||||
import 'package:selfprivacy/ui/layouts/brand_hero_screen.dart';
|
||||
import 'package:cubit_form/cubit_form.dart';
|
||||
import 'package:selfprivacy/logic/cubit/server_installation/server_installation_cubit.dart';
|
||||
|
|
|
@ -11,21 +11,25 @@ class _NoUsers extends StatelessWidget {
|
|||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
const Icon(BrandIcons.users, size: 50, color: BrandColors.grey7),
|
||||
Icon(
|
||||
BrandIcons.users,
|
||||
size: 50,
|
||||
color: Theme.of(context).colorScheme.onBackground,
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
BrandText.h2(
|
||||
Text(
|
||||
'users.nobody_here'.tr(),
|
||||
style: const TextStyle(
|
||||
color: BrandColors.grey7,
|
||||
),
|
||||
style: Theme.of(context).textTheme.headlineMedium?.copyWith(
|
||||
color: Theme.of(context).colorScheme.onBackground,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
BrandText.medium(
|
||||
Text(
|
||||
text,
|
||||
textAlign: TextAlign.center,
|
||||
style: const TextStyle(
|
||||
color: BrandColors.grey7,
|
||||
),
|
||||
style: Theme.of(context).textTheme.titleSmall?.copyWith(
|
||||
color: Theme.of(context).colorScheme.onBackground,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
@ -43,21 +47,25 @@ class _CouldNotLoadUsers extends StatelessWidget {
|
|||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
const Icon(BrandIcons.users, size: 50, color: BrandColors.grey7),
|
||||
Icon(
|
||||
BrandIcons.users,
|
||||
size: 50,
|
||||
color: Theme.of(context).colorScheme.onBackground,
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
BrandText.h2(
|
||||
Text(
|
||||
'users.could_not_fetch_users'.tr(),
|
||||
style: const TextStyle(
|
||||
color: BrandColors.grey7,
|
||||
),
|
||||
style: Theme.of(context).textTheme.headlineMedium?.copyWith(
|
||||
color: Theme.of(context).colorScheme.onBackground,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
BrandText.medium(
|
||||
Text(
|
||||
text,
|
||||
textAlign: TextAlign.center,
|
||||
style: const TextStyle(
|
||||
color: BrandColors.grey7,
|
||||
),
|
||||
style: Theme.of(context).textTheme.titleSmall?.copyWith(
|
||||
color: Theme.of(context).colorScheme.onBackground,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
|
|
@ -28,17 +28,17 @@ class _User extends StatelessWidget {
|
|||
),
|
||||
const SizedBox(width: 20),
|
||||
Flexible(
|
||||
child: isRootUser
|
||||
? BrandText.h4Underlined(user.login)
|
||||
// cross out text if user not found on server
|
||||
: BrandText.h4(
|
||||
user.login,
|
||||
style: user.isFoundOnServer
|
||||
? null
|
||||
: const TextStyle(
|
||||
decoration: TextDecoration.lineThrough,
|
||||
),
|
||||
child: Text(
|
||||
user.login,
|
||||
style: Theme.of(context).textTheme.titleMedium?.copyWith(
|
||||
color: Theme.of(context).colorScheme.onBackground,
|
||||
decoration: isRootUser
|
||||
? TextDecoration.underline
|
||||
: user.isFoundOnServer
|
||||
? TextDecoration.none
|
||||
: TextDecoration.lineThrough,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
|
|
@ -13,13 +13,12 @@ import 'package:selfprivacy/logic/cubit/users/users_cubit.dart';
|
|||
import 'package:selfprivacy/logic/models/job.dart';
|
||||
import 'package:selfprivacy/logic/models/hive/user.dart';
|
||||
import 'package:selfprivacy/ui/components/brand_bottom_sheet/brand_bottom_sheet.dart';
|
||||
import 'package:selfprivacy/ui/components/brand_button/brand_button.dart';
|
||||
import 'package:selfprivacy/ui/components/brand_button/outlined_button.dart';
|
||||
import 'package:selfprivacy/ui/components/buttons/brand_button.dart';
|
||||
import 'package:selfprivacy/ui/components/buttons/outlined_button.dart';
|
||||
import 'package:selfprivacy/ui/components/brand_cards/filled_card.dart';
|
||||
import 'package:selfprivacy/ui/components/brand_header/brand_header.dart';
|
||||
import 'package:selfprivacy/ui/layouts/brand_hero_screen.dart';
|
||||
import 'package:selfprivacy/ui/components/brand_icons/brand_icons.dart';
|
||||
import 'package:selfprivacy/ui/components/brand_text/brand_text.dart';
|
||||
import 'package:selfprivacy/ui/components/info_box/info_box.dart';
|
||||
import 'package:selfprivacy/ui/components/list_tiles/list_tile_on_surface_variant.dart';
|
||||
import 'package:selfprivacy/ui/components/not_ready_card/not_ready_card.dart';
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
extension TextExtension on Text {
|
||||
Text withColor(final Color color) => Text(
|
||||
|
|
Loading…
Reference in a new issue