Add a basic Purchase Thank you screen

This commit is contained in:
Vishesh Handa
2020-04-14 15:35:37 +02:00
parent 22b32d9fc3
commit fa63c98d6d
3 changed files with 40 additions and 2 deletions

View File

@ -5,6 +5,7 @@ import 'package:firebase_analytics/firebase_analytics.dart';
import 'package:firebase_analytics/observer.dart';
import 'package:flutter/material.dart';
import 'package:gitjournal/screens/purchase_screen.dart';
import 'package:gitjournal/screens/purchase_thankyou_screen.dart';
import 'package:gitjournal/utils/logger.dart';
import 'package:provider/provider.dart';
import 'package:path/path.dart' as p;
@ -137,6 +138,7 @@ class JournalApp extends StatelessWidget {
'/onBoarding': (context) =>
OnBoardingScreen(stateContainer.completeOnBoarding),
'/purchase': (context) => PurchaseScreen(),
'/purchase_thank_you': (context) => PurchaseThankYouScreen(),
},
debugShowCheckedModeBanner: false,
//debugShowMaterialGrid: true,

View File

@ -97,8 +97,7 @@ class PurchaseButton extends StatelessWidget {
Settings.instance.proMode = true;
Settings.instance.save();
// vHanda FIXME: Show some screen to indicate bought purchase?
Navigator.of(context).pop();
Navigator.of(context).popAndPushNamed('/purchase_thank_you');
return;
}
} on PlatformException catch (e) {

View File

@ -0,0 +1,37 @@
import 'package:flutter/material.dart';
class PurchaseThankYouScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
var theme = Theme.of(context);
var textTheme = theme.textTheme;
Widget w = Column(
children: <Widget>[
Text('Thank you', style: textTheme.display2),
Text(
"You're awesome for supporting GitJournal",
style: textTheme.display1,
textAlign: TextAlign.center,
),
RaisedButton(
child: const Text("Back"),
color: theme.primaryColor,
onPressed: () {
Navigator.of(context).pop();
},
padding: const EdgeInsets.fromLTRB(64.0, 16.0, 64.0, 16.0),
)
],
mainAxisAlignment: MainAxisAlignment.spaceAround,
);
return Container(
child: SafeArea(child: w),
color: theme.scaffoldBackgroundColor,
padding: const EdgeInsets.all(16.0),
);
}
}
// Ideas:
// 1. Add a button to share about GitJournal on Twitter / Social Media over here