Skip to content

Commit

Permalink
Refactor a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
Do Nguyen authored and Do Nguyen committed Feb 13, 2020
1 parent fa9196b commit b4a5543
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 30 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Moex


Follow this guide for installation and how to run a Flutter app:
https://flutter.dev/docs/get-started/install
2 changes: 1 addition & 1 deletion lib/screens/home/expense/expense_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ class _ExpensePageState extends State<ExpensePage> {
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Text(
"SUMMARY",
"TOTAL",
style: TextStyle(
fontWeight: FontWeight.w400,
fontSize: 15.0,
Expand Down
18 changes: 9 additions & 9 deletions lib/screens/home/home_page.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:moex/common/ui/shadow_icon.dart';
import 'package:moex/screens/home/expense/expense_page.dart';
import 'package:moex/screens/home/more/more_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';
import 'package:flutter/material.dart';
Expand All @@ -12,22 +12,22 @@ class HomePage extends StatefulWidget {
}

class _HomePageState extends State<HomePage> {
final dashboard = ExpensePage();
final stats = StatsPage();
final more = MorePage();
final expensePage = ExpensePage();
final dashboardPage = StatsPage();
final settingsPage = SettingsPage();

Widget _tabs;

Widget _getBody(index) {
switch (index) {
case 0:
return dashboard;
return expensePage;
break;
case 1:
return stats;
return dashboardPage;
break;
case 2:
return more;
return settingsPage;
break;
default:
return null;
Expand Down Expand Up @@ -91,14 +91,14 @@ class _HomePageState extends State<HomePage> {
),
BottomNavigationBarItem(
icon: ShadowIcon(
Icons.more_horiz,
Icons.settings,
offsetX: 0.0,
offsetY: 0.0,
blur: 3.0,
shadowColor: Colors.black.withOpacity(0.25),
),
title: Text(
'More',
'Settings',
style: TextStyle(
shadows: <Shadow>[
Shadow(
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
import 'dart:io';

import 'package:moex/common/ui/pal_title_view.dart';
import 'package:moex/screens/home/more/policy_page.dart';
import 'package:moex/screens/home/settings/policy_page.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:url_launcher/url_launcher.dart';
import 'package:launch_review/launch_review.dart';

class MorePage extends StatelessWidget {
class SettingsPage extends StatelessWidget {
_sendMail(String toMailId, String subject, String body) async {
var url = 'mailto:$toMailId?subject=$subject&body=$body';
if (await canLaunch(url)) {
Expand Down Expand Up @@ -35,7 +32,7 @@ class MorePage extends StatelessWidget {
width: 40.0,
),
Flexible(
child: PalTitleView(title: "MORE"),
child: PalTitleView(title: "SETTINGS"),
),
IconButton(
icon: Icon(Icons.help_outline),
Expand All @@ -52,18 +49,6 @@ class MorePage extends StatelessWidget {
child: Container(
child: ListView(
children: <Widget>[
ListTile(
leading: Icon(
Icons.rate_review,
color: Colors.green[600],
),
title: Text(Platform.isIOS
? 'Rate us on AppStore'
: 'Rate us on GooglePlay'),
onTap: () {
LaunchReview.launch();
},
),
ListTile(
leading: Icon(
Icons.book,
Expand All @@ -88,7 +73,8 @@ class MorePage extends StatelessWidget {
),
title: Text('Contact us'),
onTap: () {
_sendMail("[email protected]", "Expense Pal", "Check out this app. It's really great!");
_sendMail("[email protected]", "Expense Pal",
"Check out this app. It's really great!");
},
),
],
Expand Down

0 comments on commit b4a5543

Please sign in to comment.