Skip to content

Commit

Permalink
feat: black background in activity and profile page (#1461)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaxiii committed Jun 2, 2024
1 parent 93709a1 commit 2556641
Show file tree
Hide file tree
Showing 12 changed files with 45 additions and 45 deletions.
2 changes: 1 addition & 1 deletion packages/espressocash_app/lib/app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class _EspressoCashAppState extends State<EspressoCashApp> {

@override
Widget build(BuildContext context) => CpTheme(
theme: const CpThemeData.light(),
theme: const CpThemeData.dark(),
child: Builder(
builder: (context) => MaterialApp(
home: const SplashScreen(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import 'package:flutter/material.dart' hide Notification;

import '../../../l10n/l10n.dart';
import '../../../ui/app_bar.dart';
import '../../../ui/page_fade_wrapper.dart';
import '../../../ui/colors.dart';
import '../../../ui/tab_bar.dart';
import '../widgets/pending_activities_list.dart';
import '../widgets/transaction_list.dart';
Expand Down Expand Up @@ -58,21 +58,18 @@ class _ActivitiesScreenState extends State<ActivitiesScreen>
);

Widget mapWrapper(ActivitiesTab tab) => switch (tab) {
ActivitiesTab.pending => _Wrapper(
child: PendingActivitiesList(
padding: insets,
onSendMoneyPressed: widget.onSendMoneyPressed,
),
ActivitiesTab.pending => PendingActivitiesList(
padding: insets,
onSendMoneyPressed: widget.onSendMoneyPressed,
),
ActivitiesTab.transactions => _Wrapper(
child: TransactionList(
padding: insets,
onSendMoneyPressed: widget.onSendMoneyPressed,
),
ActivitiesTab.transactions => TransactionList(
padding: insets,
onSendMoneyPressed: widget.onSendMoneyPressed,
),
};

return PageFadeWrapper(
return ColoredBox(
color: CpColors.dashboardBackgroundColor,
child: Column(
children: [
CpAppBar(
Expand Down Expand Up @@ -100,20 +97,3 @@ class _ActivitiesScreenState extends State<ActivitiesScreen>
}

const double _padding = 40;

class _Wrapper extends StatelessWidget {
const _Wrapper({required this.child});

final Widget child;

@override
Widget build(BuildContext context) => Stack(
children: [
child,
const FadeGradient(
height: _padding,
direction: FadeGradientDirection.topDown,
),
],
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ class CpActivityTile extends StatelessWidget {
const _titleStyle = TextStyle(
fontSize: 16,
letterSpacing: .23,
color: CpColors.lightGreyBackground,
fontWeight: FontWeight.w600,
);

Expand All @@ -88,6 +89,7 @@ const _inAmountStyle = TextStyle(

const _subtitleStyle = TextStyle(
fontSize: 14,
color: CpColors.secondaryTextColor,
letterSpacing: .19,
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import '../../../../gen/assets.gen.dart';
import '../../../../l10n/l10n.dart';
import '../../../../ui/button.dart';
import '../../../../ui/navigation_bar/navigation_bar.dart';
import '../../../ui/colors.dart';

class NoActivity extends StatelessWidget {
const NoActivity({super.key, required this.onSendMoneyPressed});
Expand All @@ -19,7 +20,12 @@ class NoActivity extends StatelessWidget {
const Spacer(),
Assets.images.logoIcon.image(height: 101),
const SizedBox(height: 21),
Text(context.l10n.noActivity),
Text(
context.l10n.noActivity,
style: Theme.of(context).textTheme.bodyMedium?.copyWith(
color: CpColors.secondaryTextColor,
),
),
const Spacer(),
CpButton(
text: context.l10n.requestOrSendPayment,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import '../../../../../ui/icon_button.dart';
import '../../../../../ui/user_avatar.dart';
import '../../../di.dart';
import '../../../ui/clipboard.dart';
import '../../../ui/colors.dart';
import '../../accounts/models/account.dart';
import '../data/profile_repository.dart';
import '../widgets/help_section.dart';
Expand All @@ -29,7 +30,7 @@ class ProfileScreen extends StatelessWidget {
@override
Widget build(BuildContext context) => Scaffold(
body: Material(
color: const Color(0xffF4F4F4),
color: CpColors.darkBackground,
child: SingleChildScrollView(
child: SafeArea(
maintainBottomViewPadding: true,
Expand Down Expand Up @@ -142,7 +143,7 @@ class _QrCodeWidget extends StatelessWidget {
alignment: Alignment.center,
padding: const EdgeInsets.symmetric(vertical: 16, horizontal: 24),
decoration: const BoxDecoration(
color: Colors.white,
color: CpColors.darkBackgroundColor,
borderRadius: BorderRadius.all(Radius.circular(16)),
),
child: Row(
Expand All @@ -152,6 +153,7 @@ class _QrCodeWidget extends StatelessWidget {
barcode: Barcode.qrCode(),
data: qrData,
padding: EdgeInsets.zero,
color: CpColors.lightGreyBackground,
),
),
const SizedBox(width: 8),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@ class DangerSection extends StatelessWidget {
ProfileButton(
label: context.l10n.signOut,
onPressed: () => _handleLogoutPressed(context),
color: CpColors.primaryColor,
textColor: CpColors.dangerButtonTextColor,
backgroundColor: CpColors.darkOrangeButtonBackground,
iconColor: CpColors.dangerButtonChevronColor,
),
],
color: CpColors.primaryAccentColor,
color: CpColors.darkOrangeButtonBackground,
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,29 @@ class ProfileButton extends StatelessWidget {
required this.label,
this.description,
this.onPressed,
this.color = CpColors.primaryTextColor,
this.textColor = CpColors.lightGreyBackground,
this.iconColor,
this.backgroundColor,
});

final String label;
final String? description;
final Color color;
final VoidCallback? onPressed;
final Color textColor;
final Color? backgroundColor;
final Color? iconColor;

@override
Widget build(BuildContext context) {
final description = this.description;

return ListTile(
tileColor: backgroundColor,
onTap: onPressed,
title: Text(
label,
style: TextStyle(
color: color,
color: textColor,
fontSize: 17,
fontWeight: FontWeight.bold,
),
Expand All @@ -41,7 +46,7 @@ class ProfileButton extends StatelessWidget {
),
)
: null,
trailing: Icon(Icons.chevron_right, color: color),
trailing: Icon(Icons.chevron_right, color: iconColor),
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class ProfileSection extends StatelessWidget {
super.key,
this.title,
required this.actions,
this.color = Colors.white,
this.color = CpColors.darkBackgroundColor,
required this.padding,
});

Expand All @@ -51,7 +51,7 @@ class ProfileSection extends StatelessWidget {
style: const TextStyle(
fontSize: 13,
fontWeight: FontWeight.bold,
color: CpColors.menuPrimaryTextColor,
color: CpColors.lightGreyBackground,
),
),
),
Expand Down
3 changes: 3 additions & 0 deletions packages/espressocash_app/lib/ui/colors.dart
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ abstract class CpColors {
static const disabledColor = Color(0xffbbbbbb);
static const accentDisabledColor = Color(0xffff8666);
static const errorChipColor = Color(0xffe8452f);
static const dangerButtonTextColor = Color(0xffe85c30);
static const dangerButtonChevronColor = Color(0xfff5734a);

static const lightPillBackgroundColor = Color(0xffeaeaea);

Expand All @@ -66,6 +68,7 @@ abstract class CpColors {
static const yellowSplashBackgroundColor = Color(0xffB4A270);

static const darkOrangeBackgroundColor = Color(0xFFD86322);
static const darkOrangeButtonBackground = Color(0xFF794630);
static const goldBackgroundColor = Color(0xFFC8B57D);
static const darkGoldBackgroundColor = Color(0xffA08A4B);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/espressocash_app/lib/ui/profile_switch.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class ProfileSwitch extends StatelessWidget {
const ProfileSwitch({
super.key,
required this.label,
this.color = CpColors.primaryTextColor,
this.color = CpColors.lightGreyBackground,
required this.value,
required this.onChanged,
required this.subtitle,
Expand Down
2 changes: 1 addition & 1 deletion packages/espressocash_app/lib/ui/tab_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ enum CpTabBarVariant { dark, inverted, light, black }
class CpTabBar extends StatelessWidget {
const CpTabBar({
super.key,
this.variant = CpTabBarVariant.dark,
this.variant = CpTabBarVariant.black,
required this.tabs,
this.controller,
});
Expand Down
4 changes: 2 additions & 2 deletions packages/espressocash_app/lib/ui/web_view_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ class WebViewScreen extends StatefulWidget {
required this.url,
this.title,
this.onLoaded,
this.theme,
});
CpThemeData? theme,
}) : theme = theme ?? const CpThemeData.black();

static Future<void> push(
BuildContext context, {
Expand Down

0 comments on commit 2556641

Please sign in to comment.