mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-01-03 09:29:48 +00:00
fix: merge fixes
This commit is contained in:
parent
fcb2d52338
commit
61a50b8365
10 changed files with 83 additions and 121 deletions
|
@ -77,12 +77,8 @@ class ContactListPage extends BasePage {
|
||||||
final contacts = contactListViewModel.contactsToShow;
|
final contacts = contactListViewModel.contactsToShow;
|
||||||
final walletContacts = contactListViewModel.walletContactsToShow;
|
final walletContacts = contactListViewModel.walletContactsToShow;
|
||||||
return CollapsibleSectionList(
|
return CollapsibleSectionList(
|
||||||
context: context,
|
|
||||||
sectionCount: 2,
|
sectionCount: 2,
|
||||||
themeColor: Theme.of(context).primaryTextTheme.titleLarge!.color!,
|
sectionTitleBuilder: (int sectionIndex) {
|
||||||
dividerThemeColor:
|
|
||||||
Theme.of(context).primaryTextTheme.bodySmall!.decorationColor!,
|
|
||||||
sectionTitleBuilder: (_, int sectionIndex) {
|
|
||||||
var title = S.current.contact_list_contacts;
|
var title = S.current.contact_list_contacts;
|
||||||
|
|
||||||
if (sectionIndex == 0) {
|
if (sectionIndex == 0) {
|
||||||
|
|
|
@ -144,7 +144,7 @@ class BalancePage extends StatelessWidget {
|
||||||
: Colors.transparent,
|
: Colors.transparent,
|
||||||
width: 1,
|
width: 1,
|
||||||
),
|
),
|
||||||
color: Theme.of(context).textTheme.titleLarge!.backgroundColor!,
|
color: Theme.of(context).extension<SyncIndicatorTheme>()!.syncedBackgroundColor,
|
||||||
),
|
),
|
||||||
child: Container(
|
child: Container(
|
||||||
margin: const EdgeInsets.only(top: 16, left: 24, right: 24, bottom: 24),
|
margin: const EdgeInsets.only(top: 16, left: 24, right: 24, bottom: 24),
|
||||||
|
@ -212,7 +212,7 @@ class BalancePage extends StatelessWidget {
|
||||||
fontSize: 28,
|
fontSize: 28,
|
||||||
fontFamily: 'Lato',
|
fontFamily: 'Lato',
|
||||||
fontWeight: FontWeight.w800,
|
fontWeight: FontWeight.w800,
|
||||||
color: Theme.of(context).accentTextTheme!.displayMedium!.backgroundColor!,
|
color: Theme.of(context).extension<BalancePageTheme>()!.assetTitleColor,
|
||||||
height: 1)),
|
height: 1)),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|
|
@ -20,18 +20,18 @@ class MenuWidget extends StatefulWidget {
|
||||||
|
|
||||||
class MenuWidgetState extends State<MenuWidget> {
|
class MenuWidgetState extends State<MenuWidget> {
|
||||||
MenuWidgetState()
|
MenuWidgetState()
|
||||||
: this.menuWidth = 0,
|
: this.menuWidth = 0,
|
||||||
this.screenWidth = 0,
|
this.screenWidth = 0,
|
||||||
this.screenHeight = 0,
|
this.screenHeight = 0,
|
||||||
this.headerHeight = 120,
|
this.headerHeight = 120,
|
||||||
this.tileHeight = 60,
|
this.tileHeight = 60,
|
||||||
this.fromTopEdge = 50,
|
this.fromTopEdge = 50,
|
||||||
this.fromBottomEdge = 25,
|
this.fromBottomEdge = 25,
|
||||||
this.moneroIcon = Image.asset('assets/images/monero_menu.png'),
|
this.moneroIcon = Image.asset('assets/images/monero_menu.png'),
|
||||||
this.bitcoinIcon = Image.asset('assets/images/bitcoin_menu.png'),
|
this.bitcoinIcon = Image.asset('assets/images/bitcoin_menu.png'),
|
||||||
this.litecoinIcon = Image.asset('assets/images/litecoin_menu.png'),
|
this.litecoinIcon = Image.asset('assets/images/litecoin_menu.png'),
|
||||||
this.havenIcon = Image.asset('assets/images/haven_menu.png'),
|
this.havenIcon = Image.asset('assets/images/haven_menu.png'),
|
||||||
this.ethereumIcon = Image.asset('assets/images/eth_icon.png');
|
this.ethereumIcon = Image.asset('assets/images/eth_icon.png');
|
||||||
|
|
||||||
final largeScreen = 731;
|
final largeScreen = 731;
|
||||||
|
|
||||||
|
@ -87,15 +87,11 @@ class MenuWidgetState extends State<MenuWidget> {
|
||||||
final itemCount = SettingActions.all.length;
|
final itemCount = SettingActions.all.length;
|
||||||
|
|
||||||
moneroIcon = Image.asset('assets/images/monero_menu.png',
|
moneroIcon = Image.asset('assets/images/monero_menu.png',
|
||||||
color: Theme.of(context)
|
color: Theme.of(context).extension<CakeMenuTheme>()!.iconColor);
|
||||||
.accentTextTheme
|
|
||||||
.labelSmall!
|
|
||||||
.decorationColor!);
|
|
||||||
bitcoinIcon = Image.asset('assets/images/bitcoin_menu.png',
|
bitcoinIcon = Image.asset('assets/images/bitcoin_menu.png',
|
||||||
color: Theme.of(context)
|
color: Theme.of(context).extension<CakeMenuTheme>()!.iconColor);
|
||||||
.accentTextTheme
|
litecoinIcon = Image.asset('assets/images/litecoin_menu.png');
|
||||||
.labelSmall!
|
havenIcon = Image.asset('assets/images/haven_menu.png');
|
||||||
.decorationColor!);
|
|
||||||
|
|
||||||
return Row(
|
return Row(
|
||||||
mainAxisSize: MainAxisSize.max,
|
mainAxisSize: MainAxisSize.max,
|
||||||
|
@ -115,8 +111,7 @@ class MenuWidgetState extends State<MenuWidget> {
|
||||||
borderRadius: BorderRadius.only(
|
borderRadius: BorderRadius.only(
|
||||||
topLeft: Radius.circular(24), bottomLeft: Radius.circular(24)),
|
topLeft: Radius.circular(24), bottomLeft: Radius.circular(24)),
|
||||||
child: Container(
|
child: Container(
|
||||||
color:
|
color: Theme.of(context).extension<CakeMenuTheme>()!.backgroundColor,
|
||||||
Theme.of(context).extension<CakeMenuTheme>()!.backgroundColor,
|
|
||||||
child: ListView.separated(
|
child: ListView.separated(
|
||||||
padding: EdgeInsets.only(top: 0),
|
padding: EdgeInsets.only(top: 0),
|
||||||
itemBuilder: (_, index) {
|
itemBuilder: (_, index) {
|
||||||
|
@ -125,8 +120,13 @@ class MenuWidgetState extends State<MenuWidget> {
|
||||||
height: headerHeight,
|
height: headerHeight,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
gradient: LinearGradient(colors: [
|
gradient: LinearGradient(colors: [
|
||||||
Theme.of(context).extension<CakeMenuTheme>()!.headerFirstGradientColor,
|
Theme.of(context)
|
||||||
Theme.of(context).extension<CakeMenuTheme>()!.headerSecondGradientColor, ], begin: Alignment.topLeft, end: Alignment.bottomRight),
|
.extension<CakeMenuTheme>()!
|
||||||
|
.headerFirstGradientColor,
|
||||||
|
Theme.of(context)
|
||||||
|
.extension<CakeMenuTheme>()!
|
||||||
|
.headerSecondGradientColor,
|
||||||
|
], begin: Alignment.topLeft, end: Alignment.bottomRight),
|
||||||
),
|
),
|
||||||
padding: EdgeInsets.only(
|
padding: EdgeInsets.only(
|
||||||
left: 24, top: fromTopEdge, right: 24, bottom: fromBottomEdge),
|
left: 24, top: fromTopEdge, right: 24, bottom: fromBottomEdge),
|
||||||
|
@ -155,7 +155,9 @@ class MenuWidgetState extends State<MenuWidget> {
|
||||||
builder: (_) => Text(
|
builder: (_) => Text(
|
||||||
widget.dashboardViewModel.subname,
|
widget.dashboardViewModel.subname,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Theme.of(context).extension<CakeMenuTheme>()!.subnameTextColor,
|
color: Theme.of(context)
|
||||||
|
.extension<CakeMenuTheme>()!
|
||||||
|
.subnameTextColor,
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
fontSize: 12),
|
fontSize: 12),
|
||||||
))
|
))
|
||||||
|
|
|
@ -23,11 +23,11 @@ class AccountTile extends StatelessWidget {
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final color = isCurrent
|
final color = isCurrent
|
||||||
? Theme.of(context).textTheme.titleSmall!.decorationColor!
|
? Theme.of(context).extension<AccountListTheme>()!.currentAccountBackgroundColor
|
||||||
: Theme.of(context).textTheme.displayLarge!.decorationColor!;
|
: Theme.of(context).extension<AccountListTheme>()!.tilesBackgroundColor;
|
||||||
final textColor = isCurrent
|
final textColor = isCurrent
|
||||||
? Theme.of(context).textTheme.titleSmall!.color!
|
? Theme.of(context).extension<AccountListTheme>()!.currentAccountTextColor
|
||||||
: Theme.of(context).textTheme.displayLarge!.color!;
|
: Theme.of(context).extension<AccountListTheme>()!.tilesTextColor;
|
||||||
|
|
||||||
final Widget cell = GestureDetector(
|
final Widget cell = GestureDetector(
|
||||||
onTap: onTap,
|
onTap: onTap,
|
||||||
|
@ -63,7 +63,9 @@ class AccountTile extends StatelessWidget {
|
||||||
fontSize: 15,
|
fontSize: 15,
|
||||||
fontWeight: FontWeight.w600,
|
fontWeight: FontWeight.w600,
|
||||||
fontFamily: 'Lato',
|
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,
|
decoration: TextDecoration.none,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -74,24 +76,20 @@ class AccountTile extends StatelessWidget {
|
||||||
);
|
);
|
||||||
|
|
||||||
// return cell;
|
// return cell;
|
||||||
return Slidable(
|
return Slidable(key: Key(accountName), child: cell, endActionPane: _actionPane(context));
|
||||||
key: Key(accountName),
|
|
||||||
child: cell,
|
|
||||||
endActionPane: _actionPane(context)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ActionPane _actionPane(BuildContext context) => ActionPane(
|
ActionPane _actionPane(BuildContext context) => ActionPane(
|
||||||
motion: const ScrollMotion(),
|
motion: const ScrollMotion(),
|
||||||
extentRatio: 0.3,
|
extentRatio: 0.3,
|
||||||
children: [
|
children: [
|
||||||
SlidableAction(
|
SlidableAction(
|
||||||
onPressed: (_) => onEdit.call(),
|
onPressed: (_) => onEdit.call(),
|
||||||
backgroundColor: Colors.blue,
|
backgroundColor: Colors.blue,
|
||||||
foregroundColor: Colors.white,
|
foregroundColor: Colors.white,
|
||||||
icon: Icons.edit,
|
icon: Icons.edit,
|
||||||
label: S.of(context).edit,
|
label: S.of(context).edit,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,8 +32,6 @@ class AnonPayReceivePage extends BasePage {
|
||||||
@override
|
@override
|
||||||
void onClose(BuildContext context) => Navigator.popUntil(context, (route) => route.isFirst);
|
void onClose(BuildContext context) => Navigator.popUntil(context, (route) => route.isFirst);
|
||||||
|
|
||||||
void onClose(BuildContext context) => Navigator.popUntil(context, (route) => route.isFirst);
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget middle(BuildContext context) {
|
Widget middle(BuildContext context) {
|
||||||
return Column(
|
return Column(
|
||||||
|
|
|
@ -63,7 +63,7 @@ class SendPage extends BasePage {
|
||||||
Widget? leading(BuildContext context) {
|
Widget? leading(BuildContext context) {
|
||||||
final _backButton = Icon(
|
final _backButton = Icon(
|
||||||
Icons.arrow_back_ios,
|
Icons.arrow_back_ios,
|
||||||
color: titleColor,
|
color: titleColor(context),
|
||||||
size: 16,
|
size: 16,
|
||||||
);
|
);
|
||||||
final _closeButton = currentTheme.type == ThemeType.dark
|
final _closeButton = currentTheme.type == ThemeType.dark
|
||||||
|
|
|
@ -6,6 +6,7 @@ import 'package:cake_wallet/src/widgets/standard_list.dart';
|
||||||
import 'package:cake_wallet/generated/i18n.dart';
|
import 'package:cake_wallet/generated/i18n.dart';
|
||||||
import 'package:cake_wallet/palette.dart';
|
import 'package:cake_wallet/palette.dart';
|
||||||
import 'package:cake_wallet/routes.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/clipboard_util.dart';
|
||||||
import 'package:cake_wallet/utils/show_bar.dart';
|
import 'package:cake_wallet/utils/show_bar.dart';
|
||||||
import 'package:cake_wallet/view_model/set_up_2fa_viewmodel.dart';
|
import 'package:cake_wallet/view_model/set_up_2fa_viewmodel.dart';
|
||||||
|
|
|
@ -87,7 +87,7 @@ class WalletKeysPage extends BasePage {
|
||||||
height: 1,
|
height: 1,
|
||||||
padding: EdgeInsets.only(left: 24),
|
padding: EdgeInsets.only(left: 24),
|
||||||
color: Theme.of(context).accentTextTheme.titleLarge!.backgroundColor!,
|
color: Theme.of(context).accentTextTheme.titleLarge!.backgroundColor!,
|
||||||
child: const SectionDivider(),
|
child: const HorizontalSectionDivider(),
|
||||||
),
|
),
|
||||||
itemCount: walletKeysViewModel.items.length,
|
itemCount: walletKeysViewModel.items.length,
|
||||||
itemBuilder: (BuildContext context, int index) {
|
itemBuilder: (BuildContext context, int index) {
|
||||||
|
|
|
@ -147,9 +147,7 @@ class _PickerState<Item> extends State<Picker<Item>> {
|
||||||
child: ClipRRect(
|
child: ClipRRect(
|
||||||
borderRadius: BorderRadius.all(Radius.circular(30)),
|
borderRadius: BorderRadius.all(Radius.circular(30)),
|
||||||
child: Container(
|
child: Container(
|
||||||
color: Theme.of(context)
|
color: Theme.of(context).accentTextTheme.titleLarge!.color!,
|
||||||
.accentTextTheme.titleLarge!
|
|
||||||
.color!,
|
|
||||||
child: ConstrainedBox(
|
child: ConstrainedBox(
|
||||||
constraints: BoxConstraints(
|
constraints: BoxConstraints(
|
||||||
maxHeight: containerHeight,
|
maxHeight: containerHeight,
|
||||||
|
@ -164,9 +162,7 @@ class _PickerState<Item> extends State<Picker<Item>> {
|
||||||
child: SearchBarWidget(searchController: searchController),
|
child: SearchBarWidget(searchController: searchController),
|
||||||
),
|
),
|
||||||
Divider(
|
Divider(
|
||||||
color: Theme.of(context)
|
color: Theme.of(context).accentTextTheme.titleLarge!.backgroundColor!,
|
||||||
.accentTextTheme.titleLarge!
|
|
||||||
.backgroundColor!,
|
|
||||||
height: 1,
|
height: 1,
|
||||||
),
|
),
|
||||||
if (widget.selectedAtIndex != -1) buildSelectedItem(widget.selectedAtIndex),
|
if (widget.selectedAtIndex != -1) buildSelectedItem(widget.selectedAtIndex),
|
||||||
|
@ -214,9 +210,7 @@ class _PickerState<Item> extends State<Picker<Item>> {
|
||||||
|
|
||||||
Widget itemsList() {
|
Widget itemsList() {
|
||||||
return Container(
|
return Container(
|
||||||
color: Theme.of(context)
|
color: Theme.of(context).accentTextTheme.titleLarge!.backgroundColor!,
|
||||||
.accentTextTheme.titleLarge!
|
|
||||||
.backgroundColor!,
|
|
||||||
child: widget.isGridView
|
child: widget.isGridView
|
||||||
? GridView.builder(
|
? GridView.builder(
|
||||||
padding: EdgeInsets.zero,
|
padding: EdgeInsets.zero,
|
||||||
|
@ -236,9 +230,7 @@ class _PickerState<Item> extends State<Picker<Item>> {
|
||||||
shrinkWrap: true,
|
shrinkWrap: true,
|
||||||
separatorBuilder: (context, index) => widget.isSeparated
|
separatorBuilder: (context, index) => widget.isSeparated
|
||||||
? Divider(
|
? Divider(
|
||||||
color: Theme.of(context)
|
color: Theme.of(context).accentTextTheme.titleLarge!.backgroundColor!,
|
||||||
.accentTextTheme.titleLarge!
|
|
||||||
.backgroundColor!,
|
|
||||||
height: 1,
|
height: 1,
|
||||||
)
|
)
|
||||||
: const SizedBox(),
|
: const SizedBox(),
|
||||||
|
@ -263,9 +255,7 @@ class _PickerState<Item> extends State<Picker<Item>> {
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
height: 55,
|
height: 55,
|
||||||
color: Theme.of(context)
|
color: Theme.of(context).accentTextTheme.titleLarge!.color!,
|
||||||
.accentTextTheme.titleLarge!
|
|
||||||
.color!,
|
|
||||||
padding: EdgeInsets.symmetric(horizontal: 24),
|
padding: EdgeInsets.symmetric(horizontal: 24),
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisSize: MainAxisSize.max,
|
mainAxisSize: MainAxisSize.max,
|
||||||
|
@ -286,9 +276,7 @@ class _PickerState<Item> extends State<Picker<Item>> {
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
fontFamily: 'Lato',
|
fontFamily: 'Lato',
|
||||||
fontWeight: FontWeight.w600,
|
fontWeight: FontWeight.w600,
|
||||||
color: Theme.of(context)
|
color: Theme.of(context).primaryTextTheme.titleLarge!.color!,
|
||||||
.primaryTextTheme.titleLarge!
|
|
||||||
.color!,
|
|
||||||
decoration: TextDecoration.none,
|
decoration: TextDecoration.none,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -313,9 +301,7 @@ class _PickerState<Item> extends State<Picker<Item>> {
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.circular(6.0),
|
borderRadius: BorderRadius.circular(6.0),
|
||||||
//border: Border.all(color: ),
|
//border: Border.all(color: ),
|
||||||
color: Theme.of(context)
|
color: Theme.of(context).extension<CakeScrollbarTheme>()!.trackColor,
|
||||||
.textTheme.bodyMedium!
|
|
||||||
.decorationColor!,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -343,9 +329,7 @@ class _PickerState<Item> extends State<Picker<Item>> {
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
height: 55,
|
height: 55,
|
||||||
color: Theme.of(context)
|
color: Theme.of(context).accentTextTheme.titleLarge!.color!,
|
||||||
.accentTextTheme.titleLarge!
|
|
||||||
.color!,
|
|
||||||
padding: EdgeInsets.symmetric(horizontal: 24),
|
padding: EdgeInsets.symmetric(horizontal: 24),
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisSize: MainAxisSize.max,
|
mainAxisSize: MainAxisSize.max,
|
||||||
|
@ -366,9 +350,7 @@ class _PickerState<Item> extends State<Picker<Item>> {
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
fontFamily: 'Lato',
|
fontFamily: 'Lato',
|
||||||
fontWeight: FontWeight.w700,
|
fontWeight: FontWeight.w700,
|
||||||
color: Theme.of(context)
|
color: Theme.of(context).primaryTextTheme.titleLarge!.color!,
|
||||||
.primaryTextTheme.titleLarge!
|
|
||||||
.color!,
|
|
||||||
decoration: TextDecoration.none,
|
decoration: TextDecoration.none,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -393,9 +375,7 @@ class _PickerState<Item> extends State<Picker<Item>> {
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.circular(6.0),
|
borderRadius: BorderRadius.circular(6.0),
|
||||||
//border: Border.all(color: ),
|
//border: Border.all(color: ),
|
||||||
color: Theme.of(context)
|
color: Theme.of(context).extension<CakeScrollbarTheme>()!.trackColor,
|
||||||
.textTheme.bodyMedium!
|
|
||||||
.decorationColor!,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
@ -5,8 +5,7 @@ import 'package:cake_wallet/src/widgets/standard_list_status_row.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
class StandardListRow extends StatelessWidget {
|
class StandardListRow extends StatelessWidget {
|
||||||
StandardListRow(
|
StandardListRow({required this.title, required this.isSelected, this.onTap, this.decoration});
|
||||||
{required this.title, required this.isSelected, this.onTap, this.decoration});
|
|
||||||
|
|
||||||
final String title;
|
final String title;
|
||||||
final bool isSelected;
|
final bool isSelected;
|
||||||
|
@ -23,16 +22,15 @@ class StandardListRow extends StatelessWidget {
|
||||||
child: Container(
|
child: Container(
|
||||||
height: 56,
|
height: 56,
|
||||||
padding: EdgeInsets.only(left: 24, right: 24),
|
padding: EdgeInsets.only(left: 24, right: 24),
|
||||||
decoration: decoration ?? BoxDecoration(
|
decoration: decoration ??
|
||||||
color: Theme.of(context).colorScheme.background,
|
BoxDecoration(
|
||||||
),
|
color: Theme.of(context).colorScheme.background,
|
||||||
child: Row(
|
),
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
child: Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: <Widget>[
|
||||||
children: <Widget>[
|
if (leading != null) leading,
|
||||||
if (leading != null) leading,
|
buildCenter(context, hasLeftOffset: leading != null),
|
||||||
buildCenter(context, hasLeftOffset: leading != null),
|
if (trailing != null) trailing
|
||||||
if (trailing != null) trailing
|
])));
|
||||||
])));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget? buildLeading(BuildContext context) => null;
|
Widget? buildLeading(BuildContext context) => null;
|
||||||
|
@ -58,8 +56,8 @@ class StandardListRow extends StatelessWidget {
|
||||||
Widget? buildTrailing(BuildContext context) => null;
|
Widget? buildTrailing(BuildContext context) => null;
|
||||||
|
|
||||||
Color titleColor(BuildContext context) => isSelected
|
Color titleColor(BuildContext context) => isSelected
|
||||||
? Palette.blueCraiola
|
? Theme.of(context).primaryColor
|
||||||
: Theme.of(context).primaryTextTheme.titleLarge!.color!;
|
: Theme.of(context).extension<CakeTextTheme>()!.titleColor;
|
||||||
|
|
||||||
Color _backgroundColor(BuildContext context) {
|
Color _backgroundColor(BuildContext context) {
|
||||||
return Theme.of(context).colorScheme.background;
|
return Theme.of(context).colorScheme.background;
|
||||||
|
@ -71,15 +69,12 @@ class SectionHeaderListRow extends StatelessWidget {
|
||||||
Widget build(BuildContext context) => Column(children: [
|
Widget build(BuildContext context) => Column(children: [
|
||||||
StandardListSeparator(padding: EdgeInsets.only(left: 24)),
|
StandardListSeparator(padding: EdgeInsets.only(left: 24)),
|
||||||
Container(
|
Container(
|
||||||
width: double.infinity,
|
width: double.infinity, height: 40, color: Theme.of(context).colorScheme.background),
|
||||||
height: 40,
|
|
||||||
color: Theme.of(context).colorScheme.background),
|
|
||||||
//StandardListSeparator(padding: EdgeInsets.only(left: 24))
|
//StandardListSeparator(padding: EdgeInsets.only(left: 24))
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
class StandardListSeparator extends StatelessWidget {
|
class StandardListSeparator extends StatelessWidget {
|
||||||
|
|
||||||
const StandardListSeparator({this.padding, this.height = 1});
|
const StandardListSeparator({this.padding, this.height = 1});
|
||||||
|
|
||||||
final EdgeInsets? padding;
|
final EdgeInsets? padding;
|
||||||
|
@ -92,11 +87,7 @@ class StandardListSeparator extends StatelessWidget {
|
||||||
padding: padding,
|
padding: padding,
|
||||||
color: Theme.of(context).colorScheme.background,
|
color: Theme.of(context).colorScheme.background,
|
||||||
child: Container(
|
child: Container(
|
||||||
height: height,
|
height: height, color: Theme.of(context).primaryTextTheme.titleLarge?.backgroundColor));
|
||||||
color: Theme.of(context)
|
|
||||||
.primaryTextTheme
|
|
||||||
.titleLarge
|
|
||||||
?.backgroundColor));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -109,8 +100,7 @@ class StandardList extends StatelessWidget {
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return ListView.separated(
|
return ListView.separated(
|
||||||
separatorBuilder: (_, __) =>
|
separatorBuilder: (_, __) => StandardListSeparator(padding: EdgeInsets.only(left: 24)),
|
||||||
StandardListSeparator(padding: EdgeInsets.only(left: 24)),
|
|
||||||
itemCount: itemCount,
|
itemCount: itemCount,
|
||||||
itemBuilder: itemBuilder);
|
itemBuilder: itemBuilder);
|
||||||
}
|
}
|
||||||
|
@ -178,8 +168,7 @@ class SectionStandardList extends StatelessWidget {
|
||||||
return sectionTitleBuilder!.call(sectionIndex);
|
return sectionTitleBuilder!.call(sectionIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
List<Widget> buildSection(
|
List<Widget> buildSection(int itemCount, List<Widget> items, int sectionIndex) {
|
||||||
int itemCount, List<Widget> items, int sectionIndex) {
|
|
||||||
final List<Widget> section = [];
|
final List<Widget> section = [];
|
||||||
|
|
||||||
for (var itemIndex = 0; itemIndex < itemCount; itemIndex++) {
|
for (var itemIndex = 0; itemIndex < itemCount; itemIndex++) {
|
||||||
|
@ -192,8 +181,8 @@ class SectionStandardList extends StatelessWidget {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
totalRows.addAll(transform(hasTopSeparator, sectionCount, itemCounter,
|
totalRows.addAll(
|
||||||
itemBuilder, sectionTitleBuilder));
|
transform(hasTopSeparator, sectionCount, itemCounter, itemBuilder, sectionTitleBuilder));
|
||||||
|
|
||||||
return ListView.separated(
|
return ListView.separated(
|
||||||
separatorBuilder: (_, index) {
|
separatorBuilder: (_, index) {
|
||||||
|
@ -203,16 +192,14 @@ class SectionStandardList extends StatelessWidget {
|
||||||
return Container();
|
return Container();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (row is StandardListStatusRow ||
|
if (row is StandardListStatusRow || row is TradeDetailsStandardListCard) {
|
||||||
row is TradeDetailsStandardListCard) {
|
|
||||||
return Container();
|
return Container();
|
||||||
}
|
}
|
||||||
|
|
||||||
final nextRow = totalRows[index + 1];
|
final nextRow = totalRows[index + 1];
|
||||||
|
|
||||||
// If current row is pre last and last row is separator.
|
// If current row is pre last and last row is separator.
|
||||||
if (nextRow is StandardListSeparator ||
|
if (nextRow is StandardListSeparator || nextRow is SectionHeaderListRow) {
|
||||||
nextRow is SectionHeaderListRow) {
|
|
||||||
return Container();
|
return Container();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue