@@ -22,57 +22,58 @@ void main() async {
2222 /// Auth or reAuth
2323 ///
2424 ////////////////////////////////////////////////////
25- // Authenticate user and comment this line
25+ // // Authenticate user and comment this line
2626 var rep = await flutterFeathersjs.authenticate (
27- strategy: "phone" ,
28- userNameFieldName: "tel" ,
29- userName: user["tel " ],
27+ // strategy: "phone",
28+ // userNameFieldName: "tel",
29+ userName: user["email " ],
3030 password: user["password" ]);
31- //Then use this one to reuse access token as it still valide
32- // var reAuthResp = await flutterFeathersjs.rest .reAuthenticate();
31+ // // Then use this one to reuse access token as it still valide
32+ var reAuthResp = await flutterFeathersjs.reAuthenticate ();
3333
34- ////////////////////////////////////////////////////
35- ///
36- /// Singleton testing
37- ///
38- ////////////////////////////////////////////////////
34+ // print("Hello");
35+ // ////////////////////////////////////////////////////
36+ // ///
37+ // /// Singleton testing
38+ // ///
39+ // ////////////////////////////////////////////////////
3940
40- // // Singleton pattern if the flutterFeathersjs class
41+ // // // Singleton pattern if the flutterFeathersjs class
4142 // test('Testing singleton ', () {
4243 // FlutterFeathersjs flutterFeathersjs1 = FlutterFeathersjs();
4344 // expect(identical(flutterFeathersjs1, flutterFeathersjs), true);
4445 // });
4546
46- // // ////////////////////////////////////////////////////
47- // // ///
48- // // /// reAuth
49- // // ////////////////////////////////////////////////////
47+ // // // // //////////////////////////////////////////////////
48+ // // // // /
49+ // // // // / reAuth
50+ // // // // //////////////////////////////////////////////////
5051
51- // //Testing the authentication method
52+ // // // Testing the authentication method
5253 // test(' reAuthentication method', () async {
53- // var reps = await flutterFeathersjs.reAuthenticate();
54- // if (!reps["error"]) {
55- // print('client is authed');
56- // print("----------Authed user :------");
57- // print(reps["message"]);
58- // print("----------Authed user :------");
59- // } else if (reps["error_zone"] == Constants.BOTH_CLIENT_AUTHED)
60- // print("Blabal");
61- // else {
62- // print(reps["error_zone"]);
63- // print(reps["message"]);
64- // print("frm secktio");
65- // print(reps["scketResponse"]);
66- // print("frm rest");
67- // print(reps["restResponse"]);
68- // }
54+ // var reps = await flutterFeathersjs.reAuthenticate();
55+ // if (!reps["error"]) {
56+ // print('client is authed');
57+ // print("----------Authed user :------");
58+ // print(reps["message"]);
59+ // print("----------Authed user :------");
60+ // } else if (reps["error_zone"] == Constants.BOTH_CLIENT_AUTHED)
61+ // print("Blabal");
62+ // else {
63+ // print(reps["error_zone"]);
64+ // print(reps["message"]);
65+ // print("frm secktio");
66+ // print(reps["scketResponse"]);
67+ // print("frm rest");
68+ // print(reps["restResponse"]);
69+ // }
6970 // });
7071
71- // ////////////////////////////////////////////////////
72- // ///
73- // /// Rest client methods
74- // ///
75- // ///////////////////////////////////////////////////
72+ // // // // //////////////////////////////////////////////////
73+ // // // // /
74+ // // // // / Rest client methods
75+ // // // // /
76+ // // // // /////////////////////////////////////////////////
7677
7778 // test('Testing singleton on Rest client', () {
7879 // RestClient so1 = RestClient()..init(baseUrl: BASE_URL);
@@ -83,11 +84,12 @@ void main() async {
8384 // expect(identical(so1, so2), true);
8485 // });
8586
86- // test(' \n rest Find all method \n', () async {
87- // var rep2 = await flutterFeathersjs.rest.find(serviceName: "v1/news");
88- // print("\n Founds news are: \n");
89- // print(rep2.data);
90- // });
87+ test (' \n rest Find all method \n ' , () async {
88+ var rep2 =
89+ await flutterFeathersjs.rest.find (serviceName: "v1/news" , query: {});
90+ print ("\n Founds news are: \n " );
91+ print (rep2.data['data' ]);
92+ });
9193
9294 // test(' \n rest find with with query params \n ', () async {
9395 // var rep2 = await flutterFeathersjs.rest.find(
@@ -128,7 +130,6 @@ void main() async {
128130 // serviceName: "v1/news",
129131 // data: data2Send,
130132 // containsFile: true,
131- // hasSingleFile: true,
132133 // fileFieldName: "file",
133134 // files: files);
134135 // print("\n The new news menu created is: \n");
@@ -168,6 +169,7 @@ void main() async {
168169
169170 // test('find method', () async {
170171 // var rep2 = await flutterFeathersjs.scketio.find(
172+ // query: {},
171173 // serviceName: "v1/news",
172174 // );
173175 // print("Printing news:");
0 commit comments