Compare commits
8 Commits
Author | SHA1 | Date |
---|---|---|
Illia Chub | 5d8b953e0a | |
ilchub | c3eed056b5 | |
ilchub | f30b54f564 | |
Illia Chub | 039449d3f5 | |
Illia Chub | 160bdd51a3 | |
Illia Chub | dc5f888d7b | |
ilchub | c1bb670b63 | |
ilchub | 82d1c3a651 |
|
@ -1,16 +0,0 @@
|
||||||
# editorconfig.org
|
|
||||||
root = true
|
|
||||||
|
|
||||||
[*]
|
|
||||||
indent_size = 2
|
|
||||||
indent_style = space
|
|
||||||
end_of_line = lf
|
|
||||||
charset = utf-8
|
|
||||||
trim_trailing_whitespace = true
|
|
||||||
insert_final_newline = true
|
|
||||||
|
|
||||||
[*.dart]
|
|
||||||
max_line_length = 150
|
|
||||||
|
|
||||||
[*.md]
|
|
||||||
trim_trailing_whitespace = false
|
|
|
@ -1,12 +1,12 @@
|
||||||
### О проекте
|
### О проекте
|
||||||
|
|
||||||
Всё больше организаций хотят владеть нашими данными
|
Всё больше организаций хотят владеть нашими данными
|
||||||
Проект позволяет только Вам в полной мере распоряжаться собственными **данными** на своём сервере.
|
А мы сами хотим распоряжаться своими **данными** на своем сервере.
|
||||||
|
|
||||||
### Миссия проекта
|
### Миссия проекта
|
||||||
|
|
||||||
Цифровая независимость и приватность доступная каждому.
|
Цифровая независимость и приватность доступная каждому
|
||||||
|
|
||||||
### Цель
|
### Цель
|
||||||
|
|
||||||
Развивать программу, которая позволит каждому создавать приватные сервисы для себя и своих близких.
|
Развивать программу, которая позволит каждому создавать приватные сервисы для себя и своих близких
|
|
@ -3,5 +3,5 @@
|
||||||
2. Заходим в созданный нами проект. Если такового - нет, значит создаём.
|
2. Заходим в созданный нами проект. Если такового - нет, значит создаём.
|
||||||
3. Наводим мышкой на боковую панель. Она должна раскрыться, показав нам пункты меню. Нас интересует последний — Security (с иконкой ключика).
|
3. Наводим мышкой на боковую панель. Она должна раскрыться, показав нам пункты меню. Нас интересует последний — Security (с иконкой ключика).
|
||||||
4. Далее, в верхней части интерфейса видим примерно такой список: SSH Keys, API Tokens, Certificates, Members. Нам нужен API Tokens. Переходим по нему.
|
4. Далее, в верхней части интерфейса видим примерно такой список: SSH Keys, API Tokens, Certificates, Members. Нам нужен API Tokens. Переходим по нему.
|
||||||
5. В правой части интерфейса, нас будет ожидать кнопка Generate API token. Если же Вы используете мобильную версию сайта, в нижнем правом углу Вы увидите красный плюсик. Нажимаем на эту кнопку.
|
5. В правой части интерфейса, нас будет ожидать кнопка Generate API token. Если же вы используете мобильную версию сайта, в нижнем правом углу вы увидите красный плюсик. Нажимаем на эту кнопку.
|
||||||
6. В поле Description, даём нашему токену название (это может быть любое название, которые Вам нравиться. Сути оно не меняет.
|
6. В поле Description, даём нашему токену название (это может быть любое название, которые вам нравиться. Сути оно не меняет.
|
|
@ -19,15 +19,12 @@
|
||||||
"connect": "Connect",
|
"connect": "Connect",
|
||||||
"domain": "Domain",
|
"domain": "Domain",
|
||||||
"saving": "Saving..",
|
"saving": "Saving..",
|
||||||
"nickname": "Nickname",
|
"nickname": "nickname",
|
||||||
"loading": "Loading...",
|
"loading": "Loading...",
|
||||||
"later": "I will setup it later",
|
"later": "I will setup it later",
|
||||||
"reset": "Reset",
|
"reset": "Reset",
|
||||||
"details": "Details",
|
"details": "Details",
|
||||||
"no_data": "No data",
|
"no_data": "No data"
|
||||||
"wait": "Wait",
|
|
||||||
"remove": "Remove",
|
|
||||||
"apply": "Apply"
|
|
||||||
},
|
},
|
||||||
"more": {
|
"more": {
|
||||||
"_comment": "'More' tab",
|
"_comment": "'More' tab",
|
||||||
|
@ -35,22 +32,9 @@
|
||||||
"about_project": "About us",
|
"about_project": "About us",
|
||||||
"about_app": "About application",
|
"about_app": "About application",
|
||||||
"onboarding": "Onboarding",
|
"onboarding": "Onboarding",
|
||||||
"create_ssh_key": "Create ssh key",
|
|
||||||
"generate_key": "Generate key",
|
|
||||||
"generate_key_text": "You can generate ssh key",
|
|
||||||
"console": "Console",
|
"console": "Console",
|
||||||
"remove": "Remove",
|
|
||||||
"enable": "Enable",
|
|
||||||
"ok": "ok",
|
|
||||||
"continue": "Continue",
|
|
||||||
"ssh_key_exist_text": "You have generated ssh key",
|
|
||||||
"yes_delete": "Yes, delete my SSH key",
|
|
||||||
"share": "Share",
|
|
||||||
"copy_buffer": "Copy to buffer",
|
|
||||||
"copied_ssh": "SSH copied to clipboard",
|
|
||||||
"delete_ssh_text": "Delete SSH key?",
|
|
||||||
"about_app_page": {
|
"about_app_page": {
|
||||||
"text": "Application version v.{}"
|
"text": "Тут любая служебная информация, v.{}"
|
||||||
},
|
},
|
||||||
"settings": {
|
"settings": {
|
||||||
"title": "Application settings",
|
"title": "Application settings",
|
||||||
|
@ -161,13 +145,6 @@
|
||||||
"bottom_sheet": {
|
"bottom_sheet": {
|
||||||
"1": "You can connect and create a new user here:"
|
"1": "You can connect and create a new user here:"
|
||||||
}
|
}
|
||||||
},
|
|
||||||
"vpn": {
|
|
||||||
"title": "VPN Server",
|
|
||||||
"subtitle": "Private VPN server",
|
|
||||||
"bottom_sheet": {
|
|
||||||
"1": "Openconnect VPN Server. Engine for secure and scalable VPN infrastructure"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"users": {
|
"users": {
|
||||||
|
@ -211,9 +188,8 @@
|
||||||
"20": "\n",
|
"20": "\n",
|
||||||
"21": "One more restart to apply your security certificates.",
|
"21": "One more restart to apply your security certificates.",
|
||||||
"22": "Create master account",
|
"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": {
|
"modals": {
|
||||||
"_comment": "messages in modals",
|
"_comment": "messages in modals",
|
||||||
|
@ -223,29 +199,9 @@
|
||||||
"4": "Purge all authentication keys?",
|
"4": "Purge all authentication keys?",
|
||||||
"5": "Yes, purge all my tokens",
|
"5": "Yes, purge all my tokens",
|
||||||
"6": "Delete the server and volume?",
|
"6": "Delete the server and volume?",
|
||||||
"7": "Yes",
|
"7": "Yes"
|
||||||
"8": "Remove task"
|
|
||||||
},
|
},
|
||||||
"timer": {
|
"timer": {
|
||||||
"sec": "{} sec"
|
"sec": "{} sec"
|
||||||
},
|
|
||||||
"jobs": {
|
|
||||||
"_comment": "Jobs list",
|
|
||||||
"title": "Jobs list",
|
|
||||||
"start": "Start",
|
|
||||||
"empty": "No jobs",
|
|
||||||
"createUser": "Create",
|
|
||||||
"serviceTurnOff": "Turn off",
|
|
||||||
"serviceTurnOn": "Turn on",
|
|
||||||
"jobAdded": "Job added",
|
|
||||||
"runJobs": "Run 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 {}",
|
|
||||||
"user_alredy_exist": "Already exists"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -6,7 +6,7 @@
|
||||||
"providers": "Провайдеры",
|
"providers": "Провайдеры",
|
||||||
"services": "Сервисы",
|
"services": "Сервисы",
|
||||||
"users": "Пользователи",
|
"users": "Пользователи",
|
||||||
"more": "Ещё",
|
"more": "Еще",
|
||||||
"next": "Далее",
|
"next": "Далее",
|
||||||
"got_it": "Понял",
|
"got_it": "Понял",
|
||||||
"settings": "Настройки",
|
"settings": "Настройки",
|
||||||
|
@ -22,42 +22,26 @@
|
||||||
"nickname": "Никнейм",
|
"nickname": "Никнейм",
|
||||||
"loading": "Загрузка",
|
"loading": "Загрузка",
|
||||||
"later": "Настрою потом",
|
"later": "Настрою потом",
|
||||||
"reset": "Сбросить",
|
"reset": "Reset",
|
||||||
"details": "Детальная информация",
|
"details": "Детальная информация",
|
||||||
"no_data": "Нет данных",
|
"no_data": "Нет данных"
|
||||||
"wait": "Загрузка",
|
|
||||||
"remove": "Удалить",
|
|
||||||
"apply": "Подать"
|
|
||||||
},
|
},
|
||||||
"more": {
|
"more": {
|
||||||
"_comment": "вкладка ещё",
|
"_comment": "вкладка еще",
|
||||||
"configuration_wizard": "Мастер Подключения",
|
"configuration_wizard": "Мастер Подключения",
|
||||||
"about_project": "О проекте SelfPrivacy",
|
"about_project": "О проекте SelfPrivacy",
|
||||||
"about_app": "О приложении",
|
"about_app": "О приложении",
|
||||||
"onboarding": "Приветствие",
|
"onboarding": "Приветствие",
|
||||||
"console": "Консоль",
|
"console": "Консоль",
|
||||||
"create_ssh_key": "Создать ssh ключ",
|
|
||||||
"generate_key": "Сгенерировать ключ",
|
|
||||||
"generate_key_text": "Вы сможете сгенерировать ключ",
|
|
||||||
"remove": "Отключить",
|
|
||||||
"enable": "Включить",
|
|
||||||
"ok": "ok",
|
|
||||||
"continue": "Продолжить",
|
|
||||||
"ssh_key_exist_text": "У Вас уже есть сгенерированный ssk ключ",
|
|
||||||
"yes_delete": "Да, удалить",
|
|
||||||
"share": "Поделиться",
|
|
||||||
"copy_buffer": "Копировать в буфер",
|
|
||||||
"copied_ssh": "SSH копировано в буфер",
|
|
||||||
"delete_ssh_text": "Удалить SSH ключ?",
|
|
||||||
"about_app_page": {
|
"about_app_page": {
|
||||||
"text": "Версия приложения: v.{}"
|
"text": "Версия приложения: v.{}"
|
||||||
},
|
},
|
||||||
"settings": {
|
"settings": {
|
||||||
"title": "Настройки приложения",
|
"title": "Настройки приложения",
|
||||||
"1": "Тёмная тема",
|
"1": "Темная тема",
|
||||||
"2": "Сменить цветовую тему.",
|
"2": "Сменить цветовую тему",
|
||||||
"3": "Сброс настроек",
|
"3": "Сброс настроек",
|
||||||
"4": "Сбросить API ключи а также root пользвателя.",
|
"4": "Сбросить API ключи а так же root пользвателя",
|
||||||
"5": "Удалить сервер",
|
"5": "Удалить сервер",
|
||||||
"6": "Действие приведет к удалению сервера. После чего он не будет доступен."
|
"6": "Действие приведет к удалению сервера. После чего он не будет доступен."
|
||||||
}
|
}
|
||||||
|
@ -65,9 +49,9 @@
|
||||||
"onboarding": {
|
"onboarding": {
|
||||||
"_comment": "страницы онбординга",
|
"_comment": "страницы онбординга",
|
||||||
"page1_title": "Цифровая независимость доступна каждому",
|
"page1_title": "Цифровая независимость доступна каждому",
|
||||||
"page1_text": "Почта, VPN, Мессенджер, социальная сеть и многое другое на Вашем личном сервере, под Вашим полным контролем.",
|
"page1_text": "Почта, VPN, Мессенджер, социальная сеть и многое другое на вашем личном сервере, под вашим полным контролем.",
|
||||||
"page2_title": "SelfPrivacy — это не облако, а Ваш личный дата-центр",
|
"page2_title": "SelfPrivacy — это не облако, а ваш личный дата-центр",
|
||||||
"page2_text": "SelfPrivacy работает только с вашими сервис-провайдерами: Hetzner, Cloudflare, Backblaze. Если у Вас нет учётных записей, мы поможем их создать."
|
"page2_text": "У SelfPrivacy работает только с вашими сервис-провадерами: Hetzner, Cloudflare, Backblaze. Если у вас нет учетных записей, мы поможем их создать."
|
||||||
},
|
},
|
||||||
"providers": {
|
"providers": {
|
||||||
"_comment": "вкладка провайдеры",
|
"_comment": "вкладка провайдеры",
|
||||||
|
@ -76,7 +60,7 @@
|
||||||
"card_title": "Сервер",
|
"card_title": "Сервер",
|
||||||
"status": "Статус — в норме",
|
"status": "Статус — в норме",
|
||||||
"bottom_sheet": {
|
"bottom_sheet": {
|
||||||
"1": "Это виртуальный компьютер на котором работают все Ваши сервисы.",
|
"1": "Это виртульный компьютер на котором работают все ваши сервисы.",
|
||||||
"2": "Общая информация",
|
"2": "Общая информация",
|
||||||
"3": "Размещение"
|
"3": "Размещение"
|
||||||
},
|
},
|
||||||
|
@ -90,18 +74,16 @@
|
||||||
"card_title": "Домен",
|
"card_title": "Домен",
|
||||||
"status": "Статус — в норме",
|
"status": "Статус — в норме",
|
||||||
"bottom_sheet": {
|
"bottom_sheet": {
|
||||||
"1": "Это Ваш личный адрес в интернете, который будет указывать на сервер и другие ваши сервисы.",
|
"1": "Это ваш личный адрес в интернете, который будет указывать на сервер и другие ваши сервисы.",
|
||||||
"2": "{} — продлен до {}."
|
"2": "{} — продлен до {}"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"backup": {
|
"backup": {
|
||||||
"card_title": "Резервное копирование",
|
"card_title": "Резервное копирование",
|
||||||
"status": "Статус — в норме",
|
"status": "Статус — в норме",
|
||||||
"bottom_sheet": {
|
"bottom_sheet": {
|
||||||
"1": "Выручит Вас в любой ситуации: хакерская атака, удаление сервера и.т.д.",
|
"1": "Выручит в любой ситуации: хакерская атака, удаление сервера и т.п.",
|
||||||
"2": "Использовано 3Gb из бестплатых 10Gb.",
|
"2": "3Gb — бестплатно до 10Gb, последний вчера в {}"
|
||||||
"3": "Последнее копирование была сделана вчера в {}."
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -113,72 +95,72 @@
|
||||||
},
|
},
|
||||||
"services": {
|
"services": {
|
||||||
"_comment": "Вкладка сервисы",
|
"_comment": "Вкладка сервисы",
|
||||||
"title": "Ваши личные, приватные и независимые сервисы:",
|
"title": "Ваши личные приватные и независимые сервисы",
|
||||||
"mail": {
|
"mail": {
|
||||||
"title": "Почта",
|
"title": "Почта",
|
||||||
"subtitle": "Электронная почта для семьи или компании.",
|
"subtitle": "Электронная почта для семьи или компании",
|
||||||
"bottom_sheet": {
|
"bottom_sheet": {
|
||||||
"1": "Для подключения почтового ящика используйте {} и профиль, который Вы создали. Так же приглашайте",
|
"1": "Для подключения почтового ящика используйте {} и логин пароль, который вы создали. Так же приглашайте",
|
||||||
"2": "новых пользователей."
|
"2": "новых пользователей"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"messenger": {
|
"messenger": {
|
||||||
"title": "Мессенджер",
|
"title": "Мессенджер",
|
||||||
"subtitle": "Telegram и Signal не так приватны, как Delta.Chat — который использует Ваш личный сервер.",
|
"subtitle": "Telegram и Signal не так приватны, как Delta.Chat использующий ваш личный сервер.",
|
||||||
"bottom_sheet": {
|
"bottom_sheet": {
|
||||||
"1": "Для подключения используйте {} и логин пароль, который Вы создали."
|
"1": "Для подключения используйте {} и логин пароль, который вы создали"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"password_manager": {
|
"password_manager": {
|
||||||
"title": "Менеджер паролей",
|
"title": "Менеджер паролей",
|
||||||
"subtitle": "Это фундамент Вашей безопасности. Создавать, хранить, копировать пароли между устройствами и вбивать их в формы поможет — Bitwarden.",
|
"subtitle": "Фундамент безопасности. Создавать, хранить, копировать пароли между устройствами, вбивать их в формы поможет — Bitwarden.",
|
||||||
"bottom_sheet": {
|
"bottom_sheet": {
|
||||||
"1": "Подключиться к серверу и создать пользователя можно по адресу:."
|
"1": "Подключиться к серверу и создать пользователя можно по адресу:"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"video": {
|
"video": {
|
||||||
"title": "Видеоконференция",
|
"title": "Видеоконференция",
|
||||||
"subtitle": "Jitsi meet — отличный аналог Zoom и Google meet который по мимо удобства ещё и гарантирует Вам защищённые высококачественные видеоконференции.",
|
"subtitle": "Zoom и Google meet отличные инструменты, но Jitsi meet не хуже и дает уверенность, что вас никто не подслушивает.",
|
||||||
"bottom_sheet": {
|
"bottom_sheet": {
|
||||||
"1": "Для использования просто перейдите по ссылке:."
|
"1": "Для использования просто перейдите по ссылке:"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"cloud": {
|
"cloud": {
|
||||||
"title": "Файловое облако",
|
"title": "Файловое облако",
|
||||||
"subtitle": "Не позволяйте облачным сервисам просматривать ваши данные. Используйте NextCloud — надёжный дом для всех Ваших данных.",
|
"subtitle": "Не позволяйте облачным сервисам читать ваши данные используйте NextCloud.",
|
||||||
"bottom_sheet": {
|
"bottom_sheet": {
|
||||||
"1": "Подключиться к серверу и создать пользователя можно по адресу:."
|
"1": "Подключиться к серверу и создать пользователя можно по адресу:"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"social_network": {
|
"social_network": {
|
||||||
"title": "Социальная сеть",
|
"title": "Социальная сеть",
|
||||||
"subtitle": "Сложно поверить, но стало возможным создать свою собственную социальную сеть, со своими правилами и аудиторией.",
|
"subtitle": "Сложно поверить, но стало возможным создать свою собственную социальную сеть, со своими правилами и аудиторией.",
|
||||||
"bottom_sheet": {
|
"bottom_sheet": {
|
||||||
"1": "Подключиться к серверу и создать пользователя можно по адресу:."
|
"1": "Подключиться к серверу и создать пользователя можно по адресу:"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"git": {
|
"git": {
|
||||||
"title": "Git-сервер",
|
"title": "Git-сервер",
|
||||||
"subtitle": "Приватная альтернатива Github, которая принадлежит вам, а не Microsoft.",
|
"subtitle": "Приватная альтернатива Github, которая принадлежит вам, а не Microsoft.",
|
||||||
"bottom_sheet": {
|
"bottom_sheet": {
|
||||||
"1": "Подключиться к серверу и создать пользователя можно по адресу:."
|
"1": "Подключиться к серверу и создать пользователя можно по адресу:"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"users": {
|
"users": {
|
||||||
"_comment": "'Users' tab",
|
"_comment": "'Users' tab",
|
||||||
"add_new_user": "Добавьте первого пользователя.",
|
"add_new_user": "Добавьте первого пользователя",
|
||||||
"new_user": "Новый пользователь",
|
"new_user": "Новый пользователь",
|
||||||
"not_ready": "Подключите сервер, домен и DNS в разделу Провайдеры, чтобы добавить первого пользователя",
|
"not_ready": "Подключите сервер, домен и DNS в разделу Провайдеры, чтобы добавить первого пользователя",
|
||||||
"nobody_here": "Здесь будут отображаться пользователи.",
|
"nobody_here": "'Здесь пока никого'",
|
||||||
"login": "Логин",
|
"login": "Логин",
|
||||||
"onboarding": "Приветствие",
|
"onboarding": "Приветствие",
|
||||||
"console": "Консоль разработчика",
|
"console": "Консоль разработчика",
|
||||||
"new_user_info_note": "Новый пользователь автоматически получит доступ ко всем сервисам.",
|
"new_user_info_note": "Новый пользователь автоматически получит доступ ко всем сервисам. Ещё какое-то описание.",
|
||||||
"delete_confirm_question": "Вы действительно хотите удалить учетную запись?",
|
"delete_confirm_question": "удалить учетную запись?",
|
||||||
"reset_password": "Сбросить пароль",
|
"reset_password": "Сбросить пароль",
|
||||||
"account": "Учетная запись",
|
"account": "Учетная запись",
|
||||||
"send_regisration_data": "Поделиться реквизитами"
|
"send_regisration_data": "Отправить реквизиты для входа"
|
||||||
},
|
},
|
||||||
"initializing": {
|
"initializing": {
|
||||||
"_comment": "initializing page",
|
"_comment": "initializing page",
|
||||||
|
@ -191,56 +173,34 @@
|
||||||
"6": "Подключите облачное хранилище Backblaze",
|
"6": "Подключите облачное хранилище Backblaze",
|
||||||
"7": "На данный момент подлюченных доменов нет",
|
"7": "На данный момент подлюченных доменов нет",
|
||||||
"8": "Загружаем список доменов",
|
"8": "Загружаем список доменов",
|
||||||
"9": "Найдено больше одного домена, для вашей безопастности, просим Вам удалить не нужные домены",
|
"9": "Найдено больше одного домена, для вашей безопастности, просим вам удалить не нужные домены",
|
||||||
"10": "Сохранить домен",
|
"10": "Сохранить домен",
|
||||||
"final": "Последний шаг",
|
"final": "Последний шаг",
|
||||||
"11": "Создать сервер",
|
"11": "Создать сервер",
|
||||||
"what": "Что это значит?",
|
"what": "Что это значит?",
|
||||||
"13": "Сервер презагружен, ждем последнюю проверку.",
|
"13": "Сервер презагружен, ждем последнюю проверку",
|
||||||
"14": "Cервер запущен, сейчас он будет проверен и перезагружен.",
|
"14": "Cервер запушен, сейчас он будет проверен и перезагружен",
|
||||||
"15": "Cервер создан, идет проверка ДНС адресов и запуск сервера.",
|
"15": "Cервер создан, идет проверка ДНС адресов и запуск сервера",
|
||||||
"16": "До следующей проверки: ",
|
"16": "До следующей проверки: ",
|
||||||
"17": "Проверка",
|
"17": "Проверка",
|
||||||
"18": "Как получить Hetzner API Token:'",
|
"18": "Как получить Hetzner API Token'",
|
||||||
"19": "1 Переходим по ссылке ",
|
"19": "1 Переходим по ссылке ",
|
||||||
"20": "\n2 Заходим в созданный нами проект. Если такового нет - значит создаём.\n3 Наводим мышкой на боковую панель. Она должна раскрыться, показав нам пункты меню. Нас интересует последний — Security (с иконкой ключика).\n4 Далее, в верхней части интерфейса видим примерно такой список: SSH Keys, API Tokens, Certificates, Members. Нам нужен API Tokens. Переходим по нему.\n5 В правой части интерфейса, нас будет ожидать кнопка Generate API token. Если же Вы используете мобильную версию сайта - в нижнем правом углу Вы увидите красный плюсик. Нажимаем на эту кнопку.\n6 В поле Description даём нашему токену название (это может быть любое название, которое Вам нравиться, сути оно не меняет.",
|
"20": "\n2 Заходим в созданный нами проект. Если такового - нет, значит создаём.\n3 Наводим мышкой на боковую панель. Она должна раскрыться, показав нам пункты меню. Нас интересует последний — Security (с иконкой ключика).\n4 Далее, в верхней части интерфейса видим примерно такой список: SSH Keys, API Tokens, Certificates, Members. Нам нужен API Tokens. Переходим по нему.\n5 В правой части интерфейса, нас будет ожидать кнопка Generate API token. Если же вы используете мобильную версию сайта, в нижнем правом углу вы увидите красный плюсик. Нажимаем на эту кнопку.\n6 В поле Description, даём нашему токену название (это может быть любое название, которые вам нравиться. Сути оно не меняет.",
|
||||||
"21": "Сейчас будет дополнительная перезагрузка для активации сертификатов безопастности",
|
"21": "Сейчас будет дополнительная перезагрузка для активации сертификатов безопастности",
|
||||||
"22": "Создайте главную учетную запись",
|
"22": "Создайте главную учетную запись",
|
||||||
"23": "Введите никнейм и сложный пароль",
|
"23": "Введите никнейм и сложный пароль"
|
||||||
"finish": "Всё инициализировано.",
|
|
||||||
"checks": "Проверок выполнено: \n{} / {}"
|
|
||||||
},
|
},
|
||||||
"modals": {
|
"modals": {
|
||||||
"_comment": "messages in modals",
|
"_comment": "messages in modals",
|
||||||
"1": "Сервер с таким именем уже существует",
|
"1": "Сервер с таким именем уже существует",
|
||||||
"2": "Уничтожить сервер и создать новый?",
|
"2": "Уничтожить сервер и создать новый?",
|
||||||
"3": "Подтвердите",
|
"3": "Вы уверенны",
|
||||||
"4": "Сбросить все ключи?",
|
"4": "Сбросить все ключи?",
|
||||||
"5": "Да, сбросить",
|
"5": "Да, сбросить",
|
||||||
"6": "Удалить сервер и диск?",
|
"6": "Удалить сервер и диск?",
|
||||||
"7": "Да, удалить",
|
"7": "Да, удалить"
|
||||||
"8": "Удалить задачу"
|
|
||||||
},
|
},
|
||||||
"timer": {
|
"timer": {
|
||||||
"sec": "{} сек"
|
"sec": "{} сек"
|
||||||
},
|
|
||||||
"jobs": {
|
|
||||||
"_comment": "Jobs list",
|
|
||||||
"title": "Задачи",
|
|
||||||
"start": "Начать выполенение",
|
|
||||||
"empty": "Пусто.",
|
|
||||||
"createUser": "Создать запись",
|
|
||||||
"serviceTurnOff": "Остановить",
|
|
||||||
"serviceTurnOn": "Запустить",
|
|
||||||
"jobAdded": "Задача добавленна",
|
|
||||||
"runJobs": "Запустите задачи"
|
|
||||||
},
|
|
||||||
"validations": {
|
|
||||||
"required": "Обязательное поле.",
|
|
||||||
"invalid_format": "Неверный формат.",
|
|
||||||
"root_name": "Имя пользователя не может быть'root'.",
|
|
||||||
"key_format": "Неверный формат.",
|
|
||||||
"length": "Длина строки [] должна быть {}.",
|
|
||||||
"user_alredy_exist": "Имя уже используется."
|
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,7 +0,0 @@
|
||||||
- Added users creation possibility
|
|
||||||
- Fixed reverse DNS issue during server creation
|
|
||||||
- Updated NixOS to 21.05
|
|
||||||
- Defined application users as system ones
|
|
||||||
- Minor bugfixes
|
|
||||||
- Translation fixes
|
|
||||||
- en_GB is now a separate locale
|
|
|
@ -1,5 +1,5 @@
|
||||||
SelfPrivacy - is a platform on your cloud hosting, that allows to deploy your own private services and control them using mobile application.
|
SelfPrivacy - is a platform on your cloud hosting, that allows to deploy your own private services and control them using mobile application.
|
||||||
To use this application, you'll be required to create accounts of different service providers. Please reffer to this manual: https://hugo.selfprivacy.org/posts/getting_started
|
To use this application, you'll be required to create accounts of different service providers. Please reffer to this manual: https://selfprivacy.org/en/second.html
|
||||||
Application will do the following things for you:
|
Application will do the following things for you:
|
||||||
1. Create your personal server
|
1. Create your personal server
|
||||||
2. Setup NixOS
|
2. Setup NixOS
|
||||||
|
@ -12,4 +12,5 @@ Application will do the following things for you:
|
||||||
* Gitea - your own Git server
|
* Gitea - your own Git server
|
||||||
* OpenConnect - Personal VPN server
|
* OpenConnect - Personal VPN server
|
||||||
|
|
||||||
!!! Project is currently in open beta state. Feel free to try it. It would be much appreciated if you would provide us with some feedback.
|
!!! Project is currently in alpha state. Feel free to try it. It would be much appreciated if you would provide us with some feedback.
|
||||||
|
!!! Only Russian localization is currently available. English is coming soon
|
||||||
|
|
|
@ -21,6 +21,6 @@
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>1.0</string>
|
<string>1.0</string>
|
||||||
<key>MinimumOSVersion</key>
|
<key>MinimumOSVersion</key>
|
||||||
<string>9.0</string>
|
<string>8.0</string>
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
|
|
|
@ -2,14 +2,10 @@ PODS:
|
||||||
- Flutter (1.0.0)
|
- Flutter (1.0.0)
|
||||||
- flutter_secure_storage (3.3.1):
|
- flutter_secure_storage (3.3.1):
|
||||||
- Flutter
|
- Flutter
|
||||||
- local_auth (0.0.1):
|
|
||||||
- Flutter
|
|
||||||
- package_info (0.0.1):
|
- package_info (0.0.1):
|
||||||
- Flutter
|
- Flutter
|
||||||
- path_provider (0.0.1):
|
- path_provider (0.0.1):
|
||||||
- Flutter
|
- Flutter
|
||||||
- share_plus (0.0.1):
|
|
||||||
- Flutter
|
|
||||||
- shared_preferences (0.0.1):
|
- shared_preferences (0.0.1):
|
||||||
- Flutter
|
- Flutter
|
||||||
- url_launcher (0.0.1):
|
- url_launcher (0.0.1):
|
||||||
|
@ -20,10 +16,8 @@ PODS:
|
||||||
DEPENDENCIES:
|
DEPENDENCIES:
|
||||||
- Flutter (from `Flutter`)
|
- Flutter (from `Flutter`)
|
||||||
- flutter_secure_storage (from `.symlinks/plugins/flutter_secure_storage/ios`)
|
- flutter_secure_storage (from `.symlinks/plugins/flutter_secure_storage/ios`)
|
||||||
- local_auth (from `.symlinks/plugins/local_auth/ios`)
|
|
||||||
- package_info (from `.symlinks/plugins/package_info/ios`)
|
- package_info (from `.symlinks/plugins/package_info/ios`)
|
||||||
- path_provider (from `.symlinks/plugins/path_provider/ios`)
|
- path_provider (from `.symlinks/plugins/path_provider/ios`)
|
||||||
- share_plus (from `.symlinks/plugins/share_plus/ios`)
|
|
||||||
- shared_preferences (from `.symlinks/plugins/shared_preferences/ios`)
|
- shared_preferences (from `.symlinks/plugins/shared_preferences/ios`)
|
||||||
- url_launcher (from `.symlinks/plugins/url_launcher/ios`)
|
- url_launcher (from `.symlinks/plugins/url_launcher/ios`)
|
||||||
- wakelock (from `.symlinks/plugins/wakelock/ios`)
|
- wakelock (from `.symlinks/plugins/wakelock/ios`)
|
||||||
|
@ -33,14 +27,10 @@ EXTERNAL SOURCES:
|
||||||
:path: Flutter
|
:path: Flutter
|
||||||
flutter_secure_storage:
|
flutter_secure_storage:
|
||||||
:path: ".symlinks/plugins/flutter_secure_storage/ios"
|
:path: ".symlinks/plugins/flutter_secure_storage/ios"
|
||||||
local_auth:
|
|
||||||
:path: ".symlinks/plugins/local_auth/ios"
|
|
||||||
package_info:
|
package_info:
|
||||||
:path: ".symlinks/plugins/package_info/ios"
|
:path: ".symlinks/plugins/package_info/ios"
|
||||||
path_provider:
|
path_provider:
|
||||||
:path: ".symlinks/plugins/path_provider/ios"
|
:path: ".symlinks/plugins/path_provider/ios"
|
||||||
share_plus:
|
|
||||||
:path: ".symlinks/plugins/share_plus/ios"
|
|
||||||
shared_preferences:
|
shared_preferences:
|
||||||
:path: ".symlinks/plugins/shared_preferences/ios"
|
:path: ".symlinks/plugins/shared_preferences/ios"
|
||||||
url_launcher:
|
url_launcher:
|
||||||
|
@ -49,12 +39,10 @@ EXTERNAL SOURCES:
|
||||||
:path: ".symlinks/plugins/wakelock/ios"
|
:path: ".symlinks/plugins/wakelock/ios"
|
||||||
|
|
||||||
SPEC CHECKSUMS:
|
SPEC CHECKSUMS:
|
||||||
Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a
|
Flutter: 434fef37c0980e73bb6479ef766c45957d4b510c
|
||||||
flutter_secure_storage: 7953c38a04c3fdbb00571bcd87d8e3b5ceb9daec
|
flutter_secure_storage: 7953c38a04c3fdbb00571bcd87d8e3b5ceb9daec
|
||||||
local_auth: 25938960984c3a7f6e3253e3f8d962fdd16852bd
|
|
||||||
package_info: 873975fc26034f0b863a300ad47e7f1ac6c7ec62
|
package_info: 873975fc26034f0b863a300ad47e7f1ac6c7ec62
|
||||||
path_provider: abfe2b5c733d04e238b0d8691db0cfd63a27a93c
|
path_provider: abfe2b5c733d04e238b0d8691db0cfd63a27a93c
|
||||||
share_plus: 056a1e8ac890df3e33cb503afffaf1e9b4fbae68
|
|
||||||
shared_preferences: af6bfa751691cdc24be3045c43ec037377ada40d
|
shared_preferences: af6bfa751691cdc24be3045c43ec037377ada40d
|
||||||
url_launcher: 6fef411d543ceb26efce54b05a0a40bfd74cbbef
|
url_launcher: 6fef411d543ceb26efce54b05a0a40bfd74cbbef
|
||||||
wakelock: d0fc7c864128eac40eba1617cb5264d9c940b46f
|
wakelock: d0fc7c864128eac40eba1617cb5264d9c940b46f
|
||||||
|
|
|
@ -361,7 +361,6 @@
|
||||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
CLANG_ENABLE_MODULES = YES;
|
CLANG_ENABLE_MODULES = YES;
|
||||||
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
||||||
DEVELOPMENT_TEAM = UVNTKR53DD;
|
|
||||||
ENABLE_BITCODE = NO;
|
ENABLE_BITCODE = NO;
|
||||||
FRAMEWORK_SEARCH_PATHS = (
|
FRAMEWORK_SEARCH_PATHS = (
|
||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
|
@ -500,7 +499,6 @@
|
||||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
CLANG_ENABLE_MODULES = YES;
|
CLANG_ENABLE_MODULES = YES;
|
||||||
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
||||||
DEVELOPMENT_TEAM = UVNTKR53DD;
|
|
||||||
ENABLE_BITCODE = NO;
|
ENABLE_BITCODE = NO;
|
||||||
FRAMEWORK_SEARCH_PATHS = (
|
FRAMEWORK_SEARCH_PATHS = (
|
||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
|
@ -531,7 +529,6 @@
|
||||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
CLANG_ENABLE_MODULES = YES;
|
CLANG_ENABLE_MODULES = YES;
|
||||||
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
||||||
DEVELOPMENT_TEAM = UVNTKR53DD;
|
|
||||||
ENABLE_BITCODE = NO;
|
ENABLE_BITCODE = NO;
|
||||||
FRAMEWORK_SEARCH_PATHS = (
|
FRAMEWORK_SEARCH_PATHS = (
|
||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
|
|
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 30 KiB |
Before Width: | Height: | Size: 829 B After Width: | Height: | Size: 354 B |
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 608 B |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 906 B |
Before Width: | Height: | Size: 1007 B After Width: | Height: | Size: 525 B |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 907 B |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 608 B |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.2 KiB |
|
@ -2,9 +2,7 @@ import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
import 'package:selfprivacy/logic/cubit/app_settings/app_settings_cubit.dart';
|
import 'package:selfprivacy/logic/cubit/app_settings/app_settings_cubit.dart';
|
||||||
import 'package:selfprivacy/logic/cubit/app_config/app_config_cubit.dart';
|
import 'package:selfprivacy/logic/cubit/app_config/app_config_cubit.dart';
|
||||||
import 'package:selfprivacy/logic/cubit/jobs/jobs_cubit.dart';
|
|
||||||
import 'package:selfprivacy/logic/cubit/providers/providers_cubit.dart';
|
import 'package:selfprivacy/logic/cubit/providers/providers_cubit.dart';
|
||||||
import 'package:selfprivacy/logic/cubit/services/services_cubit.dart';
|
|
||||||
import 'package:selfprivacy/logic/cubit/users/users_cubit.dart';
|
import 'package:selfprivacy/logic/cubit/users/users_cubit.dart';
|
||||||
|
|
||||||
class BlocAndProviderConfig extends StatelessWidget {
|
class BlocAndProviderConfig extends StatelessWidget {
|
||||||
|
@ -14,9 +12,11 @@ class BlocAndProviderConfig extends StatelessWidget {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
// var platformBrightness =
|
||||||
|
// SchedulerBinding.instance.window.platformBrightness;
|
||||||
|
// var isDark = platformBrightness == Brightness.dark;
|
||||||
var isDark = false;
|
var isDark = false;
|
||||||
var usersCubit = UsersCubit();
|
|
||||||
var servicesCubit = ServicesCubit();
|
|
||||||
return MultiProvider(
|
return MultiProvider(
|
||||||
providers: [
|
providers: [
|
||||||
BlocProvider(
|
BlocProvider(
|
||||||
|
@ -27,17 +27,10 @@ class BlocAndProviderConfig extends StatelessWidget {
|
||||||
),
|
),
|
||||||
BlocProvider(
|
BlocProvider(
|
||||||
lazy: false,
|
lazy: false,
|
||||||
create: (_) => AppConfigCubit(servicesCubit)..load(),
|
create: (_) => AppConfigCubit()..load(),
|
||||||
),
|
),
|
||||||
BlocProvider(create: (_) => ProvidersCubit()),
|
BlocProvider(create: (_) => ProvidersCubit()),
|
||||||
BlocProvider(create: (_) => usersCubit..load(), lazy: false),
|
BlocProvider(create: (_) => UsersCubit()),
|
||||||
BlocProvider(create: (_) => servicesCubit..load(), lazy: false),
|
|
||||||
BlocProvider(
|
|
||||||
create: (_) => JobsCubit(
|
|
||||||
usersCubit: usersCubit,
|
|
||||||
servicesCubit: servicesCubit,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
child: child,
|
child: child,
|
||||||
);
|
);
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
final shadow8 = BoxShadow(
|
||||||
|
offset: Offset(0, 4),
|
||||||
|
blurRadius: 8,
|
||||||
|
color: Colors.black.withOpacity(.08),
|
||||||
|
);
|
|
@ -76,6 +76,6 @@ var darkTheme = ligtTheme.copyWith(
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
final paddingH15V30 = EdgeInsets.symmetric(horizontal: 15, vertical: 30);
|
final brandPagePadding1 = EdgeInsets.symmetric(horizontal: 15, vertical: 30);
|
||||||
|
|
||||||
final paddingH15V0 = EdgeInsets.symmetric(horizontal: 15);
|
final brandPagePadding2 = EdgeInsets.symmetric(horizontal: 15);
|
||||||
|
|
|
@ -2,7 +2,6 @@ import 'package:get_it/get_it.dart';
|
||||||
import 'package:selfprivacy/logic/get_it/api_config.dart';
|
import 'package:selfprivacy/logic/get_it/api_config.dart';
|
||||||
import 'package:selfprivacy/logic/get_it/console.dart';
|
import 'package:selfprivacy/logic/get_it/console.dart';
|
||||||
import 'package:selfprivacy/logic/get_it/navigation.dart';
|
import 'package:selfprivacy/logic/get_it/navigation.dart';
|
||||||
import 'package:selfprivacy/logic/get_it/ssh.dart';
|
|
||||||
import 'package:selfprivacy/logic/get_it/timer.dart';
|
import 'package:selfprivacy/logic/get_it/timer.dart';
|
||||||
|
|
||||||
export 'package:selfprivacy/logic/get_it/api_config.dart';
|
export 'package:selfprivacy/logic/get_it/api_config.dart';
|
||||||
|
@ -10,6 +9,7 @@ export 'package:selfprivacy/logic/get_it/console.dart';
|
||||||
export 'package:selfprivacy/logic/get_it/navigation.dart';
|
export 'package:selfprivacy/logic/get_it/navigation.dart';
|
||||||
export 'package:selfprivacy/logic/get_it/timer.dart';
|
export 'package:selfprivacy/logic/get_it/timer.dart';
|
||||||
|
|
||||||
|
|
||||||
final getIt = GetIt.instance;
|
final getIt = GetIt.instance;
|
||||||
|
|
||||||
Future<void> getItSetup() async {
|
Future<void> getItSetup() async {
|
||||||
|
@ -17,7 +17,6 @@ Future<void> getItSetup() async {
|
||||||
|
|
||||||
getIt.registerSingleton<ConsoleModel>(ConsoleModel());
|
getIt.registerSingleton<ConsoleModel>(ConsoleModel());
|
||||||
getIt.registerSingleton<TimerModel>(TimerModel());
|
getIt.registerSingleton<TimerModel>(TimerModel());
|
||||||
getIt.registerSingleton<SSHModel>(SSHModel()..init());
|
|
||||||
getIt.registerSingleton<ApiConfigModel>(ApiConfigModel()..init());
|
getIt.registerSingleton<ApiConfigModel>(ApiConfigModel()..init());
|
||||||
|
|
||||||
await getIt.allReady();
|
await getIt.allReady();
|
||||||
|
|
|
@ -19,25 +19,21 @@ class HiveConfig {
|
||||||
Hive.registerAdapter(HetznerDataBaseAdapter());
|
Hive.registerAdapter(HetznerDataBaseAdapter());
|
||||||
|
|
||||||
await Hive.openBox(BNames.appSettings);
|
await Hive.openBox(BNames.appSettings);
|
||||||
await Hive.openBox<User>(BNames.users);
|
var cipher = HiveAesCipher(await getEncriptedKey());
|
||||||
await Hive.openBox(BNames.servicesState);
|
|
||||||
|
|
||||||
var cipher = HiveAesCipher(await getEncriptedKey(BNames.key));
|
|
||||||
await Hive.openBox(BNames.appConfig, encryptionCipher: cipher);
|
await Hive.openBox(BNames.appConfig, encryptionCipher: cipher);
|
||||||
|
|
||||||
var sshCipher = HiveAesCipher(await getEncriptedKey(BNames.sshEnckey));
|
|
||||||
await Hive.openBox(BNames.sshConfig, encryptionCipher: sshCipher);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static Future<Uint8List> getEncriptedKey(String encKey) async {
|
static Future<Uint8List> getEncriptedKey() async {
|
||||||
final secureStorage = FlutterSecureStorage();
|
final FlutterSecureStorage secureStorage = FlutterSecureStorage();
|
||||||
var hasEncryptionKey = await secureStorage.containsKey(key: encKey);
|
var containsEncryptionKey =
|
||||||
if (!hasEncryptionKey) {
|
await secureStorage.containsKey(key: BNames.key);
|
||||||
|
if (!containsEncryptionKey) {
|
||||||
var key = Hive.generateSecureKey();
|
var key = Hive.generateSecureKey();
|
||||||
await secureStorage.write(key: encKey, value: base64UrlEncode(key));
|
await secureStorage.write(key: BNames.key, value: base64UrlEncode(key));
|
||||||
}
|
}
|
||||||
|
|
||||||
String? string = await secureStorage.read(key: encKey);
|
String? string = await secureStorage.read(key: BNames.key);
|
||||||
return base64Url.decode(string!);
|
return base64Url.decode(string!);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -46,13 +42,10 @@ class BNames {
|
||||||
static String appConfig = 'appConfig';
|
static String appConfig = 'appConfig';
|
||||||
static String isDarkModeOn = 'isDarkModeOn';
|
static String isDarkModeOn = 'isDarkModeOn';
|
||||||
static String isOnbordingShowing = 'isOnbordingShowing';
|
static String isOnbordingShowing = 'isOnbordingShowing';
|
||||||
static String users = 'users';
|
|
||||||
|
|
||||||
static String appSettings = 'appSettings';
|
static String appSettings = 'appSettings';
|
||||||
static String servicesState = 'servicesState';
|
|
||||||
|
|
||||||
static String key = 'key';
|
static String key = 'key';
|
||||||
static String sshEnckey = 'sshEngkey';
|
|
||||||
|
|
||||||
static String cloudFlareDomain = 'cloudFlareDomain';
|
static String cloudFlareDomain = 'cloudFlareDomain';
|
||||||
static String hetznerKey = 'hetznerKey';
|
static String hetznerKey = 'hetznerKey';
|
||||||
|
@ -65,7 +58,4 @@ class BNames {
|
||||||
static String isLoading = 'isLoading';
|
static String isLoading = 'isLoading';
|
||||||
static String isServerResetedFirstTime = 'isServerResetedFirstTime';
|
static String isServerResetedFirstTime = 'isServerResetedFirstTime';
|
||||||
static String isServerResetedSecondTime = 'isServerResetedSecondTime';
|
static String isServerResetedSecondTime = 'isServerResetedSecondTime';
|
||||||
static String sshConfig = 'sshConfig';
|
|
||||||
static String sshPrivateKey = "sshPrivateKey";
|
|
||||||
static String sshPublicKey = "sshPublicKey";
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,7 @@ import 'package:selfprivacy/logic/api_maps/api_map.dart';
|
||||||
import 'package:selfprivacy/logic/models/hetzner_server_info.dart';
|
import 'package:selfprivacy/logic/models/hetzner_server_info.dart';
|
||||||
import 'package:selfprivacy/logic/models/server_details.dart';
|
import 'package:selfprivacy/logic/models/server_details.dart';
|
||||||
import 'package:selfprivacy/logic/models/user.dart';
|
import 'package:selfprivacy/logic/models/user.dart';
|
||||||
import 'package:selfprivacy/utils/password_generator.dart';
|
import 'package:selfprivacy/utils/password_generator2.dart';
|
||||||
|
|
||||||
class HetznerApi extends ApiMap {
|
class HetznerApi extends ApiMap {
|
||||||
bool hasLoger;
|
bool hasLoger;
|
||||||
|
@ -73,28 +73,30 @@ class HetznerApi extends ApiMap {
|
||||||
required User rootUser,
|
required User rootUser,
|
||||||
required String domainName,
|
required String domainName,
|
||||||
}) async {
|
}) async {
|
||||||
|
var dbPassword = getRandomString(40);
|
||||||
|
|
||||||
|
const chars =
|
||||||
|
'AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz1234567890';
|
||||||
|
|
||||||
|
var dbStorageName = getRandomString(6, chars);
|
||||||
var client = await getClient();
|
var client = await getClient();
|
||||||
|
|
||||||
Response dbCreateResponse = await client.post(
|
Response dbCreateResponse = await client.post(
|
||||||
'/volumes',
|
'/volumes',
|
||||||
data: {
|
data: {
|
||||||
"size": 10,
|
"size": 10,
|
||||||
"name": StringGenerators.dbStorageName(),
|
"name": dbStorageName,
|
||||||
"labels": {"labelkey": "value"},
|
"labels": {"labelkey": "value"},
|
||||||
"location": "fsn1",
|
"location": "fsn1",
|
||||||
"automount": false,
|
"automount": false,
|
||||||
"format": "ext4"
|
"format": "ext4"
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
var dbPassword = StringGenerators.dbPassword();
|
|
||||||
var dbId = dbCreateResponse.data['volume']['id'];
|
var dbId = dbCreateResponse.data['volume']['id'];
|
||||||
|
|
||||||
/// add ssh key when you need it: e.g. "ssh_keys":["kherel"]
|
|
||||||
/// check the branch name, it could be "development" or "master".
|
|
||||||
|
|
||||||
var data = jsonDecode(
|
var data = jsonDecode(
|
||||||
'''{"name":"$domainName","server_type":"cx11","start_after_create":false,"image":"ubuntu-20.04", "volumes":[$dbId], "networks":[], "user_data":"#cloud-config\\nruncmd:\\n- curl https://git.selfprivacy.org/ilchub/selfprivacy-nixos-infect/raw/branch/master/nixos-infect | PROVIDER=hetzner NIX_CHANNEL=nixos-21.05 DOMAIN=$domainName LUSER=${rootUser.login} PASSWORD=${rootUser.password} CF_TOKEN=$cloudFlareKey DB_PASSWORD=$dbPassword bash 2>&1 | tee /tmp/infect.log","labels":{},"automount":true, "location": "fsn1"}''');
|
'''{"name":"$domainName","server_type":"cx11","start_after_create":false,"image":"ubuntu-20.04", "volumes":[$dbId], "networks":[],"user_data":"#cloud-config\\nruncmd:\\n- curl https://git.selfprivacy.org/ilchub/selfprivacy-nixos-infect/raw/branch/master/nixos-infect | PROVIDER=hetzner NIX_CHANNEL=nixos-20.09 DOMAIN=$domainName LUSER=${rootUser.login} PASSWORD=${rootUser.password} HASHED_PASSWORD=${rootUser.hashPassword.hash} SALT=${rootUser.hashPassword.salt} CF_TOKEN=$cloudFlareKey DB_PASSWORD=$dbPassword bash 2>&1 | tee /tmp/infect.log","labels":{},"automount":true, "location": "fsn1"}''',
|
||||||
|
);
|
||||||
|
|
||||||
Response serverCreateResponse = await client.post(
|
Response serverCreateResponse = await client.post(
|
||||||
'/servers',
|
'/servers',
|
||||||
|
@ -190,20 +192,4 @@ class HetznerApi extends ApiMap {
|
||||||
|
|
||||||
return HetznerServerInfo.fromJson(response.data!['server']);
|
return HetznerServerInfo.fromJson(response.data!['server']);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> createReverseDns({
|
|
||||||
required String ip4,
|
|
||||||
required String domainName,
|
|
||||||
}) async {
|
|
||||||
var hetznerServer = getIt<ApiConfigModel>().hetznerServer;
|
|
||||||
var client = await getClient();
|
|
||||||
await client.post(
|
|
||||||
'/servers/${hetznerServer!.id}/actions/change_dns_ptr',
|
|
||||||
data: {
|
|
||||||
"ip": ip4,
|
|
||||||
"dns_ptr": domainName,
|
|
||||||
},
|
|
||||||
);
|
|
||||||
close(client);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,8 +3,6 @@ import 'dart:io';
|
||||||
|
|
||||||
import 'package:dio/dio.dart';
|
import 'package:dio/dio.dart';
|
||||||
import 'package:selfprivacy/config/get_it_config.dart';
|
import 'package:selfprivacy/config/get_it_config.dart';
|
||||||
import 'package:selfprivacy/logic/common_enum/common_enum.dart';
|
|
||||||
import 'package:selfprivacy/logic/models/user.dart';
|
|
||||||
|
|
||||||
import 'api_map.dart';
|
import 'api_map.dart';
|
||||||
|
|
||||||
|
@ -33,7 +31,7 @@ class ServerApi extends ApiMap {
|
||||||
|
|
||||||
var client = await getClient();
|
var client = await getClient();
|
||||||
try {
|
try {
|
||||||
response = await client.get('/services/status');
|
response = await client.get('/serviceStatus');
|
||||||
res = response.statusCode == HttpStatus.ok;
|
res = response.statusCode == HttpStatus.ok;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
res = false;
|
res = false;
|
||||||
|
@ -42,92 +40,6 @@ class ServerApi extends ApiMap {
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<bool> createUser(User user) async {
|
|
||||||
bool res;
|
|
||||||
Response response;
|
|
||||||
|
|
||||||
var client = await getClient();
|
|
||||||
try {
|
|
||||||
response = await client.post(
|
|
||||||
'/users/create',
|
|
||||||
options: Options(
|
|
||||||
headers: {
|
|
||||||
"X-User": user.login,
|
|
||||||
"X-Password":
|
|
||||||
'\$6\$${user.hashPassword.salt}\$${user.hashPassword.hash}',
|
|
||||||
},
|
|
||||||
),
|
|
||||||
);
|
|
||||||
res = response.statusCode == HttpStatus.ok;
|
|
||||||
} catch (e) {
|
|
||||||
print(e);
|
|
||||||
res = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
close(client);
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
|
|
||||||
String get rootAddress =>
|
String get rootAddress =>
|
||||||
throw UnimplementedError('not used in with implementation');
|
throw UnimplementedError('not used in with implementation');
|
||||||
|
|
||||||
Future<bool> apply() async {
|
|
||||||
bool res;
|
|
||||||
Response response;
|
|
||||||
|
|
||||||
var client = await getClient();
|
|
||||||
try {
|
|
||||||
response = await client.get(
|
|
||||||
'/system/configuration/apply',
|
|
||||||
);
|
|
||||||
|
|
||||||
res = response.statusCode == HttpStatus.ok;
|
|
||||||
} catch (e) {
|
|
||||||
print(e);
|
|
||||||
res = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
close(client);
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
|
|
||||||
Future<void> switchService(ServiceTypes type, bool needToTurnOn) async {
|
|
||||||
var client = await getClient();
|
|
||||||
client.post('/services/${type.url}/${needToTurnOn ? 'enable' : 'disable'}');
|
|
||||||
client.close();
|
|
||||||
}
|
|
||||||
|
|
||||||
Future<void> sendSsh(String ssh) async {
|
|
||||||
var client = await getClient();
|
|
||||||
client.post(
|
|
||||||
'/services/ssh/enable',
|
|
||||||
data: {"public_key": ssh},
|
|
||||||
);
|
|
||||||
client.close();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
extension UrlServerExt on ServiceTypes {
|
|
||||||
String get url {
|
|
||||||
switch (this) {
|
|
||||||
// case ServiceTypes.mail:
|
|
||||||
// return ''; // cannot be swithch off
|
|
||||||
// case ServiceTypes.messenger:
|
|
||||||
// return ''; // external service
|
|
||||||
// case ServiceTypes.video:
|
|
||||||
// return ''; // jeetsu meet not working
|
|
||||||
case ServiceTypes.passwordManager:
|
|
||||||
return 'bitwarden';
|
|
||||||
case ServiceTypes.cloud:
|
|
||||||
return 'nextcloud';
|
|
||||||
case ServiceTypes.socialNetwork:
|
|
||||||
return 'pleroma';
|
|
||||||
case ServiceTypes.git:
|
|
||||||
return 'gitea';
|
|
||||||
case ServiceTypes.vpn:
|
|
||||||
return 'ocserv';
|
|
||||||
default:
|
|
||||||
throw Exception('wrong state');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,3 @@
|
||||||
import 'package:easy_localization/easy_localization.dart';
|
|
||||||
import 'package:flutter/cupertino.dart';
|
|
||||||
import 'package:ionicons/ionicons.dart';
|
|
||||||
import 'package:selfprivacy/ui/components/brand_icons/brand_icons.dart';
|
|
||||||
|
|
||||||
enum InitializingSteps {
|
enum InitializingSteps {
|
||||||
setHeznerKey,
|
setHeznerKey,
|
||||||
setCloudFlareKey,
|
setCloudFlareKey,
|
||||||
|
@ -15,80 +10,3 @@ enum InitializingSteps {
|
||||||
}
|
}
|
||||||
enum Period { hour, day, month }
|
enum Period { hour, day, month }
|
||||||
|
|
||||||
enum ServiceTypes {
|
|
||||||
mail,
|
|
||||||
messenger,
|
|
||||||
passwordManager,
|
|
||||||
video,
|
|
||||||
cloud,
|
|
||||||
socialNetwork,
|
|
||||||
git,
|
|
||||||
vpn,
|
|
||||||
}
|
|
||||||
|
|
||||||
extension ServiceTypesExt on ServiceTypes {
|
|
||||||
String get title {
|
|
||||||
switch (this) {
|
|
||||||
case ServiceTypes.mail:
|
|
||||||
return 'services.mail.title'.tr();
|
|
||||||
case ServiceTypes.messenger:
|
|
||||||
return 'services.messenger.title'.tr();
|
|
||||||
case ServiceTypes.passwordManager:
|
|
||||||
return 'services.password_manager.title'.tr();
|
|
||||||
case ServiceTypes.video:
|
|
||||||
return 'services.video.title'.tr();
|
|
||||||
case ServiceTypes.cloud:
|
|
||||||
return 'services.cloud.title'.tr();
|
|
||||||
case ServiceTypes.socialNetwork:
|
|
||||||
return 'services.social_network.title'.tr();
|
|
||||||
case ServiceTypes.git:
|
|
||||||
return 'services.git.title'.tr();
|
|
||||||
case ServiceTypes.vpn:
|
|
||||||
return 'services.vpn.title'.tr();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
String get subtitle {
|
|
||||||
switch (this) {
|
|
||||||
case ServiceTypes.mail:
|
|
||||||
return 'services.mail.subtitle'.tr();
|
|
||||||
case ServiceTypes.messenger:
|
|
||||||
return 'services.messenger.subtitle'.tr();
|
|
||||||
case ServiceTypes.passwordManager:
|
|
||||||
return 'services.password_manager.subtitle'.tr();
|
|
||||||
case ServiceTypes.video:
|
|
||||||
return 'services.video.subtitle'.tr();
|
|
||||||
case ServiceTypes.cloud:
|
|
||||||
return 'services.cloud.subtitle'.tr();
|
|
||||||
case ServiceTypes.socialNetwork:
|
|
||||||
return 'services.social_network.subtitle'.tr();
|
|
||||||
case ServiceTypes.git:
|
|
||||||
return 'services.git.subtitle'.tr();
|
|
||||||
case ServiceTypes.vpn:
|
|
||||||
return 'services.vpn.subtitle'.tr();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
IconData get icon {
|
|
||||||
switch (this) {
|
|
||||||
case ServiceTypes.mail:
|
|
||||||
return BrandIcons.envelope;
|
|
||||||
case ServiceTypes.messenger:
|
|
||||||
return BrandIcons.messanger;
|
|
||||||
case ServiceTypes.passwordManager:
|
|
||||||
return BrandIcons.key;
|
|
||||||
case ServiceTypes.video:
|
|
||||||
return BrandIcons.webcam;
|
|
||||||
case ServiceTypes.cloud:
|
|
||||||
return BrandIcons.upload;
|
|
||||||
case ServiceTypes.socialNetwork:
|
|
||||||
return BrandIcons.social;
|
|
||||||
case ServiceTypes.git:
|
|
||||||
return BrandIcons.git;
|
|
||||||
case ServiceTypes.vpn:
|
|
||||||
return Ionicons.shield_checkmark_outline;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
String get txt => this.toString().split('.')[1];
|
|
||||||
}
|
|
||||||
|
|
|
@ -2,9 +2,6 @@ import 'dart:async';
|
||||||
|
|
||||||
import 'package:bloc/bloc.dart';
|
import 'package:bloc/bloc.dart';
|
||||||
import 'package:equatable/equatable.dart';
|
import 'package:equatable/equatable.dart';
|
||||||
import 'package:selfprivacy/config/get_it_config.dart';
|
|
||||||
import 'package:selfprivacy/logic/cubit/services/services_cubit.dart';
|
|
||||||
import 'package:selfprivacy/logic/get_it/ssh.dart';
|
|
||||||
import 'package:selfprivacy/logic/models/backblaze_credential.dart';
|
import 'package:selfprivacy/logic/models/backblaze_credential.dart';
|
||||||
import 'package:selfprivacy/logic/models/cloudflare_domain.dart';
|
import 'package:selfprivacy/logic/models/cloudflare_domain.dart';
|
||||||
|
|
||||||
|
@ -46,10 +43,9 @@ part 'app_config_state.dart';
|
||||||
/// c. if server is okay set that fully checked
|
/// c. if server is okay set that fully checked
|
||||||
|
|
||||||
class AppConfigCubit extends Cubit<AppConfigState> {
|
class AppConfigCubit extends Cubit<AppConfigState> {
|
||||||
AppConfigCubit(this.servicesCubit) : super(InitialAppConfigState());
|
AppConfigCubit() : super(InitialAppConfigState());
|
||||||
|
|
||||||
final repository = AppConfigRepository();
|
final repository = AppConfigRepository();
|
||||||
final ServicesCubit servicesCubit;
|
|
||||||
|
|
||||||
Future<void> load() async {
|
Future<void> load() async {
|
||||||
var state = await repository.load();
|
var state = await repository.load();
|
||||||
|
@ -236,7 +232,6 @@ class AppConfigCubit extends Cubit<AppConfigState> {
|
||||||
|
|
||||||
if (isServerWorking) {
|
if (isServerWorking) {
|
||||||
await repository.saveHasFinalChecked(true);
|
await repository.saveHasFinalChecked(true);
|
||||||
servicesCubit.allOn();
|
|
||||||
|
|
||||||
emit(state.copyWith(
|
emit(state.copyWith(
|
||||||
hasFinalChecked: true,
|
hasFinalChecked: true,
|
||||||
|
@ -264,19 +259,14 @@ class AppConfigCubit extends Cubit<AppConfigState> {
|
||||||
|
|
||||||
void clearAppConfig() {
|
void clearAppConfig() {
|
||||||
closeTimer();
|
closeTimer();
|
||||||
servicesCubit.allOff();
|
|
||||||
|
|
||||||
repository.clearAppConfig();
|
repository.clearAppConfig();
|
||||||
emit(InitialAppConfigState());
|
emit(InitialAppConfigState());
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> serverDelete() async {
|
Future<void> serverDelete() async {
|
||||||
closeTimer();
|
closeTimer();
|
||||||
servicesCubit.allOff();
|
|
||||||
|
|
||||||
if (state.hetznerServer != null) {
|
if (state.hetznerServer != null) {
|
||||||
await repository.deleteServer(state.cloudFlareDomain!);
|
await repository.deleteServer(state.cloudFlareDomain!);
|
||||||
await getIt<SSHModel>().clear();
|
|
||||||
}
|
}
|
||||||
await repository.deleteRecords();
|
await repository.deleteRecords();
|
||||||
emit(AppConfigState(
|
emit(AppConfigState(
|
||||||
|
@ -326,7 +316,7 @@ class AppConfigCubit extends Cubit<AppConfigState> {
|
||||||
|
|
||||||
void createServerAndSetDnsRecords() async {
|
void createServerAndSetDnsRecords() async {
|
||||||
AppConfigState _stateCopy = state;
|
AppConfigState _stateCopy = state;
|
||||||
var onSuccess = (HetznerServerDetails serverDetails) async {
|
var onSuccess = (serverDetails) async {
|
||||||
await repository.createDnsRecords(
|
await repository.createDnsRecords(
|
||||||
serverDetails.ip4,
|
serverDetails.ip4,
|
||||||
state.cloudFlareDomain!,
|
state.cloudFlareDomain!,
|
||||||
|
|
|
@ -149,7 +149,7 @@ class AppConfigRepository {
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> createDnsRecords(
|
Future<void> createDnsRecords(
|
||||||
String ip4,
|
String? ip4,
|
||||||
CloudFlareDomain cloudFlareDomain,
|
CloudFlareDomain cloudFlareDomain,
|
||||||
) async {
|
) async {
|
||||||
var cloudflareApi = CloudflareApi();
|
var cloudflareApi = CloudflareApi();
|
||||||
|
@ -163,11 +163,6 @@ class AppConfigRepository {
|
||||||
ip4: ip4,
|
ip4: ip4,
|
||||||
cloudFlareDomain: cloudFlareDomain,
|
cloudFlareDomain: cloudFlareDomain,
|
||||||
);
|
);
|
||||||
|
|
||||||
await HetznerApi().createReverseDns(
|
|
||||||
ip4: ip4,
|
|
||||||
domainName: cloudFlareDomain.domainName,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<bool> isHttpServerWorking() async {
|
Future<bool> isHttpServerWorking() async {
|
||||||
|
|
|
@ -85,17 +85,7 @@ class AppConfigState extends Equatable {
|
||||||
bool get isServerCreated => hetznerServer != null;
|
bool get isServerCreated => hetznerServer != null;
|
||||||
|
|
||||||
bool get isFullyInitilized => _fulfilementList.every((el) => el!);
|
bool get isFullyInitilized => _fulfilementList.every((el) => el!);
|
||||||
int get progress => _fulfilementList.where((el) => el!).length ;
|
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 {
|
List<bool?> get _fulfilementList {
|
||||||
var res = [
|
var res = [
|
||||||
|
|
|
@ -3,7 +3,6 @@ import 'package:cubit_form/cubit_form.dart';
|
||||||
import 'package:selfprivacy/logic/api_maps/backblaze.dart';
|
import 'package:selfprivacy/logic/api_maps/backblaze.dart';
|
||||||
import 'package:selfprivacy/logic/cubit/app_config/app_config_cubit.dart';
|
import 'package:selfprivacy/logic/cubit/app_config/app_config_cubit.dart';
|
||||||
import 'package:selfprivacy/logic/models/backblaze_credential.dart';
|
import 'package:selfprivacy/logic/models/backblaze_credential.dart';
|
||||||
import 'package:easy_localization/easy_localization.dart';
|
|
||||||
|
|
||||||
class BackblazeFormCubit extends FormCubit {
|
class BackblazeFormCubit extends FormCubit {
|
||||||
BackblazeFormCubit(this.initializingCubit) {
|
BackblazeFormCubit(this.initializingCubit) {
|
||||||
|
@ -11,7 +10,7 @@ class BackblazeFormCubit extends FormCubit {
|
||||||
keyId = FieldCubit(
|
keyId = FieldCubit(
|
||||||
initalValue: '',
|
initalValue: '',
|
||||||
validations: [
|
validations: [
|
||||||
RequiredStringValidation('validations.required'.tr()),
|
RequiredStringValidation('required'),
|
||||||
//ValidationModel<String>(
|
//ValidationModel<String>(
|
||||||
//(s) => regExp.hasMatch(s), 'invalid key format'),
|
//(s) => regExp.hasMatch(s), 'invalid key format'),
|
||||||
//LegnthStringValidationWithLenghShowing(64, 'length is [] shoud be 64')
|
//LegnthStringValidationWithLenghShowing(64, 'length is [] shoud be 64')
|
||||||
|
|
|
@ -4,7 +4,6 @@ import 'package:cubit_form/cubit_form.dart';
|
||||||
import 'package:selfprivacy/logic/api_maps/cloudflare.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/app_config/app_config_cubit.dart';
|
||||||
import 'package:selfprivacy/logic/cubit/forms/validations/validations.dart';
|
import 'package:selfprivacy/logic/cubit/forms/validations/validations.dart';
|
||||||
import 'package:easy_localization/easy_localization.dart';
|
|
||||||
|
|
||||||
class CloudFlareFormCubit extends FormCubit {
|
class CloudFlareFormCubit extends FormCubit {
|
||||||
CloudFlareFormCubit(this.initializingCubit) {
|
CloudFlareFormCubit(this.initializingCubit) {
|
||||||
|
@ -12,11 +11,10 @@ class CloudFlareFormCubit extends FormCubit {
|
||||||
apiKey = FieldCubit(
|
apiKey = FieldCubit(
|
||||||
initalValue: '',
|
initalValue: '',
|
||||||
validations: [
|
validations: [
|
||||||
RequiredStringValidation('validations.required'.tr()),
|
RequiredStringValidation('required'),
|
||||||
ValidationModel<String>(
|
ValidationModel<String>(
|
||||||
(s) => regExp.hasMatch(s), 'validations.key_format'.tr()),
|
(s) => regExp.hasMatch(s), 'invalid key format'),
|
||||||
LegnthStringValidationWithLenghShowing(
|
LegnthStringValidationWithLenghShowing(40, 'length is [] shoud be 40')
|
||||||
40, 'validations.length'.tr(args: ["40"]))
|
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,6 @@ import 'package:cubit_form/cubit_form.dart';
|
||||||
import 'package:selfprivacy/logic/api_maps/hetzner.dart';
|
import 'package:selfprivacy/logic/api_maps/hetzner.dart';
|
||||||
import 'package:selfprivacy/logic/cubit/forms/validations/validations.dart';
|
import 'package:selfprivacy/logic/cubit/forms/validations/validations.dart';
|
||||||
import 'package:selfprivacy/logic/cubit/app_config/app_config_cubit.dart';
|
import 'package:selfprivacy/logic/cubit/app_config/app_config_cubit.dart';
|
||||||
import 'package:easy_localization/easy_localization.dart';
|
|
||||||
|
|
||||||
class HetznerFormCubit extends FormCubit {
|
class HetznerFormCubit extends FormCubit {
|
||||||
HetznerFormCubit(this.initializingCubit) {
|
HetznerFormCubit(this.initializingCubit) {
|
||||||
|
@ -12,10 +11,10 @@ class HetznerFormCubit extends FormCubit {
|
||||||
apiKey = FieldCubit(
|
apiKey = FieldCubit(
|
||||||
initalValue: '',
|
initalValue: '',
|
||||||
validations: [
|
validations: [
|
||||||
RequiredStringValidation('validations.required'.tr()),
|
RequiredStringValidation('required'),
|
||||||
ValidationModel<String>(
|
ValidationModel<String>(
|
||||||
(s) => regExp.hasMatch(s), 'validations.key_format'.tr()),
|
(s) => regExp.hasMatch(s), 'invalid key format'),
|
||||||
LegnthStringValidationWithLenghShowing(64, 'validations.length'.tr(args: ["64"]))
|
LegnthStringValidationWithLenghShowing(64, 'length is [] shoud be 64')
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,6 @@ import 'dart:async';
|
||||||
import 'package:cubit_form/cubit_form.dart';
|
import 'package:cubit_form/cubit_form.dart';
|
||||||
import 'package:selfprivacy/logic/cubit/app_config/app_config_cubit.dart';
|
import 'package:selfprivacy/logic/cubit/app_config/app_config_cubit.dart';
|
||||||
import 'package:selfprivacy/logic/models/user.dart';
|
import 'package:selfprivacy/logic/models/user.dart';
|
||||||
import 'package:easy_localization/easy_localization.dart';
|
|
||||||
|
|
||||||
class RootUserFormCubit extends FormCubit {
|
class RootUserFormCubit extends FormCubit {
|
||||||
RootUserFormCubit(this.initializingCubit) {
|
RootUserFormCubit(this.initializingCubit) {
|
||||||
|
@ -13,20 +12,18 @@ class RootUserFormCubit extends FormCubit {
|
||||||
userName = FieldCubit(
|
userName = FieldCubit(
|
||||||
initalValue: '',
|
initalValue: '',
|
||||||
validations: [
|
validations: [
|
||||||
|
RequiredStringValidation('required'),
|
||||||
ValidationModel<String>(
|
ValidationModel<String>(
|
||||||
(s) => s.toLowerCase() == 'root', 'validations.root_name'.tr()),
|
(s) => userRegExp.hasMatch(s), 'invalid format'),
|
||||||
RequiredStringValidation('validations.required'.tr()),
|
|
||||||
ValidationModel<String>(
|
|
||||||
(s) => userRegExp.hasMatch(s), 'validations.invalid_format'.tr()),
|
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|
||||||
password = FieldCubit(
|
password = FieldCubit(
|
||||||
initalValue: '',
|
initalValue: '',
|
||||||
validations: [
|
validations: [
|
||||||
RequiredStringValidation('validations.required'.tr()),
|
RequiredStringValidation('required'),
|
||||||
ValidationModel<String>(
|
ValidationModel<String>(
|
||||||
(s) => passwordRegExp.hasMatch(s), 'validations.invalid_format'.tr()),
|
(s) => passwordRegExp.hasMatch(s), 'invalid format'),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -1,16 +1,13 @@
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
|
||||||
import 'package:cubit_form/cubit_form.dart';
|
import 'package:cubit_form/cubit_form.dart';
|
||||||
import 'package:selfprivacy/logic/cubit/jobs/jobs_cubit.dart';
|
import 'package:selfprivacy/logic/cubit/users/users_cubit.dart';
|
||||||
import 'package:selfprivacy/logic/models/job.dart';
|
|
||||||
import 'package:selfprivacy/logic/models/user.dart';
|
import 'package:selfprivacy/logic/models/user.dart';
|
||||||
import 'package:easy_localization/easy_localization.dart';
|
|
||||||
import 'package:selfprivacy/utils/password_generator.dart';
|
import 'package:selfprivacy/utils/password_generator.dart';
|
||||||
|
|
||||||
class UserFormCubit extends FormCubit {
|
class UserFormCubit extends FormCubit {
|
||||||
UserFormCubit({
|
UserFormCubit({
|
||||||
required this.jobsCubit,
|
required this.usersCubit,
|
||||||
required List<User> users,
|
|
||||||
User? user,
|
User? user,
|
||||||
}) {
|
}) {
|
||||||
var isEdit = user != null;
|
var isEdit = user != null;
|
||||||
|
@ -21,22 +18,18 @@ class UserFormCubit extends FormCubit {
|
||||||
login = FieldCubit(
|
login = FieldCubit(
|
||||||
initalValue: isEdit ? user!.login : '',
|
initalValue: isEdit ? user!.login : '',
|
||||||
validations: [
|
validations: [
|
||||||
ValidationModel(
|
RequiredStringValidation('required'),
|
||||||
(login) => users.any((user) => user.login == login),
|
|
||||||
'validations.user_alredy_exist'.tr(),
|
|
||||||
),
|
|
||||||
RequiredStringValidation('validations.required'.tr()),
|
|
||||||
ValidationModel<String>(
|
ValidationModel<String>(
|
||||||
(s) => userRegExp.hasMatch(s), 'validations.invalid_format'.tr()),
|
(s) => userRegExp.hasMatch(s), 'invalid format'),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|
||||||
password = FieldCubit(
|
password = FieldCubit(
|
||||||
initalValue: isEdit ? user!.password : StringGenerators.userPassword(),
|
initalValue: isEdit ? user!.password : genPass(),
|
||||||
validations: [
|
validations: [
|
||||||
RequiredStringValidation('validations.required'.tr()),
|
RequiredStringValidation('required'),
|
||||||
ValidationModel<String>((s) => passwordRegExp.hasMatch(s),
|
ValidationModel<String>(
|
||||||
'validations.invalid_format'.tr()),
|
(s) => passwordRegExp.hasMatch(s), 'invalid format'),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -49,15 +42,15 @@ class UserFormCubit extends FormCubit {
|
||||||
login: login.state.value,
|
login: login.state.value,
|
||||||
password: password.state.value,
|
password: password.state.value,
|
||||||
);
|
);
|
||||||
jobsCubit.addJob(CreateUserJob(user: user));
|
usersCubit.addUser(user);
|
||||||
}
|
}
|
||||||
|
|
||||||
late FieldCubit<String> login;
|
late FieldCubit<String> login;
|
||||||
late FieldCubit<String> password;
|
late FieldCubit<String> password;
|
||||||
|
|
||||||
void genNewPassword() {
|
void genNewPassword() {
|
||||||
password.externalSetValue(StringGenerators.userPassword());
|
password.externalSetValue(genPass());
|
||||||
}
|
}
|
||||||
|
|
||||||
final JobsCubit jobsCubit;
|
late UsersCubit usersCubit;
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,6 +6,7 @@ import 'hetzner_metrics_cubit.dart';
|
||||||
|
|
||||||
class HetznerMetricsRepository {
|
class HetznerMetricsRepository {
|
||||||
Future<HetznerMetricsLoaded> getMetrics(Period period) async {
|
Future<HetznerMetricsLoaded> getMetrics(Period period) async {
|
||||||
|
print(period);
|
||||||
var end = DateTime.now();
|
var end = DateTime.now();
|
||||||
DateTime start;
|
DateTime start;
|
||||||
|
|
||||||
|
|
|
@ -1,105 +0,0 @@
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
|
||||||
import 'package:selfprivacy/config/brand_colors.dart';
|
|
||||||
import 'package:selfprivacy/config/get_it_config.dart';
|
|
||||||
import 'package:selfprivacy/config/text_themes.dart';
|
|
||||||
import 'package:selfprivacy/logic/api_maps/server.dart';
|
|
||||||
import 'package:selfprivacy/logic/cubit/services/services_cubit.dart';
|
|
||||||
import 'package:selfprivacy/logic/cubit/users/users_cubit.dart';
|
|
||||||
import 'package:selfprivacy/logic/get_it/ssh.dart';
|
|
||||||
import 'package:selfprivacy/logic/models/job.dart';
|
|
||||||
import 'package:equatable/equatable.dart';
|
|
||||||
import 'package:selfprivacy/logic/models/user.dart';
|
|
||||||
export 'package:provider/provider.dart';
|
|
||||||
import 'package:easy_localization/easy_localization.dart';
|
|
||||||
|
|
||||||
part 'jobs_state.dart';
|
|
||||||
|
|
||||||
class JobsCubit extends Cubit<JobsState> {
|
|
||||||
JobsCubit({
|
|
||||||
required this.usersCubit,
|
|
||||||
required this.servicesCubit,
|
|
||||||
}) : super(JobsStateEmpty());
|
|
||||||
|
|
||||||
final api = ServerApi();
|
|
||||||
final UsersCubit usersCubit;
|
|
||||||
final ServicesCubit servicesCubit;
|
|
||||||
|
|
||||||
void addJob(Job job) {
|
|
||||||
var newJobsList = <Job>[];
|
|
||||||
if (state is JobsStateWithJobs) {
|
|
||||||
newJobsList.addAll((state as JobsStateWithJobs).jobList);
|
|
||||||
}
|
|
||||||
newJobsList.add(job);
|
|
||||||
getIt<NavigationService>().showSnackBar('jobs.jobAdded'.tr());
|
|
||||||
emit(JobsStateWithJobs(newJobsList));
|
|
||||||
}
|
|
||||||
|
|
||||||
void removeJob(String id) {
|
|
||||||
final newState = (state as JobsStateWithJobs).removeById(id);
|
|
||||||
emit(newState);
|
|
||||||
}
|
|
||||||
|
|
||||||
void createOrRemoveServiceToggleJob(ServiceToggleJob job) {
|
|
||||||
var newJobsList = <Job>[];
|
|
||||||
if (state is JobsStateWithJobs) {
|
|
||||||
newJobsList.addAll((state as JobsStateWithJobs).jobList);
|
|
||||||
}
|
|
||||||
var needToRemoveJob =
|
|
||||||
newJobsList.any((el) => el is ServiceToggleJob && el.type == job.type);
|
|
||||||
if (needToRemoveJob) {
|
|
||||||
var removingJob = newJobsList
|
|
||||||
.firstWhere(((el) => el is ServiceToggleJob && el.type == job.type));
|
|
||||||
removeJob(removingJob.id);
|
|
||||||
} else {
|
|
||||||
newJobsList.add(job);
|
|
||||||
getIt<NavigationService>().showSnackBar('jobs.jobAdded'.tr());
|
|
||||||
emit(JobsStateWithJobs(newJobsList));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void createShhJobIfNotExist(CreateSSHKeyJob job) {
|
|
||||||
var newJobsList = <Job>[];
|
|
||||||
if (state is JobsStateWithJobs) {
|
|
||||||
newJobsList.addAll((state as JobsStateWithJobs).jobList);
|
|
||||||
}
|
|
||||||
var isExistInJobList = newJobsList.any((el) => el is CreateSSHKeyJob);
|
|
||||||
if (!isExistInJobList) {
|
|
||||||
newJobsList.add(job);
|
|
||||||
getIt<NavigationService>().showSnackBar('jobs.jobAdded'.tr());
|
|
||||||
emit(JobsStateWithJobs(newJobsList));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Future<void> applyAll() async {
|
|
||||||
if (state is JobsStateWithJobs) {
|
|
||||||
var jobs = (state as JobsStateWithJobs).jobList;
|
|
||||||
emit(JobsStateLoading());
|
|
||||||
var newUsers = <User>[];
|
|
||||||
for (var job in jobs) {
|
|
||||||
if (job is CreateUserJob) {
|
|
||||||
newUsers.add(job.user);
|
|
||||||
await api.createUser(job.user);
|
|
||||||
} else if (job is ServiceToggleJob) {
|
|
||||||
await api.switchService(job.type, job.needToTurnOn);
|
|
||||||
if (job.needToTurnOn) {
|
|
||||||
servicesCubit.turnOnist([job.type]);
|
|
||||||
} else {
|
|
||||||
servicesCubit.turnOffList([job.type]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (job is CreateSSHKeyJob) {
|
|
||||||
await getIt<SSHModel>().generateKeys();
|
|
||||||
api.sendSsh(getIt<SSHModel>().savedPubKey!);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
usersCubit.addUsers(newUsers);
|
|
||||||
await api.apply();
|
|
||||||
|
|
||||||
emit(JobsStateEmpty());
|
|
||||||
|
|
||||||
getIt<NavigationService>().navigator!.pop();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,27 +0,0 @@
|
||||||
part of 'jobs_cubit.dart';
|
|
||||||
|
|
||||||
abstract class JobsState extends Equatable {
|
|
||||||
@override
|
|
||||||
List<Object?> get props => [];
|
|
||||||
}
|
|
||||||
|
|
||||||
class JobsStateLoading extends JobsState {}
|
|
||||||
|
|
||||||
class JobsStateEmpty extends JobsState {}
|
|
||||||
|
|
||||||
class JobsStateWithJobs extends JobsState {
|
|
||||||
JobsStateWithJobs(this.jobList);
|
|
||||||
final List<Job> jobList;
|
|
||||||
|
|
||||||
JobsState removeById(String id) {
|
|
||||||
var newJobsList = jobList.where((element) => element.id != id).toList();
|
|
||||||
|
|
||||||
if (newJobsList.isEmpty) {
|
|
||||||
return JobsStateEmpty();
|
|
||||||
}
|
|
||||||
return JobsStateWithJobs(newJobsList);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
List<Object?> get props => jobList;
|
|
||||||
}
|
|
|
@ -1,63 +0,0 @@
|
||||||
import 'package:bloc/bloc.dart';
|
|
||||||
import 'package:equatable/equatable.dart';
|
|
||||||
import 'package:hive/hive.dart';
|
|
||||||
import 'package:selfprivacy/config/hive_config.dart';
|
|
||||||
import 'package:selfprivacy/logic/common_enum/common_enum.dart';
|
|
||||||
|
|
||||||
part 'services_state.dart';
|
|
||||||
|
|
||||||
class ServicesCubit extends Cubit<ServicesState> {
|
|
||||||
ServicesCubit() : super(ServicesState.allOff());
|
|
||||||
|
|
||||||
Box box = Hive.box(BNames.servicesState);
|
|
||||||
|
|
||||||
void load() {
|
|
||||||
emit(
|
|
||||||
ServicesState(
|
|
||||||
isPasswordManagerEnable:
|
|
||||||
box.get(ServiceTypes.passwordManager.txt, defaultValue: false),
|
|
||||||
isCloudEnable: box.get(ServiceTypes.cloud.txt, defaultValue: false),
|
|
||||||
isGitEnable: box.get(ServiceTypes.git.txt, defaultValue: false),
|
|
||||||
isSocialNetworkEnable:
|
|
||||||
box.get(ServiceTypes.socialNetwork.txt, defaultValue: false),
|
|
||||||
isVpnEnable: box.get(ServiceTypes.vpn.txt, defaultValue: false),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
void allOn() {
|
|
||||||
box.put(ServiceTypes.passwordManager.txt, true);
|
|
||||||
box.put(ServiceTypes.cloud.txt, true);
|
|
||||||
box.put(ServiceTypes.git.txt, true);
|
|
||||||
box.put(ServiceTypes.socialNetwork.txt, true);
|
|
||||||
box.put(ServiceTypes.vpn.txt, true);
|
|
||||||
|
|
||||||
emit(ServicesState.allOn());
|
|
||||||
}
|
|
||||||
|
|
||||||
void allOff() {
|
|
||||||
box.put(ServiceTypes.passwordManager.txt, false);
|
|
||||||
box.put(ServiceTypes.cloud.txt, false);
|
|
||||||
box.put(ServiceTypes.git.txt, false);
|
|
||||||
box.put(ServiceTypes.socialNetwork.txt, false);
|
|
||||||
box.put(ServiceTypes.vpn.txt, false);
|
|
||||||
|
|
||||||
emit(ServicesState.allOff());
|
|
||||||
}
|
|
||||||
|
|
||||||
void turnOffList(List<ServiceTypes> list) {
|
|
||||||
for (final service in list) {
|
|
||||||
box.put(service.txt, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
emit(state.disableList(list));
|
|
||||||
}
|
|
||||||
|
|
||||||
void turnOnist(List<ServiceTypes> list) {
|
|
||||||
for (final service in list) {
|
|
||||||
box.put(service.txt, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
emit(state.enableList(list));
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,93 +0,0 @@
|
||||||
part of 'services_cubit.dart';
|
|
||||||
|
|
||||||
class ServicesState extends Equatable {
|
|
||||||
const ServicesState({
|
|
||||||
required this.isPasswordManagerEnable,
|
|
||||||
required this.isCloudEnable,
|
|
||||||
required this.isGitEnable,
|
|
||||||
required this.isSocialNetworkEnable,
|
|
||||||
required this.isVpnEnable,
|
|
||||||
});
|
|
||||||
|
|
||||||
final bool isPasswordManagerEnable;
|
|
||||||
final bool isCloudEnable;
|
|
||||||
final bool isGitEnable;
|
|
||||||
final bool isSocialNetworkEnable;
|
|
||||||
final bool isVpnEnable;
|
|
||||||
|
|
||||||
factory ServicesState.allOff() => ServicesState(
|
|
||||||
isPasswordManagerEnable: false,
|
|
||||||
isCloudEnable: false,
|
|
||||||
isGitEnable: false,
|
|
||||||
isSocialNetworkEnable: false,
|
|
||||||
isVpnEnable: false,
|
|
||||||
);
|
|
||||||
factory ServicesState.allOn() => ServicesState(
|
|
||||||
isPasswordManagerEnable: true,
|
|
||||||
isCloudEnable: true,
|
|
||||||
isGitEnable: true,
|
|
||||||
isSocialNetworkEnable: true,
|
|
||||||
isVpnEnable: true,
|
|
||||||
);
|
|
||||||
|
|
||||||
ServicesState enableList(
|
|
||||||
List<ServiceTypes> list,
|
|
||||||
) =>
|
|
||||||
ServicesState(
|
|
||||||
isPasswordManagerEnable: list.contains(ServiceTypes.passwordManager)
|
|
||||||
? true
|
|
||||||
: isPasswordManagerEnable,
|
|
||||||
isCloudEnable: list.contains(ServiceTypes.cloud) ? true : isCloudEnable,
|
|
||||||
isGitEnable:
|
|
||||||
list.contains(ServiceTypes.git) ? true : isPasswordManagerEnable,
|
|
||||||
isSocialNetworkEnable: list.contains(ServiceTypes.socialNetwork)
|
|
||||||
? true
|
|
||||||
: isPasswordManagerEnable,
|
|
||||||
isVpnEnable:
|
|
||||||
list.contains(ServiceTypes.vpn) ? true : isPasswordManagerEnable,
|
|
||||||
);
|
|
||||||
|
|
||||||
ServicesState disableList(
|
|
||||||
List<ServiceTypes> list,
|
|
||||||
) =>
|
|
||||||
ServicesState(
|
|
||||||
isPasswordManagerEnable: list.contains(ServiceTypes.passwordManager)
|
|
||||||
? false
|
|
||||||
: isPasswordManagerEnable,
|
|
||||||
isCloudEnable:
|
|
||||||
list.contains(ServiceTypes.cloud) ? false : isCloudEnable,
|
|
||||||
isGitEnable:
|
|
||||||
list.contains(ServiceTypes.git) ? false : isPasswordManagerEnable,
|
|
||||||
isSocialNetworkEnable: list.contains(ServiceTypes.socialNetwork)
|
|
||||||
? false
|
|
||||||
: isPasswordManagerEnable,
|
|
||||||
isVpnEnable:
|
|
||||||
list.contains(ServiceTypes.vpn) ? false : isPasswordManagerEnable,
|
|
||||||
);
|
|
||||||
|
|
||||||
@override
|
|
||||||
List<Object> get props => [
|
|
||||||
isPasswordManagerEnable,
|
|
||||||
isCloudEnable,
|
|
||||||
isGitEnable,
|
|
||||||
isSocialNetworkEnable,
|
|
||||||
isVpnEnable
|
|
||||||
];
|
|
||||||
|
|
||||||
bool isEnableByType(ServiceTypes type) {
|
|
||||||
switch (type) {
|
|
||||||
case ServiceTypes.passwordManager:
|
|
||||||
return isPasswordManagerEnable;
|
|
||||||
case ServiceTypes.cloud:
|
|
||||||
return isCloudEnable;
|
|
||||||
case ServiceTypes.socialNetwork:
|
|
||||||
return isSocialNetworkEnable;
|
|
||||||
case ServiceTypes.git:
|
|
||||||
return isGitEnable;
|
|
||||||
case ServiceTypes.vpn:
|
|
||||||
return isVpnEnable;
|
|
||||||
default:
|
|
||||||
throw Exception('wrong state');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,36 +1,42 @@
|
||||||
import 'package:bloc/bloc.dart';
|
import 'package:bloc/bloc.dart';
|
||||||
import 'package:equatable/equatable.dart';
|
import 'package:equatable/equatable.dart';
|
||||||
import 'package:hive/hive.dart';
|
|
||||||
import 'package:selfprivacy/config/hive_config.dart';
|
|
||||||
import 'package:selfprivacy/logic/models/user.dart';
|
import 'package:selfprivacy/logic/models/user.dart';
|
||||||
export 'package:provider/provider.dart';
|
export 'package:provider/provider.dart';
|
||||||
|
|
||||||
part 'users_state.dart';
|
part 'users_state.dart';
|
||||||
|
|
||||||
class UsersCubit extends Cubit<UsersState> {
|
class UsersCubit extends Cubit<UsersState> {
|
||||||
UsersCubit() : super(UsersState(<User>[]));
|
UsersCubit() : super(UsersState([]));
|
||||||
Box<User> box = Hive.box<User>(BNames.users);
|
|
||||||
|
|
||||||
void load() async {
|
void addUser(User user) {
|
||||||
var loadedUsers = box.values.toList();
|
var users = [...state.users];
|
||||||
if (loadedUsers.isNotEmpty) {
|
users.add(user);
|
||||||
emit(UsersState(loadedUsers));
|
|
||||||
}
|
emit(UsersState(users));
|
||||||
}
|
}
|
||||||
|
|
||||||
void addUsers(List<User> users) async {
|
void remove(User? user) {
|
||||||
var newUserList = <User>[...state.users, ...users];
|
|
||||||
|
|
||||||
await box.addAll(users);
|
|
||||||
emit(UsersState(newUserList));
|
|
||||||
}
|
|
||||||
|
|
||||||
void remove(User user) async {
|
|
||||||
var users = [...state.users];
|
var users = [...state.users];
|
||||||
var index = users.indexOf(user);
|
|
||||||
users.remove(user);
|
users.remove(user);
|
||||||
await box.deleteAt(index);
|
|
||||||
|
|
||||||
emit(UsersState(users));
|
emit(UsersState(users));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// final initMockUsers = <User>[
|
||||||
|
// User(login: 'Heartbreaking.Goose', password: genPass()),
|
||||||
|
// User(login: 'Alma.lawson', password: genPass()),
|
||||||
|
// User(login: 'Bee.gees', password: genPass()),
|
||||||
|
// User(login: 'Bim.jennings', password: genPass()),
|
||||||
|
// User(login: 'Debra.holt', password: genPass()),
|
||||||
|
// User(login: 'Georgia.young', password: genPass()),
|
||||||
|
// User(login: 'Kenzi.lawson', password: genPass()),
|
||||||
|
// User(login: 'Le.jennings', password: genPass()),
|
||||||
|
// User(login: 'Kirill.Zh', password: genPass()),
|
||||||
|
// User(login: 'Tina.Bolton', password: genPass()),
|
||||||
|
// User(login: 'Rebekah.Lynn', password: genPass()),
|
||||||
|
// User(login: 'Aleena.Armstrong', password: genPass()),
|
||||||
|
// User(login: 'Rosemary.Williams', password: genPass()),
|
||||||
|
// User(login: 'Sullivan.Nixon', password: genPass()),
|
||||||
|
// User(login: 'Aleena.Armstrong', password: genPass()),
|
||||||
|
// ];
|
||||||
|
|
|
@ -1,13 +1,8 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/widgets.dart';
|
import 'package:flutter/widgets.dart';
|
||||||
import 'package:selfprivacy/config/brand_colors.dart';
|
|
||||||
import 'package:selfprivacy/config/text_themes.dart';
|
|
||||||
|
|
||||||
class NavigationService {
|
class NavigationService {
|
||||||
final GlobalKey<ScaffoldMessengerState> scaffoldMessengerKey =
|
|
||||||
GlobalKey<ScaffoldMessengerState>();
|
|
||||||
final GlobalKey<NavigatorState> navigatorKey = GlobalKey<NavigatorState>();
|
final GlobalKey<NavigatorState> navigatorKey = GlobalKey<NavigatorState>();
|
||||||
|
|
||||||
NavigatorState? get navigator => navigatorKey.currentState;
|
NavigatorState? get navigator => navigatorKey.currentState;
|
||||||
|
|
||||||
void showPopUpDialog(AlertDialog dialog) {
|
void showPopUpDialog(AlertDialog dialog) {
|
||||||
|
@ -18,14 +13,4 @@ class NavigationService {
|
||||||
builder: (_) => dialog,
|
builder: (_) => dialog,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
void showSnackBar(String text) {
|
|
||||||
final state = scaffoldMessengerKey.currentState!;
|
|
||||||
final snack = SnackBar(
|
|
||||||
backgroundColor: BrandColors.black.withOpacity(0.8),
|
|
||||||
content: Text(text, style: buttonTitleText),
|
|
||||||
duration: const Duration(seconds: 2),
|
|
||||||
);
|
|
||||||
state.showSnackBar(snack);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,39 +0,0 @@
|
||||||
import 'package:hive/hive.dart';
|
|
||||||
import 'package:pointycastle/pointycastle.dart';
|
|
||||||
import 'package:rsa_encrypt/rsa_encrypt.dart';
|
|
||||||
import 'package:selfprivacy/config/hive_config.dart';
|
|
||||||
import 'package:pointycastle/api.dart' as crypto;
|
|
||||||
import 'package:ssh_key/ssh_key.dart' as ssh_key;
|
|
||||||
|
|
||||||
class SSHModel {
|
|
||||||
Box _box = Hive.box(BNames.sshConfig);
|
|
||||||
String? savedPrivateKey;
|
|
||||||
String? savedPubKey;
|
|
||||||
|
|
||||||
Future<void> generateKeys() async {
|
|
||||||
var helper = RsaKeyHelper();
|
|
||||||
crypto.AsymmetricKeyPair pair =
|
|
||||||
await helper.computeRSAKeyPair(helper.getSecureRandom());
|
|
||||||
var privateKey = pair.privateKey as RSAPrivateKey;
|
|
||||||
var publicKey = pair.publicKey as RSAPublicKey;
|
|
||||||
|
|
||||||
savedPrivateKey = helper.encodePrivateKeyToPemPKCS1(privateKey);
|
|
||||||
savedPubKey = publicKey.encode(ssh_key.PubKeyEncoding.openSsh);
|
|
||||||
|
|
||||||
await _box.put(BNames.sshPrivateKey, savedPrivateKey);
|
|
||||||
await _box.put(BNames.sshPublicKey, savedPubKey);
|
|
||||||
}
|
|
||||||
|
|
||||||
void init() async {
|
|
||||||
savedPrivateKey = _box.get(BNames.sshPrivateKey);
|
|
||||||
savedPubKey = _box.get(BNames.sshPublicKey);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool get isSSHKeyGenerated => savedPrivateKey != null && savedPubKey != null;
|
|
||||||
|
|
||||||
Future<void> clear() async {
|
|
||||||
savedPrivateKey = null;
|
|
||||||
savedPubKey = null;
|
|
||||||
await _box.clear();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,54 +0,0 @@
|
||||||
import 'package:equatable/equatable.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:selfprivacy/logic/common_enum/common_enum.dart';
|
|
||||||
import 'package:selfprivacy/utils/password_generator.dart';
|
|
||||||
import 'package:easy_localization/easy_localization.dart';
|
|
||||||
|
|
||||||
import 'user.dart';
|
|
||||||
|
|
||||||
@immutable
|
|
||||||
class Job extends Equatable {
|
|
||||||
Job({
|
|
||||||
String? id,
|
|
||||||
required this.title,
|
|
||||||
}) : id = id ?? StringGenerators.simpleId();
|
|
||||||
|
|
||||||
final String title;
|
|
||||||
final String id;
|
|
||||||
|
|
||||||
@override
|
|
||||||
List<Object> get props => [id, title];
|
|
||||||
}
|
|
||||||
|
|
||||||
class CreateUserJob extends Job {
|
|
||||||
CreateUserJob({
|
|
||||||
required this.user,
|
|
||||||
}) : super(title: '${"jobs.createUser".tr()} ${user.login}');
|
|
||||||
|
|
||||||
final User user;
|
|
||||||
|
|
||||||
@override
|
|
||||||
List<Object> get props => [id, title, user];
|
|
||||||
}
|
|
||||||
|
|
||||||
class ServiceToggleJob extends Job {
|
|
||||||
ServiceToggleJob({
|
|
||||||
required this.type,
|
|
||||||
required this.needToTurnOn,
|
|
||||||
}) : super(
|
|
||||||
title:
|
|
||||||
'${needToTurnOn ? "jobs.serviceTurnOn".tr() : "jobs.serviceTurnOff".tr()} ${type.title}');
|
|
||||||
|
|
||||||
final ServiceTypes type;
|
|
||||||
final bool needToTurnOn;
|
|
||||||
|
|
||||||
@override
|
|
||||||
List<Object> get props => [id, title, type, needToTurnOn];
|
|
||||||
}
|
|
||||||
|
|
||||||
class CreateSSHKeyJob extends Job {
|
|
||||||
CreateSSHKeyJob() : super(title: '${"more.create_ssh_key".tr()}');
|
|
||||||
|
|
||||||
@override
|
|
||||||
List<Object> get props => [id, title];
|
|
||||||
}
|
|
|
@ -4,7 +4,6 @@ import 'package:crypt/crypt.dart';
|
||||||
import 'package:equatable/equatable.dart';
|
import 'package:equatable/equatable.dart';
|
||||||
import 'package:selfprivacy/utils/color_utils.dart';
|
import 'package:selfprivacy/utils/color_utils.dart';
|
||||||
import 'package:hive/hive.dart';
|
import 'package:hive/hive.dart';
|
||||||
import 'package:selfprivacy/utils/password_generator.dart';
|
|
||||||
|
|
||||||
part 'user.g.dart';
|
part 'user.g.dart';
|
||||||
|
|
||||||
|
@ -26,10 +25,7 @@ class User extends Equatable {
|
||||||
|
|
||||||
Color get color => stringToColor(login);
|
Color get color => stringToColor(login);
|
||||||
|
|
||||||
Crypt get hashPassword => Crypt.sha512(
|
Crypt get hashPassword => Crypt.sha512(password);
|
||||||
password,
|
|
||||||
salt: StringGenerators.passwordSalt(),
|
|
||||||
);
|
|
||||||
|
|
||||||
String toString() {
|
String toString() {
|
||||||
return login;
|
return login;
|
||||||
|
|
|
@ -16,50 +16,47 @@ import 'config/localization.dart';
|
||||||
import 'logic/cubit/app_settings/app_settings_cubit.dart';
|
import 'logic/cubit/app_settings/app_settings_cubit.dart';
|
||||||
|
|
||||||
void main() async {
|
void main() async {
|
||||||
WidgetsFlutterBinding.ensureInitialized();
|
|
||||||
await HiveConfig.init();
|
await HiveConfig.init();
|
||||||
Bloc.observer = SimpleBlocObserver();
|
Bloc.observer = SimpleBlocObserver();
|
||||||
Wakelock.enable();
|
Wakelock.enable();
|
||||||
await getItSetup();
|
await getItSetup();
|
||||||
|
WidgetsFlutterBinding.ensureInitialized();
|
||||||
await EasyLocalization.ensureInitialized();
|
await EasyLocalization.ensureInitialized();
|
||||||
|
|
||||||
runApp(MyApp());
|
runApp(
|
||||||
|
Localization(
|
||||||
|
child: BlocAndProviderConfig(
|
||||||
|
child: MyApp(),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
class MyApp extends StatelessWidget {
|
class MyApp extends StatelessWidget {
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Localization(
|
AppSettingsState appSettings = context.watch<AppSettingsCubit>().state;
|
||||||
child: BlocAndProviderConfig(
|
|
||||||
child: Builder(builder: (context) {
|
|
||||||
var appSettings = context.watch<AppSettingsCubit>().state;
|
|
||||||
|
|
||||||
return AnnotatedRegion<SystemUiOverlayStyle>(
|
return AnnotatedRegion<SystemUiOverlayStyle>(
|
||||||
value: SystemUiOverlayStyle.light, // Manually changnig appbar color
|
value: SystemUiOverlayStyle.light, // Manually changnig appbar color
|
||||||
child: MaterialApp(
|
child: MaterialApp(
|
||||||
scaffoldMessengerKey:
|
navigatorKey: getIt.get<NavigationService>().navigatorKey,
|
||||||
getIt.get<NavigationService>().scaffoldMessengerKey,
|
localizationsDelegates: context.localizationDelegates,
|
||||||
navigatorKey: getIt.get<NavigationService>().navigatorKey,
|
supportedLocales: context.supportedLocales,
|
||||||
localizationsDelegates: context.localizationDelegates,
|
locale: context.locale,
|
||||||
supportedLocales: context.supportedLocales,
|
debugShowCheckedModeBanner: false,
|
||||||
locale: context.locale,
|
title: 'SelfPrivacy',
|
||||||
debugShowCheckedModeBanner: false,
|
theme: appSettings.isDarkModeOn ? darkTheme : ligtTheme,
|
||||||
title: 'SelfPrivacy',
|
home: appSettings.isOnbordingShowing
|
||||||
theme: appSettings.isDarkModeOn ? darkTheme : ligtTheme,
|
? OnboardingPage(nextPage: InitializingPage())
|
||||||
home: appSettings.isOnbordingShowing
|
: RootPage(),
|
||||||
? OnboardingPage(nextPage: InitializingPage())
|
builder: (BuildContext context, Widget? widget) {
|
||||||
: RootPage(),
|
Widget error = Text('...rendering error...');
|
||||||
builder: (BuildContext context, Widget? widget) {
|
if (widget is Scaffold || widget is Navigator)
|
||||||
Widget error = Text('...rendering error...');
|
error = Scaffold(body: Center(child: error));
|
||||||
if (widget is Scaffold || widget is Navigator)
|
ErrorWidget.builder = (FlutterErrorDetails errorDetails) => error;
|
||||||
error = Scaffold(body: Center(child: error));
|
return widget!;
|
||||||
ErrorWidget.builder =
|
},
|
||||||
(FlutterErrorDetails errorDetails) => error;
|
|
||||||
return widget!;
|
|
||||||
},
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}),
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,59 +0,0 @@
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:selfprivacy/config/brand_colors.dart';
|
|
||||||
|
|
||||||
class BrandBottomSheet extends StatelessWidget {
|
|
||||||
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(
|
|
||||||
height: 4,
|
|
||||||
width: 30,
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
borderRadius: BorderRadius.circular(2),
|
|
||||||
color: BrandColors.gray4,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
SizedBox(height: 6),
|
|
||||||
ClipRRect(
|
|
||||||
borderRadius: BorderRadius.vertical(top: Radius.circular(20)),
|
|
||||||
child: ConstrainedBox(
|
|
||||||
constraints: BoxConstraints(maxHeight: mainHeight),
|
|
||||||
child: innerWidget,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -10,14 +10,14 @@ class BrandButton {
|
||||||
static rised({
|
static rised({
|
||||||
Key? key,
|
Key? key,
|
||||||
required VoidCallback? onPressed,
|
required VoidCallback? onPressed,
|
||||||
String? text,
|
String? title,
|
||||||
Widget? child,
|
Widget? child,
|
||||||
}) {
|
}) {
|
||||||
assert(text == null || child == null, 'required title or child');
|
assert(title == null || child == null, 'required title or child');
|
||||||
assert(text != null || child != null, 'required title or child');
|
assert(title != null || child != null, 'required title or child');
|
||||||
return _RisedButton(
|
return _RisedButton(
|
||||||
key: key,
|
key: key,
|
||||||
title: text,
|
title: title,
|
||||||
onPressed: onPressed,
|
onPressed: onPressed,
|
||||||
child: child,
|
child: child,
|
||||||
);
|
);
|
||||||
|
|
|
@ -0,0 +1,29 @@
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:selfprivacy/config/brand_colors.dart';
|
||||||
|
import 'package:selfprivacy/utils/extensions/elevation_extension.dart';
|
||||||
|
|
||||||
|
class BrandCard extends StatelessWidget {
|
||||||
|
const BrandCard({
|
||||||
|
Key? key,
|
||||||
|
this.child,
|
||||||
|
}) : super(key: key);
|
||||||
|
|
||||||
|
final Widget? child;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Theme.of(context).brightness == Brightness.dark
|
||||||
|
? BrandColors.black
|
||||||
|
: BrandColors.white,
|
||||||
|
borderRadius: BorderRadius.circular(20),
|
||||||
|
).ev8,
|
||||||
|
padding: EdgeInsets.symmetric(
|
||||||
|
horizontal: 20,
|
||||||
|
vertical: 15,
|
||||||
|
),
|
||||||
|
child: child,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,61 +0,0 @@
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:selfprivacy/config/brand_colors.dart';
|
|
||||||
|
|
||||||
class BrandCards {
|
|
||||||
static Widget big({required Widget child}) => _BrandCard(
|
|
||||||
child: child,
|
|
||||||
padding: EdgeInsets.symmetric(
|
|
||||||
horizontal: 20,
|
|
||||||
vertical: 15,
|
|
||||||
),
|
|
||||||
shadow: bigShadow,
|
|
||||||
borderRadius: BorderRadius.circular(20),
|
|
||||||
);
|
|
||||||
static Widget small({required Widget child}) => _BrandCard(
|
|
||||||
child: child,
|
|
||||||
padding: EdgeInsets.symmetric(
|
|
||||||
horizontal: 15,
|
|
||||||
vertical: 10,
|
|
||||||
),
|
|
||||||
shadow: bigShadow,
|
|
||||||
borderRadius: BorderRadius.circular(10),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
class _BrandCard extends StatelessWidget {
|
|
||||||
const _BrandCard({
|
|
||||||
Key? key,
|
|
||||||
required this.child,
|
|
||||||
required this.padding,
|
|
||||||
required this.shadow,
|
|
||||||
required this.borderRadius,
|
|
||||||
}) : super(key: key);
|
|
||||||
|
|
||||||
final Widget child;
|
|
||||||
final EdgeInsets padding;
|
|
||||||
final List<BoxShadow> shadow;
|
|
||||||
final BorderRadius borderRadius;
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return Container(
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: Theme.of(context).brightness == Brightness.dark
|
|
||||||
? BrandColors.black
|
|
||||||
: BrandColors.white,
|
|
||||||
borderRadius: borderRadius,
|
|
||||||
boxShadow: shadow,
|
|
||||||
),
|
|
||||||
padding: padding,
|
|
||||||
child: child,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
final bigShadow = [
|
|
||||||
BoxShadow(
|
|
||||||
offset: Offset(0, 4),
|
|
||||||
blurRadius: 8,
|
|
||||||
color: Colors.black.withOpacity(.08),
|
|
||||||
)
|
|
||||||
];
|
|
|
@ -1,19 +1,16 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:selfprivacy/ui/components/brand_icons/brand_icons.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/brand_text/brand_text.dart';
|
||||||
import 'package:selfprivacy/ui/components/pre_styled_buttons/pre_styled_buttons.dart';
|
|
||||||
|
|
||||||
class BrandHeader extends StatelessWidget {
|
class BrandHeader extends StatelessWidget {
|
||||||
const BrandHeader({
|
const BrandHeader({
|
||||||
Key? key,
|
Key? key,
|
||||||
required this.title,
|
required this.title,
|
||||||
this.hasBackButton = false,
|
this.hasBackButton = false,
|
||||||
this.hasFlashButton = false,
|
|
||||||
}) : super(key: key);
|
}) : super(key: key);
|
||||||
|
|
||||||
final String title;
|
final String title;
|
||||||
final bool hasBackButton;
|
final bool hasBackButton;
|
||||||
final bool hasFlashButton;
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
@ -34,8 +31,6 @@ class BrandHeader extends StatelessWidget {
|
||||||
SizedBox(width: 10),
|
SizedBox(width: 10),
|
||||||
],
|
],
|
||||||
BrandText.h4(title),
|
BrandText.h4(title),
|
||||||
Spacer(),
|
|
||||||
if (hasFlashButton) PreStyledButtons.flash(),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
@ -1,21 +0,0 @@
|
||||||
import 'package:flutter/cupertino.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:easy_localization/easy_localization.dart';
|
|
||||||
|
|
||||||
class BrandLoader {
|
|
||||||
static horizontal() => _HorizontalLoader();
|
|
||||||
}
|
|
||||||
|
|
||||||
class _HorizontalLoader extends StatelessWidget {
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return Column(
|
|
||||||
mainAxisSize: MainAxisSize.min,
|
|
||||||
children: [
|
|
||||||
Text('basis.wait'.tr()),
|
|
||||||
SizedBox(height: 10),
|
|
||||||
LinearProgressIndicator(minHeight: 3),
|
|
||||||
],
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -56,7 +56,6 @@ class _BrandMarkdownState extends State<BrandMarkdown> {
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
return Markdown(
|
return Markdown(
|
||||||
shrinkWrap: true,
|
|
||||||
styleSheet: markdown,
|
styleSheet: markdown,
|
||||||
onTapLink: (String text, String? href, String title) {
|
onTapLink: (String text, String? href, String title) {
|
||||||
if (href != null) {
|
if (href != null) {
|
||||||
|
|
|
@ -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 {
|
class BrandModalSheet extends StatelessWidget {
|
||||||
// const BrandModalSheet({
|
const BrandModalSheet({
|
||||||
// Key? key,
|
Key? key,
|
||||||
// this.child,
|
this.child,
|
||||||
// }) : super(key: key);
|
}) : super(key: key);
|
||||||
|
|
||||||
// final Widget? child;
|
final Widget? child;
|
||||||
// @override
|
@override
|
||||||
// Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
// return DraggableScrollableSheet(
|
return DraggableScrollableSheet(
|
||||||
// minChildSize: 1,
|
minChildSize: 0.95,
|
||||||
// initialChildSize: 1,
|
initialChildSize: 1,
|
||||||
// maxChildSize: 1,
|
maxChildSize: 1,
|
||||||
// builder: (context, scrollController) {
|
builder: (context, scrollController) {
|
||||||
// return SingleChildScrollView(
|
return SingleChildScrollView(
|
||||||
// controller: scrollController,
|
controller: scrollController,
|
||||||
// physics: ClampingScrollPhysics(),
|
physics: ClampingScrollPhysics(),
|
||||||
// child: Container(
|
child: Container(
|
||||||
// child: Column(
|
child: Column(
|
||||||
// children: [
|
children: [
|
||||||
// GestureDetector(
|
GestureDetector(
|
||||||
// onTap: () => Navigator.of(context).pop(),
|
onTap: () => Navigator.of(context).pop(),
|
||||||
// behavior: HitTestBehavior.opaque,
|
behavior: HitTestBehavior.opaque,
|
||||||
// child: Container(
|
child: Container(
|
||||||
// width: double.infinity,
|
width: double.infinity,
|
||||||
// child: Center(
|
child: Center(
|
||||||
// child: Padding(
|
child: Padding(
|
||||||
// padding: EdgeInsets.only(top: 132, bottom: 6),
|
padding: EdgeInsets.only(top: 132, bottom: 6),
|
||||||
// child: Container(
|
child: Container(
|
||||||
// height: 4,
|
height: 4,
|
||||||
// width: 30,
|
width: 30,
|
||||||
// decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
// borderRadius: BorderRadius.circular(2),
|
borderRadius: BorderRadius.circular(2),
|
||||||
// color: Color(0xFFE3E3E3).withOpacity(0.65),
|
color: Color(0xFFE3E3E3).withOpacity(0.65),
|
||||||
// ),
|
),
|
||||||
// ),
|
),
|
||||||
// ),
|
),
|
||||||
// ),
|
),
|
||||||
// ),
|
),
|
||||||
// ),
|
),
|
||||||
// Container(
|
Container(
|
||||||
// constraints: BoxConstraints(
|
constraints: BoxConstraints(
|
||||||
// minHeight: MediaQuery.of(context).size.height - 132,
|
minHeight: MediaQuery.of(context).size.height - 132,
|
||||||
// maxHeight: MediaQuery.of(context).size.height - 132,
|
maxHeight: MediaQuery.of(context).size.height - 132,
|
||||||
// ),
|
),
|
||||||
// decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
// borderRadius:
|
borderRadius:
|
||||||
// BorderRadius.vertical(top: Radius.circular(20)),
|
BorderRadius.vertical(top: Radius.circular(20)),
|
||||||
// color: Theme.of(context).scaffoldBackgroundColor,
|
color: Theme.of(context).scaffoldBackgroundColor,
|
||||||
// ),
|
),
|
||||||
// width: double.infinity,
|
width: double.infinity,
|
||||||
// child: child),
|
child: child),
|
||||||
// ],
|
],
|
||||||
// ),
|
),
|
||||||
// ),
|
),
|
||||||
// );
|
);
|
||||||
// });
|
});
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
|
|
|
@ -1,24 +0,0 @@
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
|
|
||||||
import 'package:selfprivacy/config/brand_colors.dart';
|
|
||||||
|
|
||||||
class BrandSwitch extends StatelessWidget {
|
|
||||||
const BrandSwitch({
|
|
||||||
Key? key,
|
|
||||||
required this.onChanged,
|
|
||||||
required this.value,
|
|
||||||
}) : super(key: key);
|
|
||||||
|
|
||||||
final ValueChanged<bool> onChanged;
|
|
||||||
final bool value;
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return Switch(
|
|
||||||
activeColor: BrandColors.green1,
|
|
||||||
activeTrackColor: BrandColors.green2,
|
|
||||||
value: value,
|
|
||||||
onChanged: onChanged,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,6 +1,5 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:selfprivacy/config/text_themes.dart';
|
import 'package:selfprivacy/config/text_themes.dart';
|
||||||
export 'package:selfprivacy/utils/extensions/text_extensions.dart';
|
|
||||||
|
|
||||||
enum TextType {
|
enum TextType {
|
||||||
h1, // right now only at onboarding and opened providers
|
h1, // right now only at onboarding and opened providers
|
||||||
|
@ -52,16 +51,10 @@ class BrandText extends StatelessWidget {
|
||||||
type: TextType.onboardingTitle,
|
type: TextType.onboardingTitle,
|
||||||
style: style,
|
style: style,
|
||||||
);
|
);
|
||||||
factory BrandText.h2(
|
factory BrandText.h2(String? text, {TextStyle? style}) => BrandText(
|
||||||
String? text, {
|
|
||||||
TextStyle? style,
|
|
||||||
TextAlign? textAlign,
|
|
||||||
}) =>
|
|
||||||
BrandText(
|
|
||||||
text,
|
text,
|
||||||
type: TextType.h2,
|
type: TextType.h2,
|
||||||
style: style,
|
style: style,
|
||||||
textAlign: textAlign,
|
|
||||||
);
|
);
|
||||||
factory BrandText.h3(String text, {TextStyle? style, TextAlign? textAlign}) =>
|
factory BrandText.h3(String text, {TextStyle? style, TextAlign? textAlign}) =>
|
||||||
BrandText(
|
BrandText(
|
||||||
|
@ -127,6 +120,7 @@ class BrandText extends StatelessWidget {
|
||||||
Text build(BuildContext context) {
|
Text build(BuildContext context) {
|
||||||
TextStyle style;
|
TextStyle style;
|
||||||
var isDark = Theme.of(context).brightness == Brightness.dark;
|
var isDark = Theme.of(context).brightness == Brightness.dark;
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case TextType.h1:
|
case TextType.h1:
|
||||||
style = isDark
|
style = isDark
|
||||||
|
|
|
@ -1,81 +0,0 @@
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:easy_localization/easy_localization.dart';
|
|
||||||
import 'package:flutter_bloc/flutter_bloc.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/logic/cubit/users/users_cubit.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_loader/brand_loader.dart';
|
|
||||||
import 'package:selfprivacy/ui/components/brand_text/brand_text.dart';
|
|
||||||
|
|
||||||
class JobsContent extends StatelessWidget {
|
|
||||||
const JobsContent({Key? key}) : super(key: key);
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return BlocBuilder<JobsCubit, JobsState>(
|
|
||||||
builder: (context, state) {
|
|
||||||
late final List<Widget> widgets;
|
|
||||||
if (state is JobsStateEmpty) {
|
|
||||||
widgets = [
|
|
||||||
SizedBox(height: 80),
|
|
||||||
Center(child: BrandText.body1('jobs.empty'.tr())),
|
|
||||||
];
|
|
||||||
} else if (state is JobsStateLoading) {
|
|
||||||
widgets = [
|
|
||||||
SizedBox(height: 80),
|
|
||||||
BrandLoader.horizontal(),
|
|
||||||
];
|
|
||||||
} else if (state is JobsStateWithJobs) {
|
|
||||||
widgets = [
|
|
||||||
...state.jobList
|
|
||||||
.map(
|
|
||||||
(j) => Row(
|
|
||||||
children: [
|
|
||||||
Expanded(
|
|
||||||
child: BrandCards.small(
|
|
||||||
child: Text(j.title),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
SizedBox(width: 10),
|
|
||||||
ElevatedButton(
|
|
||||||
style: ElevatedButton.styleFrom(
|
|
||||||
primary: BrandColors.red1,
|
|
||||||
shape: RoundedRectangleBorder(
|
|
||||||
borderRadius: BorderRadius.circular(10),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
onPressed: () =>
|
|
||||||
context.read<JobsCubit>().removeJob(j.id),
|
|
||||||
child: Text('basis.remove'.tr()),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
)
|
|
||||||
.toList(),
|
|
||||||
SizedBox(height: 20),
|
|
||||||
BrandButton.rised(
|
|
||||||
onPressed: () => context.read<JobsCubit>().applyAll(),
|
|
||||||
text: 'jobs.start'.tr(),
|
|
||||||
),
|
|
||||||
];
|
|
||||||
}
|
|
||||||
return ListView(
|
|
||||||
padding: paddingH15V0,
|
|
||||||
children: [
|
|
||||||
SizedBox(height: 15),
|
|
||||||
Center(
|
|
||||||
child: BrandText.h2(
|
|
||||||
'jobs.title'.tr(),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
SizedBox(height: 20),
|
|
||||||
...widgets
|
|
||||||
],
|
|
||||||
);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -2,7 +2,7 @@ import 'package:flutter/material.dart';
|
||||||
import 'package:selfprivacy/ui/components/brand_divider/brand_divider.dart';
|
import 'package:selfprivacy/ui/components/brand_divider/brand_divider.dart';
|
||||||
import 'package:selfprivacy/ui/components/brand_text/brand_text.dart';
|
import 'package:selfprivacy/ui/components/brand_text/brand_text.dart';
|
||||||
import 'package:easy_localization/easy_localization.dart';
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:selfprivacy/ui/components/pre_styled_buttons/pre_styled_buttons.dart';
|
import 'package:selfprivacy/ui/components/pre_styled_buttons.dart';
|
||||||
|
|
||||||
class OnePage extends StatelessWidget {
|
class OnePage extends StatelessWidget {
|
||||||
const OnePage({
|
const OnePage({
|
||||||
|
@ -16,31 +16,33 @@ class OnePage extends StatelessWidget {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return SafeArea(
|
||||||
appBar: PreferredSize(
|
child: Scaffold(
|
||||||
child: Column(
|
appBar: PreferredSize(
|
||||||
children: [
|
child: Column(
|
||||||
Container(
|
children: [
|
||||||
height: 51,
|
Container(
|
||||||
alignment: Alignment.center,
|
height: 51,
|
||||||
padding: EdgeInsets.symmetric(horizontal: 15),
|
alignment: Alignment.center,
|
||||||
child: BrandText.h4('basis.details'.tr()),
|
padding: EdgeInsets.symmetric(horizontal: 15),
|
||||||
),
|
child: BrandText.h4('basis.details'.tr()),
|
||||||
BrandDivider(),
|
),
|
||||||
],
|
BrandDivider(),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
preferredSize: Size.fromHeight(52),
|
||||||
),
|
),
|
||||||
preferredSize: Size.fromHeight(52),
|
body: child,
|
||||||
),
|
bottomNavigationBar: SafeArea(
|
||||||
body: child,
|
|
||||||
bottomNavigationBar: SafeArea(
|
|
||||||
child: Container(
|
|
||||||
decoration: BoxDecoration(boxShadow: kElevationToShadow[3]),
|
|
||||||
height: kBottomNavigationBarHeight,
|
|
||||||
child: Container(
|
child: Container(
|
||||||
color: Theme.of(context).scaffoldBackgroundColor,
|
decoration: BoxDecoration(boxShadow: kElevationToShadow[3]),
|
||||||
alignment: Alignment.center,
|
height: kBottomNavigationBarHeight,
|
||||||
child: PreStyledButtons.close(
|
child: Container(
|
||||||
onPress: () => Navigator.of(context).pop()),
|
color: Theme.of(context).scaffoldBackgroundColor,
|
||||||
|
alignment: Alignment.center,
|
||||||
|
child: PreStyledButtons.close(
|
||||||
|
onPress: () => Navigator.of(context).pop()),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
@ -1,4 +1,13 @@
|
||||||
part of 'pre_styled_buttons.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:selfprivacy/ui/components/brand_text/brand_text.dart';
|
||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
|
|
||||||
|
class PreStyledButtons {
|
||||||
|
static Widget close({
|
||||||
|
required VoidCallback onPress,
|
||||||
|
}) =>
|
||||||
|
_CloseButton(onPress: onPress);
|
||||||
|
}
|
||||||
|
|
||||||
class _CloseButton extends StatelessWidget {
|
class _CloseButton extends StatelessWidget {
|
||||||
const _CloseButton({Key? key, required this.onPress}) : super(key: key);
|
const _CloseButton({Key? key, required this.onPress}) : super(key: key);
|
|
@ -1,86 +0,0 @@
|
||||||
part of 'pre_styled_buttons.dart';
|
|
||||||
|
|
||||||
class _BrandFlashButton extends StatefulWidget {
|
|
||||||
_BrandFlashButton({Key? key}) : super(key: key);
|
|
||||||
|
|
||||||
@override
|
|
||||||
_BrandFlashButtonState createState() => _BrandFlashButtonState();
|
|
||||||
}
|
|
||||||
|
|
||||||
class _BrandFlashButtonState extends State<_BrandFlashButton>
|
|
||||||
with SingleTickerProviderStateMixin {
|
|
||||||
late AnimationController _animationController;
|
|
||||||
late Animation _colorTween;
|
|
||||||
|
|
||||||
@override
|
|
||||||
void initState() {
|
|
||||||
_animationController =
|
|
||||||
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
|
|
||||||
void dispose() {
|
|
||||||
_animationController.dispose();
|
|
||||||
super.dispose();
|
|
||||||
}
|
|
||||||
|
|
||||||
bool wasPrevStateIsEmpty = true;
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return BlocListener<JobsCubit, JobsState>(
|
|
||||||
listener: (context, state) {
|
|
||||||
if (wasPrevStateIsEmpty && state is! JobsStateEmpty) {
|
|
||||||
wasPrevStateIsEmpty = false;
|
|
||||||
_animationController.forward();
|
|
||||||
} else if (!wasPrevStateIsEmpty && state is JobsStateEmpty) {
|
|
||||||
wasPrevStateIsEmpty = true;
|
|
||||||
|
|
||||||
_animationController.reverse();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
child: IconButton(
|
|
||||||
onPressed: () {
|
|
||||||
showBrandBottomSheet(
|
|
||||||
context: context,
|
|
||||||
builder: (context) => BrandBottomSheet(
|
|
||||||
isExpended: true,
|
|
||||||
child: JobsContent(),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
icon: AnimatedBuilder(
|
|
||||||
animation: _colorTween,
|
|
||||||
builder: (context, child) {
|
|
||||||
var v = _animationController.value;
|
|
||||||
var icon = v > 0.5 ? Ionicons.flash : Ionicons.flash_outline;
|
|
||||||
return Transform.scale(
|
|
||||||
scale: 1 + (v < 0.5 ? v : 1 - v) * 2,
|
|
||||||
child: Icon(
|
|
||||||
icon,
|
|
||||||
color: _colorTween.value,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,23 +0,0 @@
|
||||||
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';
|
|
||||||
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:selfprivacy/ui/components/jobs_content/jobs_content.dart';
|
|
||||||
import 'package:selfprivacy/ui/helpers/modals.dart';
|
|
||||||
|
|
||||||
part 'close.dart';
|
|
||||||
part 'flash.dart';
|
|
||||||
|
|
||||||
class PreStyledButtons {
|
|
||||||
static Widget close({
|
|
||||||
required VoidCallback onPress,
|
|
||||||
}) =>
|
|
||||||
_CloseButton(onPress: onPress);
|
|
||||||
|
|
||||||
static Widget flash() => _BrandFlashButton();
|
|
||||||
}
|
|
|
@ -53,9 +53,9 @@ class _ProgressBarState extends State<ProgressBar> {
|
||||||
width: 10,
|
width: 10,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
odd.add(
|
even.add(
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: 20,
|
width: 10,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -1,14 +0,0 @@
|
||||||
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,
|
|
||||||
);
|
|
|
@ -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/forms/initializing/root_user_form_cubit.dart';
|
||||||
import 'package:selfprivacy/logic/cubit/app_config/app_config_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/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_button/brand_button.dart';
|
||||||
import 'package:selfprivacy/ui/components/brand_cards/brand_cards.dart';
|
import 'package:selfprivacy/ui/components/brand_card/brand_card.dart';
|
||||||
import 'package:selfprivacy/ui/components/brand_md/brand_md.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_text/brand_text.dart';
|
||||||
import 'package:selfprivacy/ui/components/brand_timer/brand_timer.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/progress_bar/progress_bar.dart';
|
||||||
|
@ -36,7 +36,7 @@ class InitializingPage extends StatelessWidget {
|
||||||
() => _stepCheck(cubit),
|
() => _stepCheck(cubit),
|
||||||
() => _stepCheck(cubit),
|
() => _stepCheck(cubit),
|
||||||
() => _stepCheck(cubit),
|
() => _stepCheck(cubit),
|
||||||
() => Container(child: Center(child: Text('initializing.finish'.tr())))
|
() => Container(child: Text('Everythigng is initialized'))
|
||||||
][cubit.state.progress]();
|
][cubit.state.progress]();
|
||||||
return BlocListener<AppConfigCubit, AppConfigState>(
|
return BlocListener<AppConfigCubit, AppConfigState>(
|
||||||
listener: (context, state) {
|
listener: (context, state) {
|
||||||
|
@ -50,7 +50,7 @@ class InitializingPage extends StatelessWidget {
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Padding(
|
Padding(
|
||||||
padding: paddingH15V0.copyWith(top: 10, bottom: 10),
|
padding: brandPagePadding2.copyWith(top: 10, bottom: 10),
|
||||||
child: ProgressBar(
|
child: ProgressBar(
|
||||||
steps: [
|
steps: [
|
||||||
'Hetzner',
|
'Hetzner',
|
||||||
|
@ -59,9 +59,12 @@ class InitializingPage extends StatelessWidget {
|
||||||
'Domain',
|
'Domain',
|
||||||
'User',
|
'User',
|
||||||
'Server',
|
'Server',
|
||||||
'✅ Check',
|
' ✅',
|
||||||
|
' ✅',
|
||||||
|
' ✅',
|
||||||
|
' ✅',
|
||||||
],
|
],
|
||||||
activeIndex: cubit.state.porgressBar,
|
activeIndex: cubit.state.progress,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
_addCard(
|
_addCard(
|
||||||
|
@ -129,7 +132,7 @@ class InitializingPage extends StatelessWidget {
|
||||||
onPressed: formCubitState.isSubmitting
|
onPressed: formCubitState.isSubmitting
|
||||||
? null
|
? null
|
||||||
: () => context.read<HetznerFormCubit>().trySubmit(),
|
: () => context.read<HetznerFormCubit>().trySubmit(),
|
||||||
text: 'basis.connect'.tr(),
|
title: 'basis.connect'.tr(),
|
||||||
),
|
),
|
||||||
SizedBox(height: 10),
|
SizedBox(height: 10),
|
||||||
BrandButton.text(
|
BrandButton.text(
|
||||||
|
@ -184,7 +187,7 @@ class InitializingPage extends StatelessWidget {
|
||||||
onPressed: formCubitState.isSubmitting
|
onPressed: formCubitState.isSubmitting
|
||||||
? null
|
? null
|
||||||
: () => context.read<CloudFlareFormCubit>().trySubmit(),
|
: () => context.read<CloudFlareFormCubit>().trySubmit(),
|
||||||
text: 'basis.connect'.tr(),
|
title: 'basis.connect'.tr(),
|
||||||
),
|
),
|
||||||
SizedBox(height: 10),
|
SizedBox(height: 10),
|
||||||
BrandButton.text(
|
BrandButton.text(
|
||||||
|
@ -235,7 +238,7 @@ class InitializingPage extends StatelessWidget {
|
||||||
onPressed: formCubitState.isSubmitting
|
onPressed: formCubitState.isSubmitting
|
||||||
? null
|
? null
|
||||||
: () => context.read<BackblazeFormCubit>().trySubmit(),
|
: () => context.read<BackblazeFormCubit>().trySubmit(),
|
||||||
text: 'basis.connect'.tr(),
|
title: 'basis.connect'.tr(),
|
||||||
),
|
),
|
||||||
SizedBox(height: 10),
|
SizedBox(height: 10),
|
||||||
BrandButton.text(
|
BrandButton.text(
|
||||||
|
@ -327,7 +330,7 @@ class InitializingPage extends StatelessWidget {
|
||||||
SizedBox(height: 30),
|
SizedBox(height: 30),
|
||||||
BrandButton.rised(
|
BrandButton.rised(
|
||||||
onPressed: () => context.read<DomainSetupCubit>().saveDomain(),
|
onPressed: () => context.read<DomainSetupCubit>().saveDomain(),
|
||||||
text: 'initializing.10'.tr(),
|
title: 'initializing.10'.tr(),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
SizedBox(height: 10),
|
SizedBox(height: 10),
|
||||||
|
@ -397,7 +400,7 @@ class InitializingPage extends StatelessWidget {
|
||||||
onPressed: formCubitState.isSubmitting
|
onPressed: formCubitState.isSubmitting
|
||||||
? null
|
? null
|
||||||
: () => context.read<RootUserFormCubit>().trySubmit(),
|
: () => context.read<RootUserFormCubit>().trySubmit(),
|
||||||
text: 'basis.connect'.tr(),
|
title: 'basis.connect'.tr(),
|
||||||
),
|
),
|
||||||
SizedBox(height: 10),
|
SizedBox(height: 10),
|
||||||
BrandButton.text(
|
BrandButton.text(
|
||||||
|
@ -425,7 +428,7 @@ class InitializingPage extends StatelessWidget {
|
||||||
onPressed: isLoading
|
onPressed: isLoading
|
||||||
? null
|
? null
|
||||||
: () => appConfigCubit.createServerAndSetDnsRecords(),
|
: () => appConfigCubit.createServerAndSetDnsRecords(),
|
||||||
text: isLoading ? 'basis.loading'.tr() : 'initializing.11'.tr(),
|
title: isLoading ? 'basis.loading'.tr() : 'initializing.11'.tr(),
|
||||||
),
|
),
|
||||||
Spacer(flex: 2),
|
Spacer(flex: 2),
|
||||||
BrandButton.text(
|
BrandButton.text(
|
||||||
|
@ -440,29 +443,21 @@ class InitializingPage extends StatelessWidget {
|
||||||
Widget _stepCheck(AppConfigCubit appConfigCubit) {
|
Widget _stepCheck(AppConfigCubit appConfigCubit) {
|
||||||
assert(appConfigCubit.state is TimerState, 'wronge state');
|
assert(appConfigCubit.state is TimerState, 'wronge state');
|
||||||
var state = appConfigCubit.state as TimerState;
|
var state = appConfigCubit.state as TimerState;
|
||||||
late int doneCount;
|
|
||||||
late String? text;
|
late String? text;
|
||||||
if (state.isServerResetedSecondTime) {
|
if (state.isServerResetedSecondTime) {
|
||||||
text = 'initializing.13'.tr();
|
text = 'initializing.13'.tr();
|
||||||
doneCount = 3;
|
|
||||||
} else if (state.isServerResetedFirstTime) {
|
} else if (state.isServerResetedFirstTime) {
|
||||||
text = 'initializing.21'.tr();
|
text = 'initializing.21'.tr();
|
||||||
doneCount = 2;
|
|
||||||
} else if (state.isServerStarted) {
|
} else if (state.isServerStarted) {
|
||||||
text = 'initializing.14'.tr();
|
text = 'initializing.14'.tr();
|
||||||
doneCount = 1;
|
|
||||||
} else if (state.isServerCreated) {
|
} else if (state.isServerCreated) {
|
||||||
text = 'initializing.15'.tr();
|
text = 'initializing.15'.tr();
|
||||||
doneCount = 0;
|
|
||||||
}
|
}
|
||||||
return Builder(builder: (context) {
|
return Builder(builder: (context) {
|
||||||
return Column(
|
return Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
SizedBox(height: 15),
|
|
||||||
BrandText.h4(
|
|
||||||
'initializing.checks'.tr(args: [doneCount.toString(), "4"]),
|
|
||||||
),
|
|
||||||
Spacer(flex: 2),
|
Spacer(flex: 2),
|
||||||
SizedBox(height: 10),
|
SizedBox(height: 10),
|
||||||
BrandText.body2(text),
|
BrandText.body2(text),
|
||||||
|
@ -493,8 +488,8 @@ class InitializingPage extends StatelessWidget {
|
||||||
Widget _addCard(Widget child) {
|
Widget _addCard(Widget child) {
|
||||||
return Container(
|
return Container(
|
||||||
height: 450,
|
height: 450,
|
||||||
padding: paddingH15V0,
|
padding: brandPagePadding2,
|
||||||
child: BrandCards.big(child: child),
|
child: BrandCard(child: child),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -506,14 +501,12 @@ class _HowHetzner extends StatelessWidget {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return BrandBottomSheet(
|
return BrandModalSheet(
|
||||||
isExpended: true,
|
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: paddingH15V0,
|
padding: brandPagePadding2.copyWith(top: 25),
|
||||||
child: BrandMarkdown(
|
child: BrandMarkdown(
|
||||||
fileName: 'how_hetzner',
|
fileName: 'how_hetzner',
|
||||||
),
|
)),
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,6 @@ 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_alert/brand_alert.dart';
|
||||||
import 'package:selfprivacy/ui/components/brand_divider/brand_divider.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_header/brand_header.dart';
|
||||||
import 'package:selfprivacy/ui/components/brand_switch/brand_switch.dart';
|
|
||||||
import 'package:selfprivacy/ui/components/brand_text/brand_text.dart';
|
import 'package:selfprivacy/ui/components/brand_text/brand_text.dart';
|
||||||
import 'package:selfprivacy/utils/named_font_weight.dart';
|
import 'package:selfprivacy/utils/named_font_weight.dart';
|
||||||
import 'package:easy_localization/easy_localization.dart';
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
|
@ -33,7 +32,7 @@ class _AppSettingsPageState extends State<AppSettingsPage> {
|
||||||
preferredSize: Size.fromHeight(52),
|
preferredSize: Size.fromHeight(52),
|
||||||
),
|
),
|
||||||
body: ListView(
|
body: ListView(
|
||||||
padding: paddingH15V0,
|
padding: brandPagePadding2,
|
||||||
children: [
|
children: [
|
||||||
BrandDivider(),
|
BrandDivider(),
|
||||||
Container(
|
Container(
|
||||||
|
@ -53,7 +52,9 @@ class _AppSettingsPageState extends State<AppSettingsPage> {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SizedBox(width: 5),
|
SizedBox(width: 5),
|
||||||
BrandSwitch(
|
Switch(
|
||||||
|
activeColor: BrandColors.green1,
|
||||||
|
activeTrackColor: BrandColors.green2,
|
||||||
value: Theme.of(context).brightness == Brightness.dark,
|
value: Theme.of(context).brightness == Brightness.dark,
|
||||||
onChanged: (value) => context
|
onChanged: (value) => context
|
||||||
.read<AppSettingsCubit>()
|
.read<AppSettingsCubit>()
|
||||||
|
@ -119,72 +120,69 @@ class _AppSettingsPageState extends State<AppSettingsPage> {
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
// deleteServer(context)
|
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: _TextColumn(
|
||||||
|
title: 'more.settings.5'.tr(),
|
||||||
|
value: 'more.settings.6'.tr(),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(width: 5),
|
||||||
|
ElevatedButton(
|
||||||
|
style: ElevatedButton.styleFrom(
|
||||||
|
primary: BrandColors.red1,
|
||||||
|
),
|
||||||
|
child: Text(
|
||||||
|
'basis.delete'.tr(),
|
||||||
|
style: TextStyle(
|
||||||
|
color: BrandColors.white,
|
||||||
|
fontWeight: NamedFontWeight.demiBold,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
onPressed: () {
|
||||||
|
showDialog(
|
||||||
|
context: context,
|
||||||
|
builder: (_) {
|
||||||
|
return BrandAlert(
|
||||||
|
title: 'modals.3'.tr(),
|
||||||
|
contentText: 'modals.6'.tr(),
|
||||||
|
acitons: [
|
||||||
|
ActionButton(
|
||||||
|
text: 'modals.7'.tr(),
|
||||||
|
isRed: true,
|
||||||
|
onPressed: () async {
|
||||||
|
await context
|
||||||
|
.read<AppConfigCubit>()
|
||||||
|
.serverDelete();
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
}),
|
||||||
|
ActionButton(
|
||||||
|
text: 'basis.cancel'.tr(),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget deleteServer(BuildContext context) {
|
|
||||||
// todo: need to check
|
|
||||||
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: _TextColumn(
|
|
||||||
title: 'more.settings.5'.tr(),
|
|
||||||
value: 'more.settings.6'.tr(),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
SizedBox(width: 5),
|
|
||||||
ElevatedButton(
|
|
||||||
style: ElevatedButton.styleFrom(
|
|
||||||
primary: BrandColors.red1,
|
|
||||||
),
|
|
||||||
child: Text(
|
|
||||||
'basis.delete'.tr(),
|
|
||||||
style: TextStyle(
|
|
||||||
color: BrandColors.white,
|
|
||||||
fontWeight: NamedFontWeight.demiBold,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
onPressed: () {
|
|
||||||
showDialog(
|
|
||||||
context: context,
|
|
||||||
builder: (_) {
|
|
||||||
return BrandAlert(
|
|
||||||
title: 'modals.3'.tr(),
|
|
||||||
contentText: 'modals.6'.tr(),
|
|
||||||
acitons: [
|
|
||||||
ActionButton(
|
|
||||||
text: 'modals.7'.tr(),
|
|
||||||
isRed: true,
|
|
||||||
onPressed: () async {
|
|
||||||
await context.read<AppConfigCubit>().serverDelete();
|
|
||||||
Navigator.of(context).pop();
|
|
||||||
}),
|
|
||||||
ActionButton(
|
|
||||||
text: 'basis.cancel'.tr(),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class _TextColumn extends StatelessWidget {
|
class _TextColumn extends StatelessWidget {
|
||||||
|
|
|
@ -18,7 +18,7 @@ class InfoPage extends StatelessWidget {
|
||||||
preferredSize: Size.fromHeight(52),
|
preferredSize: Size.fromHeight(52),
|
||||||
),
|
),
|
||||||
body: ListView(
|
body: ListView(
|
||||||
padding: paddingH15V0,
|
padding: brandPagePadding2,
|
||||||
children: [
|
children: [
|
||||||
BrandDivider(),
|
BrandDivider(),
|
||||||
SizedBox(height: 10),
|
SizedBox(height: 10),
|
||||||
|
|
|
@ -1,29 +1,15 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
|
||||||
import 'package:ionicons/ionicons.dart';
|
|
||||||
import 'package:selfprivacy/config/brand_colors.dart';
|
import 'package:selfprivacy/config/brand_colors.dart';
|
||||||
import 'package:selfprivacy/config/brand_theme.dart';
|
import 'package:selfprivacy/config/brand_theme.dart';
|
||||||
import 'package:selfprivacy/config/get_it_config.dart';
|
|
||||||
import 'package:selfprivacy/config/text_themes.dart';
|
|
||||||
import 'package:selfprivacy/logic/cubit/app_config/app_config_cubit.dart';
|
|
||||||
import 'package:selfprivacy/logic/cubit/jobs/jobs_cubit.dart';
|
|
||||||
import 'package:selfprivacy/logic/get_it/ssh.dart';
|
|
||||||
import 'package:selfprivacy/logic/models/job.dart';
|
|
||||||
import 'package:selfprivacy/logic/models/state_types.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_button/brand_button.dart';
|
|
||||||
import 'package:selfprivacy/ui/components/brand_divider/brand_divider.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_header/brand_header.dart';
|
||||||
import 'package:selfprivacy/ui/components/brand_icons/brand_icons.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/brand_text/brand_text.dart';
|
||||||
import 'package:selfprivacy/ui/components/icon_status_mask/icon_status_mask.dart';
|
|
||||||
import 'package:selfprivacy/ui/pages/initializing/initializing.dart';
|
import 'package:selfprivacy/ui/pages/initializing/initializing.dart';
|
||||||
import 'package:selfprivacy/ui/pages/onboarding/onboarding.dart';
|
import 'package:selfprivacy/ui/pages/onboarding/onboarding.dart';
|
||||||
import 'package:selfprivacy/ui/pages/rootRoute.dart';
|
import 'package:selfprivacy/ui/pages/rootRoute.dart';
|
||||||
import 'package:selfprivacy/utils/route_transitions/basic.dart';
|
import 'package:selfprivacy/utils/route_transitions/basic.dart';
|
||||||
import 'package:easy_localization/easy_localization.dart';
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:share_plus/share_plus.dart';
|
|
||||||
|
|
||||||
import 'about/about.dart';
|
import 'about/about.dart';
|
||||||
import 'app_settings/app_setting.dart';
|
import 'app_settings/app_setting.dart';
|
||||||
|
@ -35,21 +21,15 @@ class MorePage extends StatelessWidget {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
var jobsCubit = context.watch<JobsCubit>();
|
|
||||||
var isReady = context.watch<AppConfigCubit>().state.isFullyInitilized;
|
|
||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: PreferredSize(
|
appBar: PreferredSize(
|
||||||
child: BrandHeader(
|
child: BrandHeader(title: 'basis.more'.tr()),
|
||||||
title: 'basis.more'.tr(),
|
|
||||||
hasFlashButton: true,
|
|
||||||
),
|
|
||||||
preferredSize: Size.fromHeight(52),
|
preferredSize: Size.fromHeight(52),
|
||||||
),
|
),
|
||||||
body: ListView(
|
body: ListView(
|
||||||
children: [
|
children: [
|
||||||
Padding(
|
Padding(
|
||||||
padding: paddingH15V0,
|
padding: brandPagePadding2,
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
BrandDivider(),
|
BrandDivider(),
|
||||||
|
@ -83,73 +63,6 @@ class MorePage extends StatelessWidget {
|
||||||
iconData: BrandIcons.terminal,
|
iconData: BrandIcons.terminal,
|
||||||
goTo: Console(),
|
goTo: Console(),
|
||||||
),
|
),
|
||||||
_MoreMenuTapItem(
|
|
||||||
title: 'more.create_ssh_key'.tr(),
|
|
||||||
iconData: Ionicons.key_outline,
|
|
||||||
onTap: isReady
|
|
||||||
? () {
|
|
||||||
if (getIt<SSHModel>().isSSHKeyGenerated) {
|
|
||||||
showDialog<void>(
|
|
||||||
context: context,
|
|
||||||
builder: (BuildContext context) {
|
|
||||||
return _SSHExitsDetails(
|
|
||||||
onShareTap: () {
|
|
||||||
Share.share(
|
|
||||||
getIt<SSHModel>().savedPrivateKey!);
|
|
||||||
},
|
|
||||||
onDeleteTap: () {
|
|
||||||
showDialog(
|
|
||||||
context: context,
|
|
||||||
builder: (_) {
|
|
||||||
return BrandAlert(
|
|
||||||
title: 'modals.3'.tr(),
|
|
||||||
contentText:
|
|
||||||
'more.delete_ssh_text'.tr(),
|
|
||||||
acitons: [
|
|
||||||
ActionButton(
|
|
||||||
text: 'more.yes_delete'.tr(),
|
|
||||||
isRed: true,
|
|
||||||
onPressed: () {
|
|
||||||
getIt<SSHModel>().clear();
|
|
||||||
Navigator.of(context).pop();
|
|
||||||
}),
|
|
||||||
ActionButton(
|
|
||||||
text: 'basis.cancel'.tr(),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
},
|
|
||||||
onCopyTap: () {
|
|
||||||
Clipboard.setData(ClipboardData(
|
|
||||||
text: getIt<SSHModel>()
|
|
||||||
.savedPrivateKey!));
|
|
||||||
getIt<NavigationService>()
|
|
||||||
.showSnackBar('more.copied_ssh'.tr());
|
|
||||||
},
|
|
||||||
);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
showDialog<void>(
|
|
||||||
context: context,
|
|
||||||
builder: (BuildContext context) {
|
|
||||||
return _MoreDetails(
|
|
||||||
title: 'more.create_ssh_key'.tr(),
|
|
||||||
icon: Ionicons.key_outline,
|
|
||||||
onTap: () {
|
|
||||||
jobsCubit.createShhJobIfNotExist(
|
|
||||||
CreateSSHKeyJob());
|
|
||||||
},
|
|
||||||
text: 'more.generate_key_text'.tr(),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
: null,
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
@ -159,150 +72,6 @@ class MorePage extends StatelessWidget {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class _SSHExitsDetails extends StatelessWidget {
|
|
||||||
const _SSHExitsDetails({
|
|
||||||
Key? key,
|
|
||||||
required this.onDeleteTap,
|
|
||||||
required this.onShareTap,
|
|
||||||
required this.onCopyTap,
|
|
||||||
}) : super(key: key);
|
|
||||||
final Function onDeleteTap;
|
|
||||||
final Function onShareTap;
|
|
||||||
final Function onCopyTap;
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
var textStyle = body1Style.copyWith(
|
|
||||||
color: Theme.of(context).brightness == Brightness.dark
|
|
||||||
? Colors.white
|
|
||||||
: BrandColors.black);
|
|
||||||
return Dialog(
|
|
||||||
shape: RoundedRectangleBorder(
|
|
||||||
borderRadius: BorderRadius.circular(20),
|
|
||||||
),
|
|
||||||
child: SingleChildScrollView(
|
|
||||||
child: Container(
|
|
||||||
width: 350,
|
|
||||||
child: Column(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
|
||||||
children: [
|
|
||||||
Padding(
|
|
||||||
padding: paddingH15V30,
|
|
||||||
child: Column(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
|
||||||
children: [
|
|
||||||
SizedBox(height: 10),
|
|
||||||
Text(
|
|
||||||
'more.ssh_key_exist_text'.tr(),
|
|
||||||
style: textStyle,
|
|
||||||
),
|
|
||||||
SizedBox(height: 10),
|
|
||||||
Container(
|
|
||||||
child: BrandButton.text(
|
|
||||||
onPressed: () {
|
|
||||||
Navigator.of(context).pop();
|
|
||||||
onShareTap();
|
|
||||||
},
|
|
||||||
title: 'more.share'.tr(),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Container(
|
|
||||||
alignment: Alignment.centerLeft,
|
|
||||||
child: BrandButton.text(
|
|
||||||
onPressed: () {
|
|
||||||
Navigator.of(context).pop();
|
|
||||||
onDeleteTap();
|
|
||||||
},
|
|
||||||
title: 'basis.delete'.tr(),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Container(
|
|
||||||
child: BrandButton.text(
|
|
||||||
onPressed: () {
|
|
||||||
Navigator.of(context).pop();
|
|
||||||
onCopyTap();
|
|
||||||
},
|
|
||||||
title: 'more.copy_buffer'.tr(),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class _MoreDetails extends StatelessWidget {
|
|
||||||
const _MoreDetails({
|
|
||||||
Key? key,
|
|
||||||
required this.icon,
|
|
||||||
required this.title,
|
|
||||||
required this.onTap,
|
|
||||||
required this.text,
|
|
||||||
}) : super(key: key);
|
|
||||||
final String title;
|
|
||||||
final IconData icon;
|
|
||||||
final Function onTap;
|
|
||||||
final String text;
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
var textStyle = body1Style.copyWith(
|
|
||||||
color: Theme.of(context).brightness == Brightness.dark
|
|
||||||
? Colors.white
|
|
||||||
: BrandColors.black);
|
|
||||||
return Dialog(
|
|
||||||
shape: RoundedRectangleBorder(
|
|
||||||
borderRadius: BorderRadius.circular(20),
|
|
||||||
),
|
|
||||||
child: SingleChildScrollView(
|
|
||||||
child: Container(
|
|
||||||
width: 350,
|
|
||||||
child: Column(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
children: [
|
|
||||||
Padding(
|
|
||||||
padding: paddingH15V30,
|
|
||||||
child: Column(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
children: [
|
|
||||||
IconStatusMask(
|
|
||||||
status: StateType.stable,
|
|
||||||
child: Icon(icon, size: 40, color: Colors.white),
|
|
||||||
),
|
|
||||||
SizedBox(height: 10),
|
|
||||||
BrandText.h2(title),
|
|
||||||
SizedBox(height: 10),
|
|
||||||
Text(
|
|
||||||
text,
|
|
||||||
style: textStyle,
|
|
||||||
),
|
|
||||||
SizedBox(height: 40),
|
|
||||||
Center(
|
|
||||||
child: Container(
|
|
||||||
child: BrandButton.rised(
|
|
||||||
onPressed: () {
|
|
||||||
Navigator.of(context).pop();
|
|
||||||
onTap();
|
|
||||||
},
|
|
||||||
text: 'more.generate_key'.tr(),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class _NavItem extends StatelessWidget {
|
class _NavItem extends StatelessWidget {
|
||||||
const _NavItem({
|
const _NavItem({
|
||||||
Key? key,
|
Key? key,
|
||||||
|
@ -319,81 +88,29 @@ class _NavItem extends StatelessWidget {
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return GestureDetector(
|
return GestureDetector(
|
||||||
onTap: () => Navigator.of(context).push(materialRoute(goTo)),
|
onTap: () => Navigator.of(context).push(materialRoute(goTo)),
|
||||||
child: _MoreMenuItem(
|
child: Container(
|
||||||
iconData: iconData,
|
padding: EdgeInsets.symmetric(vertical: 24),
|
||||||
title: title,
|
decoration: BoxDecoration(
|
||||||
isActive: true,
|
border: Border(
|
||||||
),
|
bottom: BorderSide(
|
||||||
);
|
width: 1.0,
|
||||||
}
|
color: BrandColors.dividerColor,
|
||||||
}
|
),
|
||||||
|
|
||||||
class _MoreMenuTapItem extends StatelessWidget {
|
|
||||||
const _MoreMenuTapItem({
|
|
||||||
Key? key,
|
|
||||||
required this.iconData,
|
|
||||||
required this.onTap,
|
|
||||||
required this.title,
|
|
||||||
}) : super(key: key);
|
|
||||||
|
|
||||||
final IconData iconData;
|
|
||||||
final VoidCallback? onTap;
|
|
||||||
final String title;
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return GestureDetector(
|
|
||||||
onTap: onTap,
|
|
||||||
child: _MoreMenuItem(
|
|
||||||
isActive: onTap != null,
|
|
||||||
iconData: iconData,
|
|
||||||
title: title,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class _MoreMenuItem extends StatelessWidget {
|
|
||||||
const _MoreMenuItem({
|
|
||||||
Key? key,
|
|
||||||
required this.iconData,
|
|
||||||
required this.title,
|
|
||||||
required this.isActive,
|
|
||||||
}) : super(key: key);
|
|
||||||
|
|
||||||
final IconData iconData;
|
|
||||||
final String title;
|
|
||||||
final bool isActive;
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return Container(
|
|
||||||
padding: EdgeInsets.symmetric(vertical: 24),
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
border: Border(
|
|
||||||
bottom: BorderSide(
|
|
||||||
width: 1.0,
|
|
||||||
color: BrandColors.dividerColor,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
child: Row(
|
||||||
child: Row(
|
children: [
|
||||||
children: [
|
BrandText.body1(title),
|
||||||
BrandText.body1(
|
Spacer(),
|
||||||
title,
|
SizedBox(
|
||||||
style: TextStyle(
|
width: 56,
|
||||||
color: isActive ? null : Colors.grey,
|
child: Icon(
|
||||||
|
iconData,
|
||||||
|
size: 20,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
],
|
||||||
Spacer(),
|
),
|
||||||
SizedBox(
|
|
||||||
width: 56,
|
|
||||||
child: Icon(
|
|
||||||
iconData,
|
|
||||||
size: 20,
|
|
||||||
color: isActive ? null : Colors.grey,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -79,7 +79,7 @@ class _OnboardingPageState extends State<OnboardingPage> {
|
||||||
curve: Curves.easeIn,
|
curve: Curves.easeIn,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
text: 'basis.next'.tr(),
|
title: 'basis.next'.tr(),
|
||||||
),
|
),
|
||||||
SizedBox(height: 30),
|
SizedBox(height: 30),
|
||||||
],
|
],
|
||||||
|
@ -129,7 +129,7 @@ class _OnboardingPageState extends State<OnboardingPage> {
|
||||||
(route) => false,
|
(route) => false,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
text: 'basis.got_it'.tr(),
|
title: 'basis.got_it'.tr(),
|
||||||
),
|
),
|
||||||
SizedBox(height: 30),
|
SizedBox(height: 30),
|
||||||
],
|
],
|
||||||
|
|
|
@ -1,19 +1,20 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:selfprivacy/config/brand_theme.dart';
|
import 'package:selfprivacy/config/brand_theme.dart';
|
||||||
import 'package:selfprivacy/logic/cubit/app_config/app_config_cubit.dart';
|
import 'package:selfprivacy/logic/cubit/app_config/app_config_cubit.dart';
|
||||||
import 'package:selfprivacy/logic/cubit/jobs/jobs_cubit.dart';
|
|
||||||
import 'package:selfprivacy/logic/cubit/providers/providers_cubit.dart';
|
import 'package:selfprivacy/logic/cubit/providers/providers_cubit.dart';
|
||||||
import 'package:selfprivacy/logic/models/provider.dart';
|
import 'package:selfprivacy/logic/models/provider.dart';
|
||||||
import 'package:selfprivacy/logic/models/state_types.dart';
|
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_card/brand_card.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_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/brand_text/brand_text.dart';
|
||||||
import 'package:selfprivacy/ui/components/icon_status_mask/icon_status_mask.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/components/not_ready_card/not_ready_card.dart';
|
||||||
import 'package:selfprivacy/ui/helpers/modals.dart';
|
import 'package:selfprivacy/ui/components/one_page/one_page.dart';
|
||||||
import 'package:selfprivacy/ui/pages/server_details/server_details.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:easy_localization/easy_localization.dart';
|
||||||
|
import 'package:selfprivacy/utils/route_transitions/slide_bottom.dart';
|
||||||
import 'package:selfprivacy/utils/ui_helpers.dart';
|
import 'package:selfprivacy/utils/ui_helpers.dart';
|
||||||
|
|
||||||
var navigatorKey = GlobalKey<NavigatorState>();
|
var navigatorKey = GlobalKey<NavigatorState>();
|
||||||
|
@ -45,14 +46,11 @@ class _ProvidersPageState extends State<ProvidersPage> {
|
||||||
.toList();
|
.toList();
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: PreferredSize(
|
appBar: PreferredSize(
|
||||||
child: BrandHeader(
|
child: BrandHeader(title: 'providers.page_title'.tr()),
|
||||||
title: 'providers.page_title'.tr(),
|
|
||||||
hasFlashButton: true,
|
|
||||||
),
|
|
||||||
preferredSize: Size.fromHeight(52),
|
preferredSize: Size.fromHeight(52),
|
||||||
),
|
),
|
||||||
body: ListView(
|
body: ListView(
|
||||||
padding: paddingH15V0,
|
padding: brandPagePadding2,
|
||||||
children: [
|
children: [
|
||||||
if (!isReady) ...[
|
if (!isReady) ...[
|
||||||
NotReadyCard(),
|
NotReadyCard(),
|
||||||
|
@ -75,7 +73,7 @@ class _Card extends StatelessWidget {
|
||||||
String? message;
|
String? message;
|
||||||
late String stableText;
|
late String stableText;
|
||||||
late VoidCallback onTap;
|
late VoidCallback onTap;
|
||||||
var isReady = context.watch<AppConfigCubit>().state.isFullyInitilized;
|
|
||||||
AppConfigState appConfig = context.watch<AppConfigCubit>().state;
|
AppConfigState appConfig = context.watch<AppConfigCubit>().state;
|
||||||
|
|
||||||
var domainName =
|
var domainName =
|
||||||
|
@ -85,22 +83,24 @@ class _Card extends StatelessWidget {
|
||||||
case ProviderType.server:
|
case ProviderType.server:
|
||||||
title = 'providers.server.card_title'.tr();
|
title = 'providers.server.card_title'.tr();
|
||||||
stableText = 'providers.server.status'.tr();
|
stableText = 'providers.server.status'.tr();
|
||||||
onTap = () => showBrandBottomSheet(
|
onTap = () => Navigator.of(context).push(
|
||||||
context: context,
|
SlideBottomRoute(
|
||||||
builder: (context) => BrandBottomSheet(
|
OnePage(
|
||||||
isExpended: true,
|
title: title,
|
||||||
child: ServerDetails(),
|
child: ServerDetails(),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case ProviderType.domain:
|
case ProviderType.domain:
|
||||||
title = 'providers.domain.card_title'.tr();
|
title = 'providers.domain.card_title'.tr();
|
||||||
message = domainName;
|
message = domainName;
|
||||||
stableText = 'providers.domain.status'.tr();
|
stableText = 'providers.domain.status'.tr();
|
||||||
|
|
||||||
onTap = () => showBrandBottomSheet<void>(
|
onTap = () => showModalBottomSheet<void>(
|
||||||
context: context,
|
context: context,
|
||||||
|
isScrollControlled: true,
|
||||||
|
backgroundColor: Colors.transparent,
|
||||||
builder: (BuildContext context) {
|
builder: (BuildContext context) {
|
||||||
return _ProviderDetails(
|
return _ProviderDetails(
|
||||||
provider: provider,
|
provider: provider,
|
||||||
|
@ -127,8 +127,8 @@ class _Card extends StatelessWidget {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return GestureDetector(
|
return GestureDetector(
|
||||||
onTap: isReady ? onTap : null,
|
onTap: onTap,
|
||||||
child: BrandCards.big(
|
child: BrandCard(
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
|
@ -196,31 +196,37 @@ class _ProviderDetails extends StatelessWidget {
|
||||||
];
|
];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return BrandBottomSheet(
|
return BrandModalSheet(
|
||||||
child: SafeArea(
|
child: Navigator(
|
||||||
child: Column(
|
key: navigatorKey,
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
initialRoute: '/',
|
||||||
children: [
|
onGenerateRoute: (_) {
|
||||||
SizedBox(height: 40),
|
return materialRoute(
|
||||||
Padding(
|
Column(
|
||||||
padding: paddingH15V0,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
child: Column(
|
children: [
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
SizedBox(height: 40),
|
||||||
children: [
|
Padding(
|
||||||
IconStatusMask(
|
padding: brandPagePadding2,
|
||||||
status: provider.state,
|
child: Column(
|
||||||
child: Icon(provider.icon, size: 40, color: Colors.white),
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
IconStatusMask(
|
||||||
|
status: provider.state,
|
||||||
|
child:
|
||||||
|
Icon(provider.icon, size: 40, color: Colors.white),
|
||||||
|
),
|
||||||
|
SizedBox(height: 10),
|
||||||
|
BrandText.h1(title),
|
||||||
|
SizedBox(height: 10),
|
||||||
|
...children
|
||||||
|
],
|
||||||
),
|
),
|
||||||
SizedBox(height: 10),
|
)
|
||||||
BrandText.h1(title),
|
],
|
||||||
SizedBox(height: 10),
|
),
|
||||||
...children,
|
);
|
||||||
SizedBox(height: 30),
|
},
|
||||||
],
|
|
||||||
),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,7 +13,7 @@ class SettingsPage extends StatelessWidget {
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return ListView(
|
return ListView(
|
||||||
padding: paddingH15V0,
|
padding: brandPagePadding2,
|
||||||
children: [
|
children: [
|
||||||
SizedBox(height: 10),
|
SizedBox(height: 10),
|
||||||
BrandHeader(title: 'basis.settings'.tr(), hasBackButton: true),
|
BrandHeader(title: 'basis.settings'.tr(), hasBackButton: true),
|
||||||
|
|
|
@ -51,7 +51,7 @@ class CpuChart extends StatelessWidget {
|
||||||
interval: 20,
|
interval: 20,
|
||||||
rotateAngle: 90.0,
|
rotateAngle: 90.0,
|
||||||
showTitles: true,
|
showTitles: true,
|
||||||
getTextStyles: (_, __) => const TextStyle(
|
getTextStyles: (value) => const TextStyle(
|
||||||
fontSize: 10,
|
fontSize: 10,
|
||||||
color: Colors.purple,
|
color: Colors.purple,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
|
@ -60,7 +60,7 @@ class CpuChart extends StatelessWidget {
|
||||||
return bottomTitle(value.toInt());
|
return bottomTitle(value.toInt());
|
||||||
}),
|
}),
|
||||||
leftTitles: SideTitles(
|
leftTitles: SideTitles(
|
||||||
getTextStyles: (_, __) => progressTextStyleLight.copyWith(
|
getTextStyles: (value) => progressTextStyleLight.copyWith(
|
||||||
color: Theme.of(context).brightness == Brightness.dark
|
color: Theme.of(context).brightness == Brightness.dark
|
||||||
? BrandColors.gray4
|
? BrandColors.gray4
|
||||||
: null,
|
: null,
|
||||||
|
@ -82,6 +82,7 @@ class CpuChart extends StatelessWidget {
|
||||||
double appliedInterval,
|
double appliedInterval,
|
||||||
double value,
|
double value,
|
||||||
) {
|
) {
|
||||||
|
print(value);
|
||||||
if (value < 0) {
|
if (value < 0) {
|
||||||
return false;
|
return false;
|
||||||
} else if (value == 0) {
|
} else if (value == 0) {
|
||||||
|
|
|
@ -71,7 +71,7 @@ class NetworkChart extends StatelessWidget {
|
||||||
interval: 20,
|
interval: 20,
|
||||||
rotateAngle: 90.0,
|
rotateAngle: 90.0,
|
||||||
showTitles: true,
|
showTitles: true,
|
||||||
getTextStyles: (_, __) => const TextStyle(
|
getTextStyles: (value) => const TextStyle(
|
||||||
fontSize: 10,
|
fontSize: 10,
|
||||||
color: Colors.purple,
|
color: Colors.purple,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
|
@ -87,7 +87,7 @@ class NetworkChart extends StatelessWidget {
|
||||||
].reduce(max) *
|
].reduce(max) *
|
||||||
1.2 /
|
1.2 /
|
||||||
10,
|
10,
|
||||||
getTextStyles: (_, __) => progressTextStyleLight.copyWith(
|
getTextStyles: (value) => progressTextStyleLight.copyWith(
|
||||||
color: Theme.of(context).brightness == Brightness.dark
|
color: Theme.of(context).brightness == Brightness.dark
|
||||||
? BrandColors.gray4
|
? BrandColors.gray4
|
||||||
: null,
|
: null,
|
||||||
|
|
|
@ -56,58 +56,41 @@ class _ServerDetailsState extends State<ServerDetails>
|
||||||
var isReady = context.watch<AppConfigCubit>().state.isFullyInitilized;
|
var isReady = context.watch<AppConfigCubit>().state.isFullyInitilized;
|
||||||
var providerState = isReady ? StateType.stable : StateType.uninitialized;
|
var providerState = isReady ? StateType.stable : StateType.uninitialized;
|
||||||
|
|
||||||
return Scaffold(
|
return TabBarView(
|
||||||
appBar: PreferredSize(
|
physics: NeverScrollableScrollPhysics(),
|
||||||
child: Column(
|
controller: tabController,
|
||||||
children: [
|
children: [
|
||||||
Container(
|
SingleChildScrollView(
|
||||||
height: 51,
|
child: Column(
|
||||||
alignment: Alignment.center,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
padding: EdgeInsets.symmetric(horizontal: 15),
|
children: [
|
||||||
child: BrandText.h4('basis.details'.tr()),
|
Padding(
|
||||||
),
|
padding: brandPagePadding2,
|
||||||
BrandDivider(),
|
child: Column(
|
||||||
],
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
),
|
children: [
|
||||||
preferredSize: Size.fromHeight(52),
|
_Header(
|
||||||
),
|
providerState: providerState,
|
||||||
body: TabBarView(
|
tabController: tabController),
|
||||||
physics: NeverScrollableScrollPhysics(),
|
BrandText.body1('providers.server.bottom_sheet.1'.tr()),
|
||||||
controller: tabController,
|
SizedBox(height: 10),
|
||||||
children: [
|
BlocProvider(
|
||||||
SingleChildScrollView(
|
create: (context) => HetznerMetricsCubit()..restart(),
|
||||||
physics: ClampingScrollPhysics(),
|
child: _Chart(),
|
||||||
child: Column(
|
),
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
SizedBox(height: 20),
|
||||||
children: [
|
BlocProvider(
|
||||||
Padding(
|
create: (context) => ServerDetailsCubit()..check(),
|
||||||
padding: paddingH15V0,
|
child: _TextDetails(),
|
||||||
child: Column(
|
),
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
],
|
||||||
children: [
|
|
||||||
_Header(
|
|
||||||
providerState: providerState,
|
|
||||||
tabController: tabController),
|
|
||||||
BrandText.body1('providers.server.bottom_sheet.1'.tr()),
|
|
||||||
SizedBox(height: 10),
|
|
||||||
BlocProvider(
|
|
||||||
create: (context) => HetznerMetricsCubit()..restart(),
|
|
||||||
child: _Chart(),
|
|
||||||
),
|
|
||||||
SizedBox(height: 20),
|
|
||||||
BlocProvider(
|
|
||||||
create: (context) => ServerDetailsCubit()..check(),
|
|
||||||
child: _TextDetails(),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
],
|
),
|
||||||
),
|
],
|
||||||
),
|
),
|
||||||
_ServerSettings(tabController: tabController),
|
),
|
||||||
],
|
_ServerSettings(tabController: tabController),
|
||||||
),
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,7 @@ class _ServerSettings extends StatelessWidget {
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return ListView(
|
return ListView(
|
||||||
padding: paddingH15V0,
|
padding: brandPagePadding2,
|
||||||
children: [
|
children: [
|
||||||
SizedBox(height: 10),
|
SizedBox(height: 10),
|
||||||
Container(
|
Container(
|
||||||
|
|
|
@ -27,13 +27,13 @@ class _TextDetails extends StatelessWidget {
|
||||||
children: [
|
children: [
|
||||||
TableRow(
|
TableRow(
|
||||||
children: [
|
children: [
|
||||||
getRowTitle('Last check:'),
|
getRowTitle('Last check'),
|
||||||
getRowValue(formater.format(checkTime)),
|
getRowValue(formater.format(checkTime)),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
TableRow(
|
TableRow(
|
||||||
children: [
|
children: [
|
||||||
getRowTitle('Server Id:'),
|
getRowTitle('Server Id'),
|
||||||
getRowValue(data.id.toString()),
|
getRowValue(data.id.toString()),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
@ -48,7 +48,7 @@ class _TextDetails extends StatelessWidget {
|
||||||
),
|
),
|
||||||
TableRow(
|
TableRow(
|
||||||
children: [
|
children: [
|
||||||
getRowTitle('CPU:'),
|
getRowTitle('CPU'),
|
||||||
getRowValue(
|
getRowValue(
|
||||||
data.serverType.cores.toString(),
|
data.serverType.cores.toString(),
|
||||||
),
|
),
|
||||||
|
@ -56,7 +56,7 @@ class _TextDetails extends StatelessWidget {
|
||||||
),
|
),
|
||||||
TableRow(
|
TableRow(
|
||||||
children: [
|
children: [
|
||||||
getRowTitle('Memory:'),
|
getRowTitle('Memory'),
|
||||||
getRowValue(
|
getRowValue(
|
||||||
'${data.serverType.memory.toString()} GB',
|
'${data.serverType.memory.toString()} GB',
|
||||||
),
|
),
|
||||||
|
@ -64,7 +64,7 @@ class _TextDetails extends StatelessWidget {
|
||||||
),
|
),
|
||||||
TableRow(
|
TableRow(
|
||||||
children: [
|
children: [
|
||||||
getRowTitle('Disk Local:'),
|
getRowTitle('Disk Local'),
|
||||||
getRowValue(
|
getRowValue(
|
||||||
'${data.serverType.disk.toString()} GB',
|
'${data.serverType.disk.toString()} GB',
|
||||||
),
|
),
|
||||||
|
@ -100,7 +100,7 @@ class _TextDetails extends StatelessWidget {
|
||||||
children: [
|
children: [
|
||||||
TableRow(
|
TableRow(
|
||||||
children: [
|
children: [
|
||||||
getRowTitle('Country:'),
|
getRowTitle('Country'),
|
||||||
getRowValue(
|
getRowValue(
|
||||||
'${data.location.country}',
|
'${data.location.country}',
|
||||||
),
|
),
|
||||||
|
@ -108,13 +108,13 @@ class _TextDetails extends StatelessWidget {
|
||||||
),
|
),
|
||||||
TableRow(
|
TableRow(
|
||||||
children: [
|
children: [
|
||||||
getRowTitle('City:'),
|
getRowTitle('City'),
|
||||||
getRowValue(data.location.city),
|
getRowValue(data.location.city),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
TableRow(
|
TableRow(
|
||||||
children: [
|
children: [
|
||||||
getRowTitle('Description:'),
|
getRowTitle('Description'),
|
||||||
getRowValue(data.location.description),
|
getRowValue(data.location.description),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|
|
@ -1,19 +1,13 @@
|
||||||
import 'dart:ui';
|
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:selfprivacy/config/brand_colors.dart';
|
import 'package:selfprivacy/config/brand_colors.dart';
|
||||||
import 'package:selfprivacy/config/brand_theme.dart';
|
import 'package:selfprivacy/config/brand_theme.dart';
|
||||||
import 'package:selfprivacy/config/text_themes.dart';
|
import 'package:selfprivacy/config/text_themes.dart';
|
||||||
import 'package:selfprivacy/logic/common_enum/common_enum.dart';
|
|
||||||
import 'package:selfprivacy/logic/cubit/app_config/app_config_cubit.dart';
|
import 'package:selfprivacy/logic/cubit/app_config/app_config_cubit.dart';
|
||||||
import 'package:selfprivacy/logic/cubit/jobs/jobs_cubit.dart';
|
|
||||||
import 'package:selfprivacy/logic/cubit/services/services_cubit.dart';
|
|
||||||
import 'package:selfprivacy/logic/models/job.dart';
|
|
||||||
import 'package:selfprivacy/logic/models/state_types.dart';
|
import 'package:selfprivacy/logic/models/state_types.dart';
|
||||||
import 'package:selfprivacy/ui/components/brand_button/brand_button.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_card/brand_card.dart';
|
||||||
import 'package:selfprivacy/ui/components/brand_header/brand_header.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_icons/brand_icons.dart';
|
||||||
import 'package:selfprivacy/ui/components/brand_text/brand_text.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/icon_status_mask/icon_status_mask.dart';
|
||||||
import 'package:selfprivacy/ui/components/not_ready_card/not_ready_card.dart';
|
import 'package:selfprivacy/ui/components/not_ready_card/not_ready_card.dart';
|
||||||
|
@ -23,14 +17,6 @@ import 'package:url_launcher/url_launcher.dart';
|
||||||
|
|
||||||
import '../rootRoute.dart';
|
import '../rootRoute.dart';
|
||||||
|
|
||||||
const switchableServices = [
|
|
||||||
ServiceTypes.passwordManager,
|
|
||||||
ServiceTypes.cloud,
|
|
||||||
ServiceTypes.socialNetwork,
|
|
||||||
ServiceTypes.git,
|
|
||||||
ServiceTypes.vpn,
|
|
||||||
];
|
|
||||||
|
|
||||||
class ServicesPage extends StatefulWidget {
|
class ServicesPage extends StatefulWidget {
|
||||||
ServicesPage({Key? key}) : super(key: key);
|
ServicesPage({Key? key}) : super(key: key);
|
||||||
|
|
||||||
|
@ -45,14 +31,11 @@ class _ServicesPageState extends State<ServicesPage> {
|
||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: PreferredSize(
|
appBar: PreferredSize(
|
||||||
child: BrandHeader(
|
child: BrandHeader(title: 'basis.services'.tr()),
|
||||||
title: 'basis.services'.tr(),
|
|
||||||
hasFlashButton: true,
|
|
||||||
),
|
|
||||||
preferredSize: Size.fromHeight(52),
|
preferredSize: Size.fromHeight(52),
|
||||||
),
|
),
|
||||||
body: ListView(
|
body: ListView(
|
||||||
padding: paddingH15V0,
|
padding: brandPagePadding2,
|
||||||
children: [
|
children: [
|
||||||
BrandText.body1('services.title'.tr()),
|
BrandText.body1('services.title'.tr()),
|
||||||
SizedBox(height: 24),
|
SizedBox(height: 24),
|
||||||
|
@ -77,115 +60,78 @@ class _Card extends StatelessWidget {
|
||||||
final ServiceTypes serviceType;
|
final ServiceTypes serviceType;
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
String title;
|
||||||
|
IconData iconData;
|
||||||
|
String subtitle;
|
||||||
|
|
||||||
|
switch (serviceType) {
|
||||||
|
case ServiceTypes.mail:
|
||||||
|
iconData = BrandIcons.envelope;
|
||||||
|
title = 'services.mail.title'.tr();
|
||||||
|
subtitle = 'services.mail.subtitle'.tr();
|
||||||
|
break;
|
||||||
|
case ServiceTypes.messenger:
|
||||||
|
iconData = BrandIcons.messanger;
|
||||||
|
title = 'services.messenger.title'.tr();
|
||||||
|
subtitle = 'services.messenger.subtitle'.tr();
|
||||||
|
break;
|
||||||
|
case ServiceTypes.passwordManager:
|
||||||
|
iconData = BrandIcons.key;
|
||||||
|
title = 'services.password_manager.title'.tr();
|
||||||
|
subtitle = 'services.password_manager.subtitle'.tr();
|
||||||
|
break;
|
||||||
|
case ServiceTypes.video:
|
||||||
|
iconData = BrandIcons.webcam;
|
||||||
|
title = 'services.video.title'.tr();
|
||||||
|
subtitle = 'services.video.subtitle'.tr();
|
||||||
|
break;
|
||||||
|
case ServiceTypes.cloud:
|
||||||
|
iconData = BrandIcons.upload;
|
||||||
|
title = 'services.cloud.title'.tr();
|
||||||
|
subtitle = 'services.cloud.subtitle'.tr();
|
||||||
|
break;
|
||||||
|
case ServiceTypes.socialNetwork:
|
||||||
|
iconData = BrandIcons.social;
|
||||||
|
title = 'services.social_network.title'.tr();
|
||||||
|
subtitle = 'services.social_network.subtitle'.tr();
|
||||||
|
break;
|
||||||
|
case ServiceTypes.git:
|
||||||
|
iconData = BrandIcons.git;
|
||||||
|
title = 'services.git.title'.tr();
|
||||||
|
subtitle = 'services.git.subtitle'.tr();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
var isReady = context.watch<AppConfigCubit>().state.isFullyInitilized;
|
var isReady = context.watch<AppConfigCubit>().state.isFullyInitilized;
|
||||||
var changeTab = context.read<ChangeTab>().onPress;
|
var changeTab = context.read<ChangeTab>().onPress;
|
||||||
|
|
||||||
var serviceState = context.watch<ServicesCubit>().state;
|
|
||||||
var jobsCubit = context.watch<JobsCubit>();
|
|
||||||
var jobState = jobsCubit.state;
|
|
||||||
|
|
||||||
var switchebleService = switchableServices.contains(serviceType);
|
|
||||||
var hasSwitchJob = switchebleService &&
|
|
||||||
jobState is JobsStateWithJobs &&
|
|
||||||
jobState.jobList
|
|
||||||
.any((el) => el is ServiceToggleJob && el.type == serviceType);
|
|
||||||
|
|
||||||
var isSwithOn = isReady &&
|
|
||||||
(!switchableServices.contains(serviceType) ||
|
|
||||||
serviceState.isEnableByType(serviceType));
|
|
||||||
|
|
||||||
return GestureDetector(
|
return GestureDetector(
|
||||||
onTap: isSwithOn
|
onTap: () => showDialog<void>(
|
||||||
? () => showDialog<void>(
|
context: context,
|
||||||
context: context,
|
// isScrollControlled: true,
|
||||||
// isScrollControlled: true,
|
// backgroundColor: Colors.transparent,
|
||||||
// backgroundColor: Colors.transparent,
|
builder: (BuildContext context) {
|
||||||
builder: (BuildContext context) {
|
return _ServiceDetails(
|
||||||
return _ServiceDetails(
|
serviceType: serviceType,
|
||||||
serviceType: serviceType,
|
status: isReady ? StateType.stable : StateType.uninitialized,
|
||||||
status:
|
title: title,
|
||||||
isSwithOn ? StateType.stable : StateType.uninitialized,
|
icon: iconData,
|
||||||
title: serviceType.title,
|
changeTab: changeTab,
|
||||||
icon: serviceType.icon,
|
);
|
||||||
changeTab: changeTab,
|
},
|
||||||
);
|
),
|
||||||
},
|
child: BrandCard(
|
||||||
)
|
|
||||||
: null,
|
|
||||||
child: BrandCards.big(
|
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Row(
|
IconStatusMask(
|
||||||
children: [
|
status: isReady ? StateType.stable : StateType.uninitialized,
|
||||||
IconStatusMask(
|
child: Icon(iconData, size: 30, color: Colors.white),
|
||||||
status:
|
|
||||||
isSwithOn ? StateType.stable : StateType.uninitialized,
|
|
||||||
child: Icon(serviceType.icon, size: 30, color: Colors.white),
|
|
||||||
),
|
|
||||||
if (isReady && switchebleService) ...[
|
|
||||||
Spacer(),
|
|
||||||
Builder(
|
|
||||||
builder: (context) {
|
|
||||||
late bool isActive;
|
|
||||||
if (hasSwitchJob) {
|
|
||||||
isActive = ((jobState as JobsStateWithJobs)
|
|
||||||
.jobList
|
|
||||||
.firstWhere((el) =>
|
|
||||||
el is ServiceToggleJob &&
|
|
||||||
el.type == serviceType) as ServiceToggleJob)
|
|
||||||
.needToTurnOn;
|
|
||||||
} else {
|
|
||||||
isActive = serviceState.isEnableByType(serviceType);
|
|
||||||
}
|
|
||||||
|
|
||||||
return BrandSwitch(
|
|
||||||
value: isActive,
|
|
||||||
onChanged: (value) =>
|
|
||||||
jobsCubit.createOrRemoveServiceToggleJob(
|
|
||||||
ServiceToggleJob(
|
|
||||||
type: serviceType,
|
|
||||||
needToTurnOn: value,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
]
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
ClipRect(
|
SizedBox(height: 10),
|
||||||
child: Stack(
|
BrandText.h2(title),
|
||||||
children: [
|
SizedBox(height: 10),
|
||||||
Column(
|
BrandText.body2(subtitle),
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
SizedBox(height: 10),
|
||||||
children: [
|
|
||||||
SizedBox(height: 10),
|
|
||||||
BrandText.h2(serviceType.title),
|
|
||||||
SizedBox(height: 10),
|
|
||||||
BrandText.body2(serviceType.subtitle),
|
|
||||||
SizedBox(height: 10),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
if (hasSwitchJob)
|
|
||||||
Positioned(
|
|
||||||
bottom: 30,
|
|
||||||
left: 0,
|
|
||||||
right: 0,
|
|
||||||
child: BackdropFilter(
|
|
||||||
filter: ImageFilter.blur(
|
|
||||||
sigmaX: 3,
|
|
||||||
sigmaY: 2,
|
|
||||||
),
|
|
||||||
child: BrandText.h2(
|
|
||||||
'jobs.runJobs'.tr(),
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
)
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -193,6 +139,16 @@ class _Card extends StatelessWidget {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum ServiceTypes {
|
||||||
|
mail,
|
||||||
|
messenger,
|
||||||
|
passwordManager,
|
||||||
|
video,
|
||||||
|
cloud,
|
||||||
|
socialNetwork,
|
||||||
|
git,
|
||||||
|
}
|
||||||
|
|
||||||
class _ServiceDetails extends StatelessWidget {
|
class _ServiceDetails extends StatelessWidget {
|
||||||
const _ServiceDetails({
|
const _ServiceDetails({
|
||||||
Key? key,
|
Key? key,
|
||||||
|
@ -391,12 +347,7 @@ class _ServiceDetails extends StatelessWidget {
|
||||||
],
|
],
|
||||||
));
|
));
|
||||||
break;
|
break;
|
||||||
case ServiceTypes.vpn:
|
|
||||||
child = Text(
|
|
||||||
'services.vpn.bottom_sheet.1'.tr(),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return Dialog(
|
return Dialog(
|
||||||
shape: RoundedRectangleBorder(
|
shape: RoundedRectangleBorder(
|
||||||
borderRadius: BorderRadius.circular(20),
|
borderRadius: BorderRadius.circular(20),
|
||||||
|
@ -408,7 +359,7 @@ class _ServiceDetails extends StatelessWidget {
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Padding(
|
Padding(
|
||||||
padding: paddingH15V30,
|
padding: brandPagePadding1,
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
|
@ -425,7 +376,7 @@ class _ServiceDetails extends StatelessWidget {
|
||||||
child: Container(
|
child: Container(
|
||||||
child: BrandButton.rised(
|
child: BrandButton.rised(
|
||||||
onPressed: () => Navigator.of(context).pop(),
|
onPressed: () => Navigator.of(context).pop(),
|
||||||
text: 'basis.close'.tr(),
|
title: 'basis.close'.tr(),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -456,3 +407,252 @@ class _ServiceDetails extends StatelessWidget {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// class _ServiceDetails extends StatelessWidget {
|
||||||
|
// const _ServiceDetails({
|
||||||
|
// Key? key,
|
||||||
|
// required this.serviceType,
|
||||||
|
// required this.icon,
|
||||||
|
// required this.status,
|
||||||
|
// required this.title,
|
||||||
|
// required this.changeTab,
|
||||||
|
// }) : super(key: key);
|
||||||
|
|
||||||
|
// final ServiceTypes serviceType;
|
||||||
|
// final IconData icon;
|
||||||
|
// final StateType status;
|
||||||
|
// final String title;
|
||||||
|
// final ValueChanged<int> changeTab;
|
||||||
|
|
||||||
|
// @override
|
||||||
|
// Widget build(BuildContext context) {
|
||||||
|
// late Widget child;
|
||||||
|
|
||||||
|
// var config = context.watch<AppConfigCubit>().state;
|
||||||
|
// var domainName = UiHelpers.getDomainName(config);
|
||||||
|
|
||||||
|
// var linksStyle = body1Style.copyWith(
|
||||||
|
// fontSize: 15,
|
||||||
|
// color: Theme.of(context).brightness == Brightness.dark
|
||||||
|
// ? Colors.white
|
||||||
|
// : BrandColors.black,
|
||||||
|
// fontWeight: FontWeight.bold,
|
||||||
|
// decoration: TextDecoration.underline,
|
||||||
|
// // height: 1.1,
|
||||||
|
// );
|
||||||
|
|
||||||
|
// var textStyle = body1Style.copyWith(
|
||||||
|
// color: Theme.of(context).brightness == Brightness.dark
|
||||||
|
// ? Colors.white
|
||||||
|
// : BrandColors.black,
|
||||||
|
// );
|
||||||
|
// switch (serviceType) {
|
||||||
|
// case ServiceTypes.mail:
|
||||||
|
// child = RichText(
|
||||||
|
// text: TextSpan(
|
||||||
|
// children: [
|
||||||
|
// TextSpan(
|
||||||
|
// text: 'services.mail.bottom_sheet.1'.tr(args: [domainName]),
|
||||||
|
// style: textStyle,
|
||||||
|
// ),
|
||||||
|
// WidgetSpan(
|
||||||
|
// child: Padding(
|
||||||
|
// padding: EdgeInsets.only(bottom: 0.8, left: 5),
|
||||||
|
// child: GestureDetector(
|
||||||
|
// child: Text(
|
||||||
|
// 'services.mail.bottom_sheet.2'.tr(),
|
||||||
|
// style: linksStyle,
|
||||||
|
// ),
|
||||||
|
// onTap: () {
|
||||||
|
// Navigator.of(context).pop();
|
||||||
|
// changeTab(2);
|
||||||
|
// },
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ],
|
||||||
|
// ));
|
||||||
|
// break;
|
||||||
|
// case ServiceTypes.messenger:
|
||||||
|
// child = RichText(
|
||||||
|
// text: TextSpan(
|
||||||
|
// children: [
|
||||||
|
// TextSpan(
|
||||||
|
// text: 'services.messenger.bottom_sheet.1'.tr(args: [domainName]),
|
||||||
|
// style: textStyle,
|
||||||
|
// )
|
||||||
|
// ],
|
||||||
|
// ));
|
||||||
|
// break;
|
||||||
|
// case ServiceTypes.passwordManager:
|
||||||
|
// child = RichText(
|
||||||
|
// text: TextSpan(
|
||||||
|
// children: [
|
||||||
|
// TextSpan(
|
||||||
|
// text: 'services.password_manager.bottom_sheet.1'
|
||||||
|
// .tr(args: [domainName]),
|
||||||
|
// style: textStyle,
|
||||||
|
// ),
|
||||||
|
// WidgetSpan(
|
||||||
|
// child: Padding(
|
||||||
|
// padding: EdgeInsets.only(bottom: 0.8, left: 5),
|
||||||
|
// child: GestureDetector(
|
||||||
|
// onTap: () => _launchURL('https://password.$domainName'),
|
||||||
|
// child: Text(
|
||||||
|
// 'password.$domainName',
|
||||||
|
// style: linksStyle,
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ],
|
||||||
|
// ));
|
||||||
|
// break;
|
||||||
|
// case ServiceTypes.video:
|
||||||
|
// child = RichText(
|
||||||
|
// text: TextSpan(
|
||||||
|
// children: [
|
||||||
|
// TextSpan(
|
||||||
|
// text: 'services.video.bottom_sheet.1'.tr(args: [domainName]),
|
||||||
|
// style: textStyle,
|
||||||
|
// ),
|
||||||
|
// WidgetSpan(
|
||||||
|
// child: Padding(
|
||||||
|
// padding: EdgeInsets.only(bottom: 0.8, left: 5),
|
||||||
|
// child: GestureDetector(
|
||||||
|
// onTap: () => _launchURL('https://meet.$domainName'),
|
||||||
|
// child: Text(
|
||||||
|
// 'meet.$domainName',
|
||||||
|
// style: linksStyle,
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ],
|
||||||
|
// ));
|
||||||
|
// break;
|
||||||
|
// case ServiceTypes.cloud:
|
||||||
|
// child = RichText(
|
||||||
|
// text: TextSpan(
|
||||||
|
// children: [
|
||||||
|
// TextSpan(
|
||||||
|
// text: 'services.cloud.bottom_sheet.1'.tr(args: [domainName]),
|
||||||
|
// style: textStyle,
|
||||||
|
// ),
|
||||||
|
// WidgetSpan(
|
||||||
|
// child: Padding(
|
||||||
|
// padding: EdgeInsets.only(bottom: 0.8, left: 5),
|
||||||
|
// child: GestureDetector(
|
||||||
|
// onTap: () => _launchURL('https://cloud.$domainName'),
|
||||||
|
// child: Text(
|
||||||
|
// 'cloud.$domainName',
|
||||||
|
// style: linksStyle,
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ],
|
||||||
|
// ));
|
||||||
|
// break;
|
||||||
|
// case ServiceTypes.socialNetwork:
|
||||||
|
// child = RichText(
|
||||||
|
// text: TextSpan(
|
||||||
|
// children: [
|
||||||
|
// TextSpan(
|
||||||
|
// text: 'services.social_network.bottom_sheet.1'
|
||||||
|
// .tr(args: [domainName]),
|
||||||
|
// style: textStyle,
|
||||||
|
// ),
|
||||||
|
// WidgetSpan(
|
||||||
|
// child: Padding(
|
||||||
|
// padding: EdgeInsets.only(bottom: 0.8, left: 5),
|
||||||
|
// child: GestureDetector(
|
||||||
|
// onTap: () => _launchURL('https://social.$domainName'),
|
||||||
|
// child: Text(
|
||||||
|
// 'social.$domainName',
|
||||||
|
// style: linksStyle,
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ],
|
||||||
|
// ));
|
||||||
|
// break;
|
||||||
|
// case ServiceTypes.git:
|
||||||
|
// child = RichText(
|
||||||
|
// text: TextSpan(
|
||||||
|
// children: [
|
||||||
|
// TextSpan(
|
||||||
|
// text: 'services.git.bottom_sheet.1'.tr(args: [domainName]),
|
||||||
|
// style: textStyle,
|
||||||
|
// ),
|
||||||
|
// WidgetSpan(
|
||||||
|
// child: Padding(
|
||||||
|
// padding: EdgeInsets.only(bottom: 0.8, left: 5),
|
||||||
|
// child: GestureDetector(
|
||||||
|
// onTap: () => _launchURL('https://git.$domainName'),
|
||||||
|
// child: Text(
|
||||||
|
// 'git.$domainName',
|
||||||
|
// style: linksStyle,
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ],
|
||||||
|
// ));
|
||||||
|
// break;
|
||||||
|
// }
|
||||||
|
// return BrandModalSheet(
|
||||||
|
// child: Navigator(
|
||||||
|
// key: navigatorKey,
|
||||||
|
// initialRoute: '/',
|
||||||
|
// onGenerateRoute: (_) {
|
||||||
|
// return materialRoute(
|
||||||
|
// Column(
|
||||||
|
// crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
// children: [
|
||||||
|
// Padding(
|
||||||
|
// padding: brandPagePadding1,
|
||||||
|
// child: Column(
|
||||||
|
// crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
// children: [
|
||||||
|
// SizedBox(height: 13),
|
||||||
|
// IconStatusMask(
|
||||||
|
// status: status,
|
||||||
|
// child: Icon(icon, size: 40, color: Colors.white),
|
||||||
|
// ),
|
||||||
|
// SizedBox(height: 10),
|
||||||
|
// BrandText.h1(title),
|
||||||
|
// SizedBox(height: 10),
|
||||||
|
// child,
|
||||||
|
// ],
|
||||||
|
// ),
|
||||||
|
// )
|
||||||
|
// ],
|
||||||
|
// ),
|
||||||
|
// );
|
||||||
|
// },
|
||||||
|
// ),
|
||||||
|
// );
|
||||||
|
// }
|
||||||
|
|
||||||
|
// void _launchURL(url) async {
|
||||||
|
// var _possible = await canLaunch(url);
|
||||||
|
|
||||||
|
// if (_possible) {
|
||||||
|
// try {
|
||||||
|
// await launch(
|
||||||
|
// url,
|
||||||
|
// forceSafariVC: true,
|
||||||
|
// enableJavaScript: true,
|
||||||
|
// );
|
||||||
|
// } catch (e) {
|
||||||
|
// print(e);
|
||||||
|
// }
|
||||||
|
// } else {
|
||||||
|
// throw 'Could not launch $url';
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
|
@ -7,26 +7,10 @@ class _NewUser extends StatelessWidget {
|
||||||
|
|
||||||
var domainName = UiHelpers.getDomainName(config);
|
var domainName = UiHelpers.getDomainName(config);
|
||||||
|
|
||||||
return BrandBottomSheet(
|
return BrandModalSheet(
|
||||||
child: BlocProvider(
|
child: BlocProvider(
|
||||||
create: (context) {
|
create: (context) =>
|
||||||
var jobCubit = context.read<JobsCubit>();
|
UserFormCubit(usersCubit: context.read<UsersCubit>()),
|
||||||
var jobState = jobCubit.state;
|
|
||||||
var users = <User>[];
|
|
||||||
users.addAll(context.read<UsersCubit>().state.users);
|
|
||||||
if (jobState is JobsStateWithJobs) {
|
|
||||||
var jobs = jobState.jobList;
|
|
||||||
jobs.forEach((job) {
|
|
||||||
if (job is CreateUserJob) {
|
|
||||||
users.add(job.user);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return UserFormCubit(
|
|
||||||
jobsCubit: jobCubit,
|
|
||||||
users: users,
|
|
||||||
);
|
|
||||||
},
|
|
||||||
child: Builder(builder: (context) {
|
child: Builder(builder: (context) {
|
||||||
var formCubitState = context.watch<UserFormCubit>().state;
|
var formCubitState = context.watch<UserFormCubit>().state;
|
||||||
|
|
||||||
|
@ -38,24 +22,20 @@ class _NewUser extends StatelessWidget {
|
||||||
},
|
},
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
mainAxisSize: MainAxisSize.min,
|
|
||||||
children: [
|
children: [
|
||||||
BrandHeader(
|
BrandHeader(
|
||||||
title: 'users.new_user'.tr(),
|
title: 'users.new_user'.tr(),
|
||||||
),
|
),
|
||||||
SizedBox(width: 14),
|
SizedBox(width: 14),
|
||||||
Padding(
|
Padding(
|
||||||
padding: paddingH15V0,
|
padding: brandPagePadding2,
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisSize: MainAxisSize.min,
|
|
||||||
children: [
|
children: [
|
||||||
IntrinsicHeight(
|
CubitFormTextField(
|
||||||
child: CubitFormTextField(
|
formFieldCubit: context.read<UserFormCubit>().login,
|
||||||
formFieldCubit: context.read<UserFormCubit>().login,
|
decoration: InputDecoration(
|
||||||
decoration: InputDecoration(
|
labelText: 'users.login'.tr(),
|
||||||
labelText: 'users.login'.tr(),
|
suffixText: '@$domainName',
|
||||||
suffixText: '@$domainName',
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SizedBox(height: 20),
|
SizedBox(height: 20),
|
||||||
|
@ -82,7 +62,7 @@ class _NewUser extends StatelessWidget {
|
||||||
onPressed: formCubitState.isSubmitting
|
onPressed: formCubitState.isSubmitting
|
||||||
? null
|
? null
|
||||||
: () => context.read<UserFormCubit>().trySubmit(),
|
: () => context.read<UserFormCubit>().trySubmit(),
|
||||||
text: 'basis.create'.tr(),
|
title: 'basis.create'.tr(),
|
||||||
),
|
),
|
||||||
SizedBox(height: 40),
|
SizedBox(height: 40),
|
||||||
Text('users.new_user_info_note'.tr()),
|
Text('users.new_user_info_note'.tr()),
|
||||||
|
|
|
@ -1,22 +1,24 @@
|
||||||
part of 'users.dart';
|
part of 'users.dart';
|
||||||
|
|
||||||
class _User extends StatelessWidget {
|
class _User extends StatelessWidget {
|
||||||
const _User({Key? key, required this.user}) : super(key: key);
|
const _User({Key? key, this.user}) : super(key: key);
|
||||||
|
|
||||||
final User user;
|
final User? user;
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return InkWell(
|
return InkWell(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
showBrandBottomSheet<void>(
|
showModalBottomSheet<void>(
|
||||||
context: context,
|
context: context,
|
||||||
|
isScrollControlled: true,
|
||||||
|
backgroundColor: Colors.transparent,
|
||||||
builder: (BuildContext context) {
|
builder: (BuildContext context) {
|
||||||
return _UserDetails(user: user);
|
return _UserDetails(user: user);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
padding: paddingH15V0,
|
padding: brandPagePadding2,
|
||||||
height: 48,
|
height: 48,
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
|
@ -24,12 +26,12 @@ class _User extends StatelessWidget {
|
||||||
width: 17,
|
width: 17,
|
||||||
height: 17,
|
height: 17,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: user.color,
|
color: user!.color,
|
||||||
shape: BoxShape.circle,
|
shape: BoxShape.circle,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SizedBox(width: 20),
|
SizedBox(width: 20),
|
||||||
BrandText.h4(user.login),
|
BrandText.h4(user!.login),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
@ -3,10 +3,10 @@ part of 'users.dart';
|
||||||
class _UserDetails extends StatelessWidget {
|
class _UserDetails extends StatelessWidget {
|
||||||
const _UserDetails({
|
const _UserDetails({
|
||||||
Key? key,
|
Key? key,
|
||||||
required this.user,
|
this.user,
|
||||||
}) : super(key: key);
|
}) : super(key: key);
|
||||||
|
|
||||||
final User user;
|
final User? user;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
@ -14,16 +14,14 @@ class _UserDetails extends StatelessWidget {
|
||||||
|
|
||||||
var domainName = UiHelpers.getDomainName(config);
|
var domainName = UiHelpers.getDomainName(config);
|
||||||
|
|
||||||
return BrandBottomSheet(
|
return BrandModalSheet(
|
||||||
isExpended: true,
|
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
mainAxisSize: MainAxisSize.min,
|
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
height: 200,
|
height: 200,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: user.color,
|
color: user!.color,
|
||||||
borderRadius: BorderRadius.vertical(
|
borderRadius: BorderRadius.vertical(
|
||||||
top: Radius.circular(20),
|
top: Radius.circular(20),
|
||||||
),
|
),
|
||||||
|
@ -116,7 +114,7 @@ class _UserDetails extends StatelessWidget {
|
||||||
horizontal: 15,
|
horizontal: 15,
|
||||||
),
|
),
|
||||||
child: BrandText.h1(
|
child: BrandText.h1(
|
||||||
user.login,
|
user!.login,
|
||||||
softWrap: true,
|
softWrap: true,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
)),
|
)),
|
||||||
|
@ -125,7 +123,7 @@ class _UserDetails extends StatelessWidget {
|
||||||
),
|
),
|
||||||
SizedBox(height: 20),
|
SizedBox(height: 20),
|
||||||
Padding(
|
Padding(
|
||||||
padding: paddingH15V0.copyWith(bottom: 20),
|
padding: brandPagePadding2.copyWith(bottom: 20),
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
|
@ -133,14 +131,14 @@ class _UserDetails extends StatelessWidget {
|
||||||
Container(
|
Container(
|
||||||
height: 40,
|
height: 40,
|
||||||
alignment: Alignment.centerLeft,
|
alignment: Alignment.centerLeft,
|
||||||
child: BrandText.h4('${user.login}@$domainName'),
|
child: BrandText.h4('${user!.login}@$domainName'),
|
||||||
),
|
),
|
||||||
SizedBox(height: 14),
|
SizedBox(height: 14),
|
||||||
BrandText.small('basis.password'.tr()),
|
BrandText.small('basis.password'.tr()),
|
||||||
Container(
|
Container(
|
||||||
height: 40,
|
height: 40,
|
||||||
alignment: Alignment.centerLeft,
|
alignment: Alignment.centerLeft,
|
||||||
child: BrandText.h4(user.password),
|
child: BrandText.h4(user!.password),
|
||||||
),
|
),
|
||||||
SizedBox(height: 24),
|
SizedBox(height: 24),
|
||||||
BrandDivider(),
|
BrandDivider(),
|
||||||
|
@ -148,10 +146,7 @@ class _UserDetails extends StatelessWidget {
|
||||||
BrandButton.emptyWithIconText(
|
BrandButton.emptyWithIconText(
|
||||||
title: 'users.send_regisration_data'.tr(),
|
title: 'users.send_regisration_data'.tr(),
|
||||||
icon: Icon(BrandIcons.share),
|
icon: Icon(BrandIcons.share),
|
||||||
onPressed: () {
|
onPressed: () {},
|
||||||
Share.share(
|
|
||||||
'login: ${user.login}, password: ${user.password}');
|
|
||||||
},
|
|
||||||
),
|
),
|
||||||
SizedBox(height: 20),
|
SizedBox(height: 20),
|
||||||
],
|
],
|
||||||
|
|
|
@ -4,21 +4,17 @@ import 'package:selfprivacy/config/brand_colors.dart';
|
||||||
import 'package:selfprivacy/config/brand_theme.dart';
|
import 'package:selfprivacy/config/brand_theme.dart';
|
||||||
import 'package:selfprivacy/logic/cubit/app_config/app_config_cubit.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/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/cubit/users/users_cubit.dart';
|
||||||
import 'package:selfprivacy/logic/models/job.dart';
|
|
||||||
import 'package:selfprivacy/logic/models/user.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_button/brand_button.dart';
|
||||||
import 'package:selfprivacy/ui/components/brand_divider/brand_divider.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_header/brand_header.dart';
|
||||||
import 'package:selfprivacy/ui/components/brand_icons/brand_icons.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/brand_text/brand_text.dart';
|
||||||
import 'package:selfprivacy/ui/components/not_ready_card/not_ready_card.dart';
|
import 'package:selfprivacy/ui/components/not_ready_card/not_ready_card.dart';
|
||||||
import 'package:easy_localization/easy_localization.dart';
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:selfprivacy/ui/helpers/modals.dart';
|
|
||||||
import 'package:selfprivacy/utils/ui_helpers.dart';
|
import 'package:selfprivacy/utils/ui_helpers.dart';
|
||||||
import 'package:share_plus/share_plus.dart';
|
|
||||||
|
|
||||||
part 'fab.dart';
|
part 'fab.dart';
|
||||||
part 'new_user.dart';
|
part 'new_user.dart';
|
||||||
|
@ -35,6 +31,7 @@ class UsersPage extends StatelessWidget {
|
||||||
var isReady = context.watch<AppConfigCubit>().state.isFullyInitilized;
|
var isReady = context.watch<AppConfigCubit>().state.isFullyInitilized;
|
||||||
final users = usersCubitState.users;
|
final users = usersCubitState.users;
|
||||||
final isEmpty = usersCubitState.isEmpty;
|
final isEmpty = usersCubitState.isEmpty;
|
||||||
|
|
||||||
Widget child;
|
Widget child;
|
||||||
|
|
||||||
if (!isReady) {
|
if (!isReady) {
|
||||||
|
@ -49,17 +46,14 @@ class UsersPage extends StatelessWidget {
|
||||||
)
|
)
|
||||||
: ListView(
|
: ListView(
|
||||||
children: [
|
children: [
|
||||||
...users.map((user) => _User(user: user)).toList(),
|
...users.map((user) => _User(user: user)),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: PreferredSize(
|
appBar: PreferredSize(
|
||||||
child: BrandHeader(
|
child: BrandHeader(title: 'basis.users'.tr()),
|
||||||
title: 'basis.users'.tr(),
|
|
||||||
hasFlashButton: true,
|
|
||||||
),
|
|
||||||
preferredSize: Size.fromHeight(52),
|
preferredSize: Size.fromHeight(52),
|
||||||
),
|
),
|
||||||
floatingActionButton: isReady ? _Fab() : null,
|
floatingActionButton: isReady ? _Fab() : null,
|
||||||
|
|
|
@ -2,8 +2,10 @@ library elevation_extension;
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
|
import 'package:selfprivacy/config/brand_shadow.dart';
|
||||||
|
|
||||||
extension ElevationExtension on BoxDecoration {
|
extension ElevationExtension on BoxDecoration {
|
||||||
|
BoxDecoration get ev8 => copyWith(boxShadow: [shadow8]);
|
||||||
|
|
||||||
BoxDecoration copyWith({
|
BoxDecoration copyWith({
|
||||||
Color? color,
|
Color? color,
|
||||||
|
|
|
@ -1,51 +0,0 @@
|
||||||
import 'dart:ui';
|
|
||||||
import 'package:flutter/cupertino.dart';
|
|
||||||
|
|
||||||
extension TextExtension on Text {
|
|
||||||
Text withColor(Color color) => Text(
|
|
||||||
data!,
|
|
||||||
key: this.key,
|
|
||||||
strutStyle: this.strutStyle,
|
|
||||||
textAlign: this.textAlign,
|
|
||||||
textDirection: this.textDirection,
|
|
||||||
locale: this.locale,
|
|
||||||
softWrap: this.softWrap,
|
|
||||||
overflow: this.overflow,
|
|
||||||
textScaleFactor: this.textScaleFactor,
|
|
||||||
maxLines: this.maxLines,
|
|
||||||
semanticsLabel: this.semanticsLabel,
|
|
||||||
textWidthBasis: textWidthBasis ?? this.textWidthBasis,
|
|
||||||
style: this.style != null
|
|
||||||
? this.style!.copyWith(color: color)
|
|
||||||
: TextStyle(color: color),
|
|
||||||
);
|
|
||||||
|
|
||||||
Text copyWith({
|
|
||||||
Key? key,
|
|
||||||
StrutStyle? strutStyle,
|
|
||||||
TextAlign? textAlign,
|
|
||||||
TextDirection? textDirection,
|
|
||||||
Locale? locale,
|
|
||||||
bool? softWrap,
|
|
||||||
TextOverflow? overflow,
|
|
||||||
double? textScaleFactor,
|
|
||||||
int? maxLines,
|
|
||||||
String? semanticsLabel,
|
|
||||||
TextWidthBasis? textWidthBasis,
|
|
||||||
TextStyle? style,
|
|
||||||
}) {
|
|
||||||
return Text(data!,
|
|
||||||
key: key ?? this.key,
|
|
||||||
strutStyle: strutStyle ?? this.strutStyle,
|
|
||||||
textAlign: textAlign ?? this.textAlign,
|
|
||||||
textDirection: textDirection ?? this.textDirection,
|
|
||||||
locale: locale ?? this.locale,
|
|
||||||
softWrap: softWrap ?? this.softWrap,
|
|
||||||
overflow: overflow ?? this.overflow,
|
|
||||||
textScaleFactor: textScaleFactor ?? this.textScaleFactor,
|
|
||||||
maxLines: maxLines ?? this.maxLines,
|
|
||||||
semanticsLabel: semanticsLabel ?? this.semanticsLabel,
|
|
||||||
textWidthBasis: textWidthBasis ?? this.textWidthBasis,
|
|
||||||
style: style != null ? this.style?.merge(style) ?? style : this.style);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,99 +1,138 @@
|
||||||
import 'dart:math';
|
import 'dart:math';
|
||||||
|
|
||||||
Random _rnd = Random();
|
var generator = PasswordGenerator();
|
||||||
|
|
||||||
typedef StringGeneratorFunction = String Function();
|
String genPass() {
|
||||||
|
generator.generate(8);
|
||||||
class StringGenerators {
|
return generator.getGeneratedValue();
|
||||||
static const letters = 'abcdefghijklmnopqrstuvwxyz';
|
}
|
||||||
static const numbers = '1234567890';
|
|
||||||
static const symbols = '_';
|
///Generates a password.
|
||||||
|
///
|
||||||
static String getRandomString(
|
///The password [_generatedValue] is of a specified length, including letters [_letterGen] of mixed cases,
|
||||||
int length, {
|
///numbers [_numGen], and symbols[_symGen] depending on user choice.
|
||||||
hasLowercaseLetters = false,
|
class PasswordGenerator {
|
||||||
hasUppercaseLetters = false,
|
late bool _letterGen;
|
||||||
hasNumbers = false,
|
late bool _numGen;
|
||||||
hasSymbols = false,
|
late bool _symGen;
|
||||||
isStrict = false,
|
late String _generatedValue;
|
||||||
}) {
|
|
||||||
var chars = '';
|
///Constructor.
|
||||||
if (hasLowercaseLetters) chars += letters;
|
///
|
||||||
if (hasUppercaseLetters) chars += letters.toUpperCase();
|
///[_letterGen] is true to make password generation possible from the opening of the application, and
|
||||||
if (hasNumbers) chars += numbers;
|
///[_generatedValue] is intialized to the value below so the text containing it can be first generated
|
||||||
if (hasSymbols) chars += symbols;
|
///upon users request
|
||||||
|
PasswordGenerator() {
|
||||||
assert(chars.isNotEmpty, 'chart empty');
|
_letterGen = true;
|
||||||
|
_numGen = true;
|
||||||
if (!isStrict) {
|
_symGen = false;
|
||||||
return genString(length, chars);
|
_generatedValue = "Press Generate";
|
||||||
}
|
}
|
||||||
|
|
||||||
var res = '';
|
///Call to generate a value, of [n] length
|
||||||
var loose = length;
|
void generate(int n) {
|
||||||
if (hasLowercaseLetters) {
|
//Discards the old value
|
||||||
loose -= 1;
|
_generatedValue = "";
|
||||||
res += genString(1, letters);
|
|
||||||
}
|
///Cannot generate a value without any character types selected
|
||||||
if (hasUppercaseLetters) {
|
if (!_letterGen && !_numGen && !_symGen) {
|
||||||
loose -= 1;
|
_generatedValue = "No character type selected";
|
||||||
res += genString(1, letters.toUpperCase());
|
return;
|
||||||
}
|
}
|
||||||
if (hasNumbers) {
|
|
||||||
loose -= 1;
|
///'Randomly' selectes caracter type to generate and append [toAppend] to [_generatedValue]
|
||||||
res += genString(1, numbers.toUpperCase());
|
// ignore: unnecessary_statements
|
||||||
}
|
for (n; n > 0; n--) {
|
||||||
if (hasSymbols) {
|
String? toAppend;
|
||||||
loose -= 1;
|
var random = new Random();
|
||||||
res += genString(1, symbols);
|
|
||||||
}
|
///loops until a valid character is generated, meaning the user has to check the character value
|
||||||
res += genString(loose, chars);
|
///to be generated. 'Randomly' picks a character type.
|
||||||
|
while (toAppend == null) {
|
||||||
var shuffledlist = res.split('')..shuffle();
|
int selector = random.nextInt(3);
|
||||||
return shuffledlist.join();
|
|
||||||
}
|
if (selector == 0) {
|
||||||
|
toAppend = _generateLetter();
|
||||||
static String genString(int length, String chars) {
|
} else if (selector == 1) {
|
||||||
return String.fromCharCodes(
|
toAppend = _generateNumber();
|
||||||
Iterable.generate(
|
} else {
|
||||||
length,
|
toAppend = _generateSymbol();
|
||||||
(_) => chars.codeUnitAt(
|
}
|
||||||
_rnd.nextInt(chars.length),
|
}
|
||||||
),
|
|
||||||
),
|
_generatedValue += toAppend;
|
||||||
);
|
toAppend = null;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
static StringGeneratorFunction userPassword = () => getRandomString(
|
|
||||||
8,
|
///Generates a letter when called.
|
||||||
hasLowercaseLetters: true,
|
String _generateLetter() {
|
||||||
hasUppercaseLetters: true,
|
if (!_letterGen) return '';
|
||||||
hasNumbers: true,
|
|
||||||
isStrict: true,
|
///Finds the integer value for the range between a-z and A-Z, with [base] UTF-16 value for lowercase letters and
|
||||||
);
|
///[baseUpper] UTF-16 value for uppercase letters
|
||||||
|
int base = "a".codeUnitAt(0);
|
||||||
static StringGeneratorFunction passwordSalt = () => getRandomString(
|
int baseUpper = "A".codeUnitAt(0);
|
||||||
8,
|
int maxRand = ("z".codeUnitAt(0) - base) + 1;
|
||||||
hasLowercaseLetters: true,
|
Random random = new Random();
|
||||||
);
|
|
||||||
|
///Randomly selects between upper and lower case generation, randomly generates value from [maxRand], then adding base,
|
||||||
static StringGeneratorFunction simpleId = () => getRandomString(
|
///which creates a UTF-16 encoded character to be converted into a string of one character between a-z/A-Z.
|
||||||
5,
|
///This string is then returned.
|
||||||
hasLowercaseLetters: true,
|
if (random.nextInt(2) == 0) {
|
||||||
);
|
return String.fromCharCodes([random.nextInt(maxRand) + base]);
|
||||||
|
} else {
|
||||||
static StringGeneratorFunction dbPassword = () => getRandomString(
|
return String.fromCharCodes([random.nextInt(maxRand) + baseUpper]);
|
||||||
40,
|
}
|
||||||
hasLowercaseLetters: true,
|
}
|
||||||
hasUppercaseLetters: true,
|
|
||||||
hasNumbers: true,
|
///Generates a number when called
|
||||||
hasSymbols: true,
|
String? _generateNumber() {
|
||||||
);
|
if (!_numGen) return null;
|
||||||
|
|
||||||
static StringGeneratorFunction dbStorageName = () => getRandomString(
|
///Finds the integer value for the range between 0-9
|
||||||
6,
|
int base = "0".codeUnitAt(0);
|
||||||
hasLowercaseLetters: true,
|
int maxRand = ("9".codeUnitAt(0) - base) + 1;
|
||||||
hasUppercaseLetters: true,
|
Random random = new Random();
|
||||||
hasNumbers: true,
|
|
||||||
);
|
///Randomly generates value from [maxRand], then adding base, which creates a UTF-16 encoded character to be converted into a
|
||||||
|
///string of one character between 0-9. This string is then returned.
|
||||||
|
return String.fromCharCodes([random.nextInt(maxRand) + base]);
|
||||||
|
}
|
||||||
|
|
||||||
|
///Generates a symbol when called
|
||||||
|
String? _generateSymbol() {
|
||||||
|
if (!_symGen) return null;
|
||||||
|
|
||||||
|
///Finds the integer value for the range between symbols !-.
|
||||||
|
|
||||||
|
///(note) which includes symbols !"#$%&'()*+,=.
|
||||||
|
int base = "!".codeUnitAt(0);
|
||||||
|
int maxRand = (".".codeUnitAt(0) - base) + 1;
|
||||||
|
Random random = new Random();
|
||||||
|
|
||||||
|
///Randomly generates value from [maxRand], then adding base, which creates a UTF-16 encoded character to be
|
||||||
|
///converted into a string of one character between !-. . This string is then returned.
|
||||||
|
return String.fromCharCodes([random.nextInt(maxRand) + base]);
|
||||||
|
}
|
||||||
|
|
||||||
|
///Toggles letter generation
|
||||||
|
void checkLetterGen(bool value) {
|
||||||
|
_letterGen = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
///Toggles number generation
|
||||||
|
void checkNumGen(bool value) {
|
||||||
|
_numGen = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
///Toggles symbol generation
|
||||||
|
void checkSymGen(bool value) {
|
||||||
|
_symGen = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
///Returns the generated value to be used by generator app
|
||||||
|
String getGeneratedValue() {
|
||||||
|
return _generatedValue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,14 @@
|
||||||
|
import 'dart:math';
|
||||||
|
|
||||||
|
const _chars =
|
||||||
|
'AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz1234567890_';
|
||||||
|
Random _rnd = Random();
|
||||||
|
|
||||||
|
String getRandomString(int length, [chars = _chars]) => String.fromCharCodes(
|
||||||
|
Iterable.generate(
|
||||||
|
length,
|
||||||
|
(_) => chars.codeUnitAt(
|
||||||
|
_rnd.nextInt(chars.length),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
319
pubspec.lock
|
@ -7,14 +7,14 @@ packages:
|
||||||
name: _fe_analyzer_shared
|
name: _fe_analyzer_shared
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "22.0.0"
|
version: "19.0.0"
|
||||||
analyzer:
|
analyzer:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: analyzer
|
name: analyzer
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.7.2"
|
version: "1.3.0"
|
||||||
archive:
|
archive:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -28,35 +28,28 @@ packages:
|
||||||
name: args
|
name: args
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.2.0"
|
version: "2.0.0"
|
||||||
asn1lib:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: asn1lib
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "1.0.2"
|
|
||||||
async:
|
async:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: async
|
name: async
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.8.1"
|
version: "2.5.0"
|
||||||
basic_utils:
|
basic_utils:
|
||||||
dependency: "direct main"
|
dependency: "direct dev"
|
||||||
description:
|
description:
|
||||||
name: basic_utils
|
name: basic_utils
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.5.0"
|
version: "3.0.0-nullsafety.3"
|
||||||
bloc:
|
bloc:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: bloc
|
name: bloc
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "7.1.0"
|
version: "7.0.0"
|
||||||
boolean_selector:
|
boolean_selector:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -70,56 +63,56 @@ packages:
|
||||||
name: build
|
name: build
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.1.0"
|
version: "2.0.0"
|
||||||
build_config:
|
build_config:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: build_config
|
name: build_config
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.0.0"
|
version: "0.4.7"
|
||||||
build_daemon:
|
build_daemon:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: build_daemon
|
name: build_daemon
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.0.0"
|
version: "2.1.10"
|
||||||
build_resolvers:
|
build_resolvers:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: build_resolvers
|
name: build_resolvers
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.4"
|
version: "2.0.0"
|
||||||
build_runner:
|
build_runner:
|
||||||
dependency: "direct dev"
|
dependency: "direct dev"
|
||||||
description:
|
description:
|
||||||
name: build_runner
|
name: build_runner
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.1.1"
|
version: "1.12.2"
|
||||||
build_runner_core:
|
build_runner_core:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: build_runner_core
|
name: build_runner_core
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "7.1.0"
|
version: "6.1.12"
|
||||||
built_collection:
|
built_collection:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: built_collection
|
name: built_collection
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "5.1.0"
|
version: "5.0.0"
|
||||||
built_value:
|
built_value:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: built_value
|
name: built_value
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "8.1.2"
|
version: "8.0.4"
|
||||||
characters:
|
characters:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -133,7 +126,7 @@ packages:
|
||||||
name: charcode
|
name: charcode
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.3.1"
|
version: "1.2.0"
|
||||||
checked_yaml:
|
checked_yaml:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -147,7 +140,7 @@ packages:
|
||||||
name: cli_util
|
name: cli_util
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.3.3"
|
version: "0.3.0"
|
||||||
clock:
|
clock:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -161,7 +154,7 @@ packages:
|
||||||
name: code_builder
|
name: code_builder
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "4.1.0"
|
version: "3.7.0"
|
||||||
collection:
|
collection:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -175,14 +168,14 @@ packages:
|
||||||
name: convert
|
name: convert
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.0.1"
|
version: "3.0.0"
|
||||||
coverage:
|
coverage:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: coverage
|
name: coverage
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.0.3"
|
version: "1.0.2"
|
||||||
crypt:
|
crypt:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
|
@ -191,33 +184,33 @@ packages:
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "4.0.1"
|
version: "4.0.1"
|
||||||
crypto:
|
crypto:
|
||||||
dependency: transitive
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: crypto
|
name: crypto
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.0.1"
|
version: "3.0.0"
|
||||||
cubit_form:
|
cubit_form:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: cubit_form
|
name: cubit_form
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.0.18"
|
version: "1.0.2-nullsafety.0"
|
||||||
cupertino_icons:
|
cupertino_icons:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: cupertino_icons
|
name: cupertino_icons
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.0.3"
|
version: "1.0.2"
|
||||||
dart_style:
|
dart_style:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: dart_style
|
name: dart_style
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.3"
|
version: "2.0.0"
|
||||||
dio:
|
dio:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
|
@ -259,14 +252,7 @@ packages:
|
||||||
name: equatable
|
name: equatable
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.3"
|
version: "2.0.0"
|
||||||
extended_masked_text:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: extended_masked_text
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "2.3.1"
|
|
||||||
fake_async:
|
fake_async:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -280,14 +266,14 @@ packages:
|
||||||
name: ffi
|
name: ffi
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.1.2"
|
version: "1.0.0"
|
||||||
file:
|
file:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: file
|
name: file
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "6.1.2"
|
version: "6.1.0"
|
||||||
fixnum:
|
fixnum:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -301,7 +287,7 @@ packages:
|
||||||
name: fl_chart
|
name: fl_chart
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.40.0"
|
version: "0.35.0"
|
||||||
flutter:
|
flutter:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description: flutter
|
description: flutter
|
||||||
|
@ -313,14 +299,14 @@ packages:
|
||||||
name: flutter_bloc
|
name: flutter_bloc
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "7.2.0"
|
version: "7.0.0"
|
||||||
flutter_launcher_icons:
|
flutter_launcher_icons:
|
||||||
dependency: "direct dev"
|
dependency: "direct dev"
|
||||||
description:
|
description:
|
||||||
name: flutter_launcher_icons
|
name: flutter_launcher_icons
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.9.2"
|
version: "0.9.0"
|
||||||
flutter_localizations:
|
flutter_localizations:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description: flutter
|
description: flutter
|
||||||
|
@ -332,21 +318,14 @@ packages:
|
||||||
name: flutter_markdown
|
name: flutter_markdown
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.6.5"
|
version: "0.6.1"
|
||||||
flutter_plugin_android_lifecycle:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: flutter_plugin_android_lifecycle
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "2.0.3"
|
|
||||||
flutter_secure_storage:
|
flutter_secure_storage:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: flutter_secure_storage
|
name: flutter_secure_storage
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "4.2.1"
|
version: "4.1.0"
|
||||||
flutter_test:
|
flutter_test:
|
||||||
dependency: "direct dev"
|
dependency: "direct dev"
|
||||||
description: flutter
|
description: flutter
|
||||||
|
@ -357,20 +336,13 @@ packages:
|
||||||
description: flutter
|
description: flutter
|
||||||
source: sdk
|
source: sdk
|
||||||
version: "0.0.0"
|
version: "0.0.0"
|
||||||
frontend_server_client:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: frontend_server_client
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "2.1.2"
|
|
||||||
get_it:
|
get_it:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: get_it
|
name: get_it
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "7.2.0"
|
version: "6.0.0"
|
||||||
glob:
|
glob:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -384,42 +356,42 @@ packages:
|
||||||
name: graphs
|
name: graphs
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.0"
|
version: "1.0.0"
|
||||||
hive:
|
hive:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: hive
|
name: hive
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.4"
|
version: "2.0.1"
|
||||||
hive_flutter:
|
hive_flutter:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: hive_flutter
|
name: hive_flutter
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.1.0"
|
version: "1.0.0"
|
||||||
hive_generator:
|
hive_generator:
|
||||||
dependency: "direct dev"
|
dependency: "direct dev"
|
||||||
description:
|
description:
|
||||||
name: hive_generator
|
name: hive_generator
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.1.0"
|
version: "1.0.1"
|
||||||
http:
|
http:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: http
|
name: http
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.13.3"
|
version: "0.13.1"
|
||||||
http_multi_server:
|
http_multi_server:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: http_multi_server
|
name: http_multi_server
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.0.1"
|
version: "3.0.0"
|
||||||
http_parser:
|
http_parser:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -447,14 +419,7 @@ packages:
|
||||||
name: io
|
name: io
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.0.3"
|
version: "1.0.0"
|
||||||
ionicons:
|
|
||||||
dependency: "direct main"
|
|
||||||
description:
|
|
||||||
name: ionicons
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "0.1.2"
|
|
||||||
js:
|
js:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -475,14 +440,7 @@ packages:
|
||||||
name: json_serializable
|
name: json_serializable
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "4.1.4"
|
version: "4.1.0"
|
||||||
local_auth:
|
|
||||||
dependency: "direct main"
|
|
||||||
description:
|
|
||||||
name: local_auth
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "1.1.7"
|
|
||||||
logging:
|
logging:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -497,6 +455,13 @@ packages:
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "4.0.0"
|
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:
|
matcher:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -510,7 +475,7 @@ packages:
|
||||||
name: meta
|
name: meta
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.7.0"
|
version: "1.3.0"
|
||||||
mime:
|
mime:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -518,20 +483,6 @@ packages:
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.0.0"
|
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:
|
nested:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -545,7 +496,7 @@ packages:
|
||||||
name: node_preamble
|
name: node_preamble
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.1"
|
version: "1.4.13"
|
||||||
package_config:
|
package_config:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -559,7 +510,7 @@ packages:
|
||||||
name: package_info
|
name: package_info
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.2"
|
version: "2.0.0"
|
||||||
path:
|
path:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -573,21 +524,21 @@ packages:
|
||||||
name: path_provider
|
name: path_provider
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.2"
|
version: "2.0.1"
|
||||||
path_provider_linux:
|
path_provider_linux:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: path_provider_linux
|
name: path_provider_linux
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.2"
|
version: "2.0.0"
|
||||||
path_provider_macos:
|
path_provider_macos:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: path_provider_macos
|
name: path_provider_macos
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.2"
|
version: "2.0.0"
|
||||||
path_provider_platform_interface:
|
path_provider_platform_interface:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -601,42 +552,42 @@ packages:
|
||||||
name: path_provider_windows
|
name: path_provider_windows
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.3"
|
version: "2.0.0"
|
||||||
pedantic:
|
pedantic:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: pedantic
|
name: pedantic
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.11.1"
|
version: "1.11.0"
|
||||||
petitparser:
|
petitparser:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: petitparser
|
name: petitparser
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "4.1.0"
|
version: "4.0.2"
|
||||||
platform:
|
platform:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: platform
|
name: platform
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.0.2"
|
version: "3.0.0"
|
||||||
plugin_platform_interface:
|
plugin_platform_interface:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: plugin_platform_interface
|
name: plugin_platform_interface
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.1"
|
version: "2.0.0"
|
||||||
pointycastle:
|
pointycastle:
|
||||||
dependency: "direct main"
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: pointycastle
|
name: pointycastle
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.3.2"
|
version: "3.0.1"
|
||||||
pool:
|
pool:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -657,14 +608,14 @@ packages:
|
||||||
name: process
|
name: process
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "4.2.3"
|
version: "4.2.1"
|
||||||
provider:
|
provider:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: provider
|
name: provider
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "6.0.0"
|
version: "5.0.0"
|
||||||
pub_semver:
|
pub_semver:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -679,83 +630,27 @@ packages:
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.0.0"
|
version: "1.0.0"
|
||||||
quiver:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: quiver
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "3.0.1"
|
|
||||||
rsa_encrypt:
|
|
||||||
dependency: "direct main"
|
|
||||||
description:
|
|
||||||
name: rsa_encrypt
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "2.0.0"
|
|
||||||
share_plus:
|
|
||||||
dependency: "direct main"
|
|
||||||
description:
|
|
||||||
name: share_plus
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "2.1.4"
|
|
||||||
share_plus_linux:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: share_plus_linux
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "2.0.4"
|
|
||||||
share_plus_macos:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: share_plus_macos
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "2.0.2"
|
|
||||||
share_plus_platform_interface:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: share_plus_platform_interface
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "2.0.1"
|
|
||||||
share_plus_web:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: share_plus_web
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "2.0.4"
|
|
||||||
share_plus_windows:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: share_plus_windows
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "2.0.3"
|
|
||||||
shared_preferences:
|
shared_preferences:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: shared_preferences
|
name: shared_preferences
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.7"
|
version: "2.0.5"
|
||||||
shared_preferences_linux:
|
shared_preferences_linux:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: shared_preferences_linux
|
name: shared_preferences_linux
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.2"
|
version: "2.0.0"
|
||||||
shared_preferences_macos:
|
shared_preferences_macos:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: shared_preferences_macos
|
name: shared_preferences_macos
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.2"
|
version: "2.0.0"
|
||||||
shared_preferences_platform_interface:
|
shared_preferences_platform_interface:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -769,21 +664,21 @@ packages:
|
||||||
name: shared_preferences_web
|
name: shared_preferences_web
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.2"
|
version: "2.0.0"
|
||||||
shared_preferences_windows:
|
shared_preferences_windows:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: shared_preferences_windows
|
name: shared_preferences_windows
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.2"
|
version: "2.0.0"
|
||||||
shelf:
|
shelf:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: shelf
|
name: shelf
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.2.0"
|
version: "1.1.0"
|
||||||
shelf_packages_handler:
|
shelf_packages_handler:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -797,7 +692,7 @@ packages:
|
||||||
name: shelf_static
|
name: shelf_static
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.1.0"
|
version: "1.0.0"
|
||||||
shelf_web_socket:
|
shelf_web_socket:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -816,14 +711,7 @@ packages:
|
||||||
name: source_gen
|
name: source_gen
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.0.3"
|
version: "1.0.0"
|
||||||
source_helper:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: source_helper
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "1.2.1"
|
|
||||||
source_map_stack_trace:
|
source_map_stack_trace:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -844,14 +732,7 @@ packages:
|
||||||
name: source_span
|
name: source_span
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.8.1"
|
version: "1.8.0"
|
||||||
ssh_key:
|
|
||||||
dependency: "direct main"
|
|
||||||
description:
|
|
||||||
name: ssh_key
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "0.7.0"
|
|
||||||
stack_trace:
|
stack_trace:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -893,21 +774,21 @@ packages:
|
||||||
name: test
|
name: test
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.17.10"
|
version: "1.16.5"
|
||||||
test_api:
|
test_api:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: test_api
|
name: test_api
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.4.2"
|
version: "0.2.19"
|
||||||
test_core:
|
test_core:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: test_core
|
name: test_core
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.4.0"
|
version: "0.3.15"
|
||||||
timing:
|
timing:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -915,13 +796,6 @@ packages:
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.0.0"
|
version: "1.0.0"
|
||||||
tuple:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: tuple
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "2.0.0"
|
|
||||||
typed_data:
|
typed_data:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -929,48 +803,55 @@ packages:
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.3.0"
|
version: "1.3.0"
|
||||||
|
unicons:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: unicons
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "1.0.2"
|
||||||
url_launcher:
|
url_launcher:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: url_launcher
|
name: url_launcher
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "6.0.9"
|
version: "6.0.3"
|
||||||
url_launcher_linux:
|
url_launcher_linux:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: url_launcher_linux
|
name: url_launcher_linux
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.1"
|
version: "2.0.0"
|
||||||
url_launcher_macos:
|
url_launcher_macos:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: url_launcher_macos
|
name: url_launcher_macos
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.1"
|
version: "2.0.0"
|
||||||
url_launcher_platform_interface:
|
url_launcher_platform_interface:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: url_launcher_platform_interface
|
name: url_launcher_platform_interface
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.4"
|
version: "2.0.2"
|
||||||
url_launcher_web:
|
url_launcher_web:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: url_launcher_web
|
name: url_launcher_web
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.4"
|
version: "2.0.0"
|
||||||
url_launcher_windows:
|
url_launcher_windows:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: url_launcher_windows
|
name: url_launcher_windows
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.2"
|
version: "2.0.0"
|
||||||
vector_math:
|
vector_math:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -984,42 +865,42 @@ packages:
|
||||||
name: vm_service
|
name: vm_service
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "6.2.0"
|
version: "6.1.0+1"
|
||||||
wakelock:
|
wakelock:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: wakelock
|
name: wakelock
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.5.3+3"
|
version: "0.5.0+2"
|
||||||
wakelock_macos:
|
wakelock_macos:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: wakelock_macos
|
name: wakelock_macos
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.1.0+2"
|
version: "0.1.0"
|
||||||
wakelock_platform_interface:
|
wakelock_platform_interface:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: wakelock_platform_interface
|
name: wakelock_platform_interface
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.2.1+2"
|
version: "0.2.0"
|
||||||
wakelock_web:
|
wakelock_web:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: wakelock_web
|
name: wakelock_web
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.2.0+2"
|
version: "0.2.0"
|
||||||
wakelock_windows:
|
wakelock_windows:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: wakelock_windows
|
name: wakelock_windows
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.1.0+1"
|
version: "0.1.0"
|
||||||
watcher:
|
watcher:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -1033,7 +914,7 @@ packages:
|
||||||
name: web_socket_channel
|
name: web_socket_channel
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.1.0"
|
version: "2.0.0"
|
||||||
webkit_inspection_protocol:
|
webkit_inspection_protocol:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -1047,7 +928,7 @@ packages:
|
||||||
name: win32
|
name: win32
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.2.7"
|
version: "2.0.5"
|
||||||
xdg_directories:
|
xdg_directories:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -1061,7 +942,7 @@ packages:
|
||||||
name: xml
|
name: xml
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "5.1.2"
|
version: "5.0.2"
|
||||||
yaml:
|
yaml:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -1070,5 +951,5 @@ packages:
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.1.0"
|
version: "3.1.0"
|
||||||
sdks:
|
sdks:
|
||||||
dart: ">=2.13.4 <3.0.0"
|
dart: ">=2.12.0 <3.0.0"
|
||||||
flutter: ">=2.2.3"
|
flutter: ">=2.0.0"
|
||||||
|
|