浏览代码

Merge pull request #262 from ente-io/on-bording-screen-fixes

Subscription screen fixes
Neeraj Gupta 3 年之前
父节点
当前提交
01b41164a1

+ 4 - 0
lib/ente_theme_data.dart

@@ -43,6 +43,10 @@ extension CustomColorScheme on ColorScheme {
   Color get cancelSelectedButtonColor => brightness == Brightness.light
       ? Color.fromRGBO(0, 0, 0, 0.35)
       : Color.fromRGBO(16, 16, 16, 0.5);
+
+  Color get bgColorForQuestions => brightness == Brightness.light
+      ? Colors.white
+      : Color.fromRGBO(10, 15, 15, 1.0);
 }
 
 OutlinedButtonThemeData buildOutlinedButtonThemeData(

+ 2 - 0
lib/ui/billing_questions_widget.dart

@@ -66,6 +66,8 @@ class FaqWidget extends StatelessWidget {
   @override
   Widget build(BuildContext context) {
     return ExpansionTileCard(
+      borderRadius: BorderRadius.all(Radius.circular(0)),
+      elevation: 0,
       title: Text(faq.q),
       expandedTextColor: Theme.of(context).buttonColor,
       baseColor: Theme.of(context).cardColor,

+ 0 - 1
lib/ui/password_entry_page.dart

@@ -124,7 +124,6 @@ class _PasswordEntryPageState extends State<PasswordEntryPage> {
   }
 
   Widget _getBody(String buttonTextAndHeading) {
-    final isKeypadOpen = MediaQuery.of(context).viewInsets.bottom != 0;
     final email = Configuration.instance.getEmail();
     var passwordStrengthText = 'Weak';
     var passwordStrengthColor = Colors.redAccent;

+ 1 - 1
lib/ui/payment/payment_web_page.dart

@@ -156,7 +156,7 @@ class _PaymentWebPageState extends State<PaymentWebPage> {
             child: Text(
               'no',
               style: TextStyle(
-                color: Colors.white,
+                color: Theme.of(context).buttonColor,
               ),
             ),
             onPressed: () => Navigator.of(context).pop(false),

+ 2 - 2
lib/ui/payment/skip_subscription_widget.dart

@@ -19,8 +19,8 @@ class SkipSubscriptionWidget extends StatelessWidget {
     return Container(
       width: double.infinity,
       height: 64,
-      margin: const EdgeInsets.fromLTRB(0, 30, 0, 30),
-      padding: const EdgeInsets.fromLTRB(50, 0, 50, 0),
+      margin: const EdgeInsets.fromLTRB(0, 30, 0, 0),
+      padding: const EdgeInsets.fromLTRB(20, 0, 20, 0),
       child: OutlinedButton(
         child: Text("Continue on free plan"),
         style: Theme.of(context).outlinedButtonTheme.style.copyWith(

+ 36 - 20
lib/ui/payment/stripe_subscription_page.dart

@@ -8,6 +8,7 @@ import 'package:photos/models/subscription.dart';
 import 'package:photos/models/user_details.dart';
 import 'package:photos/services/billing_service.dart';
 import 'package:photos/services/user_service.dart';
+import 'package:photos/ui/common/bottomShadow.dart';
 import 'package:photos/ui/common/dialogs.dart';
 import 'package:photos/ui/loading_widget.dart';
 import 'package:photos/ui/payment/child_subscription_widget.dart';
@@ -112,29 +113,44 @@ class _StripeSubscriptionPageState extends State<StripeSubscriptionPage> {
 
   @override
   Widget build(BuildContext context) {
-    // final appBar = AppBar(
-    //   title: Text("Subscription"),
-    // );
-    final appBar = widget.isOnboarding
-        ? AppBar(
-            elevation: 0,
-            title: Hero(
-                tag: "subscription",
-                child: StepProgressIndicator(
-                  totalSteps: 4,
-                  currentStep: 4,
-                  selectedColor: Theme.of(context).buttonColor,
-                  roundedEdges: Radius.circular(10),
-                  unselectedColor: Theme.of(context).bottomAppBarColor,
+    final appBar = PreferredSize(
+      preferredSize: Size(double.infinity, 60),
+      child: Container(
+          decoration: BoxDecoration(boxShadow: [
+            BoxShadow(
+                color: Theme.of(context).backgroundColor,
+                blurRadius: 16,
+                offset: Offset(0, 8))
+          ]),
+          child: widget.isOnboarding
+              ? AppBar(
+                  elevation: 0,
+                  title: Hero(
+                      tag: "subscription",
+                      child: StepProgressIndicator(
+                        totalSteps: 4,
+                        currentStep: 4,
+                        selectedColor: Theme.of(context).buttonColor,
+                        roundedEdges: Radius.circular(10),
+                        unselectedColor: Theme.of(context).bottomAppBarColor,
+                      )),
+                )
+              : AppBar(
+                  elevation: 0,
+                  title: Text("Subscription"),
                 )),
-          )
-        : AppBar(
-            elevation: 0,
-            title: Text("Subscription"),
-          );
+    );
     return Scaffold(
       appBar: appBar,
-      body: _getBody(),
+      body: Stack(
+        alignment: Alignment.bottomCenter,
+        children: [
+          _getBody(),
+          BottomShadowWidget(
+            offsetDy: 40,
+          )
+        ],
+      ),
     );
   }
 

+ 3 - 2
lib/ui/payment/subscription_common_widgets.dart

@@ -1,5 +1,6 @@
 import 'package:flutter/material.dart';
 import 'package:flutter/widgets.dart';
+import 'package:photos/ente_theme_data.dart';
 import 'package:photos/models/subscription.dart';
 import 'package:photos/ui/billing_questions_widget.dart';
 import 'package:photos/utils/data_util.dart';
@@ -111,7 +112,7 @@ class SubFaqWidget extends StatelessWidget {
         behavior: HitTestBehavior.translucent,
         onTap: () {
           showModalBottomSheet<void>(
-            backgroundColor: Color.fromRGBO(10, 15, 15, 1.0),
+            backgroundColor: Theme.of(context).colorScheme.bgColorForQuestions,
             barrierColor: Colors.black87,
             context: context,
             builder: (context) {
@@ -126,7 +127,7 @@ class SubFaqWidget extends StatelessWidget {
               text: "Questions?",
               style: TextStyle(
                 color: Colors.blue,
-                fontFamily: 'Ubuntu',
+                fontFamily: 'Inter',
               ),
             ),
           ),