WT1.1.2g Sizes

This commit is contained in:
bossanyit 2020-11-17 17:51:54 +01:00
parent e28f1edf50
commit b71544ba13
7 changed files with 230 additions and 246 deletions

View File

@ -362,7 +362,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = 29; CURRENT_PROJECT_VERSION = 30;
DEVELOPMENT_TEAM = SFJJBDCU6Z; DEVELOPMENT_TEAM = SFJJBDCU6Z;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = ( FRAMEWORK_SEARCH_PATHS = (
@ -505,7 +505,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = 29; CURRENT_PROJECT_VERSION = 30;
DEVELOPMENT_TEAM = SFJJBDCU6Z; DEVELOPMENT_TEAM = SFJJBDCU6Z;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = ( FRAMEWORK_SEARCH_PATHS = (
@ -540,7 +540,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = 29; CURRENT_PROJECT_VERSION = 30;
DEVELOPMENT_TEAM = SFJJBDCU6Z; DEVELOPMENT_TEAM = SFJJBDCU6Z;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = ( FRAMEWORK_SEARCH_PATHS = (

View File

@ -38,8 +38,11 @@ class ExerciseNewBloc extends Bloc<ExerciseNewEvent, ExerciseNewState> {
final List<Property> womanSizes = List(); final List<Property> womanSizes = List();
final List<Property> manSizes = List(); final List<Property> manSizes = List();
final double baseWidth = 312;
final double baseHeight = 675.2;
double mediaWidth = 0; double mediaWidth = 0;
double mediaHeight = 0; double mediaHeight = 0;
bool isMan = true;
@override @override
ExerciseNewBloc({this.exerciseRepository, this.menuBloc, this.customerRepository, ExerciseType exerciseType}) ExerciseNewBloc({this.exerciseRepository, this.menuBloc, this.customerRepository, ExerciseType exerciseType})
@ -52,6 +55,8 @@ class ExerciseNewBloc extends Bloc<ExerciseNewEvent, ExerciseNewState> {
weight = customerRepository.customer.getProperty("Weight"); weight = customerRepository.customer.getProperty("Weight");
height = customerRepository.customer.getProperty("Height"); height = customerRepository.customer.getProperty("Height");
fitnessLevel = customerRepository.customer.fitnessLevel; fitnessLevel = customerRepository.customer.fitnessLevel;
this.isMan = (customerRepository.customer.sex == "m");
print("Sex Man? " + isMan.toString() + " " + customerRepository.customer.sex);
} }
} }
@ -63,66 +68,72 @@ class ExerciseNewBloc extends Bloc<ExerciseNewEvent, ExerciseNewState> {
void addSizes(String sex) { void addSizes(String sex) {
List<Property> properties = Cache().getProperties(); List<Property> properties = Cache().getProperties();
if (sex == "Man") { if (properties == null) {
return;
}
final double distortionWidth = mediaWidth / baseWidth;
final double distortionHeight = mediaHeight / baseHeight;
print("distiortionW " + distortionWidth.toString() + " dH " + distortionHeight.toString());
if (isMan) {
properties.forEach((element) { properties.forEach((element) {
if (element.propertyName == "Shoulder") { if (element.propertyName == "Shoulder") {
element.top = (mediaHeight * 0.131).toInt(); element.top = (122 * distortionHeight).toInt();
element.left = (mediaWidth * 0.23).toInt(); element.left = (130 * distortionWidth).toInt();
element.value = customerRepository.customer.getProperty("Shoulder"); element.value = customerRepository.customer.getProperty("Shoulder");
manSizes.add(element); manSizes.add(element);
} else if (element.propertyName == "Neck") { } else if (element.propertyName == "Neck") {
element.top = (mediaHeight * 0.069).toInt(); element.top = (68 * distortionHeight).toInt();
element.left = (mediaWidth * 0.23).toInt(); element.left = (130 * distortionWidth).toInt();
element.value = customerRepository.customer.getProperty("Neck"); element.value = customerRepository.customer.getProperty("Neck");
manSizes.add(element); manSizes.add(element);
} else if (element.propertyName == "Biceps") { } else if (element.propertyName == "Biceps") {
element.top = (mediaHeight * 0.199).toInt(); element.top = (178 * distortionHeight).toInt();
element.left = (mediaWidth * 0.44).toInt(); element.left = (208 * distortionWidth).toInt();
element.value = customerRepository.customer.getProperty("Biceps"); element.value = customerRepository.customer.getProperty("Biceps");
manSizes.add(element); manSizes.add(element);
} else if (element.propertyName == "Chest") { } else if (element.propertyName == "Chest") {
element.top = (mediaHeight * 0.171).toInt(); element.top = (154 * distortionHeight).toInt();
element.left = (mediaWidth * 0.23).toInt(); element.left = (130 * distortionWidth).toInt();
element.value = customerRepository.customer.getProperty("Chest"); element.value = customerRepository.customer.getProperty("Chest");
manSizes.add(element); manSizes.add(element);
} else if (element.propertyName == "Belly") { } else if (element.propertyName == "Belly") {
element.top = (mediaHeight * 0.275).toInt(); element.top = (244 * distortionHeight).toInt();
element.left = (mediaWidth * 0.23).toInt(); element.left = (130 * distortionWidth).toInt();
element.value = customerRepository.customer.getProperty("Belly"); element.value = customerRepository.customer.getProperty("Belly");
manSizes.add(element); manSizes.add(element);
} else if (element.propertyName == "Hip") { } else if (element.propertyName == "Hip") {
element.top = (mediaHeight * 0.355).toInt(); element.top = (308 * distortionHeight).toInt();
element.left = (mediaWidth * 0.23).toInt(); element.left = (130 * distortionWidth).toInt();
element.value = customerRepository.customer.getProperty("Hip"); element.value = customerRepository.customer.getProperty("Hip");
manSizes.add(element); manSizes.add(element);
} else if (element.propertyName == "Thigh Top") { } else if (element.propertyName == "Thigh Top") {
element.top = (mediaHeight * 0.38).toInt(); element.top = (332 * distortionHeight).toInt();
element.left = (mediaWidth * 0.32).toInt(); element.left = (165 * distortionWidth).toInt();
element.value = customerRepository.customer.getProperty("Thigh Top"); element.value = customerRepository.customer.getProperty("Thigh Top");
manSizes.add(element); manSizes.add(element);
} else if (element.propertyName == "Thigh Middle") { } else if (element.propertyName == "Thigh Middle") {
element.top = (mediaHeight * 0.438).toInt(); element.top = (382 * distortionHeight).toInt();
element.left = (mediaWidth * 0.14).toInt(); element.left = (100 * distortionWidth).toInt();
element.value = customerRepository.customer.getProperty("Thigh Middle"); element.value = customerRepository.customer.getProperty("Thigh Middle");
manSizes.add(element); manSizes.add(element);
} else if (element.propertyName == "Knee") { } else if (element.propertyName == "Knee") {
element.top = (mediaHeight * 0.535).toInt(); element.top = (464 * distortionHeight).toInt();
element.left = (mediaWidth * 0.14).toInt(); element.left = (97 * distortionWidth).toInt();
element.value = customerRepository.customer.getProperty("Knee"); element.value = customerRepository.customer.getProperty("Knee");
manSizes.add(element); manSizes.add(element);
} else if (element.propertyName == "Calf") { } else if (element.propertyName == "Calf") {
element.top = (mediaHeight * 0.60).toInt(); element.top = (520 * distortionHeight).toInt();
element.left = (mediaWidth * 0.14).toInt(); element.left = (97 * distortionWidth).toInt();
element.value = customerRepository.customer.getProperty("Calf"); element.value = customerRepository.customer.getProperty("Calf");
manSizes.add(element); manSizes.add(element);
} else if (element.propertyName == "Ankle") { } else if (element.propertyName == "Ankle") {
element.top = (mediaHeight * 0.72).toInt(); element.top = (620 * distortionHeight).toInt();
element.left = (mediaWidth * 0.28).toInt(); element.left = (150 * distortionWidth).toInt();
element.value = customerRepository.customer.getProperty("Ankle"); element.value = customerRepository.customer.getProperty("Ankle");
manSizes.add(element); manSizes.add(element);
} else if (element.propertyName == "Weight") { } else if (element.propertyName == "Weight") {
element.top = (mediaHeight * 0.44).toInt(); element.top = (402 * distortionHeight).toInt();
element.left = (mediaWidth * 0.54).toInt(); element.left = (240 * distortionWidth).toInt();
element.value = customerRepository.customer.getProperty("Weight"); element.value = customerRepository.customer.getProperty("Weight");
manSizes.add(element); manSizes.add(element);
} }
@ -130,63 +141,65 @@ class ExerciseNewBloc extends Bloc<ExerciseNewEvent, ExerciseNewState> {
} else { } else {
properties.forEach((element) { properties.forEach((element) {
if (element.propertyName == "Shoulder") { if (element.propertyName == "Shoulder") {
element.top = (mediaHeight * 0.131).toInt(); element.top = (122 * distortionHeight).toInt();
element.left = (mediaWidth * 0.195).toInt(); element.left = (151 * distortionWidth).toInt();
element.value = customerRepository.customer.getProperty("Shoulder"); element.value = customerRepository.customer.getProperty("Shoulder");
print("CHEST top: " + element.top.toString() + " left " + element.left.toString());
manSizes.add(element); manSizes.add(element);
} else if (element.propertyName == "Neck") { } else if (element.propertyName == "Neck") {
element.top = (mediaHeight * 0.081).toInt(); element.top = (78 * distortionHeight).toInt();
element.left = (mediaWidth * 0.195).toInt(); element.left = (151 * distortionWidth).toInt();
print("Neck top: " + element.top.toString() + " left " + element.left.toString());
element.value = customerRepository.customer.getProperty("Neck"); element.value = customerRepository.customer.getProperty("Neck");
manSizes.add(element); manSizes.add(element);
} else if (element.propertyName == "Biceps") { } else if (element.propertyName == "Biceps") {
element.top = (mediaHeight * 0.199).toInt(); element.top = (178 * distortionHeight).toInt();
element.left = (mediaWidth * 0.36).toInt(); element.left = (212 * distortionWidth).toInt();
element.value = customerRepository.customer.getProperty("Biceps"); element.value = customerRepository.customer.getProperty("Biceps");
manSizes.add(element); manSizes.add(element);
} else if (element.propertyName == "Chest") { } else if (element.propertyName == "Chest") {
element.top = (mediaHeight * 0.168).toInt(); element.top = (154 * distortionHeight).toInt();
element.left = (mediaWidth * 0.195).toInt(); element.left = (151 * distortionWidth).toInt();
element.value = customerRepository.customer.getProperty("Chest"); element.value = customerRepository.customer.getProperty("Chest");
manSizes.add(element); manSizes.add(element);
} else if (element.propertyName == "Belly") { } else if (element.propertyName == "Belly") {
element.top = (mediaHeight * 0.26).toInt(); element.top = (230 * distortionHeight).toInt();
element.left = (mediaWidth * 0.195).toInt(); element.left = (151 * distortionWidth).toInt();
element.value = customerRepository.customer.getProperty("Belly"); element.value = customerRepository.customer.getProperty("Belly");
manSizes.add(element); manSizes.add(element);
} else if (element.propertyName == "Hip") { } else if (element.propertyName == "Hip") {
element.top = (mediaHeight * 0.335).toInt(); element.top = (294 * distortionHeight).toInt();
element.left = (mediaWidth * 0.195).toInt(); element.left = (151 * distortionWidth).toInt();
element.value = customerRepository.customer.getProperty("Hip"); element.value = customerRepository.customer.getProperty("Hip");
manSizes.add(element); manSizes.add(element);
} else if (element.propertyName == "Thigh Top") { } else if (element.propertyName == "Thigh Top") {
element.top = (mediaHeight * 0.385).toInt(); element.top = (335 * distortionHeight).toInt();
element.left = (mediaWidth * 0.28).toInt(); element.left = (185 * distortionWidth).toInt();
element.value = customerRepository.customer.getProperty("Thigh Top"); element.value = customerRepository.customer.getProperty("Thigh Top");
manSizes.add(element); manSizes.add(element);
} else if (element.propertyName == "Thigh Middle") { } else if (element.propertyName == "Thigh Middle") {
element.top = (mediaHeight * 0.433).toInt(); element.top = (377 * distortionHeight).toInt();
element.left = (mediaWidth * 0.12).toInt(); element.left = (125 * distortionWidth).toInt();
element.value = customerRepository.customer.getProperty("Thigh Middle"); element.value = customerRepository.customer.getProperty("Thigh Middle");
manSizes.add(element); manSizes.add(element);
} else if (element.propertyName == "Knee") { } else if (element.propertyName == "Knee") {
element.top = (mediaHeight * 0.543).toInt(); element.top = (468 * distortionHeight).toInt();
element.left = (mediaWidth * 0.14).toInt(); element.left = (129 * distortionWidth).toInt();
element.value = customerRepository.customer.getProperty("Knee"); element.value = customerRepository.customer.getProperty("Knee");
manSizes.add(element); manSizes.add(element);
} else if (element.propertyName == "Calf") { } else if (element.propertyName == "Calf") {
element.top = (mediaHeight * 0.608).toInt(); element.top = (525 * distortionHeight).toInt();
element.left = (mediaWidth * 0.14).toInt(); element.left = (129 * distortionWidth).toInt();
element.value = customerRepository.customer.getProperty("Calf"); element.value = customerRepository.customer.getProperty("Calf");
manSizes.add(element); manSizes.add(element);
} else if (element.propertyName == "Ankle") { } else if (element.propertyName == "Ankle") {
element.top = (mediaHeight * 0.725).toInt(); element.top = (620 * distortionHeight).toInt();
element.left = (mediaWidth * 0.23).toInt(); element.left = (162 * distortionWidth).toInt();
element.value = customerRepository.customer.getProperty("Ankle"); element.value = customerRepository.customer.getProperty("Ankle");
manSizes.add(element); manSizes.add(element);
} else if (element.propertyName == "Weight") { } else if (element.propertyName == "Weight") {
element.top = (mediaHeight * 0.44).toInt(); element.top = (402 * distortionHeight).toInt();
element.left = (mediaWidth * 0.54).toInt(); element.left = (240 * distortionWidth).toInt();
element.value = customerRepository.customer.getProperty("Weight"); element.value = customerRepository.customer.getProperty("Weight");
manSizes.add(element); manSizes.add(element);
} }

View File

@ -98,9 +98,6 @@ class _ExerciseNewPageState extends State<ExerciseNewPage> with Trans {
}, },
builder: (context, state) { builder: (context, state) {
final exerciseBloc = BlocProvider.of<ExerciseNewBloc>(context); final exerciseBloc = BlocProvider.of<ExerciseNewBloc>(context);
double width = MediaQuery.of(context).size.width;
double height = MediaQuery.of(context).size.height;
exerciseBloc.setMediaDimensions(width, height);
return getExerciseWidget(exerciseBloc, exerciseType); return getExerciseWidget(exerciseBloc, exerciseType);
}, },
)); ));

View File

@ -35,14 +35,11 @@ class _LoginWidget extends State<LoginWidget> with Common, Trans {
final accountBloc = BlocProvider.of<AccountBloc>(context); final accountBloc = BlocProvider.of<AccountBloc>(context);
setContext(context); setContext(context);
return BlocProvider( return BlocProvider(
create: (context) => LoginFormBloc( create: (context) => LoginFormBloc(userRepository: UserRepository(), accountBloc: accountBloc),
userRepository: UserRepository(),
accountBloc: accountBloc
),
child: Builder(builder: (context) { child: Builder(builder: (context) {
final loginBloc = BlocProvider.of<LoginFormBloc>(context); final loginBloc = BlocProvider.of<LoginFormBloc>(context);
return Scaffold( return Scaffold(
key: _scaffoldKey, //key: _scaffoldKey,
appBar: AppBarMin(), appBar: AppBarMin(),
body: FormBlocListener<LoginFormBloc, String, String>( body: FormBlocListener<LoginFormBloc, String, String>(
onSubmitting: (context, state) { onSubmitting: (context, state) {
@ -56,11 +53,8 @@ class _LoginWidget extends State<LoginWidget> with Common, Trans {
LoadingDialog.hide(context); LoadingDialog.hide(context);
showInSnackBar(t(state.failureResponse)); showInSnackBar(t(state.failureResponse));
}, },
onLoaded: (context, state ) { onLoaded: (context, state) {},
child: loadForm(loginBloc, accountBloc)),
},
child: loadForm(loginBloc, accountBloc)
),
); );
})); }));
} }
@ -83,14 +77,11 @@ class _LoginWidget extends State<LoginWidget> with Common, Trans {
} }
Widget buildLoginForm(LoginFormBloc formBloc, AccountBloc accountBloc) { Widget buildLoginForm(LoginFormBloc formBloc, AccountBloc accountBloc) {
return Form( return Form(
key: _scaffoldKey, key: _scaffoldKey,
child: Container( child: Container(
padding: const EdgeInsets.only(left: 15, right: 50), padding: const EdgeInsets.only(left: 15, right: 50),
child: child: ListView(shrinkWrap: false, padding: EdgeInsets.only(top: 150.0), children: <Widget>[
ListView(shrinkWrap: false, padding: EdgeInsets.only(top: 150.0),
children: <Widget>[
Divider(color: Colors.transparent), Divider(color: Colors.transparent),
/* FlatButton( /* FlatButton(
child: new Image.asset( child: new Image.asset(
@ -109,10 +100,8 @@ class _LoginWidget extends State<LoginWidget> with Common, Trans {
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
new InkWell( new InkWell(
child: new Text( child: new Text(AppLocalizations.of(context).translate('Login'),
AppLocalizations.of(context).translate('Login'), style: TextStyle(fontWeight: FontWeight.bold, fontSize: 24)),
style: TextStyle(
fontWeight: FontWeight.bold, fontSize: 24)),
), ),
], ],
), ),
@ -142,39 +131,28 @@ class _LoginWidget extends State<LoginWidget> with Common, Trans {
Divider( Divider(
color: Colors.transparent, color: Colors.transparent,
), ),
Row( Row(mainAxisAlignment: MainAxisAlignment.end, children: <Widget>[
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
new FlatButton( new FlatButton(
key: LibraryKeys.loginOKButton, key: LibraryKeys.loginOKButton,
child: Image.asset('asset/image/WT_OK.png', child: Image.asset('asset/image/WT_OK.png', width: 100, height: 100),
width: 100, height: 100), onPressed: () => {formBloc.add(SubmitFormBloc())}),
onPressed: () => {
formBloc.add(SubmitFormBloc())
}),
]), ]),
Divider( Divider(
color: Colors.transparent, color: Colors.transparent,
), ),
Row( Row(mainAxisAlignment: MainAxisAlignment.spaceAround, children: <Widget>[
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: <Widget>[
new InkWell( new InkWell(
child: new Text( child: new Text(AppLocalizations.of(context).translate('SignUp')),
AppLocalizations.of(context).translate('SignUp')), onTap: () => Navigator.of(context).pushNamed('registration'),
onTap: () =>
Navigator.of(context).pushNamed('registration'),
), ),
Spacer(flex: 2), Spacer(flex: 2),
new InkWell( new InkWell(
child: new Text( child: new Text(AppLocalizations.of(context).translate('I forgot the password')),
AppLocalizations.of(context).translate('I forgot the password')),
onTap: () => Navigator.of(context).pushNamed('resetPassword'), onTap: () => Navigator.of(context).pushNamed('resetPassword'),
), ),
Spacer(flex: 2), Spacer(flex: 2),
new InkWell( new InkWell(
child: new Text( child: new Text(AppLocalizations.of(context).translate('Privacy')),
AppLocalizations.of(context).translate('Privacy')),
onTap: () => Navigator.of(context).pushNamed('gdpr'), onTap: () => Navigator.of(context).pushNamed('gdpr'),
), ),
]), ]),
@ -182,11 +160,8 @@ class _LoginWidget extends State<LoginWidget> with Common, Trans {
); );
} }
void showInSnackBar(String error) { void showInSnackBar(String error) {
_scaffoldKey.currentState.showSnackBar(SnackBar( _scaffoldKey.currentState
backgroundColor: Colors.orange, .showSnackBar(SnackBar(backgroundColor: Colors.orange, content: Text(error, style: TextStyle(color: Colors.white))));
content: Text(error, style: TextStyle(color: Colors.white))));
} }
} }

View File

@ -20,8 +20,7 @@ class RegistrationPage extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return RegistrationWidget( return RegistrationWidget(userRepository: userRepository, customerRepository: customerRepository);
userRepository: userRepository, customerRepository: customerRepository);
} }
} }
@ -37,20 +36,16 @@ class RegistrationWidget extends StatefulWidget {
class _RegistrationWidget extends State<RegistrationWidget> with Common { class _RegistrationWidget extends State<RegistrationWidget> with Common {
final GlobalKey<ScaffoldState> _scaffoldKey = new GlobalKey<ScaffoldState>(); final GlobalKey<ScaffoldState> _scaffoldKey = new GlobalKey<ScaffoldState>();
final _formKey = GlobalKey<FormState>();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final cWidth = mediaSizeWidth(context);
// ignore: close_sinks // ignore: close_sinks
final accountBloc = BlocProvider.of<AccountBloc>(context); final accountBloc = BlocProvider.of<AccountBloc>(context);
return BlocProvider( return BlocProvider(
create: (context) => RegistrationFormBloc( create: (context) => RegistrationFormBloc(userRepository: UserRepository(), accountBloc: accountBloc),
userRepository: UserRepository(), accountBloc: accountBloc),
child: Builder(builder: (context) { child: Builder(builder: (context) {
// ignore: close_sinks // ignore: close_sinks
final registrationBloc = final registrationBloc = BlocProvider.of<RegistrationFormBloc>(context);
BlocProvider.of<RegistrationFormBloc>(context);
return Scaffold( return Scaffold(
key: _scaffoldKey, key: _scaffoldKey,
@ -80,12 +75,9 @@ class _RegistrationWidget extends State<RegistrationWidget> with Common {
), ),
), ),
child: Form( child: Form(
key: _formKey,
child: Container( child: Container(
padding: const EdgeInsets.only(left: 25, right: 50), padding: const EdgeInsets.only(left: 25, right: 50),
child: ListView( child: ListView(shrinkWrap: false, padding: EdgeInsets.only(top: 150.0),
shrinkWrap: false,
padding: EdgeInsets.only(top: 150.0),
//mainAxisAlignment: MainAxisAlignment.spaceAround, //mainAxisAlignment: MainAxisAlignment.spaceAround,
children: <Widget>[ children: <Widget>[
Divider( Divider(
@ -109,12 +101,8 @@ class _RegistrationWidget extends State<RegistrationWidget> with Common {
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
new InkWell( new InkWell(
child: new Text( child: new Text(AppLocalizations.of(context).translate('SignUp'),
AppLocalizations.of(context) style: TextStyle(fontWeight: FontWeight.bold, fontSize: 24)),
.translate('SignUp'),
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 24)),
), ),
], ],
), ),
@ -144,37 +132,20 @@ class _RegistrationWidget extends State<RegistrationWidget> with Common {
Divider( Divider(
color: Colors.transparent, color: Colors.transparent,
), ),
Row( Row(mainAxisAlignment: MainAxisAlignment.end, children: <Widget>[
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
new FlatButton( new FlatButton(
child: Image.asset( child: Image.asset('asset/image/WT_OK.png', width: 100, height: 100),
'asset/image/WT_OK.png', onPressed: () => {registrationBloc.add(SubmitFormBloc())}),
width: 100,
height: 100),
onPressed: () => {
registrationBloc
.add(SubmitFormBloc())
}),
]), ]),
Row( Row(mainAxisAlignment: MainAxisAlignment.spaceAround, children: <Widget>[
mainAxisAlignment:
MainAxisAlignment.spaceAround,
children: <Widget>[
new InkWell( new InkWell(
child: new Text( child: new Text(AppLocalizations.of(context).translate('Login')),
AppLocalizations.of(context) onTap: () => Navigator.of(context).pushNamed('login'),
.translate('Login')),
onTap: () => Navigator.of(context)
.pushNamed('login'),
), ),
Spacer(flex: 1), Spacer(flex: 1),
new InkWell( new InkWell(
child: new Text( child: new Text(AppLocalizations.of(context).translate('Privacy')),
AppLocalizations.of(context) onTap: () => Navigator.of(context).pushNamed('gdpr'),
.translate('Privacy')),
onTap: () => Navigator.of(context)
.pushNamed('gdpr'),
), ),
Spacer(flex: 2), Spacer(flex: 2),
]), ]),
@ -191,11 +162,7 @@ class _RegistrationWidget extends State<RegistrationWidget> with Common {
void showInSnackBar(String error) { void showInSnackBar(String error) {
_scaffoldKey.currentState.showSnackBar(SnackBar( _scaffoldKey.currentState.showSnackBar(SnackBar(
backgroundColor: Colors.orange, backgroundColor: Colors.orange,
content: Text( content: Text(AppLocalizations.of(context).translate("There is an error: during registration:") + " " + error,
AppLocalizations.of(context)
.translate("There is an error: during registration:") +
" " +
error,
style: TextStyle(color: Colors.white)))); style: TextStyle(color: Colors.white))));
} }
} }

View File

@ -68,7 +68,7 @@ class _InputDialogState<Event> extends State<InputDialog<Event>> with Trans {
_buildChild(BuildContext context) => Container( _buildChild(BuildContext context) => Container(
height: 350, height: 350,
decoration: BoxDecoration(color: Colors.white60, shape: BoxShape.rectangle, borderRadius: BorderRadius.all(Radius.circular(12))), decoration: BoxDecoration(color: Colors.grey[700], shape: BoxShape.rectangle, borderRadius: BorderRadius.all(Radius.circular(12))),
child: KeyboardActions( child: KeyboardActions(
config: _buildConfig(context), config: _buildConfig(context),
child: Column( child: Column(
@ -107,7 +107,7 @@ class _InputDialogState<Event> extends State<InputDialog<Event>> with Trans {
]), ]),
width: double.infinity, width: double.infinity,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white70, color: Colors.grey[900],
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
borderRadius: BorderRadius.only(topLeft: Radius.circular(12), topRight: Radius.circular(12))), borderRadius: BorderRadius.only(topLeft: Radius.circular(12), topRight: Radius.circular(12))),
), ),

View File

@ -42,6 +42,7 @@ class _SizeState extends State<SizeWidget> with Trans {
padding: EdgeInsets.only(top: 10), padding: EdgeInsets.only(top: 10),
child: Column(crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center, children: [ child: Column(crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center, children: [
Stack( Stack(
alignment: Alignment.center,
children: getSizeFigure(), children: getSizeFigure(),
) )
]))), ]))),
@ -49,16 +50,20 @@ class _SizeState extends State<SizeWidget> with Trans {
} }
List<Widget> getSizeFigure() { List<Widget> getSizeFigure() {
//print("w " + MediaQuery.of(context).size.width.toString() + "h " + MediaQuery.of(context).size.height.toString()); double mediaWidth = MediaQuery.of(context).size.width * .8;
double mediaHeight = MediaQuery.of(context).size.height * .8;
print("w " + mediaWidth.toString() + "h " + mediaHeight.toString());
widget.exerciseBloc.setMediaDimensions(mediaWidth, mediaHeight);
List<Widget> list = List(); List<Widget> list = List();
list.add(SizedBox( list.add(SizedBox(
width: MediaQuery.of(context).size.width * .80, //child: Container(color: Colors.black87),
height: MediaQuery.of(context).size.height * .80, width: mediaWidth,
height: mediaHeight,
)); ));
list.add( list.add(
Positioned( Positioned(
top: 20, top: mediaHeight * .07,
left: 160, left: widget.exerciseBloc.isMan ? mediaWidth * .62 : mediaWidth * .65,
child: Stack( child: Stack(
alignment: Alignment.topLeft, alignment: Alignment.topLeft,
children: [ children: [
@ -72,7 +77,7 @@ class _SizeState extends State<SizeWidget> with Trans {
color: Colors.black54, color: Colors.black54,
), ),
], ],
fontSize: 22, fontSize: 20,
color: Colors.orange[500], color: Colors.orange[500],
)), )),
Positioned( Positioned(
@ -83,20 +88,24 @@ class _SizeState extends State<SizeWidget> with Trans {
icon: Icon(Icons.save), icon: Icon(Icons.save),
iconSize: 40, iconSize: 40,
hoverColor: Colors.blueAccent, hoverColor: Colors.blueAccent,
color: widget.exerciseBloc.changedSizes ? Colors.orange[300] : Colors.black54, color: widget.exerciseBloc.changedSizes ? Colors.orange[300] : Colors.black87,
onPressed: () => {print("Save"), widget.exerciseBloc.add(ExerciseNewSaveWeight())})) onPressed: () => {print("Save"), widget.exerciseBloc.add(ExerciseNewSaveWeight())}))
], ],
)), )),
); );
list.add(widget.exerciseBloc.customerRepository.sex == "Man" list.add(
widget.exerciseBloc.isMan
? Image.asset( ? Image.asset(
"asset/image/man_sizes.png", "asset/image/man_sizes.png",
height: MediaQuery.of(context).size.height * .80, height: mediaHeight,
width: mediaWidth,
) )
: Image.asset( : Image.asset(
"asset/image/woman_sizes.png", "asset/image/woman_sizes.png",
height: MediaQuery.of(context).size.height * .80, height: mediaHeight,
)); width: mediaWidth,
),
);
list.addAll(getSizeElements()); list.addAll(getSizeElements());
return list; return list;
@ -111,18 +120,41 @@ class _SizeState extends State<SizeWidget> with Trans {
top: element.top.toDouble(), top: element.top.toDouble(),
left: element.left.toDouble(), left: element.left.toDouble(),
child: element.value != 0 child: element.value != 0
? IconButton( ? Container(
width: 20,
height: 20,
decoration: BoxDecoration(
color: widget.exerciseBloc.isMan ? Colors.green[800] : Color(0xFFEA776C),
borderRadius: BorderRadius.all(
Radius.circular(20),
),
),
padding: EdgeInsets.zero,
child: IconButton(
icon: Icon(CustomIcon.ok_circled), icon: Icon(CustomIcon.ok_circled),
padding: EdgeInsets.zero, padding: EdgeInsets.zero,
color: Colors.green[200], color: Colors.green[200],
onPressed: () => onPressed(element), onPressed: () => onPressed(element),
) ))
: IconButton( : Container(
icon: Icon(CustomIcon.question), width: 20,
height: 20,
padding: EdgeInsets.zero,
decoration: BoxDecoration(
color: widget.exerciseBloc.isMan ? Color(0xFF369fb9) : Color(0xFFEA776C),
borderRadius: BorderRadius.all(
Radius.circular(20),
),
),
child: IconButton(
icon: Icon(
CustomIcon.help_circled,
),
padding: EdgeInsets.zero, padding: EdgeInsets.zero,
color: Colors.red[800], color: Colors.red[800],
splashColor: Colors.amber,
onPressed: () => onPressed(element), onPressed: () => onPressed(element),
)), ))),
); );
}); });