Skip to content

Commit

Permalink
Merge pull request #5 from mindnervestech/mnt-theme-fixes
Browse files Browse the repository at this point in the history
Change some hard coded theme elements to dynamic theme based. Added dark theme code.
  • Loading branch information
hillelcoren committed Jun 17, 2018
2 parents 6476f79 + f7b4388 commit bad0cc7
Show file tree
Hide file tree
Showing 10 changed files with 42 additions and 14 deletions.
28 changes: 28 additions & 0 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,40 @@ class _InvoiceNinjaAppState extends State<InvoiceNinjaApp> {
const AppLocalizationsDelegate(),
GlobalMaterialLocalizations.delegate,
],
// light theme

theme: ThemeData().copyWith(
accentColor: Colors.lightBlueAccent,
primaryColor: const Color(0xFF117cc1),
primaryColorLight: const Color(0xFF5dabf4),
primaryColorDark: const Color(0xFF0D5D91),
indicatorColor: const Color(0xFFFFFFFF),
iconTheme: IconThemeData().copyWith(),
bottomAppBarColor: const Color(0xFF117cc1),
),


//dark theme
/*
theme: ThemeData.dark().copyWith(
accentColor: Colors.lightBlueAccent,
primaryColor: const Color(0xFF117cc1),
primaryColorLight: const Color(0xFF5dabf4),
primaryColorDark: const Color(0xFF0D5D91),
indicatorColor: const Color(0xFFFFFFFF),
iconTheme: IconThemeData().copyWith(color: Colors.white),
bottomAppBarColor: const Color(0xFF117cc1),
),
*/

/*
theme: ThemeData().copyWith(
primaryColor: const Color(0xFF117cc1),
primaryColorLight: const Color(0xFF5dabf4),
primaryColorDark: const Color(0xFF0D5D91),
indicatorColor: const Color(0xFFFFFFFF),
),
*/
/*
theme: ThemeData(
brightness: Brightness.dark,
Expand Down
6 changes: 3 additions & 3 deletions lib/ui/app/actions_menu_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class ActionMenuButton extends StatelessWidget {
value: EntityAction.restore,
child: Row(
children: <Widget>[
Icon(Icons.restore, color: Colors.grey[600]),
Icon(Icons.restore,),
SizedBox(width: 15.0),
Text(AppLocalization.of(context).restore),
],
Expand All @@ -40,7 +40,7 @@ class ActionMenuButton extends StatelessWidget {
value: EntityAction.archive,
child: Row(
children: <Widget>[
Icon(Icons.archive, color: Colors.grey[600]),
Icon(Icons.archive,),
SizedBox(width: 15.0),
Text(AppLocalization.of(context).archive),
],
Expand All @@ -50,7 +50,7 @@ class ActionMenuButton extends StatelessWidget {
value: EntityAction.delete,
child: Row(
children: <Widget>[
Icon(Icons.delete, color: Colors.grey[600]),
Icon(Icons.delete,),
SizedBox(width: 15.0),
Text(AppLocalization.of(context).delete),
],
Expand Down
7 changes: 5 additions & 2 deletions lib/ui/app/app_bottom_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class _AppBottomBarState extends State<AppBottomBar> {
converter: (Store<AppState> store) => store.state.getListState(widget.entityType).stateFilters,
builder: (BuildContext context, stateFilters) {
return Container(
color: Colors.grey[200],
color: Theme.of(context).backgroundColor, //Colors.grey[200],
child: new Column(mainAxisSize: MainAxisSize.min, children: <Widget>[
Column(
children: EntityState.values.map<Widget>((state) {
Expand Down Expand Up @@ -101,7 +101,7 @@ class _AppBottomBarState extends State<AppBottomBar> {
converter: (Store<AppState> store) => store.state.getListState(widget.entityType),
builder: (BuildContext context, listUIState) {
return Container(
color: Colors.grey[200],
color: Theme.of(context).backgroundColor,
child: Column(
mainAxisSize: MainAxisSize.min,
children: widget.sortFields.map((sortField) {
Expand Down Expand Up @@ -131,18 +131,21 @@ class _AppBottomBarState extends State<AppBottomBar> {
};

return new BottomAppBar(
color: Theme.of(context).bottomAppBarColor,
hasNotch: true,
child: Row(
children: <Widget>[
IconButton(
tooltip: AppLocalization.of(context).sort,
icon: Icon(Icons.sort_by_alpha),
onPressed: _showSortSheet,
color: Colors.white,
),
IconButton(
tooltip: AppLocalization.of(context).filter,
icon: Icon(Icons.filter_list),
onPressed: _showFilterSheet,
color: Colors.white,
),
],
),
Expand Down
2 changes: 1 addition & 1 deletion lib/ui/client/client_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class ClientScreen extends StatelessWidget {
.of(context)
.push(MaterialPageRoute(builder: (_) => ClientEditScreen()));
},
child: Icon(Icons.add),
child: Icon(Icons.add, color: Colors.white,),
tooltip: localization.newClient,
),
);
Expand Down
1 change: 0 additions & 1 deletion lib/ui/client/edit/client_edit_contacts.dart
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ class ClientEditContactsState extends State<ClientEditContacts>
child: RaisedButton(
elevation: 4.0,
color: Theme.of(context).primaryColor,
textColor: Theme.of(context).secondaryHeaderColor,
child: Text(localization.addContact.toUpperCase()),
onPressed: _onAddPressed,
),
Expand Down
2 changes: 1 addition & 1 deletion lib/ui/client/view/client_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ class _ClientViewState extends State<ClientView>
]),
);
},
child: Icon(Icons.add),
child: Icon(Icons.add, color: Colors.white,),
tooltip: localization.create,
),
);
Expand Down
2 changes: 0 additions & 2 deletions lib/ui/client/view/client_view_overview.dart
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ class ClientOverview extends StatelessWidget {
height: 1.0,
),
Container(
color: Colors.white,
child: Material(
type: MaterialType.transparency,
child: ListTile(
Expand All @@ -125,7 +124,6 @@ class ClientOverview extends StatelessWidget {
height: 1.0,
),
Container(
color: Colors.white,
child: Material(
type: MaterialType.transparency,
child: ListTile(
Expand Down
4 changes: 2 additions & 2 deletions lib/ui/dashboard/dashboard_panels.dart
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class DashboardRow extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(this.title,
style: TextStyle(color: Colors.grey[700])),
style: TextStyle()),
Text(this.isMoney
? "\$" + this.amount.toStringAsFixed(2)
: this.amount.toString(),
Expand Down Expand Up @@ -140,7 +140,7 @@ class DashboardColumn extends StatelessWidget {
Center(child: ColorIcon(this.icon, this.color)),
SizedBox(height: 18.0),
Text(this.title,
style: TextStyle(color: Colors.grey[700])),
style: TextStyle()),
Text(this.isMoney
? "\$" + this.amount.toStringAsFixed(2)
: this.amount.toString(),
Expand Down
2 changes: 1 addition & 1 deletion lib/ui/invoice/invoice_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class InvoiceScreen extends StatelessWidget {
.of(context)
.push(MaterialPageRoute(builder: (_) => InvoiceEditScreen()));
},
child: Icon(Icons.add),
child: Icon(Icons.add,color: Colors.white,),
tooltip: localization.newInvoice,
),
);
Expand Down
2 changes: 1 addition & 1 deletion lib/ui/product/product_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class ProductScreen extends StatelessWidget {
.of(context)
.push(MaterialPageRoute(builder: (_) => ProductEditScreen()));
},
child: Icon(Icons.add),
child: Icon(Icons.add,color: Colors.white,),
tooltip: localization.newProduct,
),
);
Expand Down

0 comments on commit bad0cc7

Please sign in to comment.