Skip to content

Commit

Permalink
Change style
Browse files Browse the repository at this point in the history
  • Loading branch information
Do Nguyen authored and Do Nguyen committed Feb 14, 2020
1 parent b4a5543 commit 2bdaf71
Show file tree
Hide file tree
Showing 9 changed files with 42 additions and 124 deletions.
6 changes: 5 additions & 1 deletion android/.idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions lib/common/ui/pal_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ class PalButton extends StatelessWidget {

if (colors == null) {
decoration = BoxDecoration(
borderRadius: BorderRadius.circular(radius),
// borderRadius: BorderRadius.circular(radius),
border: Border.all(color: Colors.white, width: 1.0),
color: Colors.transparent,
color: Colors.lightBlue,
);
} else {
decoration = BoxDecoration(
Expand All @@ -61,7 +61,7 @@ class PalButton extends StatelessWidget {
child: FlatButton(
child: Text(
title,
style: TextStyle(color: textColor),
style: TextStyle(color: textColor, fontSize: 16.0),
),
onPressed: onPressed,
highlightColor: highlightColor,
Expand Down
11 changes: 2 additions & 9 deletions lib/common/ui/pal_title_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,9 @@ class PalTitleView extends StatelessWidget {
return Text(
title,
style: TextStyle(
color: Colors.green[700],
fontSize: 18.0,
color: Colors.lightBlue,
fontSize: 24.0,
fontWeight: FontWeight.w600,
shadows: <Shadow>[
Shadow(
offset: Offset(2.0, 2.0),
blurRadius: 2.0,
color: Colors.black.withOpacity(0.15),
),
],
),
);
}
Expand Down
22 changes: 1 addition & 21 deletions lib/moex_app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,27 +19,7 @@ class MoExApp extends StatelessWidget {
SystemChrome.setEnabledSystemUIOverlays([]);

return MaterialApp(
home: Material(
type: MaterialType.transparency,
child: FutureBuilder<bool>(
future: onboardingShown(),
builder: (BuildContext context, AsyncSnapshot<bool> snapshot) {
if (snapshot.hasData) {
if (snapshot.data) {
return home;
} else {
showOnboarding();
return onboarding;
}
} else {
return Container(
color: Colors.white,
child: Image.asset(Assets.logo),
);
}
},
),
),
home: HomePage(),
);
}

Expand Down
12 changes: 7 additions & 5 deletions lib/screens/home/expense/add_expense_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class AddExpensePageState extends State<AddExpensePage> {
},
),
Flexible(
child: PalTitleView(title: "ADD"),
child: PalTitleView(title: "ADD EXPENSE"),
),
Container(
width: 40.0,
Expand All @@ -117,7 +117,7 @@ class AddExpensePageState extends State<AddExpensePage> {
title: TextFormField(
controller: titleController,
decoration: InputDecoration(
hintText: "Title",
hintText: "What is this for?",
),
validator: (value) {
if (value.isEmpty) {
Expand Down Expand Up @@ -192,7 +192,9 @@ class AddExpensePageState extends State<AddExpensePage> {
child: ColorPicker(
pickerColor: currentColor,
onColorChanged: changeColor,
colorPickerWidth: MediaQuery.of(context).size.width - 32.0,
colorPickerWidth:
MediaQuery.of(context).size.width -
32.0,
pickerAreaHeightPercent: 0.7,
enableAlpha: true,
),
Expand Down Expand Up @@ -247,9 +249,9 @@ class AddExpensePageState extends State<AddExpensePage> {
Padding(
padding: EdgeInsets.all(16.0),
child: PalButton(
title: "ADD",
title: "Add",
width: MediaQuery.of(context).size.width * (2.0 / 3.0),
colors: [Colors.green[600], Colors.green[900]],
highlightColor: Colors.lightBlue,
onPressed: () {
if (!_formKey.currentState.validate()) {
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ import 'package:flutter/material.dart';
import 'package:flare_flutter/flare_actor.dart';
import 'package:rxdart/rxdart.dart';

class ExpensePage extends StatefulWidget {
class ExpensesPage extends StatefulWidget {
@override
_ExpensePageState createState() => _ExpensePageState();
_ExpensesPageState createState() => _ExpensesPageState();
}

class _ExpensePageState extends State<ExpensePage> {
class _ExpensesPageState extends State<ExpensesPage> {
final addPage = AddExpensePage();
final filterPage = FilterPage();

Expand Down Expand Up @@ -136,18 +136,11 @@ class _ExpensePageState extends State<ExpensePage> {
),
Expanded(
child: Text(
'There is a $activeFilters active filter' +
(activeFilters > 1 ? 's' : ''),
'Active Filter: $activeFilters',
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.w600,
shadows: [
Shadow(
offset: Offset(2.0, 2.0),
blurRadius: 2.0,
color: Colors.black.withOpacity(0.3),
),
]),
color: Colors.white,
fontWeight: FontWeight.w600,
),
textAlign: TextAlign.center,
),
),
Expand Down Expand Up @@ -202,7 +195,7 @@ class _ExpensePageState extends State<ExpensePage> {
Widget _buildList(
FilteredList<Expense> expenses, ExpensesBloc bloc, bool filtersActive) {
if (expenses.length <= 0) {
return _DashboardEmptyState(filtersActive: filtersActive);
return _ExpensesEmptyState(filtersActive: filtersActive);
}

List<dynamic> items = [];
Expand Down Expand Up @@ -415,10 +408,10 @@ class _ExpenseCard extends StatelessWidget {
}
}

class _DashboardEmptyState extends StatelessWidget {
class _ExpensesEmptyState extends StatelessWidget {
final bool filtersActive;

_DashboardEmptyState({@required this.filtersActive});
_ExpensesEmptyState({@required this.filtersActive});

@override
Widget build(BuildContext context) {
Expand All @@ -445,21 +438,14 @@ class _DashboardEmptyState extends StatelessWidget {
style: TextStyle(
color: Colors.black,
fontSize: 18.0,
shadows: <Shadow>[
Shadow(
offset: Offset(2.0, 2.0),
blurRadius: 2.0,
color: Colors.black.withOpacity(0.3),
),
],
),
),
),
),
PalButton(
title: "ADD",
title: "Add Expense",
width: MediaQuery.of(context).size.width * (2.0 / 3.0),
colors: [Colors.green[600], Colors.green[900]],
highlightColor: Colors.lightBlue,
onPressed: () {
Navigator.of(context).push(
CupertinoPageRoute(
Expand Down
4 changes: 2 additions & 2 deletions lib/screens/home/expense/filter/filter_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,9 @@ class FilterPage extends StatelessWidget {
Padding(
padding: EdgeInsets.all(16.0),
child: PalButton(
title: "APPLY",
title: "Apply",
width: MediaQuery.of(context).size.width * (2.0 / 3.0),
colors: [Colors.green[600], Colors.green[900]],
highlightColor: Colors.lightBlue,
onPressed: () {
List<ExpenseFilter> filters = [];

Expand Down
58 changes: 9 additions & 49 deletions lib/screens/home/home_page.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'package:moex/common/ui/shadow_icon.dart';
import 'package:moex/screens/home/expense/expense_page.dart';
import 'package:moex/screens/home/expense/expenses_page.dart';
import 'package:moex/screens/home/settings/settings_page.dart';
import 'package:moex/screens/home/stats/stats_page.dart';
import 'package:flutter/cupertino.dart';
Expand All @@ -12,7 +11,7 @@ class HomePage extends StatefulWidget {
}

class _HomePageState extends State<HomePage> {
final expensePage = ExpensePage();
final expensePage = ExpensesPage();
final dashboardPage = StatsPage();
final settingsPage = SettingsPage();

Expand Down Expand Up @@ -48,74 +47,35 @@ class _HomePageState extends State<HomePage> {
tabBar: CupertinoTabBar(
items: <BottomNavigationBarItem>[
BottomNavigationBarItem(
icon: ShadowIcon(
icon: Icon(
Icons.attach_money,
offsetX: 0.0,
offsetY: 0.0,
blur: 3.0,
shadowColor: Colors.black.withOpacity(0.25),
),
title: Text(
'Expenses',
style: TextStyle(
shadows: <Shadow>[
Shadow(
offset: Offset(2.0, 2.0),
blurRadius: 2.0,
color: Colors.black.withOpacity(0.3),
),
],
),
),
),
BottomNavigationBarItem(
icon: ShadowIcon(
icon: Icon(
Icons.dashboard,
offsetX: 0.0,
offsetY: 0.0,
blur: 3.0,
shadowColor: Colors.black.withOpacity(0.25),
),
title: Text(
'Dashboard',
style: TextStyle(
shadows: <Shadow>[
Shadow(
offset: Offset(2.0, 2.0),
blurRadius: 2.0,
color: Colors.black.withOpacity(0.3),
),
],
),
),
),
BottomNavigationBarItem(
icon: ShadowIcon(
icon: Icon(
Icons.settings,
offsetX: 0.0,
offsetY: 0.0,
blur: 3.0,
shadowColor: Colors.black.withOpacity(0.25),
),
title: Text(
'Settings',
style: TextStyle(
shadows: <Shadow>[
Shadow(
offset: Offset(2.0, 2.0),
blurRadius: 2.0,
color: Colors.black.withOpacity(0.3),
),
],
),
),
),
],
backgroundColor: Colors.white,
border: null,
backgroundColor: Colors.grey[100],
border: Border(top: BorderSide(color: Colors.grey[200])),
iconSize: 28.0,
activeColor: Colors.green[700],
inactiveColor: const Color(0xFFa3a3a3),
activeColor: Colors.lightBlue,
inactiveColor: Colors.grey,
),
tabBuilder: (BuildContext context, int index) {
return CupertinoTabView(
Expand Down
9 changes: 1 addition & 8 deletions lib/screens/home/stats/stats_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -268,13 +268,6 @@ class StatsPage extends StatelessWidget {
style: TextStyle(
color: Colors.black,
fontSize: 18.0,
shadows: <Shadow>[
Shadow(
offset: Offset(2.0, 2.0),
blurRadius: 2.0,
color: Colors.black.withOpacity(0.3),
),
],
)),
),
);
Expand All @@ -294,7 +287,7 @@ class StatsPage extends StatelessWidget {
width: 40.0,
),
Flexible(
child: PalTitleView(title: "STATS"),
child: PalTitleView(title: "DASHBOARD"),
),
IconButton(
icon: Icon(Icons.help_outline),
Expand Down

0 comments on commit 2bdaf71

Please sign in to comment.