mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-06-29 02:07:39 +08:00
Add a basic Purchase Thank you screen
This commit is contained in:
@ -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,
|
||||
|
@ -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) {
|
||||
|
37
lib/screens/purchase_thankyou_screen.dart
Normal file
37
lib/screens/purchase_thankyou_screen.dart
Normal 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
|
Reference in New Issue
Block a user