1
1
// @dart=2.9
2
2
import 'package:ReachUp/Component/Dialog/CustomDialog.component.dart' ;
3
+ import 'package:ReachUp/Controller/Account.controller.dart' ;
3
4
import 'package:ReachUp/Controller/Category.controller.dart' ;
4
5
import 'package:ReachUp/Model/Category.model.dart' ;
5
6
import 'package:ReachUp/Model/User.model.dart' ;
6
7
import 'package:ReachUp/View/SignView/SignUpPreferences.view.dart' ;
7
8
import 'package:flutter/material.dart' ;
9
+ import 'package:flutter_easyloading/flutter_easyloading.dart' ;
8
10
import 'package:flutter_signin_button/flutter_signin_button.dart' ;
9
11
import 'package:font_awesome_flutter/font_awesome_flutter.dart' ;
10
12
@@ -16,12 +18,12 @@ List<GlobalKey<FormState>> formKeys = [
16
18
GlobalKey <FormState >(), //Userpassword formState
17
19
];
18
20
19
- class SignUp extends StatefulWidget {
21
+ class SignUpView extends StatefulWidget {
20
22
@override
21
- _SignUpState createState () => _SignUpState ();
23
+ _SignUpViewState createState () => _SignUpViewState ();
22
24
}
23
25
24
- class _SignUpState extends State <SignUp > {
26
+ class _SignUpViewState extends State <SignUpView > {
25
27
final _formKey = GlobalKey <FormState >();
26
28
int currentStep;
27
29
@@ -97,6 +99,7 @@ class StepperBody extends StatefulWidget {
97
99
98
100
class _StepperBodyState extends State <StepperBody > {
99
101
final CategoryController _categoryController = new CategoryController ();
102
+ final AccountController accountController = new AccountController ();
100
103
101
104
static final _focusNode = FocusNode ();
102
105
static UserData user = UserData ();
@@ -114,6 +117,12 @@ class _StepperBodyState extends State<StepperBody> {
114
117
});
115
118
}
116
119
120
+ @override
121
+ void deactivate () {
122
+ EasyLoading .dismiss ();
123
+ super .deactivate ();
124
+ }
125
+
117
126
List <Step > steps = [
118
127
Step (
119
128
title: Text ('Nome' , style: TextStyle (color: Color (0xFF525252 ))),
@@ -302,7 +311,15 @@ class _StepperBodyState extends State<StepperBody> {
302
311
email: user.email,
303
312
password: user.password,
304
313
role: "cli" );
305
- //send _user to [POST] api/Account/SignUp
314
+ EasyLoading .show (status: "Carregando" );
315
+ accountController.signUp ().then ((value) {
316
+ EasyLoading .dismiss ();
317
+ Globals .user = value;
318
+ Database .insert (
319
+ key: "user" ,
320
+ value: jsonEncode (
321
+ Globals .user.toJson ()));
322
+ });
306
323
307
324
List <Category > categories = new List <Category >();
308
325
0 commit comments