WT 1.1.11+3 Evaluation, null-safe fixes
This commit is contained in:
@@ -241,7 +241,7 @@ class _BMIState extends State<BMI> with Trans {
|
||||
}
|
||||
|
||||
Widget getHeightInput() {
|
||||
if (widget.exerciseBloc.customerRepository.customer.birthYear! < 2003) {
|
||||
if (widget.exerciseBloc.customerRepository.customer!.birthYear! < 2003) {
|
||||
return Flexible(
|
||||
child: TextFormField(
|
||||
focusNode: _nodeText2,
|
||||
|
||||
@@ -3,7 +3,7 @@ import 'package:aitrainer_app/bloc/exercise_new/exercise_new_bloc.dart';
|
||||
import 'package:aitrainer_app/util/app_localization.dart';
|
||||
import 'package:aitrainer_app/model/fitness_state.dart';
|
||||
import 'package:aitrainer_app/util/trans.dart';
|
||||
import 'package:dropdown_search/dropdown_search.dart';
|
||||
import 'package:aitrainer_app/library/dropdown_search.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
@@ -196,7 +196,7 @@ class _BMRState extends State<BMR> with Trans {
|
||||
}
|
||||
|
||||
Widget getHeightInput() {
|
||||
if (widget.exerciseBloc.customerRepository.customer.birthYear! < 2003) {
|
||||
if (widget.exerciseBloc.customerRepository.customer!.birthYear! < 2003) {
|
||||
return Flexible(
|
||||
child: TextFormField(
|
||||
focusNode: _nodeText2,
|
||||
|
||||
@@ -71,7 +71,7 @@ class _BottomBarMultipleExercisesState extends State<BottomBarMultipleExercises>
|
||||
],
|
||||
),
|
||||
),
|
||||
height: 90,
|
||||
height: 70,
|
||||
child: BlocConsumer<TestSetExecuteBloc, TestSetExecuteState>(listener: (context, state) {
|
||||
if (state is TestSetExecuteError) {
|
||||
ScaffoldMessenger.of(context)
|
||||
|
||||
+85
-81
@@ -1,10 +1,12 @@
|
||||
import 'package:aitrainer_app/library/gradient_bottom_navigation_bar.dart';
|
||||
import 'dart:ui';
|
||||
|
||||
import 'package:aitrainer_app/model/cache.dart';
|
||||
import 'package:aitrainer_app/service/logging.dart';
|
||||
import 'package:aitrainer_app/util/common.dart';
|
||||
import 'package:aitrainer_app/util/enums.dart';
|
||||
import 'package:aitrainer_app/util/track.dart';
|
||||
import 'package:aitrainer_app/util/trans.dart';
|
||||
import 'package:convex_bottom_bar/convex_bottom_bar.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
// ignore: must_be_immutable
|
||||
@@ -34,91 +36,93 @@ class _NawDrawerWidget extends State<BottomNavigator> with Trans, Logging {
|
||||
Widget build(BuildContext context) {
|
||||
final Color bgrColor = Color(0xffb4f500);
|
||||
final Color bgrColorEnd = Colors.blue;
|
||||
final Color active = Colors.black;
|
||||
final Color inactive = Colors.black26;
|
||||
final Color active = Colors.white;
|
||||
final Color inactive = Colors.black38;
|
||||
setContext(context);
|
||||
|
||||
return GradientBottomNavigationBar(
|
||||
currentIndex: widget.bottomNavIndex, // this will be set when a new tab is tapped
|
||||
backgroundColorStart: bgrColorEnd,
|
||||
backgroundColorEnd: bgrColor,
|
||||
fixedColor: active,
|
||||
items: [
|
||||
BottomNavigationBarItem(
|
||||
backgroundColor: bgrColor,
|
||||
icon: Common.badgedIcon(inactive, Icons.home, "home"),
|
||||
activeIcon: Common.badgedIcon(active, Icons.home, "home"),
|
||||
title: Text(t("Home"), style: TextStyle(fontSize: 12))),
|
||||
BottomNavigationBarItem(
|
||||
backgroundColor: bgrColor,
|
||||
icon: Common.badgedIcon(inactive, Icons.trending_up, "development"),
|
||||
activeIcon: Common.badgedIcon(active, Icons.trending_up, "development"),
|
||||
title: Text(
|
||||
t("My Development"),
|
||||
style: TextStyle(fontSize: 12),
|
||||
),
|
||||
),
|
||||
BottomNavigationBarItem(
|
||||
backgroundColor: bgrColor,
|
||||
icon: Icon(Icons.featured_play_list, color: inactive),
|
||||
activeIcon: Icon(
|
||||
Icons.featured_play_list,
|
||||
color: active,
|
||||
),
|
||||
title: Text(
|
||||
t("My Training Plan"),
|
||||
style: TextStyle(fontSize: 12),
|
||||
),
|
||||
),
|
||||
BottomNavigationBarItem(
|
||||
backgroundColor: bgrColor,
|
||||
icon: Common.badgedIcon(inactive, Icons.person, "account"),
|
||||
activeIcon: Common.badgedIcon(active, Icons.person, "account"),
|
||||
title: Text(
|
||||
t("Account"),
|
||||
style: TextStyle(fontSize: 12),
|
||||
)),
|
||||
BottomNavigationBarItem(
|
||||
backgroundColor: bgrColor,
|
||||
icon: Icon(Icons.settings, color: inactive),
|
||||
activeIcon: Icon(Icons.settings, color: active),
|
||||
title: Text(t("Settings"), style: TextStyle(fontSize: 12))),
|
||||
],
|
||||
onTap: (index) {
|
||||
setState(() {
|
||||
widget.bottomNavIndex = index;
|
||||
switch (index) {
|
||||
case 0:
|
||||
Navigator.of(context).pop();
|
||||
Track().track(TrackingEvent.home);
|
||||
Navigator.of(context).pushNamed('home');
|
||||
return StyleProvider(
|
||||
style: Style(),
|
||||
child: ConvexAppBar(
|
||||
initialActiveIndex: widget.bottomNavIndex,
|
||||
curve: Curves.easeIn,
|
||||
style: TabStyle.react,
|
||||
color: inactive,
|
||||
height: 55,
|
||||
gradient: LinearGradient(colors: [bgrColorEnd, bgrColor], stops: [0.1, .75]),
|
||||
items: [
|
||||
TabItem(
|
||||
isIconBlend: false,
|
||||
title: t("Home"),
|
||||
icon: Common.badgedIcon(inactive, Icons.home, "home"),
|
||||
activeIcon: Common.badgedIcon(active, Icons.home, "home"),
|
||||
),
|
||||
TabItem(
|
||||
title: t("Growth"),
|
||||
icon: Common.badgedIcon(inactive, Icons.trending_up, "development"),
|
||||
activeIcon: Common.badgedIcon(active, Icons.trending_up, "development"),
|
||||
),
|
||||
TabItem(
|
||||
title: t("Training"),
|
||||
icon: Icon(Icons.featured_play_list, color: inactive),
|
||||
activeIcon: Icon(Icons.featured_play_list, color: active)),
|
||||
TabItem(
|
||||
title: t("Account"),
|
||||
icon: Common.badgedIcon(inactive, Icons.person, "account"),
|
||||
activeIcon: Common.badgedIcon(active, Icons.person, "account"),
|
||||
),
|
||||
TabItem(title: t("Settings"), icon: Icon(Icons.settings, color: inactive), activeIcon: Icon(Icons.settings, color: active)),
|
||||
],
|
||||
onTap: (index) {
|
||||
setState(() {
|
||||
widget.bottomNavIndex = index;
|
||||
switch (index) {
|
||||
case 0:
|
||||
Navigator.of(context).pop();
|
||||
Track().track(TrackingEvent.home);
|
||||
Navigator.of(context).pushNamed('home');
|
||||
|
||||
break;
|
||||
case 1:
|
||||
Navigator.of(context).pop();
|
||||
Track().track(TrackingEvent.my_development);
|
||||
Navigator.of(context).pushNamed('myDevelopment');
|
||||
break;
|
||||
case 2:
|
||||
Navigator.of(context).pop();
|
||||
Track().track(TrackingEvent.my_exerciseplan);
|
||||
Navigator.of(context).pushNamed('myExercisePlan');
|
||||
break;
|
||||
case 1:
|
||||
Navigator.of(context).pop();
|
||||
Track().track(TrackingEvent.my_development);
|
||||
Navigator.of(context).pushNamed('myDevelopment');
|
||||
break;
|
||||
case 2:
|
||||
Navigator.of(context).pop();
|
||||
Track().track(TrackingEvent.my_exerciseplan);
|
||||
Navigator.of(context).pushNamed('myExercisePlan');
|
||||
|
||||
break;
|
||||
case 3:
|
||||
Navigator.of(context).pop();
|
||||
Track().track(TrackingEvent.account);
|
||||
Navigator.of(context).pushNamed('account');
|
||||
break;
|
||||
case 3:
|
||||
Navigator.of(context).pop();
|
||||
Track().track(TrackingEvent.account);
|
||||
Navigator.of(context).pushNamed('account');
|
||||
|
||||
break;
|
||||
case 4:
|
||||
Navigator.of(context).pop();
|
||||
Track().track(TrackingEvent.settings);
|
||||
Navigator.of(context).pushNamed('settings');
|
||||
break;
|
||||
case 4:
|
||||
Navigator.of(context).pop();
|
||||
Track().track(TrackingEvent.settings);
|
||||
Navigator.of(context).pushNamed('settings');
|
||||
|
||||
break;
|
||||
}
|
||||
});
|
||||
});
|
||||
break;
|
||||
}
|
||||
});
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
class Style extends StyleHook {
|
||||
@override
|
||||
double get activeIconSize => 50;
|
||||
|
||||
@override
|
||||
double get activeIconMargin => 10;
|
||||
|
||||
@override
|
||||
double get iconSize => 20;
|
||||
|
||||
@override
|
||||
TextStyle textStyle(Color color) {
|
||||
return TextStyle(fontSize: 12, color: color);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ class _DialogPremiumState extends State<DialogCommon> with Trans {
|
||||
),
|
||||
elevation: 0,
|
||||
backgroundColor: Colors.transparent,
|
||||
child: contentBox(context),
|
||||
child: SingleChildScrollView(padding: EdgeInsets.only(bottom: 30), child: contentBox(context)),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
+158
-156
@@ -129,109 +129,105 @@ class _ExerciseSaveState extends State<ExerciseSave> with Trans {
|
||||
return KeyboardActions(
|
||||
config: _buildConfig(context),
|
||||
child: Container(
|
||||
padding: const EdgeInsets.only(top: 10, left: 55, right: 55),
|
||||
child: SingleChildScrollView(
|
||||
scrollDirection: Axis.vertical,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
Text(
|
||||
widget.exerciseName,
|
||||
style: GoogleFonts.archivoBlack(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 24,
|
||||
color: Colors.white,
|
||||
shadows: <Shadow>[
|
||||
Shadow(
|
||||
offset: Offset(5.0, 5.0),
|
||||
blurRadius: 12.0,
|
||||
color: Colors.black54,
|
||||
),
|
||||
Shadow(
|
||||
offset: Offset(-3.0, 3.0),
|
||||
blurRadius: 12.0,
|
||||
color: Colors.black54,
|
||||
),
|
||||
],
|
||||
),
|
||||
overflow: TextOverflow.fade,
|
||||
maxLines: 4,
|
||||
softWrap: true,
|
||||
textAlign: TextAlign.center,
|
||||
scrollDirection: Axis.vertical,
|
||||
child: Column(mainAxisAlignment: MainAxisAlignment.spaceEvenly, crossAxisAlignment: CrossAxisAlignment.center, children: <Widget>[
|
||||
Text(
|
||||
widget.exerciseName,
|
||||
style: GoogleFonts.archivoBlack(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 24,
|
||||
color: Colors.white,
|
||||
shadows: <Shadow>[
|
||||
Shadow(
|
||||
offset: Offset(5.0, 5.0),
|
||||
blurRadius: 12.0,
|
||||
color: Colors.black54,
|
||||
),
|
||||
Shadow(
|
||||
offset: Offset(-3.0, 3.0),
|
||||
blurRadius: 12.0,
|
||||
color: Colors.black54,
|
||||
),
|
||||
],
|
||||
),
|
||||
overflow: TextOverflow.fade,
|
||||
maxLines: 4,
|
||||
softWrap: true,
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
SizedBox(
|
||||
height: 15,
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 10, left: 55, right: 55),
|
||||
child: Text(
|
||||
widget.exerciseDescription,
|
||||
style: GoogleFonts.inter(fontSize: 12, color: Colors.yellow[300]),
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.fade,
|
||||
softWrap: true,
|
||||
)),
|
||||
InkWell(
|
||||
child: Text(
|
||||
t("More »"),
|
||||
style: GoogleFonts.inter(fontSize: 12, color: Colors.blue[200]),
|
||||
),
|
||||
onTap: () => {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return DialogHTML(title: widget.exerciseName, htmlData: '<p>' + widget.exerciseDescription + '</p>');
|
||||
})
|
||||
},
|
||||
),
|
||||
Divider(
|
||||
color: Colors.transparent,
|
||||
),
|
||||
Text(
|
||||
t(widget.exerciseTask),
|
||||
style: GoogleFonts.inter(
|
||||
fontSize: 14,
|
||||
color: Colors.orange,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
maxLines: 3,
|
||||
textAlign: TextAlign.center,
|
||||
overflow: TextOverflow.fade,
|
||||
softWrap: true,
|
||||
),
|
||||
Divider(
|
||||
color: Colors.transparent,
|
||||
),
|
||||
columnQuantityUnit(),
|
||||
Divider(
|
||||
color: Colors.transparent,
|
||||
),
|
||||
columnQuantity(),
|
||||
Divider(
|
||||
color: Colors.transparent,
|
||||
),
|
||||
widget.hasUnitQuantity
|
||||
? Text(
|
||||
t("Step") + ": " + "1/4",
|
||||
style: GoogleFonts.inter(
|
||||
fontSize: 22,
|
||||
color: Colors.white,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
SizedBox(
|
||||
height: 15,
|
||||
),
|
||||
Text(
|
||||
widget.exerciseDescription,
|
||||
style: GoogleFonts.inter(fontSize: 12, color: Colors.yellow[300]),
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.fade,
|
||||
softWrap: true,
|
||||
),
|
||||
InkWell(
|
||||
child: Text(
|
||||
t("More »"),
|
||||
style: GoogleFonts.inter(fontSize: 12, color: Colors.blue[200]),
|
||||
),
|
||||
onTap: () => {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return DialogHTML(title: widget.exerciseName, htmlData: '<p>' + widget.exerciseDescription + '</p>');
|
||||
})
|
||||
},
|
||||
),
|
||||
Divider(
|
||||
color: Colors.transparent,
|
||||
),
|
||||
widget.hasUnitQuantity
|
||||
? Text(
|
||||
t(widget.exerciseTask),
|
||||
style: GoogleFonts.inter(
|
||||
fontSize: 14,
|
||||
color: Colors.orange,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
maxLines: 3,
|
||||
textAlign: TextAlign.center,
|
||||
overflow: TextOverflow.fade,
|
||||
softWrap: true,
|
||||
)
|
||||
: Offstage(),
|
||||
Divider(
|
||||
color: Colors.transparent,
|
||||
),
|
||||
columnQuantityUnit(),
|
||||
Divider(
|
||||
color: Colors.transparent,
|
||||
),
|
||||
columnQuantity(),
|
||||
Divider(
|
||||
color: Colors.transparent,
|
||||
),
|
||||
widget.hasUnitQuantity
|
||||
? Text(
|
||||
t("Step") + ": " + "1/4",
|
||||
style: GoogleFonts.inter(
|
||||
fontSize: 22,
|
||||
color: Colors.white,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
maxLines: 3,
|
||||
textAlign: TextAlign.center,
|
||||
overflow: TextOverflow.fade,
|
||||
softWrap: true,
|
||||
)
|
||||
: Offstage(),
|
||||
Divider(
|
||||
color: Colors.transparent,
|
||||
),
|
||||
Divider(
|
||||
color: Colors.transparent,
|
||||
),
|
||||
/* TextButton(
|
||||
maxLines: 3,
|
||||
textAlign: TextAlign.center,
|
||||
overflow: TextOverflow.fade,
|
||||
softWrap: true,
|
||||
)
|
||||
: Offstage(),
|
||||
Divider(
|
||||
color: Colors.transparent,
|
||||
),
|
||||
Divider(
|
||||
color: Colors.transparent,
|
||||
),
|
||||
/* TextButton(
|
||||
onPressed: () {
|
||||
widget.onSubmit();
|
||||
/* showDialog(
|
||||
@@ -252,43 +248,46 @@ class _ExerciseSaveState extends State<ExerciseSave> with Trans {
|
||||
),
|
||||
],
|
||||
)), */
|
||||
]),
|
||||
)));
|
||||
]),
|
||||
)));
|
||||
}
|
||||
|
||||
Column columnQuantityUnit() {
|
||||
Column row = Column();
|
||||
Widget columnQuantityUnit() {
|
||||
Widget row = Padding(padding: const EdgeInsets.only(top: 10, left: 55, right: 55), child: Column());
|
||||
if (widget.hasUnitQuantity) {
|
||||
row = Column(mainAxisAlignment: MainAxisAlignment.spaceAround, children: [
|
||||
TextFormField(
|
||||
focusNode: _nodeText1,
|
||||
controller: _controller1,
|
||||
decoration: InputDecoration(
|
||||
contentPadding: EdgeInsets.only(left: 25, top: 5, bottom: 5),
|
||||
labelText: t(widget.unitQuantityUnit!),
|
||||
labelStyle: GoogleFonts.inter(fontSize: 20, color: Colors.yellow[50]),
|
||||
fillColor: Colors.black38,
|
||||
filled: true,
|
||||
border: OutlineInputBorder(
|
||||
gapPadding: 8.0,
|
||||
borderRadius: BorderRadius.circular(12.0),
|
||||
borderSide: BorderSide(color: Colors.white12, width: 0.4),
|
||||
),
|
||||
),
|
||||
keyboardType: TextInputType.numberWithOptions(decimal: true),
|
||||
textInputAction: TextInputAction.done,
|
||||
style: GoogleFonts.archivoBlack(fontSize: 80, color: Colors.yellow[300]),
|
||||
onChanged: (value) => widget.onUnitQuantityChanged!(value)),
|
||||
]);
|
||||
row = Padding(
|
||||
padding: const EdgeInsets.only(top: 10, left: 55, right: 55),
|
||||
child: Column(mainAxisAlignment: MainAxisAlignment.spaceAround, children: [
|
||||
TextFormField(
|
||||
focusNode: _nodeText1,
|
||||
controller: _controller1,
|
||||
decoration: InputDecoration(
|
||||
contentPadding: EdgeInsets.only(left: 25, top: 5, bottom: 5),
|
||||
labelText: t(widget.unitQuantityUnit!),
|
||||
labelStyle: GoogleFonts.inter(fontSize: 20, color: Colors.yellow[50]),
|
||||
fillColor: Colors.black38,
|
||||
filled: true,
|
||||
border: OutlineInputBorder(
|
||||
gapPadding: 8.0,
|
||||
borderRadius: BorderRadius.circular(12.0),
|
||||
borderSide: BorderSide(color: Colors.white12, width: 0.4),
|
||||
),
|
||||
),
|
||||
keyboardType: TextInputType.numberWithOptions(decimal: true),
|
||||
textInputAction: TextInputAction.done,
|
||||
style: GoogleFonts.archivoBlack(fontSize: 80, color: Colors.yellow[300]),
|
||||
onChanged: (value) => widget.onUnitQuantityChanged!(value)),
|
||||
]));
|
||||
}
|
||||
return row;
|
||||
}
|
||||
|
||||
Column columnQuantity() {
|
||||
Widget columnQuantity() {
|
||||
if (widget.unit == "second") {
|
||||
return Column(mainAxisAlignment: MainAxisAlignment.spaceAround, children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(bottom: 0),
|
||||
padding: const EdgeInsets.only(top: 10, left: 55, right: 55),
|
||||
//padding: const EdgeInsets.only(bottom: 0),
|
||||
child: StreamBuilder<int>(
|
||||
stream: stopWatchTimer.rawTime,
|
||||
initialData: stopWatchTimer.rawTime.valueWrapper?.value,
|
||||
@@ -300,13 +299,14 @@ class _ExerciseSaveState extends State<ExerciseSave> with Trans {
|
||||
padding: const EdgeInsets.all(8),
|
||||
child: Text(
|
||||
displayTime,
|
||||
style: const TextStyle(fontSize: 40, fontFamily: 'Helvetica', fontWeight: FontWeight.bold, color: Colors.white),
|
||||
style: const TextStyle(fontSize: 35, fontFamily: 'Helvetica', fontWeight: FontWeight.bold, color: Colors.white),
|
||||
),
|
||||
),
|
||||
]);
|
||||
})),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(2),
|
||||
//padding: const EdgeInsets.all(2),
|
||||
padding: const EdgeInsets.only(top: 10, left: 25, right: 25),
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
Padding(
|
||||
@@ -315,7 +315,7 @@ class _ExerciseSaveState extends State<ExerciseSave> with Trans {
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 5),
|
||||
child: IconButton(
|
||||
padding: const EdgeInsets.all(2),
|
||||
color: Colors.white70,
|
||||
@@ -328,7 +328,7 @@ class _ExerciseSaveState extends State<ExerciseSave> with Trans {
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 5),
|
||||
child: IconButton(
|
||||
padding: const EdgeInsets.all(2),
|
||||
iconSize: 40,
|
||||
@@ -341,7 +341,7 @@ class _ExerciseSaveState extends State<ExerciseSave> with Trans {
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 5),
|
||||
child: IconButton(
|
||||
padding: const EdgeInsets.all(2),
|
||||
iconSize: 40,
|
||||
@@ -364,30 +364,32 @@ class _ExerciseSaveState extends State<ExerciseSave> with Trans {
|
||||
TimePickerWidget(onChange: (value) => widget.onQuantityChanged((value).toString()))
|
||||
]);
|
||||
}
|
||||
Column row = Column(mainAxisAlignment: MainAxisAlignment.spaceAround, children: [
|
||||
TextFormField(
|
||||
focusNode: _nodeText2,
|
||||
controller: _controller2,
|
||||
decoration: InputDecoration(
|
||||
contentPadding: EdgeInsets.only(left: 25, top: 5, bottom: 5),
|
||||
labelText: t(widget.unit),
|
||||
labelStyle: GoogleFonts.inter(fontSize: 20, color: Colors.orange[50], decorationColor: Colors.black12),
|
||||
fillColor: Colors.black38,
|
||||
filled: true,
|
||||
border: OutlineInputBorder(
|
||||
gapPadding: 8.0,
|
||||
borderRadius: BorderRadius.circular(12.0),
|
||||
borderSide: BorderSide(color: Colors.black26, width: 0.4),
|
||||
Widget row = Container(
|
||||
padding: const EdgeInsets.only(top: 10, left: 55, right: 55),
|
||||
child: Column(mainAxisAlignment: MainAxisAlignment.spaceAround, children: [
|
||||
TextFormField(
|
||||
focusNode: _nodeText2,
|
||||
controller: _controller2,
|
||||
decoration: InputDecoration(
|
||||
contentPadding: EdgeInsets.only(left: 25, top: 5, bottom: 5),
|
||||
labelText: t(widget.unit),
|
||||
labelStyle: GoogleFonts.inter(fontSize: 20, color: Colors.orange[50], decorationColor: Colors.black12),
|
||||
fillColor: Colors.black38,
|
||||
filled: true,
|
||||
border: OutlineInputBorder(
|
||||
gapPadding: 8.0,
|
||||
borderRadius: BorderRadius.circular(12.0),
|
||||
borderSide: BorderSide(color: Colors.black26, width: 0.4),
|
||||
),
|
||||
),
|
||||
keyboardType: TextInputType.number,
|
||||
textInputAction: TextInputAction.next,
|
||||
style: GoogleFonts.archivoBlack(fontSize: 80, color: Colors.orange[200]),
|
||||
onChanged: (value) {
|
||||
widget.onQuantityChanged(value);
|
||||
},
|
||||
),
|
||||
),
|
||||
keyboardType: TextInputType.number,
|
||||
textInputAction: TextInputAction.next,
|
||||
style: GoogleFonts.archivoBlack(fontSize: 80, color: Colors.orange[200]),
|
||||
onChanged: (value) {
|
||||
widget.onQuantityChanged(value);
|
||||
},
|
||||
),
|
||||
]);
|
||||
]));
|
||||
|
||||
return row;
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ class _HomePageState extends State<AitrainerHome> with Logging {
|
||||
}
|
||||
|
||||
Future runDelayedEvent() async {
|
||||
await Future.delayed(Duration(seconds: 2), () async {
|
||||
await Future.delayed(Duration(milliseconds: 500), () async {
|
||||
// ignore: close_sinks
|
||||
SessionBloc sessionBloc = BlocProvider.of<SessionBloc>(context);
|
||||
if (sessionBloc.state != SessionReady()) {
|
||||
|
||||
@@ -68,7 +68,7 @@ class _MenuPageWidgetState extends State<MenuPageWidget> with Trans, Logging {
|
||||
@override
|
||||
bool didUpdateWidget(MenuPageWidget oldWidget) {
|
||||
super.didUpdateWidget(oldWidget);
|
||||
scrollController.animateTo(40, duration: Duration(milliseconds: 300), curve: Curves.easeIn);
|
||||
scrollController.animateTo(5, duration: Duration(milliseconds: 300), curve: Curves.easeIn);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -234,17 +234,18 @@ class _MenuPageWidgetState extends State<MenuPageWidget> with Trans, Logging {
|
||||
SliverGrid getFilterElements(MenuBloc menuBloc) {
|
||||
List<Widget> list = [];
|
||||
|
||||
int index = 0;
|
||||
menuBloc.exerciseDeviceRepository.getGymDevices().forEach((element) {
|
||||
String deviceName = AppLanguage().appLocal == Locale('en') ? element.name : element.nameTranslation;
|
||||
ChoiceChip chip = ChoiceChip(
|
||||
labelPadding: EdgeInsets.only(right: 5),
|
||||
labelPadding: EdgeInsets.only(right: 3),
|
||||
avatar: Icon(
|
||||
Icons.remove_circle_outline,
|
||||
color: Colors.orange,
|
||||
size: 18,
|
||||
size: 10,
|
||||
),
|
||||
label: Text(deviceName),
|
||||
labelStyle: TextStyle(fontSize: 9, color: Colors.black),
|
||||
labelStyle: TextStyle(fontSize: 9, color: Colors.indigo),
|
||||
selectedColor: Colors.white,
|
||||
selected: menuBloc.selectedDevice(element.exerciseDeviceId),
|
||||
backgroundColor: Colors.blue[100],
|
||||
@@ -252,6 +253,11 @@ class _MenuPageWidgetState extends State<MenuPageWidget> with Trans, Logging {
|
||||
onSelected: (value) => menuBloc.add(MenuFilterExerciseType(deviceId: element.exerciseDeviceId)),
|
||||
);
|
||||
list.add(chip);
|
||||
if (index == 4) {
|
||||
list.add(Divider());
|
||||
}
|
||||
|
||||
index++;
|
||||
});
|
||||
|
||||
SliverGrid sliverList = SliverGrid(
|
||||
|
||||
@@ -2,7 +2,7 @@ import 'dart:async';
|
||||
|
||||
import 'package:aitrainer_app/model/workout_menu_tree.dart';
|
||||
import 'package:aitrainer_app/util/trans.dart';
|
||||
import 'package:dropdown_search/dropdown_search.dart';
|
||||
import 'package:aitrainer_app/library/dropdown_search.dart';
|
||||
//import 'package:aitrainer_app/library/dropdown_search.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
|
||||
@@ -35,19 +35,23 @@ class _NumberPickerWidgetState extends State<NumberPickerWidget> with Trans {
|
||||
void initState() {
|
||||
super.initState();
|
||||
_scrollController = FixedExtentScrollController(initialItem: widget.initalValue);
|
||||
_scrollController.animateToItem(widget.initalValue, duration: Duration(milliseconds: 100), curve: Curves.easeIn);
|
||||
}
|
||||
|
||||
@override
|
||||
void didUpdateWidget(NumberPickerWidget oldWidget) {
|
||||
super.didUpdateWidget(oldWidget);
|
||||
_scrollController.animateToItem(widget.initalValue, duration: Duration(milliseconds: 100), curve: Curves.easeIn);
|
||||
}
|
||||
|
||||
Widget durationPicker({bool inSeconds = false, bool inHundredths = false}) {
|
||||
double value = 0;
|
||||
return CupertinoPicker(
|
||||
scrollController: _scrollController,
|
||||
useMagnifier: true,
|
||||
magnification: 1.2,
|
||||
diameterRatio: 0.85,
|
||||
backgroundColor: Colors.transparent,
|
||||
selectionOverlay: Container(),
|
||||
onSelectedItemChanged: (x) {
|
||||
currentData = x.toDouble();
|
||||
value = x.toDouble();
|
||||
@@ -57,7 +61,7 @@ class _NumberPickerWidgetState extends State<NumberPickerWidget> with Trans {
|
||||
},
|
||||
children: List.generate(
|
||||
widget.maxValue, (index) => Text('$index ' + widget.unit, style: TextStyle(color: widget.color, fontSize: widget.fontSize))),
|
||||
itemExtent: 40,
|
||||
itemExtent: 30,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -66,32 +70,30 @@ class _NumberPickerWidgetState extends State<NumberPickerWidget> with Trans {
|
||||
Widget build(BuildContext context) {
|
||||
setContext(context);
|
||||
return Container(
|
||||
//color: Colors.white24,
|
||||
color: Colors.transparent,
|
||||
width: MediaQuery.of(context).size.width * .40,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 5.0),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
color: Colors.transparent,
|
||||
width: MediaQuery.of(context).size.width * .35,
|
||||
child: Center(
|
||||
child: Container(
|
||||
color: Colors.transparent,
|
||||
width: MediaQuery.of(context).size.width * 0.95,
|
||||
height: MediaQuery.of(context).size.height * 0.25,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Expanded(child: durationPicker()),
|
||||
],
|
||||
)),
|
||||
),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
color: Colors.transparent,
|
||||
width: MediaQuery.of(context).size.width * .35,
|
||||
child: Center(
|
||||
child: Container(
|
||||
color: Colors.transparent,
|
||||
width: MediaQuery.of(context).size.width * 0.95,
|
||||
//height: MediaQuery.of(context).size.height * 0.25,
|
||||
height: 100,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Expanded(child: durationPicker()),
|
||||
],
|
||||
)),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user