From a6708912810dcb4d83321cb4665511d8250769ad Mon Sep 17 00:00:00 2001 From: Vishesh Handa Date: Wed, 12 Aug 2020 18:06:44 +0200 Subject: [PATCH] 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* --- lib/screens/purchase_screen.dart | 49 +++----------------------------- 1 file changed, 4 insertions(+), 45 deletions(-) diff --git a/lib/screens/purchase_screen.dart b/lib/screens/purchase_screen.dart index a9bbb075..e2314147 100644 --- a/lib/screens/purchase_screen.dart +++ b/lib/screens/purchase_screen.dart @@ -1,5 +1,4 @@ import 'dart:async'; -import 'dart:io'; import 'package:flutter/material.dart'; @@ -11,7 +10,9 @@ class PurchaseScreen extends StatelessWidget { Widget build(BuildContext context) { return WillPopScope( child: Scaffold( - appBar: EmptyAppBar(), + appBar: AppBar( + title: const Text('Pro Version'), + ), body: buildBody(context), ), onWillPop: _onWillPop, @@ -19,9 +20,6 @@ class PurchaseScreen extends StatelessWidget { } Widget buildBody(BuildContext context) { - var theme = Theme.of(context); - var textTheme = theme.textTheme; - // FIXME: This screen needs to be made way way more beautiful // 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( children: [ - Text( - 'Pro Version', - style: titleStyle, - textAlign: TextAlign.center, - ), - const SizedBox(height: 32.0), body, const SizedBox(height: 32.0), PurchaseWidget(), @@ -84,7 +73,7 @@ class PurchaseScreen extends StatelessWidget { mainAxisSize: MainAxisSize.min, ); - w = CustomScrollView( + return CustomScrollView( slivers: [ SliverFillRemaining( hasScrollBody: false, @@ -92,26 +81,6 @@ class PurchaseScreen extends StatelessWidget { ), ], ); - - if (Platform.isIOS) { - w = Stack( - alignment: FractionalOffset.topLeft, - children: [ - 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 _onWillPop() async { @@ -121,13 +90,3 @@ class PurchaseScreen extends StatelessWidget { 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); -}