minor fix for custom elevated button theme elevation
This commit is contained in:
parent
ca6209410b
commit
878482796d
11 changed files with 36 additions and 24 deletions
|
@ -22,9 +22,10 @@ extension CustomColorScheme on ColorScheme {
|
|||
|
||||
// todo: use brightness == Brightness.light for changing color for dark/light theme
|
||||
ButtonStyle get optionalActionButtonStyle => buildElevatedButtonThemeData(
|
||||
onPrimary: Colors.black87,
|
||||
primary: Color.fromRGBO(240, 240, 240, 1),
|
||||
).style;
|
||||
onPrimary: Color(0xFF777777),
|
||||
primary: Color(0xFFF0F0F0),
|
||||
elevation: 0)
|
||||
.style;
|
||||
}
|
||||
|
||||
OutlinedButtonThemeData buildOutlinedButtonThemeData(
|
||||
|
@ -65,10 +66,12 @@ OutlinedButtonThemeData buildOutlinedButtonThemeData(
|
|||
|
||||
ElevatedButtonThemeData buildElevatedButtonThemeData(
|
||||
{@required Color onPrimary, // text button color
|
||||
@required Color primary // background color of button
|
||||
@required Color primary,
|
||||
double elevation = 2 // background color of button
|
||||
}) {
|
||||
return ElevatedButtonThemeData(
|
||||
style: ElevatedButton.styleFrom(
|
||||
elevation: elevation,
|
||||
onPrimary: onPrimary,
|
||||
primary: primary,
|
||||
alignment: Alignment.center,
|
||||
|
@ -77,7 +80,7 @@ ElevatedButtonThemeData buildElevatedButtonThemeData(
|
|||
fontFamily: 'Inter-SemiBold',
|
||||
fontSize: 18,
|
||||
),
|
||||
padding: EdgeInsets.symmetric(vertical: 14),
|
||||
padding: EdgeInsets.symmetric(vertical: 18),
|
||||
shape: const RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.all(Radius.circular(8)),
|
||||
),
|
||||
|
|
|
@ -3,13 +3,13 @@ import 'dart:math' as math;
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:photos/ente_theme_data.dart';
|
||||
|
||||
class FABCreateAccount extends StatelessWidget {
|
||||
class DynamicFAB extends StatelessWidget {
|
||||
final bool isKeypadOpen;
|
||||
final bool isFormValid;
|
||||
final String buttonText;
|
||||
final Function onPressedFunction;
|
||||
|
||||
const FABCreateAccount(
|
||||
const DynamicFAB(
|
||||
{this.isKeypadOpen,
|
||||
this.buttonText,
|
||||
this.isFormValid,
|
|
@ -6,7 +6,8 @@ class GradientButton extends StatelessWidget {
|
|||
final List<Color> linearGradientColors;
|
||||
final Function onTap;
|
||||
|
||||
GradientButton({this.child, this.linearGradientColors, this.onTap});
|
||||
GradientButton({Key key, this.child, this.linearGradientColors, this.onTap})
|
||||
: super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
@ -15,6 +16,14 @@ class GradientButton extends StatelessWidget {
|
|||
child: Container(
|
||||
height: 56,
|
||||
decoration: BoxDecoration(
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
spreadRadius: 0,
|
||||
offset: Offset(0, 4),
|
||||
color: Colors.black.withOpacity(0.2),
|
||||
blurRadius: 2,
|
||||
)
|
||||
],
|
||||
gradient: LinearGradient(
|
||||
begin: Alignment(0.1, -0.9),
|
||||
end: Alignment(-0.6, 0.9),
|
||||
|
|
|
@ -10,7 +10,7 @@ import 'package:photos/core/configuration.dart';
|
|||
import 'package:photos/models/billing_plan.dart';
|
||||
import 'package:photos/services/billing_service.dart';
|
||||
import 'package:photos/services/user_service.dart';
|
||||
import 'package:photos/ui/common/fabCreateAccount.dart';
|
||||
import 'package:photos/ui/common/dynamicFAB.dart';
|
||||
//import 'package:photos/ui/common/report_bug_popup.dart';
|
||||
//import 'package:photos/ui/common_elements.dart';
|
||||
import 'package:photos/ui/loading_widget.dart';
|
||||
|
@ -110,7 +110,7 @@ class _EmailEntryPageState extends State<EmailEntryPage> {
|
|||
return Scaffold(
|
||||
appBar: appBar,
|
||||
body: _getBody(),
|
||||
floatingActionButton: FABCreateAccount(
|
||||
floatingActionButton: DynamicFAB(
|
||||
isKeypadOpen: isKeypadOpen,
|
||||
isFormValid: _isFormValid(),
|
||||
buttonText: 'Create Account',
|
||||
|
|
|
@ -474,13 +474,13 @@ class _HomeWidgetState extends State<HomeWidget> {
|
|||
width: 180,
|
||||
child: ClipRect(
|
||||
child: BackdropFilter(
|
||||
filter: ImageFilter.blur(sigmaX: 20, sigmaY: 20),
|
||||
filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10),
|
||||
child: GNav(
|
||||
curve: Curves.easeOutExpo,
|
||||
backgroundColor: Theme.of(context).bottomAppBarColor,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
rippleColor: Theme.of(context).buttonColor.withOpacity(0.20),
|
||||
hoverColor: Theme.of(context).buttonColor.withOpacity(0.20),
|
||||
rippleColor: Colors.white.withOpacity(0.2),
|
||||
hoverColor: Colors.white.withOpacity(0.2),
|
||||
activeColor: Colors.black,
|
||||
iconSize: 24,
|
||||
padding: EdgeInsets.fromLTRB(16, 8, 16, 8),
|
||||
|
|
|
@ -98,7 +98,7 @@ class _LandingPageWidgetState extends State<LandingPageWidget> {
|
|||
_getSignUpButton(context),
|
||||
Container(
|
||||
width: double.infinity,
|
||||
padding: EdgeInsets.fromLTRB(24, 12, 24, 28),
|
||||
padding: EdgeInsets.fromLTRB(20, 12, 20, 28),
|
||||
child: Hero(
|
||||
tag: "log_in",
|
||||
child: ElevatedButton(
|
||||
|
|
|
@ -10,7 +10,7 @@ import 'package:photos/ui/web_page.dart';
|
|||
import 'package:photos/utils/dialog_util.dart';
|
||||
import 'package:photos/utils/email_util.dart';
|
||||
|
||||
import 'common/fabCreateAccount.dart';
|
||||
import 'common/dynamicFAB.dart';
|
||||
|
||||
class LoginPage extends StatefulWidget {
|
||||
LoginPage({Key key}) : super(key: key);
|
||||
|
@ -55,7 +55,7 @@ class _LoginPageState extends State<LoginPage> {
|
|||
),
|
||||
),
|
||||
body: _getBody(),
|
||||
floatingActionButton: FABCreateAccount(
|
||||
floatingActionButton: DynamicFAB(
|
||||
isKeypadOpen: isKeypadOpen,
|
||||
isFormValid: _emailIsValid,
|
||||
buttonText: 'Log in',
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:photos/services/user_service.dart';
|
||||
import 'package:photos/ui/common/fabCreateAccount.dart';
|
||||
import 'package:photos/ui/common/dynamicFAB.dart';
|
||||
import 'package:photos/ui/common/report_bug_popup.dart';
|
||||
import 'package:photos/ui/common_elements.dart';
|
||||
import 'package:step_progress_indicator/step_progress_indicator.dart';
|
||||
|
@ -63,7 +63,7 @@ class _OTTVerificationPageState extends State<OTTVerificationPage> {
|
|||
: null,
|
||||
),
|
||||
body: _getBody(),
|
||||
floatingActionButton: FABCreateAccount(
|
||||
floatingActionButton: DynamicFAB(
|
||||
isKeypadOpen: isKeypadOpen,
|
||||
isFormValid: !(_verificationCodeController.text == null ||
|
||||
_verificationCodeController.text.isEmpty),
|
||||
|
|
|
@ -17,7 +17,7 @@ import 'package:photos/ui/web_page.dart';
|
|||
import 'package:photos/utils/dialog_util.dart';
|
||||
import 'package:photos/utils/toast_util.dart';
|
||||
|
||||
import 'common/fabCreateAccount.dart';
|
||||
import 'common/dynamicFAB.dart';
|
||||
|
||||
enum PasswordEntryMode {
|
||||
set,
|
||||
|
@ -114,7 +114,7 @@ class _PasswordEntryPageState extends State<PasswordEntryPage> {
|
|||
elevation: 0,
|
||||
),
|
||||
body: _getBody(title),
|
||||
floatingActionButton: FABCreateAccount(
|
||||
floatingActionButton: DynamicFAB(
|
||||
isKeypadOpen: isKeypadOpen,
|
||||
isFormValid: _passwordsMatch,
|
||||
buttonText: title,
|
||||
|
|
|
@ -7,7 +7,7 @@ import 'package:photos/events/subscription_purchased_event.dart';
|
|||
import 'package:photos/ui/recovery_page.dart';
|
||||
import 'package:photos/utils/dialog_util.dart';
|
||||
|
||||
import 'common/fabCreateAccount.dart';
|
||||
import 'common/dynamicFAB.dart';
|
||||
|
||||
class PasswordReentryPage extends StatefulWidget {
|
||||
PasswordReentryPage({Key key}) : super(key: key);
|
||||
|
@ -56,7 +56,7 @@ class _PasswordReentryPageState extends State<PasswordReentryPage> {
|
|||
),
|
||||
),
|
||||
body: _getBody(),
|
||||
floatingActionButton: FABCreateAccount(
|
||||
floatingActionButton: DynamicFAB(
|
||||
isKeypadOpen: isKeypadOpen,
|
||||
isFormValid: _passwordController.text.isNotEmpty,
|
||||
buttonText: 'Log in',
|
||||
|
|
|
@ -6,7 +6,7 @@ import 'package:photos/ui/password_entry_page.dart';
|
|||
import 'package:photos/utils/dialog_util.dart';
|
||||
import 'package:photos/utils/toast_util.dart';
|
||||
|
||||
import 'common/fabCreateAccount.dart';
|
||||
import 'common/dynamicFAB.dart';
|
||||
|
||||
class RecoveryPage extends StatefulWidget {
|
||||
const RecoveryPage({Key key}) : super(key: key);
|
||||
|
@ -31,7 +31,7 @@ class _RecoveryPageState extends State<RecoveryPage> {
|
|||
},
|
||||
),
|
||||
),
|
||||
floatingActionButton: FABCreateAccount(
|
||||
floatingActionButton: DynamicFAB(
|
||||
isKeypadOpen: false,
|
||||
isFormValid: _recoveryKey.text.isNotEmpty,
|
||||
buttonText: 'Recover',
|
||||
|
|
Loading…
Add table
Reference in a new issue