From 015c726372bb72f5a8000d4cc14165f2a8545d48 Mon Sep 17 00:00:00 2001 From: Raman Tank Date: Wed, 10 May 2023 03:17:17 +0530 Subject: [PATCH] Update role.dart Well, I try to optimize the code. --- lib/role.dart | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/lib/role.dart b/lib/role.dart index 445579e5..3a3056bc 100644 --- a/lib/role.dart +++ b/lib/role.dart @@ -3,27 +3,23 @@ part of appwrite; class Role { Role._(); - static String any() { - return 'any'; - } - - static String user(String id, [String status = '']) { + static String any() => 'any'; + String status=''; + static String user(String id, status]) { if(status.isEmpty) { return 'user:$id'; } return 'user:$id/$status'; } - static String users([String status = '']) { + static String users(status]) { if(status.isEmpty) { return 'users'; } return 'users/$status'; } - static String guests() { - return 'guests'; - } + static String guests() => 'guests'; static String team(String id, [String role = '']) { if(role.isEmpty) { @@ -35,4 +31,4 @@ class Role { static String member(String id) { return 'member:$id'; } -} \ No newline at end of file +}