Imporoved state control for Profile Screen

This commit is contained in:
Anastasiia Reshetnik
2024-01-29 13:07:12 +03:00
parent 243c628fc4
commit 57471264fe
9 changed files with 204 additions and 136 deletions

View File

@@ -76,10 +76,10 @@ class AdditionalInformationScreen extends StatelessWidget {
headers: {'Content-Type': 'application/json'},
body: json.encode(sheet),
);
var res = await jsonDecode(response.body);
final box = await Hive.openBox('token');
final token = json.decode(response.body)['token'];
final token = res['token']['plainTextToken'];
box.put('token', token);
print('token: ${box.get('token')}');
Navigator.pushNamed(
context,
AppRoutes.myProfile,

View File

@@ -64,11 +64,11 @@ class _FavoriteFoodsScreenState extends State<FavoriteFoodsScreen> {
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.center,
style: theme.textTheme.headlineSmall)),
SizedBox(height: 23.v),
SizedBox(height: 13.v),
_buildTextFormFieldFav(context),
SizedBox(height: 22.v),
SizedBox(height: 12.v),
_buildTextFormFieldUnfav(context),
SizedBox(height: 27.v),
SizedBox(height: 17.v),
BlocBuilder<FavoriteFoodsBloc, FavoriteFoodsState>(
builder: (context, state) {
return NextStepButton(

View File

@@ -83,17 +83,6 @@ class LanguageSelectScreen extends StatelessWidget {
});
}),
Spacer(flex: 63),
NextStepButton(
text: "тест профиля".toUpperCase(),
margin: EdgeInsets.only(
left: 16.h, right: 16.h, bottom: 50.v),
buttonStyle: CustomButtonStyles.outlinePrimaryTL15,
onPressed: () {
Navigator.pushNamed(
context,
AppRoutes.myProfile,
);
}),
])),
bottomNavigationBar:
BlocBuilder<LanguageSelectBloc, LanguageSelectState>(