2020-12-02 09:16:23 +00:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:selfprivacy/config/brand_colors.dart';
|
|
|
|
import 'package:selfprivacy/config/brand_theme.dart';
|
|
|
|
import 'package:selfprivacy/ui/components/brand_divider/brand_divider.dart';
|
|
|
|
import 'package:selfprivacy/ui/components/brand_header/brand_header.dart';
|
2020-12-08 19:26:51 +00:00
|
|
|
import 'package:selfprivacy/ui/components/brand_text/brand_text.dart';
|
2020-12-06 07:46:12 +00:00
|
|
|
import 'package:selfprivacy/ui/components/switch_block/switch_bloc.dart';
|
2020-12-02 09:16:23 +00:00
|
|
|
|
|
|
|
class SettingsPage extends StatelessWidget {
|
|
|
|
const SettingsPage({Key key}) : super(key: key);
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
2020-12-10 20:33:19 +00:00
|
|
|
return ListView(
|
|
|
|
padding: brandPagePadding2,
|
|
|
|
children: [
|
|
|
|
SizedBox(height: 10),
|
|
|
|
BrandHeader(title: 'Настройки', hasBackButton: true),
|
|
|
|
BrandDivider(),
|
|
|
|
SwitcherBlock(
|
|
|
|
onChange: (_) {},
|
|
|
|
child: _TextColumn(
|
|
|
|
title: 'Allow Auto-upgrade',
|
|
|
|
value: 'Wether to allow automatic packages upgrades',
|
|
|
|
),
|
|
|
|
isActive: true,
|
2020-12-03 16:52:53 +00:00
|
|
|
),
|
2020-12-10 20:33:19 +00:00
|
|
|
SwitcherBlock(
|
|
|
|
onChange: (_) {},
|
|
|
|
child: _TextColumn(
|
|
|
|
title: 'Reboot after upgrade',
|
|
|
|
value: 'Reboot without prompt after applying updates',
|
|
|
|
),
|
|
|
|
isActive: false,
|
2020-12-02 09:16:23 +00:00
|
|
|
),
|
2020-12-10 20:33:19 +00:00
|
|
|
_Button(
|
|
|
|
onTap: () {},
|
|
|
|
child: _TextColumn(
|
|
|
|
title: 'Server Timezone',
|
|
|
|
value: 'Europe/Kyiv',
|
|
|
|
),
|
|
|
|
),
|
|
|
|
_Button(
|
|
|
|
onTap: () {},
|
|
|
|
child: _TextColumn(
|
|
|
|
title: 'Server Locale',
|
|
|
|
value: 'Default',
|
|
|
|
),
|
|
|
|
),
|
|
|
|
_Button(
|
|
|
|
onTap: () {},
|
|
|
|
child: _TextColumn(
|
|
|
|
hasWarning: true,
|
|
|
|
title: 'Factory Reset',
|
|
|
|
value: 'Restore default settings on your server',
|
|
|
|
),
|
|
|
|
)
|
|
|
|
],
|
2020-12-02 09:16:23 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class _Button extends StatelessWidget {
|
|
|
|
const _Button({
|
|
|
|
Key key,
|
|
|
|
@required this.onTap,
|
|
|
|
@required this.child,
|
|
|
|
}) : super(key: key);
|
|
|
|
|
|
|
|
final Widget child;
|
|
|
|
final VoidCallback onTap;
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return InkWell(
|
|
|
|
onTap: onTap,
|
|
|
|
child: Container(
|
|
|
|
padding: EdgeInsets.only(top: 20, bottom: 5),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
border: Border(
|
|
|
|
bottom: BorderSide(width: 1, color: BrandColors.dividerColor),
|
|
|
|
)),
|
|
|
|
child: child,
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class _TextColumn extends StatelessWidget {
|
|
|
|
const _TextColumn({
|
|
|
|
Key key,
|
|
|
|
@required this.title,
|
|
|
|
@required this.value,
|
|
|
|
this.hasWarning = false,
|
|
|
|
}) : super(key: key);
|
|
|
|
|
|
|
|
final String title;
|
|
|
|
final String value;
|
|
|
|
final bool hasWarning;
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
2020-12-08 19:26:51 +00:00
|
|
|
BrandText.body1(
|
|
|
|
title,
|
|
|
|
style: TextStyle(color: hasWarning ? BrandColors.warning : null),
|
|
|
|
),
|
2020-12-02 09:16:23 +00:00
|
|
|
SizedBox(height: 5),
|
2020-12-08 19:26:51 +00:00
|
|
|
BrandText.body1(
|
|
|
|
value,
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: 13,
|
|
|
|
height: 1.53,
|
|
|
|
color: hasWarning ? BrandColors.warning : BrandColors.gray1,
|
|
|
|
),
|
|
|
|
),
|
2020-12-02 09:16:23 +00:00
|
|
|
],
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|