Accent color
This commit is contained in:
parent
db65407f73
commit
5b5cffe40e
|
|
@ -56,37 +56,42 @@ class MenuDrawer extends StatelessWidget {
|
||||||
)
|
)
|
||||||
: Image.asset('assets/images/logo.png', width: 32);
|
: Image.asset('assets/images/logo.png', width: 32);
|
||||||
|
|
||||||
Widget _companyListItem(CompanyEntity company) => Row(
|
Widget _companyListItem(CompanyEntity company) {
|
||||||
mainAxisSize: MainAxisSize.max,
|
final userCompany = state.userCompanyStates
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
.firstWhere(
|
||||||
children: <Widget>[
|
(userCompanyState) => userCompanyState.company.id == company.id)
|
||||||
_companyLogo(company),
|
.userCompany;
|
||||||
SizedBox(width: 28),
|
return Row(
|
||||||
Expanded(
|
mainAxisSize: MainAxisSize.max,
|
||||||
child: Text(
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
company.displayName.isEmpty
|
children: <Widget>[
|
||||||
? localization.untitledCompany
|
_companyLogo(company),
|
||||||
: company.displayName,
|
SizedBox(width: 28),
|
||||||
style: Theme.of(context).textTheme.headline6,
|
Expanded(
|
||||||
overflow: TextOverflow.ellipsis,
|
child: Text(
|
||||||
),
|
company.displayName.isEmpty
|
||||||
|
? localization.untitledCompany
|
||||||
|
: company.displayName,
|
||||||
|
style: Theme.of(context).textTheme.headline6,
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
),
|
),
|
||||||
|
),
|
||||||
|
if (userCompany.settings.accentColor != null)
|
||||||
Container(
|
Container(
|
||||||
|
padding: const EdgeInsets.only(right: 2),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
shape: BoxShape.circle,
|
shape: BoxShape.circle,
|
||||||
color: convertHexStringToColor(state.userCompanyStates
|
color: convertHexStringToColor(
|
||||||
.firstWhere((userCompanyState) =>
|
userCompany.settings.accentColor)),
|
||||||
userCompanyState.company.id == company.id)
|
|
||||||
.userCompany
|
|
||||||
.settings
|
|
||||||
.accentColor)),
|
|
||||||
width: 10,
|
width: 10,
|
||||||
height: 10,
|
height: 10,
|
||||||
//color: Colors.red,
|
//color: Colors.red,
|
||||||
),
|
),
|
||||||
SizedBox(width: 2),
|
],
|
||||||
],
|
);
|
||||||
);
|
}
|
||||||
|
|
||||||
|
;
|
||||||
|
|
||||||
final _collapsedCompanySelector = PopupMenuButton<String>(
|
final _collapsedCompanySelector = PopupMenuButton<String>(
|
||||||
tooltip: localization.selectCompany,
|
tooltip: localization.selectCompany,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue