Login i18n and color changes
This commit is contained in:
+16
@@ -1,5 +1,21 @@
|
|||||||
home:
|
home:
|
||||||
emptyList: Add an expense to begin
|
emptyList: Add an expense to begin
|
||||||
|
login:
|
||||||
|
title: Spend-o-meter
|
||||||
|
subtitle: Your personal finance app
|
||||||
|
notice:
|
||||||
|
line1: "To use this app you need to agree to our "
|
||||||
|
line2: "Terms of Service"
|
||||||
|
line3: " and "
|
||||||
|
line4: "Privacy Policy"
|
||||||
|
help:
|
||||||
|
terms: >
|
||||||
|
This service is provided AS IS and has no current warranty on how the
|
||||||
|
data and uptime is managed. The final terms will be released when the final version of the app
|
||||||
|
will be released.
|
||||||
|
privacy: >
|
||||||
|
All your data is saved anonymously on Firebase Firestore database and will be remain that way.
|
||||||
|
no other users will have access to it.
|
||||||
add:
|
add:
|
||||||
category: Category
|
category: Category
|
||||||
today: Today
|
today: Today
|
||||||
|
|||||||
+16
@@ -1,5 +1,21 @@
|
|||||||
home:
|
home:
|
||||||
emptyList: Agregue un gasto para comenzar
|
emptyList: Agregue un gasto para comenzar
|
||||||
|
login:
|
||||||
|
title: Spend-o-meter
|
||||||
|
subtitle: Tu app de finanzas personales
|
||||||
|
notice:
|
||||||
|
line1: "Al usar esta aplicación estás aceptando nuestros "
|
||||||
|
line2: "Términos de servicio"
|
||||||
|
line3: " y "
|
||||||
|
line4: "Política de privacidad"
|
||||||
|
help:
|
||||||
|
terms: >
|
||||||
|
Este servicio se provee "COMO VIENE" y no se da garantía en cómo se manejan
|
||||||
|
los datos y la disponibillildad del servicio. Los términos y condiciones finales
|
||||||
|
serán publicados cuando la app se ponga en producción.
|
||||||
|
privacy: >
|
||||||
|
Todos tus datos serán guardados anónimamente en Firebase Firestore y permanecerán de esa manera.
|
||||||
|
Ningún otro usuario tendrá acceso a tus datos.
|
||||||
add:
|
add:
|
||||||
category: Categoría
|
category: Categoría
|
||||||
today: Hoy
|
today: Hoy
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ class _LinesGraphWidgetState extends State<LinesGraphWidget> {
|
|||||||
List<Series<double, num>> series = [
|
List<Series<double, num>> series = [
|
||||||
Series<double, int>(
|
Series<double, int>(
|
||||||
id: 'Gasto',
|
id: 'Gasto',
|
||||||
colorFn: (_, __) => MaterialPalette.blue.shadeDefault,
|
colorFn: (_, __) => MaterialPalette.purple.shadeDefault,
|
||||||
domainFn: (value, index) => index,
|
domainFn: (value, index) => index,
|
||||||
measureFn: (value, _) => value,
|
measureFn: (value, _) => value,
|
||||||
data: widget.data,
|
data: widget.data,
|
||||||
|
|||||||
@@ -122,14 +122,14 @@ class _MonthWidgetState extends State<MonthWidget> {
|
|||||||
),
|
),
|
||||||
trailing: Container(
|
trailing: Container(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Colors.blueAccent.withOpacity(0.2),
|
color: Theme.of(context).primaryColor.withOpacity(0.2),
|
||||||
borderRadius: BorderRadius.circular(5.0),
|
borderRadius: BorderRadius.circular(5.0),
|
||||||
),
|
),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.all(8.0),
|
padding: const EdgeInsets.all(8.0),
|
||||||
child: Text("\$$value",
|
child: Text("\$$value",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Colors.blueAccent,
|
color: Theme.of(context).primaryColor,
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
fontSize: 16.0,
|
fontSize: 16.0,
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import 'package:image_picker/image_picker.dart';
|
|||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
import 'package:local_auth/local_auth.dart';
|
import 'package:local_auth/local_auth.dart';
|
||||||
import 'package:yaml/yaml.dart';
|
import 'package:yaml/yaml.dart';
|
||||||
|
import 'dart:io' show Platform;
|
||||||
|
|
||||||
import '../como_gasto_icons.dart';
|
import '../como_gasto_icons.dart';
|
||||||
import '../expenses_repository.dart';
|
import '../expenses_repository.dart';
|
||||||
@@ -29,7 +30,7 @@ class _AddPageState extends State<AddPage> with SingleTickerProviderStateMixin {
|
|||||||
String category;
|
String category;
|
||||||
int value = 0;
|
int value = 0;
|
||||||
|
|
||||||
String dateStr = null;
|
String dateStr;
|
||||||
DateTime date = DateTime.now();
|
DateTime date = DateTime.now();
|
||||||
|
|
||||||
File _selectedPicture;
|
File _selectedPicture;
|
||||||
@@ -42,9 +43,12 @@ class _AddPageState extends State<AddPage> with SingleTickerProviderStateMixin {
|
|||||||
super.initState();
|
super.initState();
|
||||||
|
|
||||||
_localAth = LocalAuthentication();
|
_localAth = LocalAuthentication();
|
||||||
_localAth.canCheckBiometrics.then((b) {
|
_localAth.canCheckBiometrics.then((b) async {
|
||||||
|
var methods = await _localAth.getAvailableBiometrics();
|
||||||
|
var hasFingerprint = Platform.isIOS ? methods.any((m) => m == BiometricType.fingerprint) : true;
|
||||||
|
|
||||||
setState(() {
|
setState(() {
|
||||||
_isBiometricAvailable = b;
|
_isBiometricAvailable = b && hasFingerprint;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -193,7 +197,7 @@ class _AddPageState extends State<AddPage> with SingleTickerProviderStateMixin {
|
|||||||
"${localizations.t('add.currency')}${realValue.toStringAsFixed(2)}",
|
"${localizations.t('add.currency')}${realValue.toStringAsFixed(2)}",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 50.0,
|
fontSize: 50.0,
|
||||||
color: Colors.blueAccent,
|
color: Theme.of(context).textTheme.title.color,
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -12,29 +12,22 @@ class DetailsParams {
|
|||||||
DetailsParams(this.categoryName, this.month);
|
DetailsParams(this.categoryName, this.month);
|
||||||
}
|
}
|
||||||
|
|
||||||
class DetailsPageContainer extends StatefulWidget {
|
class DetailsPageContainer extends StatelessWidget {
|
||||||
final DetailsParams params;
|
final DetailsParams params;
|
||||||
|
|
||||||
const DetailsPageContainer({Key key, this.params}) : super(key: key);
|
const DetailsPageContainer({Key key, this.params}) : super(key: key);
|
||||||
|
|
||||||
@override
|
|
||||||
_DetailsPageContainerState createState() => _DetailsPageContainerState();
|
|
||||||
}
|
|
||||||
|
|
||||||
class _DetailsPageContainerState extends State<DetailsPageContainer> {
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Consumer<ExpensesRepository>(
|
final db = Provider.of<ExpensesRepository>(context);
|
||||||
builder: (BuildContext context, ExpensesRepository db, Widget child) {
|
final query = db.queryByCategory(params.month + 1, params.categoryName);
|
||||||
var _query = db.queryByCategory(
|
|
||||||
widget.params.month + 1, widget.params.categoryName);
|
|
||||||
|
|
||||||
return StreamBuilder<QuerySnapshot>(
|
return StreamBuilder<QuerySnapshot>(
|
||||||
stream: _query,
|
stream: query,
|
||||||
builder: (BuildContext context, AsyncSnapshot<QuerySnapshot> data) {
|
builder: (BuildContext context, AsyncSnapshot<QuerySnapshot> data) {
|
||||||
if (data.hasData) {
|
if (data.hasData) {
|
||||||
return DetailsPage(
|
return DetailsPage(
|
||||||
categoryName: widget.params.categoryName,
|
categoryName: params.categoryName,
|
||||||
documents: data.data.documents,
|
documents: data.data.documents,
|
||||||
onDelete: (documentId) {
|
onDelete: (documentId) {
|
||||||
db.delete(documentId);
|
db.delete(documentId);
|
||||||
@@ -45,7 +38,6 @@ class _DetailsPageContainerState extends State<DetailsPageContainer> {
|
|||||||
return Center(
|
return Center(
|
||||||
child: CircularProgressIndicator(),
|
child: CircularProgressIndicator(),
|
||||||
);
|
);
|
||||||
});
|
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
+15
-13
@@ -1,3 +1,4 @@
|
|||||||
|
import 'package:como_gasto/como_gasto_localizations.dart';
|
||||||
import 'package:flare_flutter/flare_actor.dart';
|
import 'package:flare_flutter/flare_actor.dart';
|
||||||
import 'package:flutter/gestures.dart';
|
import 'package:flutter/gestures.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
@@ -17,6 +18,8 @@ class _LoginPageState extends State<LoginPage> {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
ComoGastoLocalizations localizations = ComoGastoLocalizations.of(context);
|
||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
body: SafeArea(
|
body: SafeArea(
|
||||||
child: Column(
|
child: Column(
|
||||||
@@ -26,7 +29,7 @@ class _LoginPageState extends State<LoginPage> {
|
|||||||
child: Container(),
|
child: Container(),
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
"Spend-o-meter",
|
localizations.t('login.title'),
|
||||||
style: Theme.of(context).textTheme.display1,
|
style: Theme.of(context).textTheme.display1,
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
@@ -40,7 +43,7 @@ class _LoginPageState extends State<LoginPage> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
"Your personal finance app",
|
localizations.t('login.subtitle'),
|
||||||
style: Theme.of(context).textTheme.caption,
|
style: Theme.of(context).textTheme.caption,
|
||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
@@ -94,19 +97,19 @@ class _LoginPageState extends State<LoginPage> {
|
|||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
text: TextSpan(
|
text: TextSpan(
|
||||||
style: Theme.of(context).textTheme.body1,
|
style: Theme.of(context).textTheme.body1,
|
||||||
text: "To use this app you need to agree to our ",
|
text: localizations.t('login.notice.line1'),
|
||||||
children: [
|
children: [
|
||||||
TextSpan(
|
TextSpan(
|
||||||
text: "Terms of Service",
|
text: localizations.t('login.notice.line2'),
|
||||||
recognizer: _recognizer1,
|
recognizer: _recognizer1,
|
||||||
style: Theme.of(context)
|
style: Theme.of(context)
|
||||||
.textTheme
|
.textTheme
|
||||||
.body1
|
.body1
|
||||||
.copyWith(fontWeight: FontWeight.bold),
|
.copyWith(fontWeight: FontWeight.bold),
|
||||||
),
|
),
|
||||||
TextSpan(text: " and "),
|
TextSpan(text: localizations.t('login.notice.line3')),
|
||||||
TextSpan(
|
TextSpan(
|
||||||
text: "Privacy Policy",
|
text: localizations.t('login.notice.line4'),
|
||||||
recognizer: _recognizer2,
|
recognizer: _recognizer2,
|
||||||
style: Theme.of(context)
|
style: Theme.of(context)
|
||||||
.textTheme
|
.textTheme
|
||||||
@@ -128,16 +131,11 @@ class _LoginPageState extends State<LoginPage> {
|
|||||||
|
|
||||||
_recognizer1 = TapGestureRecognizer()
|
_recognizer1 = TapGestureRecognizer()
|
||||||
..onTap = () {
|
..onTap = () {
|
||||||
showHelp(
|
showHelp(_getTranslatedString('login.help.terms'));
|
||||||
"This service is provided AS IS and has no current warranty on how the"
|
|
||||||
" data and uptime is managed. The final terms will be released when the final version of the app"
|
|
||||||
" will be released.");
|
|
||||||
};
|
};
|
||||||
_recognizer2 = TapGestureRecognizer()
|
_recognizer2 = TapGestureRecognizer()
|
||||||
..onTap = () {
|
..onTap = () {
|
||||||
showHelp(
|
showHelp(_getTranslatedString('login.help.privacy'));
|
||||||
"All your data is saved anonymously on Firebase Firestore database and will be remain that way."
|
|
||||||
" no other users will have access to it.");
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -148,6 +146,10 @@ class _LoginPageState extends State<LoginPage> {
|
|||||||
_recognizer2.dispose();
|
_recognizer2.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String _getTranslatedString(String key) {
|
||||||
|
return ComoGastoLocalizations.of(context).t(key);
|
||||||
|
}
|
||||||
|
|
||||||
void showHelp(String s) {
|
void showHelp(String s) {
|
||||||
showDialog(
|
showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import 'package:como_gasto/como_gasto_localizations.dart';
|
import 'package:como_gasto/como_gasto_localizations.dart';
|
||||||
|
import 'package:como_gasto/states/login_state.dart';
|
||||||
import 'package:como_gasto/states/theme_state.dart';
|
import 'package:como_gasto/states/theme_state.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
@@ -41,7 +42,8 @@ class SettingsPage extends StatelessWidget {
|
|||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
child: RaisedButton(
|
child: RaisedButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
//Provider.of<LoginState>(context).logout();
|
Provider.of<LoginState>(context).logout();
|
||||||
|
Navigator.of(context).pop();
|
||||||
},
|
},
|
||||||
child: Text(localizations.t('settings.signout')),
|
child: Text(localizations.t('settings.signout')),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ class DayExpenseListTile extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
title: Container(
|
title: Container(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Colors.blueAccent.withOpacity(0.2),
|
color: Theme.of(context).primaryColor.withOpacity(0.2),
|
||||||
borderRadius: BorderRadius.circular(5.0),
|
borderRadius: BorderRadius.circular(5.0),
|
||||||
),
|
),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
@@ -39,7 +39,7 @@ class DayExpenseListTile extends StatelessWidget {
|
|||||||
child: Text(
|
child: Text(
|
||||||
"\$${document["value"]}",
|
"\$${document["value"]}",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Colors.blueAccent,
|
color: Theme.of(context).primaryColor,
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
fontSize: 16.0,
|
fontSize: 16.0,
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ class ThemeState with ChangeNotifier {
|
|||||||
),
|
),
|
||||||
toggleableActiveColor: Colors.red,
|
toggleableActiveColor: Colors.red,
|
||||||
)
|
)
|
||||||
: ThemeData.light();
|
: _getThemeLight();
|
||||||
|
|
||||||
bool get isDarkModeEnabled => _isDarkModeEnabled;
|
bool get isDarkModeEnabled => _isDarkModeEnabled;
|
||||||
|
|
||||||
@@ -23,4 +23,12 @@ class ThemeState with ChangeNotifier {
|
|||||||
_isDarkModeEnabled = b;
|
_isDarkModeEnabled = b;
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ThemeData _getThemeLight() {
|
||||||
|
final theme = ThemeData(
|
||||||
|
primarySwatch: Colors.deepPurple,
|
||||||
|
);
|
||||||
|
|
||||||
|
return theme;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user