refactor(diary): Refactoring flutter analyze finished. Started refactoring Run Code Metrics

This commit is contained in:
2024-03-05 12:46:01 +03:00
parent e72367c656
commit 0f37f378a3
9 changed files with 225 additions and 200 deletions

View File

@@ -64,23 +64,22 @@ class LanguageSelectScreen extends StatelessWidget {
languageSelectModelObj,
) {
return CustomDropDown(
icon: Container(
margin:
EdgeInsets.fromLTRB(30.h, 11.v, 17.h, 11.v),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(1.h)),
child: CustomImageView(
imagePath: ImageConstant.imgFavorite,
height: 12.adaptSize,
width: 12.adaptSize)),
hintText: "Не выбрано".tr,
items:
languageSelectModelObj?.dropdownItemList ?? [],
onChanged: (value) {
context
.read<LanguageSelectBloc>()
.add(ChangeDropDownEvent(value: value));
});
icon: Container(
margin: EdgeInsets.fromLTRB(30.h, 11.v, 17.h, 11.v),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(1.h),
),
child: CustomImageView(
imagePath: ImageConstant.imgFavorite,
height: 12.adaptSize,
width: 12.adaptSize,
),
),
hintText: "Не выбрано".tr,
items: languageSelectModelObj?.dropdownItemList ?? [],
onChanged: (value) =>
_onDropDownChanged(context, value),
);
}),
Spacer(flex: 63),
])),
@@ -92,15 +91,24 @@ class LanguageSelectScreen extends StatelessWidget {
margin:
EdgeInsets.only(left: 16.h, right: 16.h, bottom: 50.v),
buttonStyle: CustomButtonStyles.outlinePrimaryTL15,
onPressed: () {
UserRegistrationSheet sheet =
state.languageSelectModelObj!.userRegistrationSheet;
Navigator.pushNamed(
context,
AppRoutes.credentialsScreen,
arguments: sheet,
);
});
onPressed: _saveAndPush(state, context));
})));
}
void Function()? _saveAndPush(
LanguageSelectState state, BuildContext context) {
return () {
UserRegistrationSheet sheet =
state.languageSelectModelObj!.userRegistrationSheet;
Navigator.pushNamed(
context,
AppRoutes.credentialsScreen,
arguments: sheet,
);
};
}
void _onDropDownChanged(BuildContext context, value) {
context.read<LanguageSelectBloc>().add(ChangeDropDownEvent(value: value));
}
}