master
Kherel 2021-06-20 23:08:52 +02:00
parent d8393f75ea
commit 21611e63c7
26 changed files with 340 additions and 223 deletions

View File

@ -34,7 +34,7 @@
"onboarding": "Onboarding",
"console": "Console",
"about_app_page": {
"text": "Тут любая служебная информация, v.{}"
"text": "Application version v.{}"
},
"settings": {
"title": "Application settings",
@ -188,7 +188,10 @@
"20": "\n",
"21": "One more restart to apply your security certificates.",
"22": "Create master account",
"23": "Enter a nickname and strong password"
"23": "Enter a nickname and strong password",
"finish": "Everything is initialized",
"checks": "Checks have been completed \n{} ouf of {}"
},
"modals": {
"_comment": "messages in modals",
@ -208,5 +211,12 @@
"title": "Jobs list",
"start": "Start",
"empty": "No jobs"
},
"validations": {
"required": "required",
"invalid_format": "invalid format",
"root_name": "User name cannot be 'root'",
"key_format": "invalid key format",
"length": "length is [] shoud be {}"
}
}

View File

@ -188,7 +188,9 @@
"20": "\n2 Заходим в созданный нами проект. Если такового - нет, значит создаём.\n3 Наводим мышкой на боковую панель. Она должна раскрыться, показав нам пункты меню. Нас интересует последний — Security (с иконкой ключика).\n4 Далее, в верхней части интерфейса видим примерно такой список: SSH Keys, API Tokens, Certificates, Members. Нам нужен API Tokens. Переходим по нему.\n5 В правой части интерфейса, нас будет ожидать кнопка Generate API token. Если же вы используете мобильную версию сайта, в нижнем правом углу вы увидите красный плюсик. Нажимаем на эту кнопку.\n6 В поле Description, даём нашему токену название (это может быть любое название, которые вам нравиться. Сути оно не меняет.",
"21": "Сейчас будет дополнительная перезагрузка для активации сертификатов безопастности",
"22": "Создайте главную учетную запись",
"23": "Введите никнейм и сложный пароль"
"23": "Введите никнейм и сложный пароль",
"finish": "Все инициализировано",
"checks": "Проверок выполнено: \n{} / {}"
},
"modals": {
"_comment": "messages in modals",
@ -209,5 +211,12 @@
"title": "Задачи",
"start": "Начать выполенение",
"empty": "Пусто"
},
"validations": {
"required": "обязательное поле",
"invalid_format": "неверный формат",
"root_name": "Имя пользователя не может быть'root'",
"key_format": "неверный формат",
"length": "Длина строки [] должна быть {}"
}
}

View File

@ -47,11 +47,21 @@ class ServerApi extends ApiMap {
var client = await getClient();
try {
response = await client.get('/createUser');
response = await client.post(
'/createUser',
options: Options(
headers: {
"X-Username": user.login,
"X-Password": user.password,
},
),
);
res = response.statusCode == HttpStatus.ok;
} catch (e) {
print(e);
res = false;
}
close(client);
return res;
}

View File

@ -87,6 +87,16 @@ class AppConfigState extends Equatable {
bool get isFullyInitilized => _fulfilementList.every((el) => el!);
int get progress => _fulfilementList.where((el) => el!).length ;
int get porgressBar {
if (progress < 6) {
return progress;
} else if (progress < 10) {
return 6;
} else {
return 7;
}
}
List<bool?> get _fulfilementList {
var res = [
isHetznerFilled,

View File

@ -3,6 +3,7 @@ import 'package:cubit_form/cubit_form.dart';
import 'package:selfprivacy/logic/api_maps/backblaze.dart';
import 'package:selfprivacy/logic/cubit/app_config/app_config_cubit.dart';
import 'package:selfprivacy/logic/models/backblaze_credential.dart';
import 'package:easy_localization/easy_localization.dart';
class BackblazeFormCubit extends FormCubit {
BackblazeFormCubit(this.initializingCubit) {
@ -10,7 +11,7 @@ class BackblazeFormCubit extends FormCubit {
keyId = FieldCubit(
initalValue: '',
validations: [
RequiredStringValidation('required'),
RequiredStringValidation('validations.required'.tr()),
//ValidationModel<String>(
//(s) => regExp.hasMatch(s), 'invalid key format'),
//LegnthStringValidationWithLenghShowing(64, 'length is [] shoud be 64')

View File

@ -4,6 +4,7 @@ import 'package:cubit_form/cubit_form.dart';
import 'package:selfprivacy/logic/api_maps/cloudflare.dart';
import 'package:selfprivacy/logic/cubit/app_config/app_config_cubit.dart';
import 'package:selfprivacy/logic/cubit/forms/validations/validations.dart';
import 'package:easy_localization/easy_localization.dart';
class CloudFlareFormCubit extends FormCubit {
CloudFlareFormCubit(this.initializingCubit) {
@ -11,10 +12,11 @@ class CloudFlareFormCubit extends FormCubit {
apiKey = FieldCubit(
initalValue: '',
validations: [
RequiredStringValidation('required'),
RequiredStringValidation('validations.required'.tr()),
ValidationModel<String>(
(s) => regExp.hasMatch(s), 'invalid key format'),
LegnthStringValidationWithLenghShowing(40, 'length is [] shoud be 40')
(s) => regExp.hasMatch(s), 'validations.key_format'.tr()),
LegnthStringValidationWithLenghShowing(
40, 'validations.length'.tr(args: ["40"]))
],
);

View File

@ -4,6 +4,7 @@ import 'package:cubit_form/cubit_form.dart';
import 'package:selfprivacy/logic/api_maps/hetzner.dart';
import 'package:selfprivacy/logic/cubit/forms/validations/validations.dart';
import 'package:selfprivacy/logic/cubit/app_config/app_config_cubit.dart';
import 'package:easy_localization/easy_localization.dart';
class HetznerFormCubit extends FormCubit {
HetznerFormCubit(this.initializingCubit) {
@ -11,10 +12,10 @@ class HetznerFormCubit extends FormCubit {
apiKey = FieldCubit(
initalValue: '',
validations: [
RequiredStringValidation('required'),
RequiredStringValidation('validations.required'.tr()),
ValidationModel<String>(
(s) => regExp.hasMatch(s), 'invalid key format'),
LegnthStringValidationWithLenghShowing(64, 'length is [] shoud be 64')
(s) => regExp.hasMatch(s), 'validations.key_format'.tr()),
LegnthStringValidationWithLenghShowing(64, 'validations.length'.tr(args: ["64"]))
],
);

View File

@ -3,6 +3,7 @@ import 'dart:async';
import 'package:cubit_form/cubit_form.dart';
import 'package:selfprivacy/logic/cubit/app_config/app_config_cubit.dart';
import 'package:selfprivacy/logic/models/user.dart';
import 'package:easy_localization/easy_localization.dart';
class RootUserFormCubit extends FormCubit {
RootUserFormCubit(this.initializingCubit) {
@ -12,18 +13,20 @@ class RootUserFormCubit extends FormCubit {
userName = FieldCubit(
initalValue: '',
validations: [
RequiredStringValidation('required'),
ValidationModel<String>(
(s) => userRegExp.hasMatch(s), 'invalid format'),
(s) => s.toLowerCase() == 'root', 'validations.root_name'.tr()),
RequiredStringValidation('validations.required'.tr()),
ValidationModel<String>(
(s) => userRegExp.hasMatch(s), 'validations.invalid_format'.tr()),
],
);
password = FieldCubit(
initalValue: '',
validations: [
RequiredStringValidation('required'),
RequiredStringValidation('validations.required'.tr()),
ValidationModel<String>(
(s) => passwordRegExp.hasMatch(s), 'invalid format'),
(s) => passwordRegExp.hasMatch(s), 'validations.invalid_format'.tr()),
],
);

View File

@ -1,9 +1,11 @@
import 'dart:async';
import 'package:cubit_form/cubit_form.dart';
import 'package:selfprivacy/logic/cubit/users/users_cubit.dart';
import 'package:selfprivacy/logic/cubit/jobs/jobs_cubit.dart';
import 'package:selfprivacy/logic/models/jobs/job.dart';
import 'package:selfprivacy/logic/models/user.dart';
import 'package:selfprivacy/utils/password_generator.dart';
import 'package:easy_localization/easy_localization.dart';
class UserFormCubit extends FormCubit {
UserFormCubit({
@ -18,18 +20,18 @@ class UserFormCubit extends FormCubit {
login = FieldCubit(
initalValue: isEdit ? user!.login : '',
validations: [
RequiredStringValidation('required'),
RequiredStringValidation('validations.required'.tr()),
ValidationModel<String>(
(s) => userRegExp.hasMatch(s), 'invalid format'),
(s) => userRegExp.hasMatch(s), 'validations.invalid_format'.tr()),
],
);
password = FieldCubit(
initalValue: isEdit ? user!.password : genPass(),
validations: [
RequiredStringValidation('required'),
ValidationModel<String>(
(s) => passwordRegExp.hasMatch(s), 'invalid format'),
RequiredStringValidation('validations.required'.tr()),
ValidationModel<String>((s) => passwordRegExp.hasMatch(s),
'validations.invalid_format'.tr()),
],
);
@ -42,7 +44,7 @@ class UserFormCubit extends FormCubit {
login: login.state.value,
password: password.state.value,
);
usersCubit.addUser(user);
usersCubit.addJob(CreateUserJob(user: user));
}
late FieldCubit<String> login;
@ -52,5 +54,5 @@ class UserFormCubit extends FormCubit {
password.externalSetValue(genPass());
}
late UsersCubit usersCubit;
late JobsCubit usersCubit;
}

View File

@ -24,7 +24,7 @@ class JobsCubit extends Cubit<JobsState> {
Future<void> applyAll() async {
for (var job in state.jobList) {
if (job is CreateUserJob) {
await api.createUser(job.user);
// await api.createUser(job.user);
}
}
emit(JobsState.emtpy());

View File

@ -2,18 +2,37 @@ import 'package:flutter/material.dart';
import 'package:selfprivacy/config/brand_colors.dart';
class BrandBottomSheet extends StatelessWidget {
const BrandBottomSheet({Key? key, required this.child}) : super(key: key);
const BrandBottomSheet({
Key? key,
required this.child,
this.isExpended = false,
}) : super(key: key);
final Widget child;
final bool isExpended;
@override
Widget build(BuildContext context) {
var mainHeight = MediaQuery.of(context).size.height -
MediaQuery.of(context).padding.top -
100;
late Widget innerWidget;
if (isExpended) {
innerWidget = Scaffold(
body: child,
);
} else {
final ThemeData themeData = Theme.of(context);
innerWidget = Material(
color: themeData.scaffoldBackgroundColor,
child: IntrinsicHeight(child: child),
);
}
return ConstrainedBox(
constraints: BoxConstraints(maxHeight: mainHeight + 4 + 6),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Center(
child: Container(
@ -27,10 +46,10 @@ class BrandBottomSheet extends StatelessWidget {
),
SizedBox(height: 6),
ClipRRect(
borderRadius: BorderRadius.circular(20),
borderRadius: BorderRadius.vertical(top: Radius.circular(20)),
child: ConstrainedBox(
constraints: BoxConstraints(maxHeight: mainHeight),
child: Scaffold(body: child),
child: innerWidget,
),
),
],

View File

@ -56,6 +56,7 @@ class _BrandMarkdownState extends State<BrandMarkdown> {
),
);
return Markdown(
shrinkWrap: true,
styleSheet: markdown,
onTapLink: (String text, String? href, String title) {
if (href != null) {

View File

@ -1,63 +1,63 @@
import 'package:flutter/material.dart';
// import 'package:flutter/material.dart';
var navigatorKey = GlobalKey<NavigatorState>();
// var navigatorKey = GlobalKey<NavigatorState>();
class BrandModalSheet extends StatelessWidget {
const BrandModalSheet({
Key? key,
this.child,
}) : super(key: key);
// class BrandModalSheet extends StatelessWidget {
// const BrandModalSheet({
// Key? key,
// this.child,
// }) : super(key: key);
final Widget? child;
@override
Widget build(BuildContext context) {
return DraggableScrollableSheet(
minChildSize: 0.95,
initialChildSize: 1,
maxChildSize: 1,
builder: (context, scrollController) {
return SingleChildScrollView(
controller: scrollController,
physics: ClampingScrollPhysics(),
child: Container(
child: Column(
children: [
GestureDetector(
onTap: () => Navigator.of(context).pop(),
behavior: HitTestBehavior.opaque,
child: Container(
width: double.infinity,
child: Center(
child: Padding(
padding: EdgeInsets.only(top: 132, bottom: 6),
child: Container(
height: 4,
width: 30,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(2),
color: Color(0xFFE3E3E3).withOpacity(0.65),
),
),
),
),
),
),
Container(
constraints: BoxConstraints(
minHeight: MediaQuery.of(context).size.height - 132,
maxHeight: MediaQuery.of(context).size.height - 132,
),
decoration: BoxDecoration(
borderRadius:
BorderRadius.vertical(top: Radius.circular(20)),
color: Theme.of(context).scaffoldBackgroundColor,
),
width: double.infinity,
child: child),
],
),
),
);
});
}
}
// final Widget? child;
// @override
// Widget build(BuildContext context) {
// return DraggableScrollableSheet(
// minChildSize: 1,
// initialChildSize: 1,
// maxChildSize: 1,
// builder: (context, scrollController) {
// return SingleChildScrollView(
// controller: scrollController,
// physics: ClampingScrollPhysics(),
// child: Container(
// child: Column(
// children: [
// GestureDetector(
// onTap: () => Navigator.of(context).pop(),
// behavior: HitTestBehavior.opaque,
// child: Container(
// width: double.infinity,
// child: Center(
// child: Padding(
// padding: EdgeInsets.only(top: 132, bottom: 6),
// child: Container(
// height: 4,
// width: 30,
// decoration: BoxDecoration(
// borderRadius: BorderRadius.circular(2),
// color: Color(0xFFE3E3E3).withOpacity(0.65),
// ),
// ),
// ),
// ),
// ),
// ),
// Container(
// constraints: BoxConstraints(
// minHeight: MediaQuery.of(context).size.height - 132,
// maxHeight: MediaQuery.of(context).size.height - 132,
// ),
// decoration: BoxDecoration(
// borderRadius:
// BorderRadius.vertical(top: Radius.circular(20)),
// color: Theme.of(context).scaffoldBackgroundColor,
// ),
// width: double.infinity,
// child: child),
// ],
// ),
// ),
// );
// });
// }
// }

View File

@ -1,6 +1,7 @@
import 'package:flutter/material.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:selfprivacy/config/brand_colors.dart';
import 'package:selfprivacy/config/brand_theme.dart';
import 'package:selfprivacy/logic/cubit/jobs/jobs_cubit.dart';
import 'package:selfprivacy/ui/components/brand_button/brand_button.dart';
import 'package:selfprivacy/ui/components/brand_cards/brand_cards.dart';
@ -12,7 +13,8 @@ class JobsContent extends StatelessWidget {
@override
Widget build(BuildContext context) {
var jobs = context.watch<JobsCubit>().state;
return Column(
return ListView(
padding: paddingH15V0,
children: [
SizedBox(height: 15),
Center(
@ -20,11 +22,8 @@ class JobsContent extends StatelessWidget {
'jobs.title'.tr(),
),
),
if (jobs.isEmpty)
Padding(
padding: const EdgeInsets.only(top: 50),
child: BrandText.body1('jobs.empty'.tr()),
),
SizedBox(height: 20),
if (jobs.isEmpty) BrandText.body1('jobs.empty'.tr()),
if (!jobs.isEmpty) ...[
...jobs.jobList
.map(

View File

@ -15,12 +15,25 @@ class _BrandFlashButtonState extends State<_BrandFlashButton>
@override
void initState() {
_animationController =
AnimationController(vsync: this, duration: Duration(milliseconds: 600));
AnimationController(vsync: this, duration: Duration(milliseconds: 800));
_colorTween = ColorTween(
begin: BrandColors.black,
end: BrandColors.primary,
).animate(_animationController);
super.initState();
WidgetsBinding.instance!.addPostFrameCallback(_afterLayout);
}
void _afterLayout(_) {
if (Theme.of(context).brightness == Brightness.dark) {
setState(() {
_colorTween = ColorTween(
begin: BrandColors.white,
end: BrandColors.primary,
).animate(_animationController);
});
}
}
@override
@ -48,13 +61,10 @@ class _BrandFlashButtonState extends State<_BrandFlashButton>
},
child: IconButton(
onPressed: () {
showCupertinoModalBottomSheet(
barrierColor: Colors.black45,
expand: false,
showBrandBottomSheet(
context: context,
shadow: BoxShadow(color: Colors.transparent),
backgroundColor: Colors.transparent,
builder: (context) => BrandBottomSheet(
isExpended: true,
child: JobsContent(),
),
);
@ -62,9 +72,13 @@ class _BrandFlashButtonState extends State<_BrandFlashButton>
icon: AnimatedBuilder(
animation: _colorTween,
builder: (context, child) {
return Icon(
var v = _animationController.value;
return Transform.scale(
scale: 1 + (v < 0.5 ? v : 1 - v) * 2,
child: Icon(
icon,
color: _colorTween.value,
),
);
}),
),

View File

@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:flutter/scheduler.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:ionicons/ionicons.dart';
import 'package:selfprivacy/config/brand_colors.dart';
@ -6,8 +7,8 @@ import 'package:selfprivacy/logic/cubit/jobs/jobs_cubit.dart';
import 'package:selfprivacy/ui/components/brand_bottom_sheet/brand_bottom_sheet.dart';
import 'package:selfprivacy/ui/components/brand_text/brand_text.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:modal_bottom_sheet/modal_bottom_sheet.dart';
import 'package:selfprivacy/ui/components/jobs_content/jobs_content.dart';
import 'package:selfprivacy/ui/helpers/modals.dart';
part 'close.dart';
part 'flash.dart';

View File

@ -53,9 +53,9 @@ class _ProgressBarState extends State<ProgressBar> {
width: 10,
),
);
even.add(
odd.add(
SizedBox(
width: 10,
width: 20,
),
);

View File

@ -0,0 +1,14 @@
import 'package:flutter/material.dart';
import 'package:modal_bottom_sheet/modal_bottom_sheet.dart';
Future<T?> showBrandBottomSheet<T>({
required BuildContext context,
required WidgetBuilder builder,
}) =>
showCupertinoModalBottomSheet<T>(
builder: builder,
barrierColor: Colors.black45,
context: context,
shadow: BoxShadow(color: Colors.transparent),
backgroundColor: Colors.transparent,
);

View File

@ -10,10 +10,10 @@ import 'package:selfprivacy/logic/cubit/forms/initializing/hetzner_form_cubit.da
import 'package:selfprivacy/logic/cubit/forms/initializing/root_user_form_cubit.dart';
import 'package:selfprivacy/logic/cubit/app_config/app_config_cubit.dart';
import 'package:selfprivacy/logic/cubit/providers/providers_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/brand_cards/brand_cards.dart';
import 'package:selfprivacy/ui/components/brand_md/brand_md.dart';
import 'package:selfprivacy/ui/components/brand_modal_sheet/brand_modal_sheet.dart';
import 'package:selfprivacy/ui/components/brand_text/brand_text.dart';
import 'package:selfprivacy/ui/components/brand_timer/brand_timer.dart';
import 'package:selfprivacy/ui/components/progress_bar/progress_bar.dart';
@ -36,7 +36,7 @@ class InitializingPage extends StatelessWidget {
() => _stepCheck(cubit),
() => _stepCheck(cubit),
() => _stepCheck(cubit),
() => Container(child: Text('Everythigng is initialized'))
() => Container(child: Center(child: Text('initializing.finish'.tr())))
][cubit.state.progress]();
return BlocListener<AppConfigCubit, AppConfigState>(
listener: (context, state) {
@ -59,12 +59,9 @@ class InitializingPage extends StatelessWidget {
'Domain',
'User',
'Server',
'',
'',
'',
'',
'✅ Check',
],
activeIndex: cubit.state.progress,
activeIndex: cubit.state.porgressBar,
),
),
_addCard(
@ -443,21 +440,29 @@ class InitializingPage extends StatelessWidget {
Widget _stepCheck(AppConfigCubit appConfigCubit) {
assert(appConfigCubit.state is TimerState, 'wronge state');
var state = appConfigCubit.state as TimerState;
late int doneCount;
late String? text;
if (state.isServerResetedSecondTime) {
text = 'initializing.13'.tr();
doneCount = 3;
} else if (state.isServerResetedFirstTime) {
text = 'initializing.21'.tr();
doneCount = 2;
} else if (state.isServerStarted) {
text = 'initializing.14'.tr();
doneCount = 1;
} else if (state.isServerCreated) {
text = 'initializing.15'.tr();
doneCount = 0;
}
return Builder(builder: (context) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(height: 15),
BrandText.h4(
'initializing.checks'.tr(args: [doneCount.toString(), "4"]),
),
Spacer(flex: 2),
SizedBox(height: 10),
BrandText.body2(text),
@ -501,12 +506,14 @@ class _HowHetzner extends StatelessWidget {
@override
Widget build(BuildContext context) {
return BrandModalSheet(
return BrandBottomSheet(
isExpended: true,
child: Padding(
padding: paddingH15V0.copyWith(top: 25),
padding: paddingH15V0,
child: BrandMarkdown(
fileName: 'how_hetzner',
)),
),
),
);
}
}

View File

@ -1,5 +1,4 @@
import 'package:flutter/material.dart';
import 'package:modal_bottom_sheet/modal_bottom_sheet.dart';
import 'package:selfprivacy/config/brand_theme.dart';
import 'package:selfprivacy/logic/cubit/app_config/app_config_cubit.dart';
import 'package:selfprivacy/logic/cubit/jobs/jobs_cubit.dart';
@ -9,12 +8,11 @@ import 'package:selfprivacy/logic/models/state_types.dart';
import 'package:selfprivacy/ui/components/brand_bottom_sheet/brand_bottom_sheet.dart';
import 'package:selfprivacy/ui/components/brand_cards/brand_cards.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/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:selfprivacy/ui/helpers/modals.dart';
import 'package:selfprivacy/ui/pages/server_details/server_details.dart';
import 'package:selfprivacy/utils/route_transitions/basic.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:selfprivacy/utils/ui_helpers.dart';
@ -87,13 +85,10 @@ class _Card extends StatelessWidget {
case ProviderType.server:
title = 'providers.server.card_title'.tr();
stableText = 'providers.server.status'.tr();
onTap = () => showCupertinoModalBottomSheet(
barrierColor: Colors.black45,
expand: false,
onTap = () => showBrandBottomSheet(
context: context,
shadow: BoxShadow(color: Colors.transparent),
backgroundColor: Colors.transparent,
builder: (context) => BrandBottomSheet(
isExpended: true,
child: ServerDetails(),
),
);
@ -104,10 +99,8 @@ class _Card extends StatelessWidget {
message = domainName;
stableText = 'providers.domain.status'.tr();
onTap = () => showModalBottomSheet<void>(
onTap = () => showBrandBottomSheet<void>(
context: context,
isScrollControlled: true,
backgroundColor: Colors.transparent,
builder: (BuildContext context) {
return _ProviderDetails(
provider: provider,
@ -203,13 +196,9 @@ class _ProviderDetails extends StatelessWidget {
];
break;
}
return BrandModalSheet(
child: Navigator(
key: navigatorKey,
initialRoute: '/',
onGenerateRoute: (_) {
return materialRoute(
Column(
return BrandBottomSheet(
child: SafeArea(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(height: 40),
@ -220,20 +209,18 @@ class _ProviderDetails extends StatelessWidget {
children: [
IconStatusMask(
status: provider.state,
child:
Icon(provider.icon, size: 40, color: Colors.white),
child: Icon(provider.icon, size: 40, color: Colors.white),
),
SizedBox(height: 10),
BrandText.h1(title),
SizedBox(height: 10),
...children
...children,
SizedBox(height: 30),
],
),
)
],
),
);
},
),
);
}

View File

@ -7,10 +7,10 @@ class _NewUser extends StatelessWidget {
var domainName = UiHelpers.getDomainName(config);
return BrandModalSheet(
return BrandBottomSheet(
child: BlocProvider(
create: (context) =>
UserFormCubit(usersCubit: context.read<UsersCubit>()),
UserFormCubit(usersCubit: context.read<JobsCubit>()),
child: Builder(builder: (context) {
var formCubitState = context.watch<UserFormCubit>().state;
@ -22,6 +22,7 @@ class _NewUser extends StatelessWidget {
},
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
BrandHeader(
title: 'users.new_user'.tr(),
@ -30,14 +31,17 @@ class _NewUser extends StatelessWidget {
Padding(
padding: paddingH15V0,
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
CubitFormTextField(
IntrinsicHeight(
child: CubitFormTextField(
formFieldCubit: context.read<UserFormCubit>().login,
decoration: InputDecoration(
labelText: 'users.login'.tr(),
suffixText: '@$domainName',
),
),
),
SizedBox(height: 20),
CubitFormTextField(
formFieldCubit: context.read<UserFormCubit>().password,

View File

@ -8,10 +8,8 @@ class _User extends StatelessWidget {
Widget build(BuildContext context) {
return InkWell(
onTap: () {
showModalBottomSheet<void>(
showBrandBottomSheet<void>(
context: context,
isScrollControlled: true,
backgroundColor: Colors.transparent,
builder: (BuildContext context) {
return _UserDetails(user: user);
},

View File

@ -14,9 +14,11 @@ class _UserDetails extends StatelessWidget {
var domainName = UiHelpers.getDomainName(config);
return BrandModalSheet(
return BrandBottomSheet(
isExpended: true,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
Container(
height: 200,

View File

@ -4,16 +4,18 @@ import 'package:selfprivacy/config/brand_colors.dart';
import 'package:selfprivacy/config/brand_theme.dart';
import 'package:selfprivacy/logic/cubit/app_config/app_config_cubit.dart';
import 'package:selfprivacy/logic/cubit/forms/user/user_form_cubit.dart';
import 'package:selfprivacy/logic/cubit/jobs/jobs_cubit.dart';
import 'package:selfprivacy/logic/cubit/users/users_cubit.dart';
import 'package:selfprivacy/logic/models/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_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_modal_sheet/brand_modal_sheet.dart';
import 'package:selfprivacy/ui/components/brand_text/brand_text.dart';
import 'package:selfprivacy/ui/components/not_ready_card/not_ready_card.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:selfprivacy/ui/helpers/modals.dart';
import 'package:selfprivacy/utils/ui_helpers.dart';
part 'fab.dart';

View File

@ -42,7 +42,7 @@ packages:
name: basic_utils
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.0-nullsafety.3"
version: "3.1.0"
bloc:
dependency: transitive
description:
@ -105,14 +105,14 @@ packages:
name: built_collection
url: "https://pub.dartlang.org"
source: hosted
version: "5.0.0"
version: "5.1.0"
built_value:
dependency: transitive
description:
name: built_value
url: "https://pub.dartlang.org"
source: hosted
version: "8.0.4"
version: "8.1.0"
characters:
dependency: transitive
description:
@ -176,7 +176,7 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.3"
crypto:
crypt:
dependency: "direct main"
description:
name: crypt
@ -189,21 +189,21 @@ packages:
name: crypto
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.0"
version: "3.0.1"
cubit_form:
dependency: "direct main"
description:
name: cubit_form
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.2-nullsafety.0"
version: "1.0.16"
cupertino_icons:
dependency: "direct main"
description:
name: cupertino_icons
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.2"
version: "1.0.3"
dart_style:
dependency: transitive
description:
@ -252,7 +252,14 @@ packages:
name: equatable
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0"
version: "2.0.3"
extended_masked_text:
dependency: transitive
description:
name: extended_masked_text
url: "https://pub.dartlang.org"
source: hosted
version: "2.2.1"
fake_async:
dependency: transitive
description:
@ -266,14 +273,14 @@ packages:
name: ffi
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.0"
version: "1.1.2"
file:
dependency: transitive
description:
name: file
url: "https://pub.dartlang.org"
source: hosted
version: "6.1.0"
version: "6.1.2"
fixnum:
dependency: transitive
description:
@ -299,7 +306,7 @@ packages:
name: flutter_bloc
url: "https://pub.dartlang.org"
source: hosted
version: "7.0.0"
version: "7.0.1"
flutter_launcher_icons:
dependency: "direct dev"
description:
@ -318,14 +325,14 @@ packages:
name: flutter_markdown
url: "https://pub.dartlang.org"
source: hosted
version: "0.6.1"
version: "0.6.2"
flutter_secure_storage:
dependency: "direct main"
description:
name: flutter_secure_storage
url: "https://pub.dartlang.org"
source: hosted
version: "4.1.0"
version: "4.2.0"
flutter_test:
dependency: "direct dev"
description: flutter
@ -342,7 +349,7 @@ packages:
name: get_it
url: "https://pub.dartlang.org"
source: hosted
version: "6.0.0"
version: "6.1.1"
glob:
dependency: transitive
description:
@ -363,28 +370,28 @@ packages:
name: hive
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.1"
version: "2.0.4"
hive_flutter:
dependency: "direct main"
description:
name: hive_flutter
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.0"
version: "1.1.0"
hive_generator:
dependency: "direct dev"
description:
name: hive_generator
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.1"
version: "1.1.0"
http:
dependency: transitive
description:
name: http
url: "https://pub.dartlang.org"
source: hosted
version: "0.13.1"
version: "0.13.3"
http_multi_server:
dependency: transitive
description:
@ -420,6 +427,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.0"
ionicons:
dependency: "direct main"
description:
name: ionicons
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.2"
js:
dependency: transitive
description:
@ -455,13 +469,6 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "4.0.0"
mask_text_input_formatter:
dependency: transitive
description:
name: mask_text_input_formatter
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0-nullsafety.2"
matcher:
dependency: transitive
description:
@ -483,6 +490,20 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.0"
modal_bottom_sheet:
dependency: "direct main"
description:
name: modal_bottom_sheet
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0"
nanoid:
dependency: "direct main"
description:
name: nanoid
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.0"
nested:
dependency: transitive
description:
@ -510,7 +531,7 @@ packages:
name: package_info
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0"
version: "2.0.2"
path:
dependency: transitive
description:
@ -524,7 +545,7 @@ packages:
name: path_provider
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.1"
version: "2.0.2"
path_provider_linux:
dependency: transitive
description:
@ -552,21 +573,21 @@ packages:
name: path_provider_windows
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0"
version: "2.0.1"
pedantic:
dependency: transitive
description:
name: pedantic
url: "https://pub.dartlang.org"
source: hosted
version: "1.11.0"
version: "1.11.1"
petitparser:
dependency: transitive
description:
name: petitparser
url: "https://pub.dartlang.org"
source: hosted
version: "4.0.2"
version: "4.1.0"
platform:
dependency: transitive
description:
@ -587,7 +608,7 @@ packages:
name: pointycastle
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.1"
version: "3.1.2"
pool:
dependency: transitive
description:
@ -630,20 +651,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.0"
quiver:
dependency: transitive
description:
name: quiver
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.5"
shared_preferences:
dependency: transitive
description:
name: shared_preferences
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.5"
version: "2.0.6"
shared_preferences_linux:
dependency: transitive
description:
@ -685,7 +699,7 @@ packages:
name: shelf
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0"
version: "1.1.4"
shelf_packages_handler:
dependency: transitive
description:
@ -719,6 +733,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.2"
source_helper:
dependency: transitive
description:
name: source_helper
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0"
source_map_stack_trace:
dependency: transitive
description:
@ -823,7 +844,7 @@ packages:
name: url_launcher
url: "https://pub.dartlang.org"
source: hosted
version: "6.0.3"
version: "6.0.6"
url_launcher_linux:
dependency: transitive
description:
@ -844,14 +865,14 @@ packages:
name: url_launcher_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.2"
version: "2.0.3"
url_launcher_web:
dependency: transitive
description:
name: url_launcher_web
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0"
version: "2.0.1"
url_launcher_windows:
dependency: transitive
description:
@ -879,28 +900,28 @@ packages:
name: wakelock
url: "https://pub.dartlang.org"
source: hosted
version: "0.5.0+2"
version: "0.5.2"
wakelock_macos:
dependency: transitive
description:
name: wakelock_macos
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.0"
version: "0.1.0+1"
wakelock_platform_interface:
dependency: transitive
description:
name: wakelock_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.0"
version: "0.2.1+1"
wakelock_web:
dependency: transitive
description:
name: wakelock_web
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.0"
version: "0.2.0+1"
wakelock_windows:
dependency: transitive
description:
@ -935,7 +956,7 @@ packages:
name: win32
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.5"
version: "2.2.1"
xdg_directories:
dependency: transitive
description:
@ -949,7 +970,7 @@ packages:
name: xml
url: "https://pub.dartlang.org"
source: hosted
version: "5.0.2"
version: "5.1.2"
yaml:
dependency: transitive
description:
@ -958,5 +979,5 @@ packages:
source: hosted
version: "3.1.0"
sdks:
dart: ">=2.12.0 <3.0.0"
dart: ">=2.13.0 <3.0.0"
flutter: ">=2.0.0"

View File

@ -1,7 +1,7 @@
name: selfprivacy
description: selfprivacy.org
publish_to: 'none'
version: 0.1.1+1
version: 0.1.3+1
environment:
sdk: '>=2.12.0 <3.0.0'