Remove BrandDivider and use vanilla instead.

pull/116/head
Inex Code 2022-09-14 16:37:29 +03:00
parent c5eed6ace9
commit 7e10c1324c
6 changed files with 12 additions and 86 deletions

View File

@ -1,48 +0,0 @@
import 'package:flutter/material.dart';
import 'package:selfprivacy/ui/components/brand_divider/brand_divider.dart';
import 'package:selfprivacy/ui/components/brand_text/brand_text.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:selfprivacy/ui/components/pre_styled_buttons/pre_styled_buttons.dart';
class OnePage extends StatelessWidget {
const OnePage({
required this.title,
required this.child,
final super.key,
});
final String title;
final Widget child;
@override
Widget build(final BuildContext context) => Scaffold(
appBar: PreferredSize(
preferredSize: const Size.fromHeight(52),
child: Column(
children: [
Container(
height: 51,
alignment: Alignment.center,
padding: const EdgeInsets.symmetric(horizontal: 15),
child: BrandText.h4('basis.details'.tr()),
),
const BrandDivider(),
],
),
),
body: child,
bottomNavigationBar: SafeArea(
child: Container(
decoration: BoxDecoration(boxShadow: kElevationToShadow[3]),
height: kBottomNavigationBarHeight,
child: Container(
color: Theme.of(context).scaffoldBackgroundColor,
alignment: Alignment.center,
child: PreStyledButtons.close(
onPress: () => Navigator.of(context).pop(),
),
),
),
),
);
}

View File

@ -5,7 +5,6 @@ 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/brand_alert/brand_alert.dart';
import 'package:selfprivacy/ui/components/brand_divider/brand_divider.dart';
import 'package:selfprivacy/ui/components/brand_header/brand_header.dart';
import 'package:selfprivacy/ui/components/brand_switch/brand_switch.dart';
import 'package:selfprivacy/ui/components/brand_text/brand_text.dart';
@ -38,15 +37,9 @@ class _AppSettingsPageState extends State<AppSettingsPage> {
body: ListView(
padding: paddingH15V0,
children: [
const BrandDivider(),
const Divider(height: 1),
Container(
padding: const EdgeInsets.only(top: 20, bottom: 5),
decoration: const BoxDecoration(
border: Border(
bottom:
BorderSide(width: 1, color: BrandColors.dividerColor),
),
),
padding: const EdgeInsets.symmetric(vertical: 16),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
@ -68,14 +61,9 @@ class _AppSettingsPageState extends State<AppSettingsPage> {
],
),
),
const Divider(height: 0),
Container(
padding: const EdgeInsets.only(top: 20, bottom: 5),
decoration: const BoxDecoration(
border: Border(
bottom:
BorderSide(width: 1, color: BrandColors.dividerColor),
),
),
padding: const EdgeInsets.symmetric(vertical: 16),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
@ -127,7 +115,8 @@ class _AppSettingsPageState extends State<AppSettingsPage> {
],
),
),
deleteServer(context)
const Divider(height: 0),
_DeleteServer(context)
],
),
),
@ -135,16 +124,11 @@ class _AppSettingsPageState extends State<AppSettingsPage> {
);
}
Widget deleteServer(final BuildContext context) {
Widget _DeleteServer(final BuildContext context) {
final bool isDisabled =
context.watch<ServerInstallationCubit>().state.serverDetails == null;
return Container(
padding: const EdgeInsets.only(top: 20, bottom: 5),
decoration: const BoxDecoration(
border: Border(
bottom: BorderSide(width: 1, color: BrandColors.dividerColor),
),
),
padding: const EdgeInsets.symmetric(vertical: 16),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceBetween,

View File

@ -4,7 +4,6 @@ import 'package:flutter/material.dart';
import 'package:selfprivacy/config/brand_colors.dart';
import 'package:selfprivacy/config/get_it_config.dart';
import 'package:selfprivacy/logic/models/message.dart';
import 'package:selfprivacy/ui/components/brand_divider/brand_divider.dart';
import 'package:selfprivacy/ui/components/brand_header/brand_header.dart';
class Console extends StatefulWidget {
@ -37,8 +36,7 @@ class _ConsoleState extends State<Console> {
preferredSize: const Size.fromHeight(53),
child: Column(
children: const [
BrandHeader(title: 'Console', hasBackButton: true),
BrandDivider(),
BrandHeader(title: 'Console', hasBackButton: true)
],
),
),

View File

@ -1,7 +1,6 @@
import 'package:flutter/material.dart';
import 'package:selfprivacy/config/brand_theme.dart';
import 'package:selfprivacy/logic/api_maps/graphql_maps/server_api/server.dart';
import 'package:selfprivacy/ui/components/brand_divider/brand_divider.dart';
import 'package:selfprivacy/ui/components/brand_header/brand_header.dart';
import 'package:selfprivacy/ui/components/brand_text/brand_text.dart';
import 'package:package_info/package_info.dart';
@ -21,7 +20,6 @@ class InfoPage extends StatelessWidget {
body: ListView(
padding: paddingH15V0,
children: [
const BrandDivider(),
const SizedBox(height: 10),
FutureBuilder(
future: _packageVersion(),

View File

@ -8,7 +8,6 @@ import 'package:selfprivacy/logic/cubit/hetzner_metrics/hetzner_metrics_cubit.da
import 'package:selfprivacy/logic/cubit/server_detailed_info/server_detailed_info_cubit.dart';
import 'package:selfprivacy/logic/cubit/server_installation/server_installation_cubit.dart';
import 'package:selfprivacy/logic/models/state_types.dart';
import 'package:selfprivacy/ui/components/brand_divider/brand_divider.dart';
import 'package:selfprivacy/ui/components/brand_header/brand_header.dart';
import 'package:selfprivacy/ui/components/brand_icons/brand_icons.dart';
import 'package:selfprivacy/ui/components/brand_loader/brand_loader.dart';
@ -78,7 +77,6 @@ class _ServerDetailsScreenState extends State<ServerDetailsScreen>
padding: const EdgeInsets.symmetric(horizontal: 15),
child: BrandText.h4('basis.details'.tr()),
),
const BrandDivider(),
],
),
),

View File

@ -34,7 +34,6 @@ class _ServerSettings extends StatelessWidget {
],
),
),
const BrandDivider(),
SwitcherBlock(
onChange: (final _) {},
isActive: serverDetailsState.autoUpgradeSettings.enable,
@ -43,6 +42,7 @@ class _ServerSettings extends StatelessWidget {
value: 'providers.server.settings.allow_autoupgrade_hint'.tr(),
),
),
const Divider(height: 0),
SwitcherBlock(
onChange: (final _) {},
isActive: serverDetailsState.autoUpgradeSettings.allowReboot,
@ -51,6 +51,7 @@ class _ServerSettings extends StatelessWidget {
value: 'providers.server.settings.reboot_after_upgrade_hint'.tr(),
),
),
const Divider(height: 0),
_Button(
onTap: () {
Navigator.of(context).push(materialRoute(const SelectTimezone()));
@ -78,12 +79,7 @@ class _Button extends StatelessWidget {
Widget build(final BuildContext context) => InkWell(
onTap: onTap,
child: Container(
padding: const EdgeInsets.only(top: 20, bottom: 5),
decoration: const BoxDecoration(
border: Border(
bottom: BorderSide(width: 1, color: BrandColors.dividerColor),
),
),
padding: const EdgeInsets.symmetric(vertical: 16),
child: child,
),
);