mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-01-03 09:29:48 +00:00
Update hamburger menu
This commit is contained in:
parent
859d1d540c
commit
a5b0856eee
2 changed files with 63 additions and 45 deletions
|
@ -141,6 +141,7 @@ class MenuWidgetState extends State<MenuWidget> {
|
||||||
return Container(
|
return Container(
|
||||||
height: headerHeight,
|
height: headerHeight,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.only(bottomLeft: Radius.circular(24)),
|
||||||
gradient: LinearGradient(colors: [
|
gradient: LinearGradient(colors: [
|
||||||
Theme.of(context).extension<CakeMenuTheme>()!.headerFirstGradientColor,
|
Theme.of(context).extension<CakeMenuTheme>()!.headerFirstGradientColor,
|
||||||
Theme.of(context).extension<CakeMenuTheme>()!.headerSecondGradientColor,
|
Theme.of(context).extension<CakeMenuTheme>()!.headerSecondGradientColor,
|
||||||
|
@ -207,7 +208,7 @@ class MenuWidgetState extends State<MenuWidget> {
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
separatorBuilder: (_, index) => Container(
|
separatorBuilder: (_, index) => Container(
|
||||||
height: 1,
|
height: 0,
|
||||||
color: Theme.of(context).extension<CakeMenuTheme>()!.dividerColor,
|
color: Theme.of(context).extension<CakeMenuTheme>()!.dividerColor,
|
||||||
),
|
),
|
||||||
itemCount: itemCount + 1,
|
itemCount: itemCount + 1,
|
||||||
|
|
|
@ -1,6 +1,10 @@
|
||||||
import 'package:cake_wallet/palette.dart';
|
import 'package:cake_wallet/palette.dart';
|
||||||
import 'package:cake_wallet/themes/extensions/menu_theme.dart';
|
import 'package:cake_wallet/themes/extensions/menu_theme.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:cake_wallet/themes/extensions/sync_indicator_theme.dart';
|
||||||
|
import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart';
|
||||||
|
import 'package:cake_wallet/themes/extensions/balance_page_theme.dart';
|
||||||
|
import 'package:cake_wallet/themes/extensions/option_tile_theme.dart';
|
||||||
|
|
||||||
class SettingActionButton extends StatelessWidget {
|
class SettingActionButton extends StatelessWidget {
|
||||||
final bool isLastTile;
|
final bool isLastTile;
|
||||||
|
@ -29,56 +33,69 @@ class SettingActionButton extends StatelessWidget {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
final isLightMode = Theme.of(context).extension<OptionTileTheme>()?.useDarkImage ?? false;
|
||||||
Color? color = isSelected
|
Color? color = isSelected
|
||||||
? Theme.of(context).extension<CakeMenuTheme>()!.settingTitleColor
|
? Theme.of(context).extension<CakeMenuTheme>()!.settingTitleColor
|
||||||
: selectionActive
|
: selectionActive
|
||||||
? Palette.darkBlue
|
? Palette.darkBlue
|
||||||
: Theme.of(context).extension<CakeMenuTheme>()!.settingTitleColor;
|
: Theme.of(context).extension<CakeMenuTheme>()!.settingTitleColor;
|
||||||
return InkWell(
|
return Container(
|
||||||
onTap: onTap,
|
//padding: EdgeInsets.only(top: 5, left: 15, bottom: 5),
|
||||||
hoverColor: Colors.transparent,
|
margin: EdgeInsets.only(top: 10, left: 20, bottom: 0),
|
||||||
child: Container(
|
child: TextButton(
|
||||||
height: tileHeight,
|
style: ButtonStyle(
|
||||||
padding: isLastTile
|
backgroundColor: MaterialStateProperty.all(isLightMode ? Theme.of(context).cardColor : Colors.black12),
|
||||||
? EdgeInsets.only(
|
shape: MaterialStateProperty.all(
|
||||||
left: 24,
|
RoundedRectangleBorder(
|
||||||
right: 24,
|
side: BorderSide(
|
||||||
top: fromBottomEdge,
|
//color: Colors.black12,
|
||||||
)
|
width: 100
|
||||||
: EdgeInsets.only(left: 24, right: 24),
|
),
|
||||||
alignment: isLastTile ? Alignment.topLeft : null,
|
borderRadius: BorderRadius.only(topLeft: Radius.circular(20), bottomLeft: Radius.circular(20),
|
||||||
child: Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
|
||||||
children: <Widget>[
|
|
||||||
Image.asset(
|
|
||||||
image,
|
|
||||||
height: 16,
|
|
||||||
width: 16,
|
|
||||||
color: Theme.of(context)
|
|
||||||
.extension<CakeMenuTheme>()!
|
|
||||||
.settingActionsIconColor,
|
|
||||||
),
|
|
||||||
SizedBox(width: 16),
|
|
||||||
Expanded(
|
|
||||||
child: Text(
|
|
||||||
title,
|
|
||||||
style: TextStyle(
|
|
||||||
color: color,
|
|
||||||
fontSize: 16,
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
if (isArrowVisible)
|
),
|
||||||
Icon(
|
),
|
||||||
Icons.arrow_forward_ios,
|
onPressed: onTap,
|
||||||
color: color,
|
//hoverColor: Colors.transparent,
|
||||||
size: 16,
|
child: Container(
|
||||||
)
|
width: double.infinity,
|
||||||
],
|
padding: EdgeInsets.only(top: 12, left: 20, bottom: 12, right: 15),
|
||||||
|
//margin: EdgeInsets.only(top: 5, left: 15, bottom: 5),
|
||||||
|
alignment: isLastTile ? Alignment.topLeft : null,
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
|
children: <Widget>[
|
||||||
|
Image.asset(
|
||||||
|
image,
|
||||||
|
height: 16,
|
||||||
|
width: 16,
|
||||||
|
color: Theme.of(context)
|
||||||
|
.extension<CakeMenuTheme>()!
|
||||||
|
.settingActionsIconColor,
|
||||||
|
),
|
||||||
|
SizedBox(width: 16),
|
||||||
|
Expanded(
|
||||||
|
child: Text(
|
||||||
|
title,
|
||||||
|
style: TextStyle(
|
||||||
|
color: color,
|
||||||
|
fontSize: 16,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
if(isArrowVisible)
|
||||||
|
Icon(
|
||||||
|
Icons.arrow_forward_ios,
|
||||||
|
color: Colors.grey,
|
||||||
|
size: 16,
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in a new issue