update project structure

fdroid
Kherel 2020-12-06 08:46:12 +01:00
parent a112d873eb
commit 7ebfc2c048
10 changed files with 123 additions and 45 deletions

View File

@ -20,7 +20,7 @@ void main() {
);
}
var _showOnbording = true;
var _showOnbording = false;
class MyApp extends StatelessWidget {
@override

View File

@ -0,0 +1,38 @@
import 'package:flutter/material.dart';
import 'package:selfprivacy/config/brand_colors.dart';
class SwitcherBlock extends StatelessWidget {
const SwitcherBlock({
Key key,
@required this.child,
@required this.isActive,
}) : super(key: key);
final Widget child;
final bool isActive;
@override
Widget build(BuildContext context) {
return Container(
padding: EdgeInsets.only(top: 20, bottom: 5),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(width: 1, color: BrandColors.dividerColor),
)),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Flexible(child: child),
SizedBox(width: 5),
Switch(
activeColor: BrandColors.green1,
activeTrackColor: BrandColors.green2,
onChanged: (v) {},
value: isActive,
),
],
),
);
}
}

View File

@ -0,0 +1,73 @@
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';
import 'package:selfprivacy/ui/components/switch_block/switch_bloc.dart';
import 'package:selfprivacy/utils/extensions/text_extension.dart';
class AppSettingsPage extends StatelessWidget {
const AppSettingsPage({Key key}) : super(key: key);
@override
Widget build(BuildContext context) {
return SafeArea(
child: Scaffold(
appBar: PreferredSize(
child:
BrandHeader(title: 'Настройки приложения', hasBackButton: true),
preferredSize: Size.fromHeight(52),
),
body: ListView(
padding: brandPagePadding2,
children: [
BrandDivider(),
SwitcherBlock(
child: _TextColumn(
title: 'Dark Theme',
value: 'Change your the app theme',
),
isActive: true,
),
],
),
),
);
}
}
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: [
Text(title).body1.copyWith(
style: TextStyle(color: hasWarning ? BrandColors.warning : null)),
SizedBox(height: 5),
Text(value)
.body1
.copyWith(
style: TextStyle(
fontSize: 13,
height: 1.53,
color: BrandColors.gray1,
),
)
.copyWith(
style:
TextStyle(color: hasWarning ? BrandColors.warning : null)),
],
);
}
}

View File

@ -4,12 +4,13 @@ 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';
import 'package:selfprivacy/ui/components/brand_icons/brand_icons.dart';
import 'package:selfprivacy/ui/pages/about/about.dart';
import 'package:selfprivacy/ui/pages/info/info.dart';
import 'package:selfprivacy/ui/pages/settings/setting.dart';
import 'package:selfprivacy/utils/extensions/text_extension.dart';
import 'package:selfprivacy/utils/route_transitions/basic.dart';
import 'about/about.dart';
import 'app_settings/app_setting.dart';
import 'info/info.dart';
class MorePage extends StatelessWidget {
const MorePage({Key key}) : super(key: key);
@ -28,9 +29,9 @@ class MorePage extends StatelessWidget {
children: [
BrandDivider(),
_NavItem(
title: 'Настройки',
title: 'Настройки приложения',
iconData: BrandIcons.settings,
goTo: SettingsPage(),
goTo: AppSettingsPage(),
),
_NavItem(
title: 'О проекте Selfprivacy',

View File

@ -5,7 +5,7 @@ import 'package:selfprivacy/ui/components/brand_button/brand_button.dart';
import 'package:selfprivacy/ui/components/brand_card/brand_card.dart';
import 'package:selfprivacy/ui/components/brand_modal_sheet/brand_modal_sheet.dart';
import 'package:selfprivacy/ui/components/brand_span_button/brand_span_button.dart';
import 'package:selfprivacy/ui/pages/dots_indicator/dots_indicator.dart';
import 'package:selfprivacy/ui/components/dots_indicator/dots_indicator.dart';
import 'package:selfprivacy/ui/pages/rootRoute.dart';
import 'package:selfprivacy/utils/extensions/text_extension.dart';
import 'package:selfprivacy/utils/route_transitions/basic.dart';

View File

@ -6,7 +6,7 @@ import 'package:selfprivacy/ui/components/brand_card/brand_card.dart';
import 'package:selfprivacy/ui/components/brand_header/brand_header.dart';
import 'package:selfprivacy/ui/components/brand_modal_sheet/brand_modal_sheet.dart';
import 'package:selfprivacy/ui/components/icon_status_mask/icon_status_mask.dart';
import 'package:selfprivacy/ui/pages/settings/setting.dart';
import 'package:selfprivacy/ui/pages/providers/settings/setting.dart';
import 'package:selfprivacy/utils/extensions/text_extension.dart';
import 'package:selfprivacy/utils/route_transitions/basic.dart';

View File

@ -3,6 +3,7 @@ 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';
import 'package:selfprivacy/ui/components/switch_block/switch_bloc.dart';
import 'package:selfprivacy/utils/extensions/text_extension.dart';
class SettingsPage extends StatelessWidget {
@ -20,14 +21,14 @@ class SettingsPage extends StatelessWidget {
padding: brandPagePadding2,
children: [
BrandDivider(),
_SwitcherBlock(
SwitcherBlock(
child: _TextColumn(
title: 'Allow Auto-upgrade',
value: 'Wether to allow automatic packages upgrades',
),
isActive: true,
),
_SwitcherBlock(
SwitcherBlock(
child: _TextColumn(
title: 'Reboot after upgrade',
value: 'Reboot without prompt after applying updates',
@ -63,41 +64,6 @@ class SettingsPage extends StatelessWidget {
}
}
class _SwitcherBlock extends StatelessWidget {
const _SwitcherBlock({
Key key,
@required this.child,
@required this.isActive,
}) : super(key: key);
final Widget child;
final bool isActive;
@override
Widget build(BuildContext context) {
return Container(
padding: EdgeInsets.only(top: 20, bottom: 5),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(width: 1, color: BrandColors.dividerColor),
)),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Flexible(child: child),
SizedBox(width: 5),
Switch(
activeColor: BrandColors.green1,
activeTrackColor: BrandColors.green2,
onChanged: (v) {},
value: isActive,
),
],
),
);
}
}
class _Button extends StatelessWidget {
const _Button({
Key key,