Updating design
This commit is contained in:
parent
bbb4e46798
commit
1229bcfc09
|
|
@ -349,6 +349,7 @@ const String kExpenseStatusInvoiced = '3';
|
||||||
const String kDefaultCurrencyId = '1';
|
const String kDefaultCurrencyId = '1';
|
||||||
const String kDefaultDateFormat = '5';
|
const String kDefaultDateFormat = '5';
|
||||||
const String kDefaultAccentColor = '#0091EA';
|
const String kDefaultAccentColor = '#0091EA';
|
||||||
|
const String kDefaultSelectedColor = '#1E252F';
|
||||||
|
|
||||||
const String kReportGroupDay = 'day';
|
const String kReportGroupDay = 'day';
|
||||||
const String kReportGroupMonth = 'month';
|
const String kReportGroupMonth = 'month';
|
||||||
|
|
|
||||||
|
|
@ -288,6 +288,10 @@ class InvoiceNinjaAppState extends State<InvoiceNinjaApp> {
|
||||||
accentColor: accentColor,
|
accentColor: accentColor,
|
||||||
textSelectionHandleColor: accentColor,
|
textSelectionHandleColor: accentColor,
|
||||||
fontFamily: fontFamily,
|
fontFamily: fontFamily,
|
||||||
|
backgroundColor: Colors.black,
|
||||||
|
//canvasColor: const Color(0xFF1B1C1E),
|
||||||
|
canvasColor: Colors.black,
|
||||||
|
cardColor: const Color(0xFF1B1C1E),
|
||||||
)
|
)
|
||||||
: ThemeData(fontFamily: fontFamily).copyWith(
|
: ThemeData(fontFamily: fontFamily).copyWith(
|
||||||
pageTransitionsTheme: pageTransitionsTheme,
|
pageTransitionsTheme: pageTransitionsTheme,
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:invoiceninja_flutter/constants.dart';
|
||||||
import 'package:invoiceninja_flutter/utils/platforms.dart';
|
import 'package:invoiceninja_flutter/utils/platforms.dart';
|
||||||
|
import 'package:invoiceninja_flutter/utils/colors.dart';
|
||||||
|
|
||||||
class SelectedIndicator extends StatelessWidget {
|
class SelectedIndicator extends StatelessWidget {
|
||||||
const SelectedIndicator({this.child, this.isSelected});
|
const SelectedIndicator({this.child, this.isSelected});
|
||||||
|
|
@ -10,7 +12,8 @@ class SelectedIndicator extends StatelessWidget {
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Container(
|
return Container(
|
||||||
color: null,
|
color: isSelected ? convertHexStringToColor(kDefaultSelectedColor) : null,
|
||||||
|
|
||||||
child: Row(
|
child: Row(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Container(
|
Container(
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,7 @@ import 'package:invoiceninja_flutter/utils/icons.dart';
|
||||||
import 'package:invoiceninja_flutter/utils/localization.dart';
|
import 'package:invoiceninja_flutter/utils/localization.dart';
|
||||||
import 'package:invoiceninja_flutter/utils/platforms.dart';
|
import 'package:invoiceninja_flutter/utils/platforms.dart';
|
||||||
import 'package:url_launcher/url_launcher.dart';
|
import 'package:url_launcher/url_launcher.dart';
|
||||||
|
import 'package:invoiceninja_flutter/utils/colors.dart';
|
||||||
// STARTER: import - do not remove comment
|
// STARTER: import - do not remove comment
|
||||||
|
|
||||||
class MenuDrawer extends StatelessWidget {
|
class MenuDrawer extends StatelessWidget {
|
||||||
|
|
@ -88,6 +89,7 @@ class MenuDrawer extends StatelessWidget {
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
child: _companyLogo(viewModel.selectedCompany),
|
child: _companyLogo(viewModel.selectedCompany),
|
||||||
),
|
),
|
||||||
|
color: Theme.of(context).cardColor,
|
||||||
itemBuilder: (BuildContext context) => [
|
itemBuilder: (BuildContext context) => [
|
||||||
...viewModel.state.companies
|
...viewModel.state.companies
|
||||||
.map((company) => PopupMenuItem<String>(
|
.map((company) => PopupMenuItem<String>(
|
||||||
|
|
@ -207,13 +209,15 @@ class MenuDrawer extends StatelessWidget {
|
||||||
: Container(
|
: Container(
|
||||||
padding:
|
padding:
|
||||||
EdgeInsets.symmetric(horizontal: 14, vertical: 3),
|
EdgeInsets.symmetric(horizontal: 14, vertical: 3),
|
||||||
color: enableDarkMode ? Colors.white10 : Colors.grey[200],
|
color: enableDarkMode ? Colors.white10 : Theme.of(context).cardColor,
|
||||||
child: state.prefState.isMenuCollapsed
|
child: state.prefState.isMenuCollapsed
|
||||||
? _collapsedCompanySelector
|
? _collapsedCompanySelector
|
||||||
: _expandedCompanySelector),
|
: _expandedCompanySelector),
|
||||||
state.credentials.token.isEmpty
|
state.credentials.token.isEmpty
|
||||||
? SizedBox()
|
? SizedBox()
|
||||||
: Expanded(
|
: Expanded(
|
||||||
|
child: Container(
|
||||||
|
color: Theme.of(context).cardColor,
|
||||||
child: ListView(
|
child: ListView(
|
||||||
shrinkWrap: true,
|
shrinkWrap: true,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
|
|
@ -307,6 +311,7 @@ class MenuDrawer extends StatelessWidget {
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
),
|
||||||
)),
|
)),
|
||||||
Align(
|
Align(
|
||||||
child: state.prefState.isMenuCollapsed
|
child: state.prefState.isMenuCollapsed
|
||||||
|
|
@ -376,11 +381,17 @@ class _DrawerTileState extends State<DrawerTile> {
|
||||||
? kReports
|
? kReports
|
||||||
: widget.entityType.name;
|
: widget.entityType.name;
|
||||||
|
|
||||||
|
final isSelected = uiState.currentRoute.startsWith('/$route');
|
||||||
|
final textColor = isSelected ? Colors.white : Colors.white.withOpacity(.6);
|
||||||
|
|
||||||
Widget trailingWidget;
|
Widget trailingWidget;
|
||||||
if (!state.prefState.isMenuCollapsed) {
|
if (!state.prefState.isMenuCollapsed) {
|
||||||
if (widget.title == localization.dashboard) {
|
if (widget.title == localization.dashboard) {
|
||||||
trailingWidget = IconButton(
|
trailingWidget = IconButton(
|
||||||
icon: Icon(Icons.search),
|
icon: Icon(
|
||||||
|
Icons.search,
|
||||||
|
color: textColor,
|
||||||
|
),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
if (isMobile(context)) {
|
if (isMobile(context)) {
|
||||||
navigator.pop();
|
navigator.pop();
|
||||||
|
|
@ -391,7 +402,10 @@ class _DrawerTileState extends State<DrawerTile> {
|
||||||
);
|
);
|
||||||
} else if (userCompany.canCreate(widget.entityType)) {
|
} else if (userCompany.canCreate(widget.entityType)) {
|
||||||
trailingWidget = IconButton(
|
trailingWidget = IconButton(
|
||||||
icon: Icon(Icons.add_circle_outline),
|
icon: Icon(
|
||||||
|
Icons.add_circle_outline,
|
||||||
|
color: textColor,
|
||||||
|
),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
if (isMobile(context)) {
|
if (isMobile(context)) {
|
||||||
navigator.pop();
|
navigator.pop();
|
||||||
|
|
@ -402,12 +416,25 @@ class _DrawerTileState extends State<DrawerTile> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget child = SelectedIndicator(
|
Widget child = Container(
|
||||||
isSelected: uiState.currentRoute.startsWith('/$route'),
|
color: isSelected ? convertHexStringToColor(kDefaultSelectedColor) : null,
|
||||||
child: ListTile(
|
child: ListTile(
|
||||||
dense: true,
|
dense: true,
|
||||||
leading: Icon(widget.icon, size: 22),
|
leading: Icon(
|
||||||
title: state.prefState.isMenuCollapsed ? null : Text(widget.title),
|
widget.icon,
|
||||||
|
size: 20,
|
||||||
|
color: isSelected ? Colors.white : Colors.white.withOpacity(.8),
|
||||||
|
),
|
||||||
|
title: state.prefState.isMenuCollapsed
|
||||||
|
? null
|
||||||
|
: Text(
|
||||||
|
widget.title,
|
||||||
|
style: Theme.of(context).textTheme.bodyText1.copyWith(
|
||||||
|
fontWeight: FontWeight.w100,
|
||||||
|
fontSize: 16,
|
||||||
|
color: textColor,
|
||||||
|
),
|
||||||
|
),
|
||||||
onTap: () => widget.entityType != null
|
onTap: () => widget.entityType != null
|
||||||
? viewEntitiesByType(
|
? viewEntitiesByType(
|
||||||
context: context, entityType: widget.entityType)
|
context: context, entityType: widget.entityType)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue