Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Use GradientButton in onboarding page

AmanRajSinghMouryacb6cfb5fbc70
diff --git a/mobile/apps/locker/lib/ui/components/gradient_button.dart b/mobile/apps/locker/lib/ui/components/gradient_button.dart
index 4579a26686..aeb98589b8 100644
--- a/mobile/apps/locker/lib/ui/components/gradient_button.dart
+++ b/mobile/apps/locker/lib/ui/components/gradient_button.dart
@@ -8,6 +8,7 @@ class GradientButton extends StatelessWidget {
final HugeIcon? hugeIcon;
final double paddingValue;
final Color? backgroundColor;
+ final Color? textColor;
const GradientButton({
super.key,
@@ -16,6 +17,7 @@ class GradientButton extends StatelessWidget {
this.hugeIcon,
this.paddingValue = 6.0,
this.backgroundColor,
+ this.textColor,
});
static const TextStyle _textStyle = TextStyle(
@@ -31,8 +33,10 @@ class GradientButton extends StatelessWidget {
final bool isEnabled = onTap != null;
final Color effectiveBackgroundColor = backgroundColor ??
(isEnabled ? colorScheme.primary700 : colorScheme.fillFaint);
+ final Color effectiveTextColor =
+ textColor ?? (isEnabled ? Colors.white : colorScheme.textMuted);
final TextStyle effectiveTextStyle = _textStyle.copyWith(
- color: isEnabled ? Colors.white : colorScheme.textMuted,
+ color: effectiveTextColor,
);
final Widget textWidget = Text(text, style: effectiveTextStyle);
diff --git a/mobile/apps/locker/lib/ui/pages/onboarding_page.dart b/mobile/apps/locker/lib/ui/pages/onboarding_page.dart
index 12d1d5ad42..71d3a6f40d 100644
--- a/mobile/apps/locker/lib/ui/pages/onboarding_page.dart
+++ b/mobile/apps/locker/lib/ui/pages/onboarding_page.dart
@@ -13,6 +13,7 @@ import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:locker/l10n/l10n.dart';
import 'package:locker/services/configuration.dart';
+import "package:locker/ui/components/gradient_button.dart";
import "package:locker/ui/components/new_account_dialog.dart";
import 'package:locker/ui/pages/home_page.dart';
@@ -185,29 +186,13 @@ class _OnboardingPageState extends State<OnboardingPage> {
),
),
const SizedBox(height: 48),
- Container(
- width: double.infinity,
+ Padding(
padding: const EdgeInsets.symmetric(horizontal: 24),
- child: ElevatedButton(
- style: ElevatedButton.styleFrom(
- backgroundColor: Colors.white,
- foregroundColor: colorScheme.primary700,
- padding: const EdgeInsets.symmetric(
- horizontal: 8,
- vertical: 18,
- ),
- shape: RoundedRectangleBorder(
- borderRadius: BorderRadius.circular(20),
- ),
- minimumSize: const Size(double.infinity, 56),
- ),
- onPressed: _navigateToSignInPage,
- child: Text(
- l10n.loginToEnteAccount,
- style: getEnteTextTheme(context).bodyBold.copyWith(
- color: colorScheme.primary700,
- ),
- ),
+ child: GradientButton(
+ text: l10n.loginToEnteAccount,
+ backgroundColor: Colors.white,
+ textColor: colorScheme.primary700,
+ onTap: _navigateToSignInPage,
),
),
const SizedBox(height: 16),