Fix docstyle comments

This commit is contained in:
NaiJi 2022-05-04 22:32:24 +03:00
parent 4c7cf05578
commit 8d6cbfdfc9
3 changed files with 16 additions and 16 deletions

View File

@ -7,14 +7,14 @@ import 'package:selfprivacy/logic/cubit/users/users_cubit.dart';
class FieldCubitFactory { class FieldCubitFactory {
FieldCubitFactory(this.context); FieldCubitFactory(this.context);
/* A common user login field. /// A common user login field.
* - Available characters are lowercase a-z, digits and underscore _ ///
* - Must start with either a-z or underscore /// - Available characters are lowercase a-z, digits and underscore _
* - Must be no longer than 'userMaxLength' characters /// - Must start with either a-z or underscore
* - Must not be empty /// - Must be no longer than 'userMaxLength' characters
* - Must not be a reserved root login /// - Must not be empty
* - Must be unique /// - Must not be a reserved root login
*/ /// - Must be unique
FieldCubit<String> createUserLoginField() { FieldCubit<String> createUserLoginField() {
final userAllowedRegExp = RegExp(r"^[a-z_][a-z0-9_]+$"); final userAllowedRegExp = RegExp(r"^[a-z_][a-z0-9_]+$");
const userMaxLength = 31; const userMaxLength = 31;
@ -35,10 +35,10 @@ class FieldCubitFactory {
); );
} }
/* A common user password field. /// A common user password field.
* - Must fail on the regural expression of invalid matches: [\n\r\s]+ ///
* - Must not be empty /// - Must fail on the regural expression of invalid matches: [\n\r\s]+
*/ /// - Must not be empty
FieldCubit<String> createUserPasswordField() { FieldCubit<String> createUserPasswordField() {
var passwordForbiddenRegExp = RegExp(r"[\n\r\s]+"); var passwordForbiddenRegExp = RegExp(r"[\n\r\s]+");
return FieldCubit( return FieldCubit(

View File

@ -13,15 +13,15 @@ abstract class LengthStringValidation extends ValidationModel<String> {
} }
} }
// String must be equal to [length]
class LengthStringNotEqualValidation extends LengthStringValidation { class LengthStringNotEqualValidation extends LengthStringValidation {
/// String must be equal to [length]
LengthStringNotEqualValidation(int length) LengthStringNotEqualValidation(int length)
: super((n) => n.length != length, : super((n) => n.length != length,
'validations.length_not_equal'.tr(args: [length.toString()])); 'validations.length_not_equal'.tr(args: [length.toString()]));
} }
// String must be shorter than or equal to [length]
class LengthStringLongerValidation extends LengthStringValidation { class LengthStringLongerValidation extends LengthStringValidation {
/// String must be shorter than or equal to [length]
LengthStringLongerValidation(int length) LengthStringLongerValidation(int length)
: super((n) => n.length > length, : super((n) => n.length > length,
'validations.length_longer'.tr(args: [length.toString()])); 'validations.length_longer'.tr(args: [length.toString()]));

View File

@ -22,8 +22,8 @@ void main() async {
await SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]); await SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]);
try { try {
/* Wakelock support for Linux /// Wakelock support for Linux
* desktop is not yet implemented */ /// desktop is not yet implemented
await Wakelock.enable(); await Wakelock.enable();
} on PlatformException catch (e) { } on PlatformException catch (e) {
print(e); print(e);