diff --git a/lib/main.dart b/lib/main.dart index 15028887e..7367afe6c 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -35,7 +35,7 @@ final themeData = ThemeData( fontFamily: 'Ubuntu', brightness: Brightness.dark, hintColor: Colors.grey, - accentColor: Color.fromRGBO(45, 194, 98, 1.0), + accentColor: Color.fromRGBO(45, 194, 98, 0.2), buttonColor: Color.fromRGBO(45, 194, 98, 1.0), buttonTheme: ButtonThemeData().copyWith( buttonColor: Color.fromRGBO(45, 194, 98, 1.0), diff --git a/lib/ui/backup_folder_selection_page.dart b/lib/ui/backup_folder_selection_page.dart index c97347485..8163dafbf 100644 --- a/lib/ui/backup_folder_selection_page.dart +++ b/lib/ui/backup_folder_selection_page.dart @@ -7,6 +7,7 @@ import 'package:photos/db/files_db.dart'; import 'package:photos/events/backup_folders_updated_event.dart'; import 'package:photos/models/file.dart'; import 'package:photos/ui/collections_gallery_widget.dart'; +import 'package:photos/ui/common_elements.dart'; import 'package:photos/ui/loading_widget.dart'; import 'package:photos/ui/thumbnail_widget.dart'; @@ -59,27 +60,9 @@ class _BackupFolderSelectionPageState extends State { padding: EdgeInsets.only(left: 60, right: 60), width: double.infinity, height: 64, - child: OutlinedButton( - style: OutlinedButton.styleFrom( - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10), - ), - padding: EdgeInsets.fromLTRB(50, 16, 50, 16), - side: BorderSide( - width: 2, - color: Theme.of(context).accentColor, - ), - ), - child: Text( - "preserve", - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 18, - letterSpacing: 1.0, - color: Colors.white, - ), - textAlign: TextAlign.center, - ), + child: button( + "preserve", + fontSize: 18, onPressed: _backedupFolders.length == 0 ? null : () { diff --git a/lib/ui/collections_gallery_widget.dart b/lib/ui/collections_gallery_widget.dart index 48314e090..bc35ea806 100644 --- a/lib/ui/collections_gallery_widget.dart +++ b/lib/ui/collections_gallery_widget.dart @@ -183,12 +183,12 @@ class _CollectionsGalleryWidgetState extends State ), side: BorderSide( width: 1, - color: Theme.of(context).accentColor.withOpacity(0.4), + color: Theme.of(context).buttonColor.withOpacity(0.4), ), ), child: Icon( Icons.add, - color: Theme.of(context).accentColor.withOpacity(0.7), + color: Theme.of(context).buttonColor.withOpacity(0.7), ), onPressed: () async { await showToast( diff --git a/lib/ui/common_elements.dart b/lib/ui/common_elements.dart index f86e59924..6fa0b284b 100644 --- a/lib/ui/common_elements.dart +++ b/lib/ui/common_elements.dart @@ -26,7 +26,7 @@ Widget button( ), padding: EdgeInsets.fromLTRB(50, 16, 50, 16), side: BorderSide( - width: 2, + width: onPressed == null ? 1 : 2, color: onPressed == null ? Colors.grey : Color.fromRGBO(45, 194, 98, 1.0), diff --git a/lib/ui/email_entry_page.dart b/lib/ui/email_entry_page.dart index a5add6957..a9bc1c426 100644 --- a/lib/ui/email_entry_page.dart +++ b/lib/ui/email_entry_page.dart @@ -219,7 +219,7 @@ class _EmailEntryPageState extends State { padding: EdgeInsets.all(20), ), _getAgreement(), - Padding(padding: EdgeInsets.all(16)), + Padding(padding: EdgeInsets.all(20)), Container( width: double.infinity, height: 64, diff --git a/lib/ui/huge_listview/lazy_loading_gallery.dart b/lib/ui/huge_listview/lazy_loading_gallery.dart index 0e5de20ac..8a148fde4 100644 --- a/lib/ui/huge_listview/lazy_loading_gallery.dart +++ b/lib/ui/huge_listview/lazy_loading_gallery.dart @@ -311,7 +311,7 @@ class _LazyLoadingGridViewState extends State { border: widget.selectedFiles.files.contains(file) ? Border.all( width: 4.0, - color: Theme.of(context).accentColor, + color: Theme.of(context).buttonColor, ) : null, ), diff --git a/lib/ui/landing_page.dart b/lib/ui/landing_page.dart index 562b43327..ca4d124fc 100644 --- a/lib/ui/landing_page.dart +++ b/lib/ui/landing_page.dart @@ -1,12 +1,7 @@ -import 'dart:async'; - import 'package:dots_indicator/dots_indicator.dart'; import 'package:flutter/material.dart'; import 'package:flutter/widgets.dart'; import 'package:photos/core/configuration.dart'; -import 'package:photos/core/event_bus.dart'; -import 'package:photos/events/subscription_purchased_event.dart'; -import 'package:photos/services/billing_service.dart'; import 'package:photos/ui/email_entry_page.dart'; import 'package:photos/ui/login_page.dart'; import 'package:photos/ui/password_entry_page.dart'; @@ -21,141 +16,122 @@ class LandingPage extends StatefulWidget { } class _LandingPageState extends State { - StreamSubscription _userAuthEventSubscription; double _featureIndex = 0; - @override - void initState() { - _userAuthEventSubscription = - Bus.instance.on().listen((event) { - setState(() {}); - }); - super.initState(); - } - - @override - void dispose() { - _userAuthEventSubscription.cancel(); - super.dispose(); - } - @override Widget build(BuildContext context) { - var hasConfiguredAccount = Configuration.instance.hasConfiguredAccount(); - var hasSubscription = BillingService.instance.getSubscription() != null; - if (hasConfiguredAccount && hasSubscription) { - return Container(); - } else { - return _getBody(context); - } + return Scaffold(body: _getBody(), resizeToAvoidBottomInset: false); } - Widget _getBody(BuildContext context) { - return Container( - padding: EdgeInsets.fromLTRB(8, 40, 8, 8), - child: Column( - children: [ - Text.rich( - TextSpan( - children: [ - TextSpan( - text: "with ", - style: TextStyle( - fontSize: 16, + Widget _getBody() { + return SingleChildScrollView( + physics: NeverScrollableScrollPhysics(), + child: Container( + padding: EdgeInsets.fromLTRB(8, 40, 8, 8), + child: Column( + children: [ + Text.rich( + TextSpan( + children: [ + TextSpan( + text: "with ", + style: TextStyle( + fontSize: 16, + ), ), - ), - TextSpan( - text: "ente", - style: TextStyle( - fontWeight: FontWeight.bold, - fontFamily: 'Montserrat', - fontSize: 16, + TextSpan( + text: "ente", + style: TextStyle( + fontWeight: FontWeight.bold, + fontFamily: 'Montserrat', + fontSize: 16, + ), ), - ), - ], + ], + ), + textAlign: TextAlign.center, ), - textAlign: TextAlign.center, - ), - Padding( - padding: EdgeInsets.all(2), - ), - Text.rich( - TextSpan( - children: [ - TextSpan( - text: "your ", - style: TextStyle( - fontSize: 16, - ), - ), - TextSpan( - text: "memories", - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 16, - ), - ), - TextSpan( - text: " are", - style: TextStyle( - fontSize: 16, - ), - ), - ], + Padding( + padding: EdgeInsets.all(2), ), - textAlign: TextAlign.center, - ), - Padding( - padding: EdgeInsets.all(24), - ), - _getFeatureSlider(), - new DotsIndicator( - dotsCount: 3, - position: _featureIndex, - decorator: DotsDecorator( - color: Colors.white24, // Inactive color - activeColor: Theme.of(context).buttonColor, + Text.rich( + TextSpan( + children: [ + TextSpan( + text: "your ", + style: TextStyle( + fontSize: 16, + ), + ), + TextSpan( + text: "memories", + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 16, + ), + ), + TextSpan( + text: " are", + style: TextStyle( + fontSize: 16, + ), + ), + ], + ), + textAlign: TextAlign.center, ), - ), - Padding( - padding: EdgeInsets.all(28), - ), - _getSignUpButton(context), - Padding( - padding: EdgeInsets.all(4), - ), - GestureDetector( - behavior: HitTestBehavior.translucent, - child: Container( - width: double.infinity, + Padding( + padding: EdgeInsets.all(24), + ), + _getFeatureSlider(), + new DotsIndicator( + dotsCount: 3, + position: _featureIndex, + decorator: DotsDecorator( + color: Colors.white24, // Inactive color + activeColor: Theme.of(context).buttonColor, + ), + ), + Padding( padding: EdgeInsets.all(28), - child: Center( - child: Hero( - tag: "sign_in", - child: Material( - type: MaterialType.transparency, - child: Text( - "sign in", - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 16, - letterSpacing: 0.6, + ), + _getSignUpButton(context), + Padding( + padding: EdgeInsets.all(4), + ), + GestureDetector( + behavior: HitTestBehavior.translucent, + child: Container( + width: double.infinity, + padding: EdgeInsets.all(28), + child: Center( + child: Hero( + tag: "sign_in", + child: Material( + type: MaterialType.transparency, + child: Text( + "sign in", + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 16, + letterSpacing: 0.6, + ), ), ), ), ), ), + onTap: _navigateToSignInPage, ), - onTap: _navigateToSignInPage, - ), - Padding( - padding: EdgeInsets.all(4), - ), - Divider( - height: 1, - color: Theme.of(context).buttonColor.withOpacity(0.5), - ), - ], + Padding( + padding: EdgeInsets.all(4), + ), + Divider( + height: 1, + color: Theme.of(context).buttonColor.withOpacity(0.5), + ), + ], + ), ), ); } @@ -173,7 +149,7 @@ class _LandingPageState extends State { padding: EdgeInsets.fromLTRB(50, 16, 50, 16), side: BorderSide( width: 2, - color: Theme.of(context).accentColor, + color: Theme.of(context).buttonColor, ), ), child: Hero( @@ -196,7 +172,8 @@ class _LandingPageState extends State { } Widget _getFeatureSlider() { - return Expanded( + return ConstrainedBox( + constraints: BoxConstraints(maxHeight: 320), child: PageView( children: [ _getProtectedFeature(), diff --git a/lib/ui/memories_widget.dart b/lib/ui/memories_widget.dart index deb60b3a8..5707e67e1 100644 --- a/lib/ui/memories_widget.dart +++ b/lib/ui/memories_widget.dart @@ -162,7 +162,7 @@ class MemoryWidget extends StatelessWidget { border: isSeen ? Border() : Border.all( - color: Theme.of(context).accentColor, + color: Theme.of(context).buttonColor, width: isSeen ? 0 : 2, ), borderRadius: BorderRadius.circular(40), diff --git a/lib/ui/ott_verification_page.dart b/lib/ui/ott_verification_page.dart index 8d22bed25..ec8152fe6 100644 --- a/lib/ui/ott_verification_page.dart +++ b/lib/ui/ott_verification_page.dart @@ -44,7 +44,7 @@ class _OTTVerificationPageState extends State { Text( Configuration.instance.getEmail(), style: TextStyle( - color: Theme.of(context).accentColor, + color: Theme.of(context).buttonColor, fontSize: 18, ), ), @@ -73,6 +73,9 @@ class _OTTVerificationPageState extends State { }, ), ), + Padding( + padding: EdgeInsets.all(12), + ), Container( padding: const EdgeInsets.fromLTRB(60, 0, 60, 0), width: double.infinity, diff --git a/lib/ui/settings/settings_section_title.dart b/lib/ui/settings/settings_section_title.dart index 90b1e0a4a..e5961fe65 100644 --- a/lib/ui/settings/settings_section_title.dart +++ b/lib/ui/settings/settings_section_title.dart @@ -16,7 +16,7 @@ class SettingsSectionTitle extends StatelessWidget { style: TextStyle( fontWeight: FontWeight.bold, fontSize: 16, - color: Theme.of(context).accentColor, + color: Theme.of(context).buttonColor, ), ), ), diff --git a/lib/ui/shared_collections_gallery.dart b/lib/ui/shared_collections_gallery.dart index 89232c688..1903f0125 100644 --- a/lib/ui/shared_collections_gallery.dart +++ b/lib/ui/shared_collections_gallery.dart @@ -174,7 +174,7 @@ class _SharedCollectionGalleryState extends State padding: EdgeInsets.fromLTRB(50, 16, 50, 16), side: BorderSide( width: 1, - color: Theme.of(context).accentColor.withOpacity(0.4), + color: Theme.of(context).buttonColor.withOpacity(0.4), ), ), child: Row( @@ -224,7 +224,7 @@ class _SharedCollectionGalleryState extends State padding: EdgeInsets.fromLTRB(50, 16, 50, 16), side: BorderSide( width: 1, - color: Theme.of(context).accentColor.withOpacity(0.4), + color: Theme.of(context).buttonColor.withOpacity(0.4), ), ), child: Row( @@ -393,7 +393,7 @@ class IncomingCollectionItem extends StatelessWidget { margin: EdgeInsets.fromLTRB(0, 0, 4, 0), decoration: BoxDecoration( shape: BoxShape.circle, - color: Theme.of(context).accentColor, + color: Theme.of(context).buttonColor, ), ), ), diff --git a/lib/ui/subscription_page.dart b/lib/ui/subscription_page.dart index fcc89e848..b78ea3d8f 100644 --- a/lib/ui/subscription_page.dart +++ b/lib/ui/subscription_page.dart @@ -542,7 +542,7 @@ class FaqWidget extends StatelessWidget { Widget build(BuildContext context) { return ExpansionCard( title: Text(faq.q), - color: Theme.of(context).accentColor, + color: Theme.of(context).buttonColor, children: [ Padding( padding: const EdgeInsets.only(left: 16, right: 16), @@ -664,7 +664,7 @@ class SubscriptionPlanWidget extends StatelessWidget { ? Expanded( child: Icon( Icons.check_circle, - color: Theme.of(context).accentColor, + color: Theme.of(context).buttonColor, ), ) : Container(), diff --git a/lib/ui/sync_indicator.dart b/lib/ui/sync_indicator.dart index ed04aac0b..c3ce4ab60 100644 --- a/lib/ui/sync_indicator.dart +++ b/lib/ui/sync_indicator.dart @@ -67,7 +67,7 @@ class _SyncIndicatorState extends State { final icon = _event.status == SyncStatus.completed_backup ? Icon( Icons.cloud_done_outlined, - color: Theme.of(context).accentColor, + color: Theme.of(context).buttonColor, ) : _inProgressIcon; return AnimatedContainer( @@ -118,7 +118,7 @@ class _SyncIndicatorState extends State { children: [ Icon( Icons.error_outline, - color: Theme.of(context).accentColor, + color: Theme.of(context).buttonColor, ), Padding(padding: EdgeInsets.all(4)), Text("your subscription has expired"), @@ -154,7 +154,7 @@ class _SyncIndicatorState extends State { children: [ Icon( Icons.error_outline, - color: Theme.of(context).accentColor, + color: Theme.of(context).buttonColor, ), Padding(padding: EdgeInsets.all(4)), Text("storage limit exceeded"), @@ -189,7 +189,7 @@ class _SyncIndicatorState extends State { children: [ Icon( Icons.error_outline, - color: Theme.of(context).accentColor, + color: Theme.of(context).buttonColor, ), Padding(padding: EdgeInsets.all(4)), Text(_event.reason ?? "upload failed"), diff --git a/lib/ui/video_controls.dart b/lib/ui/video_controls.dart index 4b1c39164..046244494 100644 --- a/lib/ui/video_controls.dart +++ b/lib/ui/video_controls.dart @@ -288,7 +288,7 @@ class _VideoControlsState extends State { }, colors: chewieController.materialProgressColors ?? ChewieProgressColors( - playedColor: Theme.of(context).accentColor, + playedColor: Theme.of(context).buttonColor, handleColor: Colors.white, bufferedColor: Colors.white, backgroundColor: Theme.of(context).disabledColor),