fix: merge fixes

This commit is contained in:
Rafael Saes 2023-08-17 09:44:19 -03:00
parent fcb2d52338
commit 61a50b8365
10 changed files with 83 additions and 121 deletions

View file

@ -77,12 +77,8 @@ class ContactListPage extends BasePage {
final contacts = contactListViewModel.contactsToShow;
final walletContacts = contactListViewModel.walletContactsToShow;
return CollapsibleSectionList(
context: context,
sectionCount: 2,
themeColor: Theme.of(context).primaryTextTheme.titleLarge!.color!,
dividerThemeColor:
Theme.of(context).primaryTextTheme.bodySmall!.decorationColor!,
sectionTitleBuilder: (_, int sectionIndex) {
sectionTitleBuilder: (int sectionIndex) {
var title = S.current.contact_list_contacts;
if (sectionIndex == 0) {

View file

@ -144,7 +144,7 @@ class BalancePage extends StatelessWidget {
: Colors.transparent,
width: 1,
),
color: Theme.of(context).textTheme.titleLarge!.backgroundColor!,
color: Theme.of(context).extension<SyncIndicatorTheme>()!.syncedBackgroundColor,
),
child: Container(
margin: const EdgeInsets.only(top: 16, left: 24, right: 24, bottom: 24),
@ -212,7 +212,7 @@ class BalancePage extends StatelessWidget {
fontSize: 28,
fontFamily: 'Lato',
fontWeight: FontWeight.w800,
color: Theme.of(context).accentTextTheme!.displayMedium!.backgroundColor!,
color: Theme.of(context).extension<BalancePageTheme>()!.assetTitleColor,
height: 1)),
],
),

View file

@ -87,15 +87,11 @@ class MenuWidgetState extends State<MenuWidget> {
final itemCount = SettingActions.all.length;
moneroIcon = Image.asset('assets/images/monero_menu.png',
color: Theme.of(context)
.accentTextTheme
.labelSmall!
.decorationColor!);
color: Theme.of(context).extension<CakeMenuTheme>()!.iconColor);
bitcoinIcon = Image.asset('assets/images/bitcoin_menu.png',
color: Theme.of(context)
.accentTextTheme
.labelSmall!
.decorationColor!);
color: Theme.of(context).extension<CakeMenuTheme>()!.iconColor);
litecoinIcon = Image.asset('assets/images/litecoin_menu.png');
havenIcon = Image.asset('assets/images/haven_menu.png');
return Row(
mainAxisSize: MainAxisSize.max,
@ -115,8 +111,7 @@ class MenuWidgetState extends State<MenuWidget> {
borderRadius: BorderRadius.only(
topLeft: Radius.circular(24), bottomLeft: Radius.circular(24)),
child: Container(
color:
Theme.of(context).extension<CakeMenuTheme>()!.backgroundColor,
color: Theme.of(context).extension<CakeMenuTheme>()!.backgroundColor,
child: ListView.separated(
padding: EdgeInsets.only(top: 0),
itemBuilder: (_, index) {
@ -125,8 +120,13 @@ class MenuWidgetState extends State<MenuWidget> {
height: headerHeight,
decoration: BoxDecoration(
gradient: LinearGradient(colors: [
Theme.of(context).extension<CakeMenuTheme>()!.headerFirstGradientColor,
Theme.of(context).extension<CakeMenuTheme>()!.headerSecondGradientColor, ], begin: Alignment.topLeft, end: Alignment.bottomRight),
Theme.of(context)
.extension<CakeMenuTheme>()!
.headerFirstGradientColor,
Theme.of(context)
.extension<CakeMenuTheme>()!
.headerSecondGradientColor,
], begin: Alignment.topLeft, end: Alignment.bottomRight),
),
padding: EdgeInsets.only(
left: 24, top: fromTopEdge, right: 24, bottom: fromBottomEdge),
@ -155,7 +155,9 @@ class MenuWidgetState extends State<MenuWidget> {
builder: (_) => Text(
widget.dashboardViewModel.subname,
style: TextStyle(
color: Theme.of(context).extension<CakeMenuTheme>()!.subnameTextColor,
color: Theme.of(context)
.extension<CakeMenuTheme>()!
.subnameTextColor,
fontWeight: FontWeight.w500,
fontSize: 12),
))

View file

@ -23,11 +23,11 @@ class AccountTile extends StatelessWidget {
@override
Widget build(BuildContext context) {
final color = isCurrent
? Theme.of(context).textTheme.titleSmall!.decorationColor!
: Theme.of(context).textTheme.displayLarge!.decorationColor!;
? Theme.of(context).extension<AccountListTheme>()!.currentAccountBackgroundColor
: Theme.of(context).extension<AccountListTheme>()!.tilesBackgroundColor;
final textColor = isCurrent
? Theme.of(context).textTheme.titleSmall!.color!
: Theme.of(context).textTheme.displayLarge!.color!;
? Theme.of(context).extension<AccountListTheme>()!.currentAccountTextColor
: Theme.of(context).extension<AccountListTheme>()!.tilesTextColor;
final Widget cell = GestureDetector(
onTap: onTap,
@ -63,7 +63,9 @@ class AccountTile extends StatelessWidget {
fontSize: 15,
fontWeight: FontWeight.w600,
fontFamily: 'Lato',
color: Theme.of(context).textTheme.headlineMedium!.color!,
color: isCurrent
? Theme.of(context).extension<AccountListTheme>()!.currentAccountAmountColor
: Theme.of(context).extension<AccountListTheme>()!.tilesAmountColor,
decoration: TextDecoration.none,
),
),
@ -74,11 +76,7 @@ class AccountTile extends StatelessWidget {
);
// return cell;
return Slidable(
key: Key(accountName),
child: cell,
endActionPane: _actionPane(context)
);
return Slidable(key: Key(accountName), child: cell, endActionPane: _actionPane(context));
}
ActionPane _actionPane(BuildContext context) => ActionPane(

View file

@ -32,8 +32,6 @@ class AnonPayReceivePage extends BasePage {
@override
void onClose(BuildContext context) => Navigator.popUntil(context, (route) => route.isFirst);
void onClose(BuildContext context) => Navigator.popUntil(context, (route) => route.isFirst);
@override
Widget middle(BuildContext context) {
return Column(

View file

@ -63,7 +63,7 @@ class SendPage extends BasePage {
Widget? leading(BuildContext context) {
final _backButton = Icon(
Icons.arrow_back_ios,
color: titleColor,
color: titleColor(context),
size: 16,
);
final _closeButton = currentTheme.type == ThemeType.dark

View file

@ -6,6 +6,7 @@ import 'package:cake_wallet/src/widgets/standard_list.dart';
import 'package:cake_wallet/generated/i18n.dart';
import 'package:cake_wallet/palette.dart';
import 'package:cake_wallet/routes.dart';
import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart';
import 'package:cake_wallet/utils/clipboard_util.dart';
import 'package:cake_wallet/utils/show_bar.dart';
import 'package:cake_wallet/view_model/set_up_2fa_viewmodel.dart';

View file

@ -87,7 +87,7 @@ class WalletKeysPage extends BasePage {
height: 1,
padding: EdgeInsets.only(left: 24),
color: Theme.of(context).accentTextTheme.titleLarge!.backgroundColor!,
child: const SectionDivider(),
child: const HorizontalSectionDivider(),
),
itemCount: walletKeysViewModel.items.length,
itemBuilder: (BuildContext context, int index) {

View file

@ -147,9 +147,7 @@ class _PickerState<Item> extends State<Picker<Item>> {
child: ClipRRect(
borderRadius: BorderRadius.all(Radius.circular(30)),
child: Container(
color: Theme.of(context)
.accentTextTheme.titleLarge!
.color!,
color: Theme.of(context).accentTextTheme.titleLarge!.color!,
child: ConstrainedBox(
constraints: BoxConstraints(
maxHeight: containerHeight,
@ -164,9 +162,7 @@ class _PickerState<Item> extends State<Picker<Item>> {
child: SearchBarWidget(searchController: searchController),
),
Divider(
color: Theme.of(context)
.accentTextTheme.titleLarge!
.backgroundColor!,
color: Theme.of(context).accentTextTheme.titleLarge!.backgroundColor!,
height: 1,
),
if (widget.selectedAtIndex != -1) buildSelectedItem(widget.selectedAtIndex),
@ -214,9 +210,7 @@ class _PickerState<Item> extends State<Picker<Item>> {
Widget itemsList() {
return Container(
color: Theme.of(context)
.accentTextTheme.titleLarge!
.backgroundColor!,
color: Theme.of(context).accentTextTheme.titleLarge!.backgroundColor!,
child: widget.isGridView
? GridView.builder(
padding: EdgeInsets.zero,
@ -236,9 +230,7 @@ class _PickerState<Item> extends State<Picker<Item>> {
shrinkWrap: true,
separatorBuilder: (context, index) => widget.isSeparated
? Divider(
color: Theme.of(context)
.accentTextTheme.titleLarge!
.backgroundColor!,
color: Theme.of(context).accentTextTheme.titleLarge!.backgroundColor!,
height: 1,
)
: const SizedBox(),
@ -263,9 +255,7 @@ class _PickerState<Item> extends State<Picker<Item>> {
},
child: Container(
height: 55,
color: Theme.of(context)
.accentTextTheme.titleLarge!
.color!,
color: Theme.of(context).accentTextTheme.titleLarge!.color!,
padding: EdgeInsets.symmetric(horizontal: 24),
child: Row(
mainAxisSize: MainAxisSize.max,
@ -286,9 +276,7 @@ class _PickerState<Item> extends State<Picker<Item>> {
fontSize: 14,
fontFamily: 'Lato',
fontWeight: FontWeight.w600,
color: Theme.of(context)
.primaryTextTheme.titleLarge!
.color!,
color: Theme.of(context).primaryTextTheme.titleLarge!.color!,
decoration: TextDecoration.none,
),
),
@ -313,9 +301,7 @@ class _PickerState<Item> extends State<Picker<Item>> {
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(6.0),
//border: Border.all(color: ),
color: Theme.of(context)
.textTheme.bodyMedium!
.decorationColor!,
color: Theme.of(context).extension<CakeScrollbarTheme>()!.trackColor,
),
),
),
@ -343,9 +329,7 @@ class _PickerState<Item> extends State<Picker<Item>> {
},
child: Container(
height: 55,
color: Theme.of(context)
.accentTextTheme.titleLarge!
.color!,
color: Theme.of(context).accentTextTheme.titleLarge!.color!,
padding: EdgeInsets.symmetric(horizontal: 24),
child: Row(
mainAxisSize: MainAxisSize.max,
@ -366,9 +350,7 @@ class _PickerState<Item> extends State<Picker<Item>> {
fontSize: 16,
fontFamily: 'Lato',
fontWeight: FontWeight.w700,
color: Theme.of(context)
.primaryTextTheme.titleLarge!
.color!,
color: Theme.of(context).primaryTextTheme.titleLarge!.color!,
decoration: TextDecoration.none,
),
),
@ -393,9 +375,7 @@ class _PickerState<Item> extends State<Picker<Item>> {
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(6.0),
//border: Border.all(color: ),
color: Theme.of(context)
.textTheme.bodyMedium!
.decorationColor!,
color: Theme.of(context).extension<CakeScrollbarTheme>()!.trackColor,
),
),
),

View file

@ -5,8 +5,7 @@ import 'package:cake_wallet/src/widgets/standard_list_status_row.dart';
import 'package:flutter/material.dart';
class StandardListRow extends StatelessWidget {
StandardListRow(
{required this.title, required this.isSelected, this.onTap, this.decoration});
StandardListRow({required this.title, required this.isSelected, this.onTap, this.decoration});
final String title;
final bool isSelected;
@ -23,12 +22,11 @@ class StandardListRow extends StatelessWidget {
child: Container(
height: 56,
padding: EdgeInsets.only(left: 24, right: 24),
decoration: decoration ?? BoxDecoration(
decoration: decoration ??
BoxDecoration(
color: Theme.of(context).colorScheme.background,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
child: Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: <Widget>[
if (leading != null) leading,
buildCenter(context, hasLeftOffset: leading != null),
if (trailing != null) trailing
@ -58,8 +56,8 @@ class StandardListRow extends StatelessWidget {
Widget? buildTrailing(BuildContext context) => null;
Color titleColor(BuildContext context) => isSelected
? Palette.blueCraiola
: Theme.of(context).primaryTextTheme.titleLarge!.color!;
? Theme.of(context).primaryColor
: Theme.of(context).extension<CakeTextTheme>()!.titleColor;
Color _backgroundColor(BuildContext context) {
return Theme.of(context).colorScheme.background;
@ -71,15 +69,12 @@ class SectionHeaderListRow extends StatelessWidget {
Widget build(BuildContext context) => Column(children: [
StandardListSeparator(padding: EdgeInsets.only(left: 24)),
Container(
width: double.infinity,
height: 40,
color: Theme.of(context).colorScheme.background),
width: double.infinity, height: 40, color: Theme.of(context).colorScheme.background),
//StandardListSeparator(padding: EdgeInsets.only(left: 24))
]);
}
class StandardListSeparator extends StatelessWidget {
const StandardListSeparator({this.padding, this.height = 1});
final EdgeInsets? padding;
@ -92,11 +87,7 @@ class StandardListSeparator extends StatelessWidget {
padding: padding,
color: Theme.of(context).colorScheme.background,
child: Container(
height: height,
color: Theme.of(context)
.primaryTextTheme
.titleLarge
?.backgroundColor));
height: height, color: Theme.of(context).primaryTextTheme.titleLarge?.backgroundColor));
}
}
@ -109,8 +100,7 @@ class StandardList extends StatelessWidget {
@override
Widget build(BuildContext context) {
return ListView.separated(
separatorBuilder: (_, __) =>
StandardListSeparator(padding: EdgeInsets.only(left: 24)),
separatorBuilder: (_, __) => StandardListSeparator(padding: EdgeInsets.only(left: 24)),
itemCount: itemCount,
itemBuilder: itemBuilder);
}
@ -178,8 +168,7 @@ class SectionStandardList extends StatelessWidget {
return sectionTitleBuilder!.call(sectionIndex);
}
List<Widget> buildSection(
int itemCount, List<Widget> items, int sectionIndex) {
List<Widget> buildSection(int itemCount, List<Widget> items, int sectionIndex) {
final List<Widget> section = [];
for (var itemIndex = 0; itemIndex < itemCount; itemIndex++) {
@ -192,8 +181,8 @@ class SectionStandardList extends StatelessWidget {
@override
Widget build(BuildContext context) {
totalRows.addAll(transform(hasTopSeparator, sectionCount, itemCounter,
itemBuilder, sectionTitleBuilder));
totalRows.addAll(
transform(hasTopSeparator, sectionCount, itemCounter, itemBuilder, sectionTitleBuilder));
return ListView.separated(
separatorBuilder: (_, index) {
@ -203,16 +192,14 @@ class SectionStandardList extends StatelessWidget {
return Container();
}
if (row is StandardListStatusRow ||
row is TradeDetailsStandardListCard) {
if (row is StandardListStatusRow || row is TradeDetailsStandardListCard) {
return Container();
}
final nextRow = totalRows[index + 1];
// If current row is pre last and last row is separator.
if (nextRow is StandardListSeparator ||
nextRow is SectionHeaderListRow) {
if (nextRow is StandardListSeparator || nextRow is SectionHeaderListRow) {
return Container();
}