WT1.1.4 build 45 android fb, iap
This commit is contained in:
@@ -142,6 +142,9 @@ class _AppBarNav extends State<AppBarNav> with SingleTickerProviderStateMixin, C
|
||||
ExerciseRepository exerciseRepository = ExerciseRepository();
|
||||
exerciseRepository.getBaseExerciseFinishedPercent();
|
||||
percent = Cache().getPercentExercises();
|
||||
if (percent == null || percent == -1) {
|
||||
percent = 0;
|
||||
}
|
||||
}
|
||||
int sizeExerciseList = Cache().getExercises() == null ? 0 : Cache().getExercises().length;
|
||||
if (sizeExerciseList == 0) {
|
||||
|
||||
@@ -160,7 +160,7 @@ class _DialogPremiumState extends State<DialogPremium> with Trans {
|
||||
Align(
|
||||
alignment: Alignment.center,
|
||||
child: GestureDetector(
|
||||
onTap: widget.onTap ?? widget.onTap,
|
||||
onTap: () => Navigator.of(context).pushNamed("salesPage"),
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
|
||||
@@ -2,12 +2,14 @@ import 'package:aitrainer_app/bloc/session/session_bloc.dart';
|
||||
import 'package:aitrainer_app/bloc/settings/settings_bloc.dart';
|
||||
import 'package:aitrainer_app/model/cache.dart';
|
||||
import 'package:aitrainer_app/service/logging.dart';
|
||||
import 'package:aitrainer_app/util/platform_purchase.dart';
|
||||
import 'package:aitrainer_app/view/login.dart';
|
||||
import 'package:aitrainer_app/view/menu_page.dart';
|
||||
import 'package:aitrainer_app/view/registration.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/scheduler.dart';
|
||||
import 'package:flutter/semantics.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'loading.dart';
|
||||
@@ -85,4 +87,10 @@ class _HomePageState extends State<AitrainerHome> with Logging {
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() async {
|
||||
super.dispose();
|
||||
await PlatformPurchaseApi().close();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,6 +53,8 @@ class ImageButton extends StatelessWidget {
|
||||
top = height - (style.fontSize - 5) * text.length - 2 * left < 0 ? height - 2 * style.fontSize - 22 : height - style.fontSize - 37;
|
||||
//print("Top: " + top.toStringAsFixed(0) + " length: " + ((style.fontSize - 5) * text.length).toString());
|
||||
}
|
||||
final double width = MediaQuery.of(context).size.width;
|
||||
print("Mediawidth: " + width.toStringAsFixed(0));
|
||||
return Stack(alignment: AlignmentDirectional.bottomStart, children: [
|
||||
FlatButton(
|
||||
child: image == null
|
||||
@@ -101,29 +103,12 @@ class ImageButton extends StatelessWidget {
|
||||
],
|
||||
)),
|
||||
)),
|
||||
/* Positioned(
|
||||
top: top,
|
||||
left: left,
|
||||
child: Container(
|
||||
height: width - 2 * left,
|
||||
width: width - 2 * left,
|
||||
child: InkWell(
|
||||
onTap: onTap ?? onTap,
|
||||
child: Text(
|
||||
text,
|
||||
maxLines: 2,
|
||||
style: style,
|
||||
),
|
||||
),
|
||||
color: Colors.transparent,
|
||||
),
|
||||
), */
|
||||
Cache().hasPurchased
|
||||
? Offstage()
|
||||
: Stack(alignment: Alignment.topCenter, children: [
|
||||
Positioned(
|
||||
top: 20,
|
||||
left: 20,
|
||||
top: 10,
|
||||
left: (width / 2 - 30) / 2 - 75,
|
||||
child: this.isLocked
|
||||
? GestureDetector(
|
||||
child: Image.asset(
|
||||
|
||||
@@ -8,12 +8,14 @@ import 'package:aitrainer_app/localization/app_localization.dart';
|
||||
import 'package:aitrainer_app/model/cache.dart';
|
||||
import 'package:aitrainer_app/model/workout_menu_tree.dart';
|
||||
import 'package:aitrainer_app/service/logging.dart';
|
||||
import 'package:aitrainer_app/util/not_found_exception.dart';
|
||||
import 'package:aitrainer_app/util/trans.dart';
|
||||
import 'package:aitrainer_app/widgets/dialog_common.dart';
|
||||
import 'package:badges/badges.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/painting.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
|
||||
@@ -331,30 +333,30 @@ class _MenuPageWidgetState extends State<MenuPageWidget> with Trans, Logging {
|
||||
return returnCode;
|
||||
}
|
||||
|
||||
dynamic _getButtonImage(WorkoutMenuTree workoutTree, double cWidth, double cHeight) {
|
||||
dynamic image;
|
||||
try {
|
||||
Widget _getButtonImage(WorkoutMenuTree workoutTree, double cWidth, double cHeight) {
|
||||
Widget image;
|
||||
|
||||
if (workoutTree.imageName.startsWith('https')) {
|
||||
image = ClipRRect(
|
||||
borderRadius: BorderRadius.circular(24),
|
||||
child: Image.asset(
|
||||
workoutTree.imageName,
|
||||
height: 210,
|
||||
errorBuilder: (context, error, stackTrace) {
|
||||
String url = Cache.mediaUrl + 'images/' + workoutTree.imageName.substring(11);
|
||||
Widget image = FadeInImage.assetNetwork(
|
||||
placeholder: 'asset/image/dots.gif',
|
||||
image: url,
|
||||
height: 210,
|
||||
);
|
||||
return image;
|
||||
},
|
||||
borderRadius: BorderRadius.circular(24.0),
|
||||
child: Container(
|
||||
color: Colors.black87,
|
||||
child: FadeInImage(
|
||||
image: NetworkImage(workoutTree.imageName),
|
||||
placeholder: AssetImage("asset/image/dots.gif"),
|
||||
),
|
||||
));
|
||||
} on Exception catch (_) {
|
||||
String url = Cache.mediaUrl + '/images/' + workoutTree.imageName;
|
||||
image = FadeInImage.assetNetwork(
|
||||
placeholder: 'asset/image/dots.gif',
|
||||
image: url,
|
||||
height: 210,
|
||||
} else {
|
||||
image = Container(
|
||||
//width: cWidth - 30,
|
||||
//height: 210.0,
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
fit: BoxFit.cover,
|
||||
image: AssetImage(workoutTree.imageName),
|
||||
),
|
||||
borderRadius: BorderRadius.all(Radius.circular(24.0)),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -365,6 +367,7 @@ class _MenuPageWidgetState extends State<MenuPageWidget> with Trans, Logging {
|
||||
String badgeKey = workoutMenuTree.nameEnglish;
|
||||
bool show = Cache().getBadges()[badgeKey] != null;
|
||||
int counter = Cache().getBadges()[badgeKey] != null ? Cache().getBadges()[badgeKey] : 0;
|
||||
Widget buttonImage = _getButtonImage(workoutMenuTree, cWidth, cHeight);
|
||||
return Badge(
|
||||
padding: EdgeInsets.all(8),
|
||||
position: BadgePosition.topEnd(top: 3, end: 3),
|
||||
@@ -377,7 +380,11 @@ class _MenuPageWidgetState extends State<MenuPageWidget> with Trans, Logging {
|
||||
color: Colors.white,
|
||||
fontSize: 16,
|
||||
)),
|
||||
child: _getButtonImage(workoutMenuTree, cWidth, cHeight),
|
||||
child: buttonImage == null
|
||||
? Container(
|
||||
color: Colors.red,
|
||||
)
|
||||
: buttonImage,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user