mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-07-02 12:56:16 +08:00
PurchaseScreen: Add an AppBar
I was trying to make the PurchaseScreen prettier, but this doesn't work with large fonts, for now I'm just going to go with a standard material design *shrug*
This commit is contained in:
@ -1,5 +1,4 @@
|
|||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'dart:io';
|
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
@ -11,7 +10,9 @@ class PurchaseScreen extends StatelessWidget {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return WillPopScope(
|
return WillPopScope(
|
||||||
child: Scaffold(
|
child: Scaffold(
|
||||||
appBar: EmptyAppBar(),
|
appBar: AppBar(
|
||||||
|
title: const Text('Pro Version'),
|
||||||
|
),
|
||||||
body: buildBody(context),
|
body: buildBody(context),
|
||||||
),
|
),
|
||||||
onWillPop: _onWillPop,
|
onWillPop: _onWillPop,
|
||||||
@ -19,9 +20,6 @@ class PurchaseScreen extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Widget buildBody(BuildContext context) {
|
Widget buildBody(BuildContext context) {
|
||||||
var theme = Theme.of(context);
|
|
||||||
var textTheme = theme.textTheme;
|
|
||||||
|
|
||||||
// FIXME: This screen needs to be made way way more beautiful
|
// FIXME: This screen needs to be made way way more beautiful
|
||||||
// It's an extrememly important screen
|
// It's an extrememly important screen
|
||||||
|
|
||||||
@ -65,17 +63,8 @@ class PurchaseScreen extends StatelessWidget {
|
|||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|
||||||
var titleStyle =
|
|
||||||
textTheme.headline3.copyWith(color: textTheme.headline6.color);
|
|
||||||
|
|
||||||
Widget w = Column(
|
Widget w = Column(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Text(
|
|
||||||
'Pro Version',
|
|
||||||
style: titleStyle,
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
),
|
|
||||||
const SizedBox(height: 32.0),
|
|
||||||
body,
|
body,
|
||||||
const SizedBox(height: 32.0),
|
const SizedBox(height: 32.0),
|
||||||
PurchaseWidget(),
|
PurchaseWidget(),
|
||||||
@ -84,7 +73,7 @@ class PurchaseScreen extends StatelessWidget {
|
|||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
);
|
);
|
||||||
|
|
||||||
w = CustomScrollView(
|
return CustomScrollView(
|
||||||
slivers: [
|
slivers: [
|
||||||
SliverFillRemaining(
|
SliverFillRemaining(
|
||||||
hasScrollBody: false,
|
hasScrollBody: false,
|
||||||
@ -92,26 +81,6 @@ class PurchaseScreen extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|
||||||
if (Platform.isIOS) {
|
|
||||||
w = Stack(
|
|
||||||
alignment: FractionalOffset.topLeft,
|
|
||||||
children: <Widget>[
|
|
||||||
w,
|
|
||||||
InkWell(
|
|
||||||
child: Container(
|
|
||||||
child: const Icon(Icons.arrow_back, size: 32.0),
|
|
||||||
padding: const EdgeInsets.all(8.0),
|
|
||||||
),
|
|
||||||
onTap: () => Navigator.of(context).pop(),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return SafeArea(
|
|
||||||
child: w,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<bool> _onWillPop() async {
|
Future<bool> _onWillPop() async {
|
||||||
@ -121,13 +90,3 @@ class PurchaseScreen extends StatelessWidget {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class EmptyAppBar extends StatelessWidget implements PreferredSizeWidget {
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return Container(color: Theme.of(context).primaryColor);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
Size get preferredSize => const Size(0.0, 0.0);
|
|
||||||
}
|
|
||||||
|
Reference in New Issue
Block a user